Formal Methods in software development a.y.2017/2018 Prof. Anna Labella 4/15/2019
The predicate calculus [H-R ch.2] The need for a richer language Terms and formulas quantifiers 4/15/2019
Examples Every student preparing his homework must be left alone x (((x) ψ(x)) χ(x)) For every natural number there is number greater than it x (N(x) y (N(y) G(y,x)) x y G(y,x) There are people who do not like their dog x (x, d(x)) 4/15/2019
Syntax Inductive term definition BNF t::= x | c | f(t1,t2,…,tn) 4/15/2019
Syntax Inductive definition of wff BNF ::= p(t1,t2,…,tn) | t1=t2 | () | () | () | () | x | x 4/15/2019
Syntax One can always do without function symbols, using predicates and equality f(x)=y is the same as F(x,y) z (F(x,z) y=z) 4/15/2019
Peano’s arithmetics Predicates: - = -, - ≤ - Functions : - + -, - . -, s(-),… Constants: 0 4/15/2019
Exercises 4/15/2019
Syntax Free and bounded variables 4/15/2019
Syntax Open and closed formulas 4/15/2019
Syntax Free and bounded variables 4/15/2019
Syntax Be careful with substitution! 4/15/2019
Natural deduction 1 A special predicate: equality =(-,-) or - = - 4/15/2019
Natural deduction 2 Proof rules for equality 4/15/2019
Natural deduction 3 We can prove symmetry 4/15/2019
Natural deduction 3 And also transitivity 4/15/2019
Exercises 4/15/2019
Natural deduction 1 Proof rules for universal quantification where t is free for x in φ 4/15/2019 where x0 is a fresh variable
Natural deduction 2 Proof rules for existential quantification where t is free for x in φ 4/15/2019 where x0 is a fresh variable
Examples of proofs where x0 is a fresh variable 4/15/2019
Examples of proofs 4/15/2019
Exercises 4/15/2019
Exercises 4/15/2019