Depending on equations

Size: px
Start display at page:

Download "Depending on equations"

Transcription

1 Depending on equations A proof-relevant framework for unification in dependent type theory Jesper Cockx DistriNet KU Leuven 3 September 2017

2 Unification for dependent types Unification is used for many purposes: logic programming, type inference, term rewriting, automated theorem proving, natural language processing,... This talk: checking definitions by dependent pattern matching 1 / 52

3 Disclaimer My work is on dependently typed languages, I know little about unification. 2 / 52

4 Disclaimer My work is on dependently typed languages, I know little about unification. This talk is about first-order unification: (suc x = suc y) = (x = y) x:=y == OK 2 / 52

5 Disclaimer My work is on dependently typed languages, I know little about unification. This talk is about first-order unification: (suc x = suc y) = (x = y) x:=y == OK (suc x = zero) = 2 / 52

6 Disclaimer My work is on dependently typed languages, I know little about unification. This talk is about first-order unification: (suc x = suc y) = (x = y) x:=y == OK (suc x = zero) =... but there will be types everywhere! 2 / 52

7 Dependent types: the big five During this presentation, we ll spot: Dependent functions: (x : A) B x 3 / 52

8 Dependent types: the big five During this presentation, we ll spot: Dependent functions: (x : A) B x Indexed datatypes: Vec A n,... 3 / 52

9 Dependent types: the big five During this presentation, we ll spot: Dependent functions: (x : A) B x Indexed datatypes: Vec A n,... Identity types: x A y 3 / 52

10 Dependent types: the big five During this presentation, we ll spot: Dependent functions: (x : A) B x Indexed datatypes: Vec A n,... Identity types: x A y Universes: Type i 3 / 52

11 Dependent types: the big five During this presentation, we ll spot: Dependent functions: (x : A) B x Indexed datatypes: Vec A n,... Identity types: x A y Universes: Type i Univalence: (A B) (A B) 3 / 52

12 Dependent types: the big five During this presentation, we ll spot: Dependent functions: (x : A) B x Indexed datatypes: Vec A n,... Identity types: x A y Universes: Type i Univalence: (A B) (A B) and see how they interact with unification! 3 / 52

13 Depending on equations Checking dependently typed programs Unification in dependent type theory Unification of dependently typed terms

14 Depending on equations Checking dependently typed programs Unification in dependent type theory Unification of dependently typed terms

15 Why use dependent types? With dependent types, you can... 4 / 52

16 Why use dependent types? With dependent types, you can guarantee that a program matches its specification 4 / 52

17 Why use dependent types? With dependent types, you can guarantee that a program matches its specification... use the same language for writing programs and proofs 4 / 52

18 Why use dependent types? With dependent types, you can guarantee that a program matches its specification... use the same language for writing programs and proofs... develop programs and proofs interactively 4 / 52

19 Dependent types A dependent type is a family of types, depending on a term of a base type. Per Martin-Löf 5 / 52

20 Dependent types A dependent type is a family of types, depending on a term of a base type. Per Martin-Löf e.g. Vec A n is the type of vectors of length n. 5 / 52

21 The Agda language Agda is a purely functional language 6 / 52

22 The Agda language Agda is a purely functional language... with a strong, static type system 6 / 52

23 The Agda language Agda is a purely functional language... with a strong, static type system... for writing programs and proofs 6 / 52

24 The Agda language Agda is a purely functional language... with a strong, static type system... for writing programs and proofs... with datatypes and pattern matching 6 / 52

25 The Agda language Agda is a purely functional language... with a strong, static type system... for writing programs and proofs... with datatypes and pattern matching... with first-class dependent types 6 / 52

26 The Agda language Agda is a purely functional language... with a strong, static type system... for writing programs and proofs... with datatypes and pattern matching... with first-class dependent types... with support for interactive development 6 / 52

27 The Agda language Agda is a purely functional language... with a strong, static type system... for writing programs and proofs... with datatypes and pattern matching... with first-class dependent types... with support for interactive development All examples are (mostly) valid Agda code! 6 / 52

28 Using dependent types With dependent types, we can give more precise types to our programs: replicate : (n : N) A Vec A n 7 / 52

29 Using dependent types With dependent types, we can give more precise types to our programs: replicate : (n : N) A Vec A n replicate 10 a : Vec Char 10 7 / 52

30 Using dependent types With dependent types, we can give more precise types to our programs: replicate : (n : N) A Vec A n tail : (n : N) Vec A (suc n) Vec A n 7 / 52

31 Using dependent types With dependent types, we can give more precise types to our programs: replicate : (n : N) A Vec A n tail : (n : N) Vec A (suc n) Vec A n append : (m n : N) Vec A m Vec A n Vec A (m + n) 7 / 52

32 Simple pattern matching data N : Type where zero : N suc : N N 8 / 52

33 Simple pattern matching data N : Type where zero : N suc : N N minimum : N N N minimum x y = { } 8 / 52

34 Simple pattern matching data N : Type where zero : N suc : N N minimum : N N N minimum zero y = { } minimum (suc x) y = { } 8 / 52

35 Simple pattern matching data N : Type where zero : N suc : N N minimum : N N N minimum zero y = zero minimum (suc x) y = { } 8 / 52

36 Simple pattern matching 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

37 Simple pattern matching 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

38 Simple pattern matching 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

39 Dependent pattern matching data Vec (A : Type) : N Type where nil : Vec A zero cons : (n : N) A Vec A n Vec A (suc n) 9 / 52

40 Dependent pattern matching 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

41 Dependent pattern matching 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

42 Dependent pattern matching 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

43 Dependent pattern matching 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

44 Dependent pattern matching 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

45 Dependent pattern matching 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

46 Dependent pattern matching 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

47 Specialization by unification Agda uses unification to: eliminate impossible cases specialize the result type 10 / 52

48 Specialization by unification Agda uses unification to: eliminate impossible cases specialize the result type The output of unification can change Agda s notion of equality! 10 / 52

49 Specialization by unification Agda uses unification to: eliminate impossible cases specialize the result type The output of unification can change Agda s notion of equality! Main question: How to make sure the output of unification is correct? 10 / 52

50 Depending on equations Checking dependently typed programs Unification in dependent type theory Unification of dependently typed terms

51 Q: What is the fastest way to start a fight between type theorists? 11 / 52

52 Q: What is the fastest way to start a fight between type theorists? A: Mention the topic of equality. 11 / 52

53 The identity type x A y... a dependent type depending on x, y : A. 12 / 52

54 The identity type x A y... a dependent type depending on x, y : A.... type theory s built-in notion of equality. 12 / 52

55 The identity type x A y... a dependent type depending on x, y : A.... type theory s built-in notion of equality.... the type of proofs that x = y. 12 / 52

56 Operations on the identity type refl : x A x 13 / 52

57 Operations on the identity type refl : x A x sym : x A y y A x 13 / 52

58 Operations on the identity type refl : x A x sym : x A y y A x trans : x A y y A z x A z 13 / 52

59 Operations on the identity type refl : x A x sym : x A y y A x trans : x A y y A z x A z cong f : x A y f x B f y 13 / 52

60 Operations on the identity type refl : x A x sym : x A y y A x trans : x A y y A z x A z cong f : x A y f x B f y subst P : x A y P x P y 13 / 52

61 Unification problems as telescopes A unification problem consists of 1. Flexible variables x 1 : A 1, x 2 : A 2, Equations u 1 = v 1 : B 1, / 52

62 Unification problems as telescopes A unification problem consists of 1. Flexible variables x 1 : A 1, x 2 : A 2, Equations u 1 = v 1 : B 1,... This can be represented as a telescope: (x 1 : A 1 )(x 2 : A 2 )... (e 1 : u 1 B1 v 1 )(e 2 : u 2 B2 v 2 )... e.g. (k : N)(n : N)(e : suc k N suc n) 14 / 52

63 Unification problems as telescopes A unification problem consists of 1. Flexible variables Γ 2. Equations u 1 = v 1 : B 1,... This can be represented as a telescope: Γ (e 1 : u 1 B1 v 1 )(e 2 : u 2 B2 v 2 )... e.g. (k : N)(n : N)(e : suc k N suc n) 14 / 52

64 Unification problems as telescopes A unification problem consists of 1. Flexible variables Γ 2. Equations ū = v : This can be represented as a telescope: Γ(ē : ū v) e.g. (k : N)(n : N)(e : suc k N suc n) 14 / 52

65 Unifiers as telescope maps A unifier of ū and v is a substitution σ : Γ Γ such that ūσ = vσ. 15 / 52

66 Unifiers as telescope maps A unifier of ū and v is a substitution σ : Γ Γ such that ūσ = vσ. This can be represented as a telescope map: f : Γ Γ(ē : ū v) e.g. f : () (n : N)(e : n N zero) f () = zero; refl 15 / 52

67 Evidence of unification A map f : () (n : N)(e : n N zero) gives us two things: 16 / 52

68 Evidence of unification A map f : () (n : N)(e : n N zero) gives us two things: 1. A value for n such that n N zero 16 / 52

69 Evidence of unification A map f : () (n : N)(e : n N zero) gives us two things: 1. A value for n such that n N zero 2. Explicit evidence e of n N zero 16 / 52

70 Evidence of unification A map f : () (n : N)(e : n N zero) gives us two things: 1. A value for n such that n N zero 2. Explicit evidence e of n N zero = Unification is guaranteed to respect! 16 / 52

71 Three valid unifiers f 1 : (k : N) (k n : N)(e : k N n) f 1 k = k; k; refl f 2 : () (k n : N)(e : k N n) f 2 () = zero; zero; refl f 3 : (k n : N) (k n : N)(e : k N n) f 3 k n = k; k; refl 17 / 52

72 Most general unifiers A most general unifier of ū and v is a unifier σ such that for any σ with ūσ = vσ, there is a ν such that σ = σ ν. 18 / 52

73 Most general unifiers A most general unifier of ū and v is a unifier σ such that for any σ with ūσ = vσ, there is a ν such that σ = σ ν. This is quite difficult to translate to type theory directly / 52

74 Most general unifiers A most general unifier of ū and v is a unifier σ such that for any σ with ūσ = vσ, there is a ν such that σ = σ ν. This is quite difficult to translate to type theory directly... Intuition: if f : Γ Γ(ē : ū v) is MGU, we can go back from Γ(ē : ū v) to Γ without losing any information. 18 / 52

75 Equivalences A function f : A B is an equivalence if it has both a left and a right inverse: islinv : (x : A) g 1 (f x) A x isrinv : (y : B) f (g 2 y) B y In this case, we write f : A B. 19 / 52

76 Most general unifiers are equivalences! f : Γ(ē : ū v) Γ 20 / 52

77 Example of unification (k n : N)(e : suc k N suc n) 21 / 52

78 Example of unification (k n : N)(e : suc k N suc n) (k n : N)(e : k N n) 21 / 52

79 Example of unification (k n : N)(e : suc k N suc n) (k n : N)(e : k N n) (k : N) 21 / 52

80 Example of unification (k n : N)(e : suc k N suc n) (k n : N)(e : k N n) (k : N) f : (k : N) (k n : N)(e : suc k N suc n) f k = k; k; refl 21 / 52

81 The solution rule solution : (x : A)(e : x A t) () 22 / 52

82 The deletion rule deletion : (e : t A t) () 23 / 52

83 The injectivity rule injectivity suc : (e : suc x N suc y) (e : x N y) 24 / 52

84 Negative unification rules A negative unification rule applies to impossible equations, e.g. suc x = zero. 25 / 52

85 Negative unification rules A negative unification rule applies to impossible equations, e.g. suc x = zero. This can be represented by an equivalence: (e : suc x N zero) where is the empty type. 25 / 52

86 The conflict rule conflict suc,zero : (e : suc x N zero) 26 / 52

87 The cycle rule cycle n,suc n : (e : n N suc n) 27 / 52

88 Unifiers as equivalences By requiring unifiers to be equivalences: we exclude bad unification rules we can safely introduce new rules 28 / 52

89 Unifiers as equivalences By requiring unifiers to be equivalences: we exclude bad unification rules we can safely introduce new rules Next, we ll explore how this idea can help us. Any questions so far? 28 / 52

90 Depending on equations Checking dependently typed programs Unification in dependent type theory Unification of dependently typed terms

91 Time for the interesting bits! Equations between types Heterogeneous equations Equations on indexed datatypes Equations between equations 29 / 52

92 Equations between types Types are first-class terms of type Type: Bool : Type, N : Type, N N : Type, / 52

93 Equations between types Types are first-class terms of type Type: Bool : Type, N : Type, N N : Type,... We can form equations between types, e.g. Bool Type Bool. 30 / 52

94 Equations between types Types are first-class terms of type Type: Bool : Type, N : Type, N N : Type,... We can form equations between types, e.g. Bool Type Bool. Q: Can we apply the deletion rule? 30 / 52

95 Equations between types Types are first-class terms of type Type: Bool : Type, N : Type, N N : Type,... We can form equations between types, e.g. Bool Type Bool. Q: Can we apply the deletion rule? A: Depends on which type theory we use! 30 / 52

96 The univalence axiom (2009) Vladimir Voevodsky 31 / 52

97 The univalence axiom (2009) Isomorphic types can be identified. Vladimir Voevodsky 31 / 52

98 The univalence axiom (2009) Isomorphic types can be identified. Vladimir Voevodsky (A B) (A B) 31 / 52

99 The univalence axiom (2009) Bool is equal to Bool in two ways: Bool true false 32 / 52

100 The univalence axiom (2009) Bool is equal to Bool in two ways: Bool true false true Bool false 32 / 52

101 The univalence axiom (2009) Bool is equal to Bool in two ways: Bool true false true Bool false 32 / 52

102 The univalence axiom (2009) Bool is equal to Bool in two ways: Bool true false true Bool false 32 / 52

103 Limiting the deletion rule The deletion rule does not always hold: there might be multiple proofs of x A x. E.g. Bool Type Bool has two elements. 33 / 52

104 Limiting the deletion rule The deletion rule does not always hold: there might be multiple proofs of x A x. E.g. Bool Type Bool has two elements. We cannot use deletion in this case! 33 / 52

105 Heterogeneous equations Σ n:n Vec A n is the type of pairs (n, xs) where n : N and xs : Vec A n. 34 / 52

106 Heterogeneous equations Σ n:n Vec A n is the type of pairs (n, xs) where n : N and xs : Vec A n. (e : (0, nil) Σn:N Vec A n (1, cons 0 x xs)) (e 1 : 0 N 1)(e 2 : nil Vec A??? cons 0 x xs) 34 / 52

107 Heterogeneous equations Σ n:n Vec A n is the type of pairs (n, xs) where n : N and xs : Vec A n. (e : (0, nil) Σn:N Vec A n (1, cons 0 x xs)) (e 1 : 0 N 1)(e 2 : nil Vec A??? cons 0 x xs) What is the type of e 2? 34 / 52

108 Heterogeneous equations Solution: use equation variables as placeholders for their solutions: (e : (0, nil) Σn:N Vec A n (1, cons 0 x xs)) (e 1 : 0 N 1)(e 2 : nil Vec A e1 cons 0 x xs) 35 / 52

109 Heterogeneous equations Solution: use equation variables as placeholders for their solutions: (e : (0, nil) Σn:N Vec A n (1, cons 0 x xs)) (e 1 : 0 N 1)(e 2 : nil Vec A e1 cons 0 x xs) This is called a telescopic equality. 35 / 52

110 Be careful with heterogeneous equations! (e : (Bool, true) ΣA:Type A (Bool, false)) 36 / 52

111 Be careful with heterogeneous equations! (e : (Bool, true) ΣA:Type A (Bool, false)) (e 1 : Bool Type Bool)(e 2 : true e1 false) 36 / 52

112 Be careful with heterogeneous equations! (e : (Bool, true) ΣA:Type A (Bool, false)) (e 1 : Bool Type Bool)(e 2 : true e1 false) 36 / 52

113 Be careful with heterogeneous equations! (e : (Bool, true) ΣA:Type A (Bool, false)) (e 1 : Bool Type Bool)(e 2 : true e1 false) The conflict rule does not apply! 36 / 52

114 Be careful with heterogeneous equations! (e : (Bool, true) ΣA:Type Bool (Bool, false)) 37 / 52

115 Be careful with heterogeneous equations! (e : (Bool, true) ΣA:Type Bool (Bool, false)) (e 1 : Bool Type Bool)(e 2 : true Bool false) 37 / 52

116 Be careful with heterogeneous equations! (e : (Bool, true) ΣA:Type Bool (Bool, false)) (e 1 : Bool Type Bool)(e 2 : true Bool false) Whether a unification rule can be applied depends on the type of the equation! 37 / 52

117 Injectivity for indexed data Do standard unification rules apply to constructors of indexed datatypes? (e : cons n x xs Vec A (suc n) cons n y ys)??? 38 / 52

118 Injectivity for indexed data Idea: simplify equations between indices together with equation between constructors: (e 1 : suc k N suc n) (e 2 : cons k x xs Vec A e1 cons n y ys) 39 / 52

119 Injectivity for indexed data Idea: simplify equations between indices together with equation between constructors: (e 1 : suc k N suc n) (e 2 : cons k x xs Vec A e1 cons n y ys) (e 1 : k N n)(e 2 : x A y) (e 3 : xs Vec A e 1 ys) 39 / 52

120 Injectivity for indexed data Idea: simplify equations between indices together with equation between constructors: (e 1 : suc k N suc n) (e 2 : cons k x xs Vec A e1 cons n y ys) (e 1 : k N n)(e 2 : x A y) (e 3 : xs Vec A e 1 ys) Length of the Vec must be fully general: must be an equation variable. 39 / 52

121 The image datatype The type Im f y consists of elements image x such that f x = y: data Im (f : A B) : B Type where image : (x : A) Im f (f x) 40 / 52

122 Solving unsolvable equations (x 1 x 2 : A)(e 1 : f x 1 B f x 2 ) (e 2 : image x 1 Im f e1 image x 2 ) 41 / 52

123 Solving unsolvable equations (x 1 x 2 : A)(e 1 : f x 1 B f x 2 ) (e 2 : image x 1 Im f e1 image x 2 ) (x 1 x 2 : A)(e : x 1 A x 2 ) 41 / 52

124 Solving unsolvable equations (x 1 x 2 : A)(e 1 : f x 1 B f x 2 ) (e 2 : image x 1 Im f e1 image x 2 ) (x 1 x 2 : A)(e : x 1 A x 2 ) (x 1 : A) 41 / 52

125 What if the indices are not fully general? (e : cons n x xs Vec A (suc n) cons n y ys) 42 / 52

126 What if the indices are not fully general? (e : cons n x xs Vec A (suc n) cons n y ys) (e 1 : suc n N suc n) (e 2 : cons n x xs Vec A e1 cons n y ys) (p : e 1 suc n N suc n refl) 42 / 52

127 What if the indices are not fully general? (e : cons n x xs Vec A (suc n) cons n y ys) (e 1 : suc n N suc n) (e 2 : cons n x xs Vec A e1 cons n y ys) (p : e 1 suc n N suc n refl) (e 1 : n N n)(e 2 : x A y)(e 3 : xs Vec A e 1 ys) (p : cong suc e 1 suc n N suc n refl) 42 / 52

128 What if the indices are not fully general? (e : cons n x xs Vec A (suc n) cons n y ys) (e 1 : suc n N suc n) (e 2 : cons n x xs Vec A e1 cons n y ys) (p : e 1 suc n N suc n refl) (e 1 : n N n)(e 2 : x A y)(e 3 : xs Vec A e 1 ys) (p : cong suc e 1 suc n N suc n refl) 42 / 52

129 Higher-dimensional equations (e 1 : n N n)(e 2 : x A y)(e 3 : xs Vec A e 1 ys) (p : cong suc e 1 suc n N suc n refl) We call an equation between equality proofs (e.g. p) a higher-dimensional equation. 43 / 52

130 How to solve higher-dimensional equations? Existing unification rules do not apply / 52

131 How to solve higher-dimensional equations? Existing unification rules do not apply... We solve the problem in three steps: 1. lower the dimension of equations 2. solve lower-dimensional equations 3. lift unifier to higher dimension 44 / 52

132 Step 1: lower the dimension of equations We replace all equation variables by regular variables: instead of (e 1 : n N n)(e 2 : x A y)(e 3 : xs Vec A e1 ys) (p : cong suc e 1 suc n N suc n refl) let s first consider (k : N)(u : A)(us : Vec A k) (e : suc k N suc n) 45 / 52

133 Step 2: solve lower-dimensional equations This gives us an equivalence f of type (k : N)(u : A)(us : Vec A k) (e : suc k N suc n) (u : A)(us : Vec A n) 46 / 52

134 Step 3: lift unifier to higher dimension We lift f to an equivalence f of type (e 1 : n N n)(e 2 : x A y) (e 3 : xs Vec A e1 ys) (p : cong suc e 1 suc n N suc n refl) (e 2 : x A y)(e 3 : xs Vec A n ys) 47 / 52

135 Final result of steps 1-3 (e : cons n x xs Vec A (suc n) cons n y ys) (e 2 : x A y)(e 3 : xs Vec A n ys) 48 / 52

136 Final result of steps 1-3 (e : cons n x xs Vec A (suc n) cons n y ys) (e 2 : x A y)(e 3 : xs Vec A n ys) This is the forcing rule for cons. 48 / 52

137 Lifting equivalences: (mostly) general case Theorem. If we have an equivalence f of type (x : A)(e : b 1 x B x b 2 x) C we can construct f of type (e : u A v)(p : cong b 1 e r B e s cong b 2 e) (e : f u r C f v s) 49 / 52

138 Implementation in Agda This is all used by Agda to check definitions by dependent pattern matching. More general than before Fixed many bugs Implementation matches theory You can try it for yourself: wiki.portal.chalmers.se/agda 50 / 52

139 Conclusion Unification rules should return evidence of their correctness. 51 / 52

140 Conclusion Unification rules should return evidence of their correctness. A most general unifier can be represented internally as an equivalence. 51 / 52

141 Conclusion Unification rules should return evidence of their correctness. A most general unifier can be represented internally as an equivalence. Unification cannot ignore the types! 51 / 52

142 Questions? If you want to know more, you can: Try out Agda: wiki.portal.chalmers.se/agda Look at the source: github.com/agda/agda Read my thesis: Dependent pattern matching and proof-relevant unification (2017) 52 / 52

143 Two applications of unification Filling in implicit arguments Checking definitions by pattern matching 52 / 52

144 Two applications of unification Filling in implicit arguments Higher order Checking definitions by pattern matching First order 52 / 52

145 Two applications of unification Filling in implicit arguments Higher order Syntactic Checking definitions by pattern matching First order Semantic 52 / 52

146 Two applications of unification Filling in implicit arguments Higher order Syntactic MGU optional Checking definitions by pattern matching First order Semantic MGU required 52 / 52

147 Two applications of unification Filling in implicit arguments Higher order Syntactic MGU optional Checking definitions by pattern matching First order Semantic MGU required Focus of this talk 52 / 52

148 Two notions of equality Definitional equality x = y : A Propositional equality e : x A y Weaker Stronger 52 / 52

149 Two notions of equality Definitional equality x = y : A Propositional equality e : x A y Weaker Decidable Stronger Undecidable 52 / 52

150 Two notions of equality Definitional equality x = y : A Propositional equality e : x A y Weaker Decidable Meta-theoretic Stronger Undecidable Internal to theory 52 / 52

151 Two notions of equality Definitional equality x = y : A Propositional equality e : x A y Weaker Decidable Meta-theoretic Implicit Stronger Undecidable Internal to theory Explicit 52 / 52

Sprinkles of extensionality for your vanilla type theory

Sprinkles of extensionality for your vanilla type theory Sprinkles of extensionality for your vanilla type theory Adding custom rewrite rules to Agda Jesper Cockx Andreas Abel DistriNet KU Leuven 24 May 2016 What are we doing? Take some Agda... vanilla 1 / 17

More information

Univalent Foundations and Set Theory

Univalent Foundations and Set Theory Univalent Foundations and Set Theory Talk by Vladimir Voevodsky from Institute for Advanced Study in Princeton, NJ. May 8, 2013 1 Univalent foundations - are based on a class of formal deduction systems

More information

Programming with Higher Inductive Types

Programming with Higher Inductive Types 1/32 Programming with Higher Inductive Types Herman Geuvers joint work with Niels van der Weide, Henning Basold, Dan Frumin, Leon Gondelman Radboud University Nijmegen, The Netherlands November 17, 2017

More information

Automated Reasoning Lecture 17: Inductive Proof (in Isabelle)

Automated Reasoning Lecture 17: Inductive Proof (in Isabelle) Automated Reasoning Lecture 17: Inductive Proof (in Isabelle) Jacques Fleuriot jdf@inf.ed.ac.uk Recap Previously: Unification and Rewriting This time: Proof by Induction (in Isabelle) Proof by Mathematical

More information

Homotopy Type Theory

Homotopy Type Theory Homotopy Type Theory Jeremy Avigad Department of Philosophy and Department of Mathematical Sciences Carnegie Mellon University February 2016 Homotopy Type Theory HoTT relies on a novel homotopy-theoretic

More information

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications NICTA Advanced Course Theorem Proving Principles, Techniques, Applications λ 1 CONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural

More information

Introduction to lambda calculus Part 6

Introduction to lambda calculus Part 6 Introduction to lambda calculus Part 6 Antti-Juhani Kaijanaho 2017-02-16 1 Untyped lambda calculus 2 Typed lambda calculi 2.1 Dynamically typed lambda calculus with integers 2.2 A model of Lisp 2.3 Simply

More information

Elaborating dependent (co)pattern matching

Elaborating dependent (co)pattern matching 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 Elaborating dependent (co)pattern matching JESPER COCKX and ANDREAS

More information

Homotopy and Directed Type Theory: a Sample

Homotopy and Directed Type Theory: a Sample Homotopy and Directed Type Theory: a Sample Dan Doel October 24, 2011 Type Theory Overview Judgments Γ ctx Γ A type Γ M : A Families Γ, x : A B(x) type Inference Γ 1 J 1 Γ 2 J 2 Type Theory Overview Π

More information

Great Theoretical Ideas in Computer Science. Lecture 7: Introduction to Computational Complexity

Great Theoretical Ideas in Computer Science. Lecture 7: Introduction to Computational Complexity 15-251 Great Theoretical Ideas in Computer Science Lecture 7: Introduction to Computational Complexity September 20th, 2016 What have we done so far? What will we do next? What have we done so far? > Introduction

More information

Weak ω-groupoids in Type Theory

Weak ω-groupoids in Type Theory Weak ω-groupoids in Type Theory Based on joint work with Ondrej Rypacek Thorsten Altenkirch Functional Programming Laboratory School of Computer Science University of Nottingham April 2, 2012 Thorsten

More information

Limitations of OCAML records

Limitations of OCAML records Limitations of OCAML records The record types must be declared before they are used; a label e can belong to only one record type (otherwise fun x x.e) would have several incompatible types; we cannot

More information

Formalising the Completeness Theorem of Classical Propositional Logic in Agda (Proof Pearl)

Formalising the Completeness Theorem of Classical Propositional Logic in Agda (Proof Pearl) Formalising the Completeness Theorem of Classical Propositional Logic in Agda (Proof Pearl) Leran Cai, Ambrus Kaposi, and Thorsten Altenkirch University of Nottingham {psylc5, psxak8, psztxa}@nottingham.ac.uk

More information

Introduction to Metalogic

Introduction to Metalogic Philosophy 135 Spring 2008 Tony Martin Introduction to Metalogic 1 The semantics of sentential logic. The language L of sentential logic. Symbols of L: Remarks: (i) sentence letters p 0, p 1, p 2,... (ii)

More information

Conservation of Information

Conservation of Information Conservation of Information Amr Sabry (in collaboration with Roshan P. James) School of Informatics and Computing Indiana University May 8, 2012 Amr Sabry (in collaboration with Roshan P. James) (IU SOIC)

More information

The equivalence axiom and univalent models of type theory.

The equivalence axiom and univalent models of type theory. The equivalence axiom and univalent models of type theory. (Talk at CMU on February 4, 2010) By Vladimir Voevodsky Abstract I will show how to define, in any type system with dependent sums, products and

More information

Reasoning About Imperative Programs. COS 441 Slides 10b

Reasoning About Imperative Programs. COS 441 Slides 10b Reasoning About Imperative Programs COS 441 Slides 10b Last time Hoare Logic: { P } C { Q } Agenda If P is true in the initial state s. And C in state s evaluates to s. Then Q must be true in s. Program

More information

Overview of Today s Lecture

Overview of Today s Lecture Branden Fitelson Philosophy 4515 (Advanced Logic) Notes 1 Overview of Today s Lecture Administrative Stuff HW #1 grades and solutions have been posted Please make sure to work through the solutions HW

More information

CS Lecture 19: Logic To Truth through Proof. Prof. Clarkson Fall Today s music: Theme from Sherlock

CS Lecture 19: Logic To Truth through Proof. Prof. Clarkson Fall Today s music: Theme from Sherlock CS 3110 Lecture 19: Logic To Truth through Proof Prof. Clarkson Fall 2014 Today s music: Theme from Sherlock Review Current topic: How to reason about correctness of code Last week: informal arguments

More information

Logic: Propositional Logic Truth Tables

Logic: Propositional Logic Truth Tables Logic: Propositional Logic Truth Tables Raffaella Bernardi bernardi@inf.unibz.it P.zza Domenicani 3, Room 2.28 Faculty of Computer Science, Free University of Bolzano-Bozen http://www.inf.unibz.it/~bernardi/courses/logic06

More information

Parallel Prefix Sums In An Embedded Hardware Description Language

Parallel Prefix Sums In An Embedded Hardware Description Language Parallel Prefix Sums In An Embedded Hardware Description Language Yorick Sijsling May 8, 2015 Supervised by Wouter Swierstra Thanks to João Paulo Pizani Flor 1 Abstract A scan (also known as a parallel

More information

The Curry-Howard Isomorphism

The Curry-Howard Isomorphism The Curry-Howard Isomorphism Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) The Curry-Howard Isomorphism MFES 2008/09

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 7. Propositional Logic Rational Thinking, Logic, Resolution Joschka Boedecker and Wolfram Burgard and Bernhard Nebel Albert-Ludwigs-Universität Freiburg May 17, 2016

More information

Relating Nominal and Higher-Order Pattern Unification

Relating Nominal and Higher-Order Pattern Unification Relating Nominal and Higher-Order Pattern Unification James Cheney University of Edinburgh UNIF 2005 April 22, 2005 1 Motivation Higher-order unification: studied since ca. 1970 Undecidable, infinitary,

More information

First Order Logic: Syntax and Semantics

First Order Logic: Syntax and Semantics CS1081 First Order Logic: Syntax and Semantics COMP30412 Sean Bechhofer sean.bechhofer@manchester.ac.uk Problems Propositional logic isn t very expressive As an example, consider p = Scotland won on Saturday

More information

6. Logical Inference

6. Logical Inference Artificial Intelligence 6. Logical Inference Prof. Bojana Dalbelo Bašić Assoc. Prof. Jan Šnajder University of Zagreb Faculty of Electrical Engineering and Computing Academic Year 2016/2017 Creative Commons

More information

Automata Theory and Formal Grammars: Lecture 1

Automata Theory and Formal Grammars: Lecture 1 Automata Theory and Formal Grammars: Lecture 1 Sets, Languages, Logic Automata Theory and Formal Grammars: Lecture 1 p.1/72 Sets, Languages, Logic Today Course Overview Administrivia Sets Theory (Review?)

More information

Propositional Logic: Part II - Syntax & Proofs 0-0

Propositional Logic: Part II - Syntax & Proofs 0-0 Propositional Logic: Part II - Syntax & Proofs 0-0 Outline Syntax of Propositional Formulas Motivating Proofs Syntactic Entailment and Proofs Proof Rules for Natural Deduction Axioms, theories and theorems

More information

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel Foundations of AI 7. Propositional Logic Rational Thinking, Logic, Resolution Wolfram Burgard and Bernhard Nebel Contents Agents that think rationally The wumpus world Propositional logic: syntax and semantics

More information

Dependent types. Paul Stansifer. March 16, 2012

Dependent types. Paul Stansifer. March 16, 2012 Dependent types Paul Stansifer March 16, 2012 1 You ve seen this before I hope you like abstraction, because we re about to use it a lot. Here s the simply-typed lambda calculus with built-in list operations

More information

Propositional Resolution

Propositional Resolution Artificial Intelligence Propositional Resolution Marco Piastra Propositional Resolution 1] Deductive systems and automation Is problem decidible? A deductive system a la Hilbert (i.e. derivation using

More information

Lecture 11: Gödel s Second Incompleteness Theorem, and Tarski s Theorem

Lecture 11: Gödel s Second Incompleteness Theorem, and Tarski s Theorem Lecture 11: Gödel s Second Incompleteness Theorem, and Tarski s Theorem Valentine Kabanets October 27, 2016 1 Gödel s Second Incompleteness Theorem 1.1 Consistency We say that a proof system P is consistent

More information

1 Introduction. 2 Recap The Typed λ-calculus λ. 3 Simple Data Structures

1 Introduction. 2 Recap The Typed λ-calculus λ. 3 Simple Data Structures CS 6110 S18 Lecture 21 Products, Sums, and Other Datatypes 1 Introduction In this lecture, we add constructs to the typed λ-calculus that allow working with more complicated data structures, such as pairs,

More information

From syntax to semantics of Dependent Type Theories - Formalized

From syntax to semantics of Dependent Type Theories - Formalized RDP 2015, Jun. 30, 2015, WCMCS, Warsaw. From syntax to semantics of Dependent Type Theories - Formalized by Vladimir Voevodsky from the Institute for Advanced Study in Princeton, NJ. I will be speaking

More information

Normalization by Evaluation

Normalization by Evaluation Normalization by Evaluation Andreas Abel Department of Computer Science and Engineering Chalmers and Gothenburg University PhD Seminar in Mathematical Engineering EAFIT University, Medellin, Colombia 9

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 7. Propositional Logic Rational Thinking, Logic, Resolution Wolfram Burgard, Maren Bennewitz, and Marco Ragni Albert-Ludwigs-Universität Freiburg Contents 1 Agents

More information

Equality and dependent type theory. CIRM, May 31

Equality and dependent type theory. CIRM, May 31 CIRM, May 31 The Axiom of Univalence, a type-theoretic view point In type theory, we reduce proof-checking to type-checking Hence we want type-checking to be decidable This holds as soon as we have the

More information

Foundations of Computation. Ana Bove

Foundations of Computation. Ana Bove Foundations of Computation Ana Bove Programming Logic (ProgLog) Group February 13th 2018 Outline of the talk: What we do in ProgLog Origines of computer science Courses in the area Warming-up Exercise

More information

Proof techniques (section 2.1)

Proof techniques (section 2.1) CHAPTER 1 Proof techniques (section 2.1) What we have seen so far: 1.1. Theorems and Informal proofs Argument: P 1 P n Q Syntax: how it's written Semantic: meaning in a given interpretation Valid argument:

More information

Discrete Mathematics for CS Fall 2003 Wagner Lecture 3. Strong induction

Discrete Mathematics for CS Fall 2003 Wagner Lecture 3. Strong induction CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 3 This lecture covers further variants of induction, including strong induction and the closely related wellordering axiom. We then apply these

More information

Type Theory and Univalent Foundation

Type Theory and Univalent Foundation Thierry Coquand Clermont-Ferrand, October 17, 2013 This talk Revisit some questions discussed by Russell at the beginning of Type Theory -Russell s Paradox (1901) -Theory of Descriptions (1905) -Theory

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 7. Propositional Logic Rational Thinking, Logic, Resolution Joschka Boedecker and Wolfram Burgard and Frank Hutter and Bernhard Nebel Albert-Ludwigs-Universität Freiburg

More information

23.1 Gödel Numberings and Diagonalization

23.1 Gödel Numberings and Diagonalization Applied Logic Lecture 23: Unsolvable Problems in Logic CS 4860 Spring 2009 Tuesday, April 14, 2009 The fact that Peano Arithmetic is expressive enough to represent all computable functions means that some

More information

Gödel s Incompleteness Theorem. Overview. Computability and Logic

Gödel s Incompleteness Theorem. Overview. Computability and Logic Gödel s Incompleteness Theorem Overview Computability and Logic Recap Remember what we set out to do in this course: Trying to find a systematic method (algorithm, procedure) which we can use to decide,

More information

2.7.1 Foundations of Proof Systems

2.7.1 Foundations of Proof Systems 2.7.1 Foundations of Proof Systems Exam 2017-2018 1 Warming up... Question 1 Give a proof in natural deduction of the following proposition : ( f = (g = h)) = (( f = g) = ( f = h)). Solution. f (g h);

More information

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg Type Theory and Constructive Mathematics Type Theory and Constructive Mathematics Thierry Coquand University of Gothenburg Content An introduction to Voevodsky s Univalent Foundations of Mathematics The

More information

Is Constructive Logic relevant for Computer Science?

Is Constructive Logic relevant for Computer Science? Is Constructive Logic relevant for Computer Science? Thorsten Altenkirch University of Nottingham BCTCS 05 p.116 Birth of Modern Mathematics BCTCS 05 p.216 Birth of Modern Mathematics Isaac Newton (1642-1727)

More information

Discrete Structures Proofwriting Checklist

Discrete Structures Proofwriting Checklist CS103 Winter 2019 Discrete Structures Proofwriting Checklist Cynthia Lee Keith Schwarz Now that we re transitioning to writing proofs about discrete structures like binary relations, functions, and graphs,

More information

Homotopy Probability Theory in the Univalent Foundations

Homotopy Probability Theory in the Univalent Foundations Homotopy Probability Theory in the Univalent Foundations Harry Crane Department of Statistics Rutgers April 11, 2018 Harry Crane (Rutgers) Homotopy Probability Theory Drexel: April 11, 2018 1 / 33 Motivating

More information

Dependent type theory

Dependent type theory Dependent type theory Γ, ::= () Γ, x : A Contexts t, u, A, B ::= x λx. t t u (x : A) B Π-types (t, u) t.1 t.2 (x : A) B Σ-types We write A B for the non-dependent product type and A B for the non-dependent

More information

Introduction to type theory and homotopy theory

Introduction to type theory and homotopy theory Introduction to type theory and homotopy theory Michael Shulman January 24, 2012 1 / 47 Homotopy theory Homotopy type theory types have a homotopy theory Intensional type theory New perspectives on extensional

More information

1 / A bird s-eye view of type theory. 2 A bird s-eye view of homotopy theory. 3 Path spaces and identity types. 4 Homotopy type theory

1 / A bird s-eye view of type theory. 2 A bird s-eye view of homotopy theory. 3 Path spaces and identity types. 4 Homotopy type theory Introduction to type theory and homotopy theory Michael Shulman January 24, 2012 Homotopy theory Homotopy type theory types have a homotopy theory New perspectives on extensional vs. intensional Intensional

More information

Interactive Theorem Provers

Interactive Theorem Provers Interactive Theorem Provers from the perspective of Isabelle/Isar Makarius Wenzel Univ. Paris-Sud, LRI July 2014 = Isabelle λ β Isar α 1 Introduction Notable ITP systems LISP based: ACL2 http://www.cs.utexas.edu/users/moore/acl2

More information

Isomorphism is equality

Isomorphism is equality Isomorphism is equality Thierry Coquand, Nils Anders Danielsson University of Gothenburg and Chalmers University of Technology Abstract The setting of this work is dependent type theory extended with the

More information

Parametricity and excluded middle

Parametricity and excluded middle Parametricity and excluded middle Auke Booij University of Birmingham May 2016 Auke Booij (University of Birmingham) Parametricity and excluded middle TYPES 2016 1 / 15 Polymorphic functions f :: forall

More information

First-Order Logic. Chapter Overview Syntax

First-Order Logic. Chapter Overview Syntax Chapter 10 First-Order Logic 10.1 Overview First-Order Logic is the calculus one usually has in mind when using the word logic. It is expressive enough for all of mathematics, except for those concepts

More information

INDUCTIVE DEFINITION

INDUCTIVE DEFINITION 1 INDUCTIVE DEFINITION OUTLINE Judgements Inference Rules Inductive Definition Derivation Rule Induction 2 META-VARIABLES A symbol in a meta-language that is used to describe some element in an object

More information

(A 3 ) (A 1 ) (1) COMPUTING CIRCUMSCRIPTION. Vladimir Lifschitz. Department of Computer Science Stanford University Stanford, CA

(A 3 ) (A 1 ) (1) COMPUTING CIRCUMSCRIPTION. Vladimir Lifschitz. Department of Computer Science Stanford University Stanford, CA COMPUTING CIRCUMSCRIPTION Vladimir Lifschitz Department of Computer Science Stanford University Stanford, CA 94305 Abstract Circumscription is a transformation of predicate formulas proposed by John McCarthy

More information

26. Januar Introduction to Computational Semantics

26. Januar Introduction to Computational Semantics 1 Lehrstuhl für Künstliche Intelligenz Institut für Informatik Friedrich-Alexander-Universität Erlangen-Nürnberg 26. Januar 2006 1 Slides are mainly due to J. Bos and P. Blackburn course on An Introduction

More information

Semantic Labelling for Proving Termination of Combinatory Reduction Systems. Makoto Hamana

Semantic Labelling for Proving Termination of Combinatory Reduction Systems. Makoto Hamana Semantic Labelling for Proving Termination of Combinatory Reduction Systems Makoto Hamana Department of Computer Science, Gunma University, Japan WFLP 09 June, 2009. 1 2 Intro: Termination Proof by RPO

More information

CS154, Lecture 10: Rice s Theorem, Oracle Machines

CS154, Lecture 10: Rice s Theorem, Oracle Machines CS154, Lecture 10: Rice s Theorem, Oracle Machines Moral: Analyzing Programs is Really, Really Hard But can we more easily tell when some program analysis problem is undecidable? Problem 1 Undecidable

More information

Two-Dimensional Modal Logic

Two-Dimensional Modal Logic Hardegree, Modal Logic, Chapter 10: Two-Dimensional Modal Logic 1 of 12 10 Two-Dimensional Modal Logic 1. Introduction...2 2. Scoped-Actuality...2 3. System 2D(1)...2 4. Examples of Derivations in 2D(1)...3

More information

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13 CSC242: Intro to AI Lecture 11 Propositional Inference Propositional Inference Factored Representation Splits a state into variables (factors, attributes, features, things you know ) that can have values

More information

Two-Dimensional Modal Logic

Two-Dimensional Modal Logic Hardegree, Modal Logic, 10: Two-Dimensional Modal Logic 13 X-1 10 Two-Dimensional Modal Logic 1. Introduction...2 2. Scoped-Actuality...2 3. System 2D(1)...3 4. Examples of Derivations in 2D(1)...4 5.

More information

Combined Satisfiability Modulo Parametric Theories

Combined Satisfiability Modulo Parametric Theories Intel 07 p.1/39 Combined Satisfiability Modulo Parametric Theories Sava Krstić*, Amit Goel*, Jim Grundy*, and Cesare Tinelli** *Strategic CAD Labs, Intel **The University of Iowa Intel 07 p.2/39 This Talk

More information

Timo Latvala. March 7, 2004

Timo Latvala. March 7, 2004 Reactive Systems: Safety, Liveness, and Fairness Timo Latvala March 7, 2004 Reactive Systems: Safety, Liveness, and Fairness 14-1 Safety Safety properties are a very useful subclass of specifications.

More information

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw Applied Logic Lecture 1 - Propositional logic Marcin Szczuka Institute of Informatics, The University of Warsaw Monographic lecture, Spring semester 2017/2018 Marcin Szczuka (MIMUW) Applied Logic 2018

More information

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra.

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra. V. Borschev and B. Partee, October 26, 2006 p. 1 Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra. 0. Preliminary notes...1 1. Freedom for algebras. Word

More information

Countability. 1 Motivation. 2 Counting

Countability. 1 Motivation. 2 Counting Countability 1 Motivation In topology as well as other areas of mathematics, we deal with a lot of infinite sets. However, as we will gradually discover, some infinite sets are bigger than others. Countably

More information

From Constructibility and Absoluteness to Computability and Domain Independence

From Constructibility and Absoluteness to Computability and Domain Independence From Constructibility and Absoluteness to Computability and Domain Independence Arnon Avron School of Computer Science Tel Aviv University, Tel Aviv 69978, Israel aa@math.tau.ac.il Abstract. Gödel s main

More information

INF3170 / INF4171 Notes on Resolution

INF3170 / INF4171 Notes on Resolution INF3170 / INF4171 Notes on Resolution Andreas Nakkerud Autumn 2015 1 Introduction This is a short description of the Resolution calculus for propositional logic, and for first order logic. We will only

More information

Univalent Categories. A formalization of category theory in Cubical Agda. Frederik Hanghøj Iversen. Master s thesis in Computer Science

Univalent Categories. A formalization of category theory in Cubical Agda. Frederik Hanghøj Iversen. Master s thesis in Computer Science Univalent Categories A formalization of category theory in Cubical Agda Frederik Hanghøj Iversen Master s thesis in Computer Science Master s thesis 2018 Univalent Categories A formalization of category

More information

HORSes: format, termination and confluence

HORSes: format, termination and confluence HORSes: format, termination and confluence Jean-Pierre Jouannaud INRIA-LIAMA and singhua Software Chair Joint on-going work with Jianqi Li School of Software, singhua University Project CoqLF NList Cross-discipline

More information

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Propositional Logic Arguments (5A) Young W. Lim 11/8/16 Propositional Logic (5A) Young W. Lim Copyright (c) 2016 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version

More information

Nunchaku: Flexible Model Finding for Higher-Order Logic

Nunchaku: Flexible Model Finding for Higher-Order Logic Nunchaku: Flexible Model Finding for Higher-Order Logic Simon Cruanes, Jasmin Blanchette, Andrew Reynolds Veridis, Inria Nancy https://cedeela.fr/~simon/ April 7th, 2016 1 / 21 Summary Introduction Nunchaku

More information

Abstract Dialectical Frameworks

Abstract Dialectical Frameworks Abstract Dialectical Frameworks Gerhard Brewka Computer Science Institute University of Leipzig brewka@informatik.uni-leipzig.de joint work with Stefan Woltran G. Brewka (Leipzig) KR 2010 1 / 18 Outline

More information

Natural Deduction for Propositional Logic

Natural Deduction for Propositional Logic Natural Deduction for Propositional Logic Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 10, 2018 Bow-Yaw Wang (Academia Sinica) Natural Deduction for Propositional Logic

More information

Type Soundness for Path Polymorphism

Type Soundness for Path Polymorphism Type Soundness for Path Polymorphism Andrés Ezequiel Viso 1,2 joint work with Eduardo Bonelli 1,3 and Mauricio Ayala-Rincón 4 1 CONICET, Argentina 2 Departamento de Computación, FCEyN, UBA, Argentina 3

More information

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B Discrete Math Review Discrete Math Review (Rosen, Chapter 1.1 1.7, 5.5) TOPICS Sets and Functions Propositional and Predicate Logic Logical Operators and Truth Tables Logical Equivalences and Inference

More information

Operational Semantics Using the Partiality Monad

Operational Semantics Using the Partiality Monad page.1 Operational Semantics Using the Partiality Monad Nils Anders Danielsson (Göteborg) Shonan Meeting 026: Coinduction for computation structures and programming languages The research leading to these

More information

A categorical model for a quantum circuit description language

A categorical model for a quantum circuit description language A categorical model for a quantum circuit description language Francisco Rios (joint work with Peter Selinger) Department of Mathematics and Statistics Dalhousie University CT July 16th 22th, 2017 What

More information

Types and Programming Languages (15-814), Fall 2018 Assignment 4: Data Representation (Sample Solutions)

Types and Programming Languages (15-814), Fall 2018 Assignment 4: Data Representation (Sample Solutions) Types and Programming Languages (15-814), Fall 2018 Assignment 4: Data Representation (Sample Solutions) Contact: 15-814 Course Staff Due Tuesday, October 16, 2018, 10:30am This assignment is due by 10:30am

More information

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule.

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule. 32 Reduction 29 32 Reduction In the preceding section, we have introduced the assignment of proof terms to natural deductions If proofs are programs then we need to explain how proofs are to be executed,

More information

Polymorphism, Subtyping, and Type Inference in MLsub

Polymorphism, Subtyping, and Type Inference in MLsub Polymorphism, Subtyping, and Type Inference in MLsub Stephen Dolan and Alan Mycroft November 8, 2016 Computer Laboratory University of Cambridge The select function select p v d = if (p v) then v else

More information

Truth-Functional Logic

Truth-Functional Logic Truth-Functional Logic Syntax Every atomic sentence (A, B, C, ) is a sentence and are sentences With ϕ a sentence, the negation ϕ is a sentence With ϕ and ψ sentences, the conjunction ϕ ψ is a sentence

More information

Equational Logic and Term Rewriting: Lecture I

Equational Logic and Term Rewriting: Lecture I Why so many logics? You all know classical propositional logic. Why would we want anything more? Equational Logic and Term Rewriting: Lecture I One reason is that we might want to change some basic logical

More information

Normalisation by Evaluation for Dependent Types

Normalisation by Evaluation for Dependent Types Normalisation by Evaluation for Dependent Types Ambrus Kaposi Eötvös Loránd University, Budapest, Hungary (j.w.w. Thorsten Altenkirch, University of Nottingham) FSCD, Porto 24 June 2016 Introduction Goal:

More information

Programming Languages and Types

Programming Languages and Types Programming Languages and Types Klaus Ostermann based on slides by Benjamin C. Pierce Subtyping Motivation With our usual typing rule for applications the term is not well typed. ` t 1 : T 11!T 12 ` t

More information

via Topos Theory Olivia Caramello University of Cambridge The unification of Mathematics via Topos Theory Olivia Caramello

via Topos Theory Olivia Caramello University of Cambridge The unification of Mathematics via Topos Theory Olivia Caramello in University of Cambridge 2 / 23 in in In this lecture, whenever I use the word topos, I really mean Grothendieck topos. Recall that a Grothendieck topos can be seen as: a generalized space a mathematical

More information

Introduction to dependent type theory. CIRM, May 30

Introduction to dependent type theory. CIRM, May 30 CIRM, May 30 Goals of this presentation Some history and motivations Notations used in type theory Main goal: the statement of main properties of equality type and the univalence axiom First talk P ropositions

More information

07 Practical Application of The Axiomatic Method

07 Practical Application of The Axiomatic Method CAS 701 Fall 2002 07 Practical Application of The Axiomatic Method Instructor: W. M. Farmer Revised: 28 November 2002 1 What is the Axiomatic Method? 1. A mathematical model is expressed as a set of axioms

More information

AN INTRODUCTION TO SEPARATION LOGIC. 2. Assertions

AN INTRODUCTION TO SEPARATION LOGIC. 2. Assertions AN INTRODUCTION TO SEPARATION LOGIC 2. Assertions John C. Reynolds Carnegie Mellon University January 7, 2011 c 2011 John C. Reynolds Pure Assertions An assertion p is pure iff, for all stores s and all

More information

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory Motivation CS389L: Automated Logical Reasoning Lecture 10: Overview of First-Order Theories Işıl Dillig Last few lectures: Full first-order logic In FOL, functions/predicates are uninterpreted (i.e., structure

More information

Covering set correctibility from the perspective of logic: categorical edits

Covering set correctibility from the perspective of logic: categorical edits Chapter 5 Covering set correctibility from the perspective of logic: categorical edits 5.1 Introduction In the previous chapter we formalised edit generation functions as logical deduction functions. In

More information

Notes from Yesterday s Discussion. Big Picture. CIS 500 Software Foundations Fall November 1. Some lessons.

Notes from Yesterday s  Discussion. Big Picture. CIS 500 Software Foundations Fall November 1. Some lessons. CIS 500 Software Foundations Fall 2006 Notes from Yesterday s Email Discussion November 1 Some lessons This is generally a crunch-time in the semester Slow down a little and give people a chance to catch

More information

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning COMP9414, Monday 26 March, 2012 Propositional Logic 2 COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning Overview Proof systems (including soundness and completeness) Normal Forms

More information

Automated Reasoning. Lecture 9: Isar A Language for Structured Proofs

Automated Reasoning. Lecture 9: Isar A Language for Structured Proofs Automated Reasoning Lecture 9: Isar A Language for Structured Proofs Jacques Fleuriot jdf@inf.ed.ac.uk Acknowledgement: Tobias Nipkow kindly provided the slides for this lecture Apply scripts unreadable

More information

6.825 Techniques in Artificial Intelligence. Logic Miscellanea. Completeness and Incompleteness Equality Paramodulation

6.825 Techniques in Artificial Intelligence. Logic Miscellanea. Completeness and Incompleteness Equality Paramodulation 6.825 Techniques in Artificial Intelligence Logic Miscellanea Completeness and Incompleteness Equality Paramodulation Lecture 9 1 Logic is a huge subject. It includes esoteric mathematical and philosophical

More information

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1) Week 1: Logic Lecture 1, 8/1 (Sections 1.1 and 1.3) Examples of theorems and proofs Theorem (Pythagoras). Let ABC be a right triangle, with legs of lengths a and b, and hypotenuse of length c. Then a +

More information

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin Today 9/28 Review propositional logic Reasoning with Models Break More reasoning Knowledge Representation A knowledge representation is a formal scheme

More information