Soutenance de thèse
Du typage vectoriel
Alejandro Díaz-Caro
CAPP Team
Adviser: Co-adviser:
Pablo Arrighi Frédéric Prost
23 – 09 – 2011
Du typage vectoriel Alejandro Daz-Caro CAPP Team Adviser: - - PowerPoint PPT Presentation
Soutenance de thse Du typage vectoriel Alejandro Daz-Caro CAPP Team Adviser: Co-adviser: Pablo Arrighi Frdric Prost 23 09 2011 Lambda calculus [Church36] Formal system to study the defini- tion of function f ( x ) t x
Adviser: Co-adviser:
23 – 09 – 2011
f (x) ∼ tx x → f (x) ∼ λx.tx (x → f (x))r ∼ (λx.tx) r (x →f (x))r =f (r) ∼ (λx.tx) r → tx[r/x]
2 / 24
f (x) ∼ tx x → f (x) ∼ λx.tx (x → f (x))r ∼ (λx.tx) r (x →f (x))r =f (r) ∼ (λx.tx) r → tx[r/x]
2 / 24
f (x) ∼ tx x → f (x) ∼ λx.tx (x → f (x))r ∼ (λx.tx) r (x →f (x))r =f (r) ∼ (λx.tx) r → tx[r/x]
2 / 24
f (x) ∼ tx x → f (x) ∼ λx.tx (x → f (x))r ∼ (λx.tx) r (x →f (x))r =f (r) ∼ (λx.tx) r → tx[r/x]
2 / 24
f (x) ∼ tx x → f (x) ∼ λx.tx (x → f (x))r ∼ (λx.tx) r (x →f (x))r =f (r) ∼ (λx.tx) r → tx[r/x]
2 / 24
◮ Differential λ-calculus [Ehrhard’03]: linearity à la Linear Logic
◮ Quantum computing: superposition of programs
3 / 24
◮ Differential λ-calculus [Ehrhard’03]: linearity à la Linear Logic
◮ Quantum computing: superposition of programs
3 / 24
◮ Differential λ-calculus [Ehrhard’03]: linearity à la Linear Logic
◮ Quantum computing: superposition of programs
3 / 24
Contribution: CPS simulation [Díaz-Caro,Perdrix,Tasson,Valiron’10]
3 / 24
4 / 24
4 / 24
4 / 24
4 / 24
α.T
T + R
α.T + β.R
5 / 24
α.T
T + R
α.T + β.R
5 / 24
6 / 24
6 / 24
6 / 24
6 / 24
6 / 24
6 / 24
◮ Subject reduction (type preservation) ◮ Strong normalisation
6 / 24
◮ Subject reduction (type preservation) ◮ Strong normalisation
Contribution: [Arrighi,Díaz-Caro’09]
6 / 24
7 / 24
◮ Sums ∼ Assoc., comm. pairs ◮ distributive w.r.t. application
8 / 24
◮ Sums ∼ Assoc., comm. pairs ◮ distributive w.r.t. application
8 / 24
◮ Sums ∼ Assoc., comm. pairs ◮ distributive w.r.t. application
◮ Simplified version without AC of +
8 / 24
◮ Sums ∼ Assoc., comm. pairs ◮ distributive w.r.t. application
◮ Simplified version without AC of +
◮ Distributivity in the translation (using the structure given by the type)
8 / 24
◮ Sums ∼ Assoc., comm. pairs ◮ distributive w.r.t. application
◮ Simplified version without AC of +
◮ Distributivity in the translation (using the structure given by the type) ◮ Equivalences given explicitly: T ≡ R implies |T| ⇔ |R|
8 / 24
◮ Sums ∼ Assoc., comm. pairs ◮ distributive w.r.t. application
◮ Simplified version without AC of +
◮ Distributivity in the translation (using the structure given by the type) ◮ Equivalences given explicitly: T ≡ R implies |T| ⇔ |R|
8 / 24
◮ Sums ∼ Assoc., comm. pairs ◮ distributive w.r.t. application
◮ Simplified version without AC of +
◮ Distributivity in the translation (using the structure given by the type) ◮ Equivalences given explicitly: T ≡ R implies |T| ⇔ |R|
Contribution: [Díaz-Caro,Petit’10]
8 / 24
9 / 24
◮ More general than Additive ◮ Less complex than Vectorial ◮ “Amounts” approximated
10 / 24
◮ More general than Additive ◮ Less complex than Vectorial ◮ “Amounts” approximated
10 / 24
◮ More general than Additive ◮ Less complex than Vectorial ◮ “Amounts” approximated
10 / 24
◮ More general than Additive ◮ Less complex than Vectorial ◮ “Amounts” approximated
↓
↓a () [·]
↓F ()
τ
[·]
10 / 24
◮ More general than Additive ◮ Less complex than Vectorial ◮ “Amounts” approximated
↓
↓a () [·]
↓F ()
τ
[·]
Contribution: [Buiras,Díaz-Caro,Jaskelioff’11]
10 / 24
12 / 24
ax Γ, x : U ⊢ x : U Γ ⊢ t : T 0I Γ ⊢ 0 : 0.T
Γ ⊢ t:
n
αi.∀ X.(U → Ti) Γ ⊢ r:
m
βj.Vj
∀Vj , ∃ Wj / U[ Wj / X] = Vj
→E Γ ⊢ (t) r:
n
m
αi × βj.Ti[ Wj/ X] Γ, x : U ⊢ t : T →I Γ ⊢ λx.t : U → T
Γ ⊢ t :
n
αi.Ui
X / ∈ FV (Γ)
∀I Γ ⊢ t :
n
αi.∀X.Ui Γ ⊢ t :
n
αi.∀X.Ui ∀E Γ ⊢ t :
n
αi.Ui[V /X]
13 / 24
ax Γ, x : U ⊢ x : U Γ ⊢ t : T 0I Γ ⊢ 0 : 0.T
Γ ⊢ t:
n
αi.∀ X.(U → Ti) Γ ⊢ r:
m
βj.Vj
∀Vj , ∃ Wj / U[ Wj / X] = Vj
→E Γ ⊢ (t) r:
n
m
αi × βj.Ti[ Wj/ X] Γ, x : U ⊢ t : T →I Γ ⊢ λx.t : U → T
Γ ⊢ t :
n
αi.Ui
X / ∈ FV (Γ)
∀I Γ ⊢ t :
n
αi.∀X.Ui Γ ⊢ t :
n
αi.∀X.Ui ∀E Γ ⊢ t :
n
αi.Ui[V /X]
i ti SN (algebraic measure)
13 / 24
ax Γ, x : U ⊢ x : U Γ ⊢ t : T 0I Γ ⊢ 0 : 0.T
Γ ⊢ t:
n
αi.∀ X.(U → Ti) Γ ⊢ r:
m
βj.Vj
∀Vj , ∃ Wj / U[ Wj / X] = Vj
→E Γ ⊢ (t) r:
n
m
αi × βj.Ti[ Wj/ X] Γ, x : U ⊢ t : T →I Γ ⊢ λx.t : U → T
Γ ⊢ t :
n
αi.Ui
X / ∈ FV (Γ)
∀I Γ ⊢ t :
n
αi.∀X.Ui Γ ⊢ t :
n
αi.∀X.Ui ∀E Γ ⊢ t :
n
αi.Ui[V /X]
i ti SN (algebraic measure)
13 / 24
14 / 24
◮ Remove factorisation rule (Done. SR and SN both work)
◮ + in scalars not used anymore. Scalars ⇒ Monoid ◮ It works!... but it is no so expressive (“vectorial” structure lost) 15 / 24
◮ Remove factorisation rule (Done. SR and SN both work)
◮ + in scalars not used anymore. Scalars ⇒ Monoid ◮ It works!... but it is no so expressive (“vectorial” structure lost)
◮ Add the typing rule
◮ As soon as we add this one, we have to add many others ◮ Too complex and inelegant (subject reduction by axiom) 15 / 24
◮ Remove factorisation rule (Done. SR and SN both work)
◮ + in scalars not used anymore. Scalars ⇒ Monoid ◮ It works!... but it is no so expressive (“vectorial” structure lost)
◮ Add the typing rule
◮ As soon as we add this one, we have to add many others ◮ Too complex and inelegant (subject reduction by axiom)
◮ Weak subject reduction
◮ If Γ ⊢ t : T and t →R r, then ◮ if R is not the factorisation rule: Γ ⊢ r : T ◮ if R is the factorisation rule: ∃S ⊑ T / Γ ⊢ r : S
Contribution: [Arrighi,Díaz-Caro,Valiron’11]
15 / 24
◮ Remove factorisation rule (Done. SR and SN both work)
◮ + in scalars not used anymore. Scalars ⇒ Monoid ◮ It works!... but it is no so expressive (“vectorial” structure lost)
◮ Add the typing rule
◮ As soon as we add this one, we have to add many others ◮ Too complex and inelegant (subject reduction by axiom)
◮ Weak subject reduction
◮ If Γ ⊢ t : T and t →R r, then ◮ if R is not the factorisation rule: Γ ⊢ r : T ◮ if R is the factorisation rule: ∃S ⊑ T / Γ ⊢ r : S
Contribution: [Arrighi,Díaz-Caro,Valiron’11]
◮ Church style
◮ Seems to be the natural solution: the type is part of the term, if the
15 / 24
16 / 24
i Vi)
17 / 24
ax Γ, x : U ⊢ x : U Γ ⊢ t : T 0I Γ ⊢ 0 : 0.T
Γ ⊢ t:
n
αi.(∀X
k .(U → Ti))@
m+δ
Wj
k
Γ ⊢ r:
m
βj.Vj
∀Vj , ∃j1, . . . , jk / U[Wj /X] k = Vj
→E Γ ⊢ (t) r:
n
m
αi × βj.Ti[Wj/X]
k
Γ, x : U ⊢ t : T →I Γ ⊢ λx : U.t : U → T
Γ ⊢ t :
n
αi.Ui
X / ∈ FV (Γ)
∀I Γ ⊢ ΛX.t :
n
αi.∀X.Ui Γ ⊢ t :
n
αi.∀X.Ui @I Γ ⊢ t@(
m
Vj) :
n
αi.(∀X.Ui)@(
m
Vj)
18 / 24
i αi.Ui
i αi.bi
i αi.bi
i αi.Ui + 0.T,
19 / 24
20 / 24
21 / 24
21 / 24
21 / 24
21 / 24
∗
∗
∗
∗
◮ Algebraic fragment: Coq proof [Valiron’10] ◮ Beta-reduction: Straightforward extension ◮ Commutation: Induction
22 / 24
◮ Relation between λlin and λalg ◮ SN and SR for the five systems ◮ Sums as pairs ◮ Types ↔ vectorial structure of terms ◮ Extra: No cloning theorem Papers Díaz-Caro,Perdrix,Tasson,Valiron HOR’10 (journal version in preparation) Arrighi,Díaz-Caro QPL’09 (journal version submitted) Díaz-Caro,Petit (in preparation) Buiras,Díaz-Caro,Jaskelioff LSFA’11 Arrighi,Díaz-Caro,Valiron DCM’11 (journal version in preparation)
23 / 24
◮ Invariability of models of λalg through the CPS simulation ◮ Differential λ-calculus ↔ Linear-algebraic λ-calculus ◮ Algebraic Linearity ↔ Linear logic resources ◮ Quantum language (orthogonality issues) ◮ Relations with Probabilistic/Quantum/Fuzzy Logics
24 / 24