Depending on equations
A proof-relevant framework for unification in dependent type theory Jesper Cockx
DistriNet – KU Leuven
Depending on equations A proof-relevant framework for unification - - PowerPoint PPT Presentation
Depending on equations A proof-relevant framework for unification in dependent type theory Jesper Cockx DistriNet KU Leuven 3 September 2017 Unification for dependent types Unification is used for many purposes: logic programming, type
DistriNet – KU Leuven
1 / 52
2 / 52
x:=y
2 / 52
x:=y
2 / 52
x:=y
2 / 52
3 / 52
3 / 52
3 / 52
3 / 52
3 / 52
3 / 52
4 / 52
4 / 52
4 / 52
4 / 52
5 / 52
5 / 52
6 / 52
6 / 52
6 / 52
6 / 52
6 / 52
6 / 52
6 / 52
7 / 52
7 / 52
7 / 52
7 / 52
data N : Type where zero : N suc : N → N
8 / 52
data N : Type where zero : N suc : N → N minimum : N → N → N minimum x y = { }
8 / 52
data N : Type where zero : N suc : N → N minimum : N → N → N minimum zero y = { } minimum (suc x) y = { }
8 / 52
data N : Type where zero : N suc : N → N minimum : N → N → N minimum zero y = zero minimum (suc x) y = { }
8 / 52
data N : Type where zero : N suc : N → N minimum : N → N → N minimum zero y = zero minimum (suc x) zero = { } minimum (suc x) (suc y) = { }
8 / 52
data N : Type where zero : N suc : N → N minimum : N → N → N minimum zero y = zero minimum (suc x) zero = zero minimum (suc x) (suc y) = { }
8 / 52
data N : Type where zero : N suc : N → N minimum : N → N → N minimum zero y = zero minimum (suc x) zero = zero minimum (suc x) (suc y) = suc (minimum x y)
8 / 52
data Vec (A : Type) : N → Type where nil : Vec A zero cons : (n : N) → A → Vec A n → Vec A (suc n)
9 / 52
data Vec (A : Type) : N → Type where nil : Vec A zero cons : (n : N) → A → Vec A n → Vec A (suc n) tail : (k : N) → Vec A (suc k) → Vec A k tail k xs = { }
9 / 52
data Vec (A : Type) : N → Type where nil : Vec A zero cons : (n : N) → A → Vec A n → Vec A (suc n) tail : (k : N) → Vec A (suc k) → Vec A k tail k nil = { } -- suc k = zero tail k (cons n x xs) = { } -- suc k = suc n
9 / 52
data Vec (A : Type) : N → Type where nil : Vec A zero cons : (n : N) → A → Vec A n → Vec A (suc n) tail : (k : N) → Vec A (suc k) → Vec A k tail k nil = { } -- impossible tail k (cons n x xs) = { } -- suc k = suc n
9 / 52
data Vec (A : Type) : N → Type where nil : Vec A zero cons : (n : N) → A → Vec A n → Vec A (suc n) tail : (k : N) → Vec A (suc k) → Vec A k tail k (cons n x xs) = { } -- suc k = suc n
9 / 52
data Vec (A : Type) : N → Type where nil : Vec A zero cons : (n : N) → A → Vec A n → Vec A (suc n) tail : (k : N) → Vec A (suc k) → Vec A k tail k (cons n x xs) = { } -- k = n
9 / 52
data Vec (A : Type) : N → Type where nil : Vec A zero cons : (n : N) → A → Vec A n → Vec A (suc n) tail : (k : N) → Vec A (suc k) → Vec A k tail .n (cons n x xs) = { }
9 / 52
data Vec (A : Type) : N → Type where nil : Vec A zero cons : (n : N) → A → Vec A n → Vec A (suc n) tail : (k : N) → Vec A (suc k) → Vec A k tail .n (cons n x xs) = xs
9 / 52
10 / 52
10 / 52
10 / 52
11 / 52
11 / 52
12 / 52
12 / 52
12 / 52
13 / 52
13 / 52
13 / 52
13 / 52
13 / 52
14 / 52
14 / 52
14 / 52
14 / 52
15 / 52
15 / 52
16 / 52
16 / 52
16 / 52
16 / 52
17 / 52
18 / 52
18 / 52
18 / 52
19 / 52
20 / 52
21 / 52
21 / 52
21 / 52
21 / 52
22 / 52
23 / 52
24 / 52
25 / 52
25 / 52
26 / 52
27 / 52
28 / 52
28 / 52
29 / 52
30 / 52
30 / 52
30 / 52
30 / 52
31 / 52
31 / 52
31 / 52
32 / 52
32 / 52
32 / 52
32 / 52
33 / 52
33 / 52
34 / 52
34 / 52
34 / 52
35 / 52
35 / 52
36 / 52
36 / 52
36 / 52
36 / 52
37 / 52
37 / 52
37 / 52
38 / 52
39 / 52
1 : k ≡N n)(e′ 2 : x ≡A y)
3 : xs ≡Vec A e1 ys)
39 / 52
1 : k ≡N n)(e′ 2 : x ≡A y)
3 : xs ≡Vec A e1 ys)
39 / 52
40 / 52
41 / 52
41 / 52
41 / 52
42 / 52
42 / 52
1 : n ≡N n)(e′ 2 : x ≡A y)(e′ 3 : xs ≡Vec A e′
1 ys)
1 ≡suc n≡Nsuc n refl)
42 / 52
1 : n ≡N n)(e′ 2 : x ≡A y)(e′ 3 : xs ≡Vec A e′
1 ys)
1 ≡suc n≡Nsuc n refl)
42 / 52
1 : n ≡N n)(e′ 2 : x ≡A y)(e′ 3 : xs ≡Vec A e′
1 ys)
1 ≡suc n≡Nsuc n refl)
43 / 52
44 / 52
44 / 52
45 / 52
46 / 52
47 / 52
48 / 52
48 / 52
49 / 52
50 / 52
51 / 52
51 / 52
51 / 52
52 / 52
52 / 52
52 / 52
52 / 52
52 / 52
52 / 52
52 / 52
52 / 52
52 / 52
52 / 52