Proofs, upside down
A functional correspondence between natural deduction and the sequent calculus Matthias Puech APLAS’13
Melbourne, December 11, 2013
1 / 19
Proofs, upside down A functional correspondence between natural - - PowerPoint PPT Presentation
Proofs, upside down A functional correspondence between natural deduction and the sequent calculus Matthias Puech APLAS13 Melbourne, December 11, 2013 1 / 19 An intuition Natural deductions are reversed sequent calculus proofs 2 / 19
1 / 19
2 / 19
2 / 19
3 / 19
4 / 19
4 / 19
4 / 19
4 / 19
5 / 19
5 / 19
5 / 19
6 / 19
7 / 19
x : A ∈ Γ Γ ⊢ x ⇒ A
Γ ⊢ R ⇒ A ⊃ B Γ ⊢ M ⇐ A Γ ⊢ R M ⇒ B
Γ ⊢ M ⇐ A Γ ⊢ (M : A) ⇒ A
Γ,x : A ⊢ M ⇐ B Γ ⊢ λx.M ⇐ A ⊃ B
Γ ⊢ R ⇒ C Γ ⊢ R ⇐ C
8 / 19
8 / 19
8 / 19
8 / 19
(* ... *) let rec infer : r → a = fun r → match r with | Var x → List.assoc x env | Annot (m, a) → check env a m; a | App (r, m) → let Imp (a, b) = infer r in check env a m; b (* ... *)
@ @ @
3
2
1
9 / 19
(* ... *) let rec infer : r → a = fun r → match r with | Var x → List.assoc x env | Annot (m, a) → check env a m; a | App (r, m) → let Imp (a, b) = infer r in check env a m; b (* ... *)
@ @ @
3
2
1
@ 3
@ 2
@ 1
9 / 19
10 / 19
11 / 19
11 / 19
11 / 19
11 / 19
11 / 19
12 / 19
12 / 19
12 / 19
12 / 19
12 / 19
12 / 19
12 / 19
12 / 19
13 / 19
13 / 19
13 / 19
13 / 19
SA Γ −→ V : A Γ | B −→ S : C Γ | A ⊃ B −→ V,S : C SA Γ | C −→ · : C
VL Γ,x : A −→ V : B Γ −→ λx.M : A ⊃ B HV x : A ∈ Γ Γ | A −→ S : C Γ −→ x (S) : C HA Γ −→ V : A Γ | A −→ S : C Γ −→ (V : A)(S) : C
14 / 19
14 / 19
14 / 19
14 / 19
14 / 19
15 / 19
16 / 19
16 / 19
16 / 19
@ @ 1
4
3
1
2
16 / 19
@ @ 1
4
3
1
2
1
@ 4
@ 3
1
2
16 / 19
17 / 19
17 / 19
17 / 19
17 / 19
18 / 19
18 / 19
18 / 19
18 / 19
19 / 19
19 / 19
19 / 19
19 / 19
20 / 19
21 / 19
21 / 19
21 / 19
19 / 19
19 / 19