Download presentation
Presentation is loading. Please wait.
1
Formal Methods in software development
a.y.2016/2017 Prof. Anna Labella 4/15/2019
2
The predicate calculus [H-R ch.2]
The need for a richer language Terms and formulas quantifiers 4/15/2019
3
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
4
Syntax Inductive term definition BNF t::= x | c | f(t1,t2,…,tn)
4/15/2019
5
Syntax Inductive definition of wff BNF
::= p(t1,t2,…,tn) | t1=t2 | () | () | () | () | x | x 4/15/2019
6
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
7
Peano’s arithmetics Predicates: - = -, - ≤ -
Functions : - + -, - . -, s(-),… Constants: 0 4/15/2019
8
Exercises 4/15/2019
9
Syntax Free and bounded variables 4/15/2019
10
Syntax Open and closed formulas 4/15/2019
11
Syntax Be careful with substitution! 4/15/2019
12
Syntax Free and bounded variables 4/15/2019
13
Natural deduction 1 A special predicate: equality =(-,-) or - = -
4/15/2019
14
Natural deduction 2 Proof rules for equality 4/15/2019
15
Natural deduction 3 We can prove symmetry 4/15/2019
16
Natural deduction 3 And also transitivity 4/15/2019
17
Exercises 4/15/2019
18
Natural deduction 1 Proof rules for universal quantification
where t is free for x in φ 4/15/2019 where x0 is a fresh variable
19
Natural deduction 2 Proof rules for existential quantification
where t is free for x in φ 4/15/2019 where x0 is a fresh variable
20
Examples of proofs 4/15/2019 where x0 is a fresh variable
21
Examples of proofs 4/15/2019
22
Exercises 4/15/2019
23
Semantics syntactical data F functional symbols- constants
P predicate symbols An interpretation M a non empty set (domain) A F a set of functions fM on A (An) P a set of relations PM on A (An) 4/15/2019
24
Semantics A subset is the interpretation of a 1-ary predicate A n-ary relation is the interpretation of a n-ary predicate 4/15/2019
25
An example: arithmetics
syntactical data F: f1(-,-), f2(-,-), f0(-), c P: - = -, P1(-,-) An interpretation M Natural numbers (domain) Functions : - + -, - . -, s(-), 0 Predicates: - = -, - ≤ - 4/15/2019
26
Semantics environments Assigning values l: var elements of A
4/15/2019
27
Semantics Summing up, we are given with 4/15/2019
28
An example: arithmetics 2
f1(c,x)=x always true in the interpretation f2(c,x)=x sometimes true sometimes false in the interpretation depending on the assignment x(f1(c,x)=x) true in the interpretation x(f2(c,x)=x) true in the interpretation x(f2(c,x)=x) false in the interpretation x(f1(c,x)=f1(c,x)) valid 4/15/2019
29
Semantics An interpretation M is a model of M |=l : 4/15/2019
30
Semantics: satisfiability
4/15/2019
31
Exercises 4/15/2019
32
Semantics: validity is valid if for every intepretation and for every environment M |= 4/15/2019
33
Properties Soundness |- M |= Completeness M |= |-
Indecidability Compactness Expressivity 4/15/2019
34
Second order logic Existential second order logic
Universal second order logic Peano’s arithmetics 4/15/2019
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.