« Mathematical foundations: (2) Classical first-order logic »
George Boole David Hilbert Gottlob Frege Reference [1] Jean van Heijenoort, editor. “From Frege to Gödel: A Source Book in Mathematical Logic, 1879-1931”. Harvard University Press, 1967. — — 2 — ľ P. Cousot
Formal logics A formal logic consists of: – a formal or informal language (formula expressing facts) – a model-theoretic semantics (to define the meaning of the language, that is which facts are valid) – a deductive system (made of axioms and inference rules to formaly derive theorems, that is facts that are provable) — 3 — ľ P. Cousot
Questions about formal logics The main questions about a formal logic are: – The soundness of the deductive system: no provable formula is invalid – The completeness of the deductive system: all valid formulæ are provable — — 4 — ľ P. Cousot
Propositional classical logic — — 5 — ľ P. Cousot
Syntax of the classical propositional logic — — 6 — ľ P. Cousot
Classical propositional logic – X 2 V are variables denoting unknown true or false facts – The set of formulæ ffi 2 F of the propositional logic are defined by the following grammar: ffi ::= X j ( ffi 1 ^ ffi 2 ) j ( : ffi ) – The relation “is a subformula of” is well founded, whence can be used for structural definitions and proofs — — 7 — ľ P. Cousot
Example of formulæ – A is a variable whence a formula The derivation tree of the for- – ( : A ) is a formula since A is a mula is: formula : – ( A ^ ( : A )) is a formula since A and and ( : A ) are formulae ^ – ( : ( A ^ ( : A )) is a formula since ( A ^ ( : A )) is a formula : � � — 8 — ľ P. Cousot
Abstract syntax – In practice we avoid parentheses thanks to priorities: - : has highest priority (evaluated first) - ^ has lowest priority (evaluated second) - ^ is left associative (evaluation from left to right) For example, : A ^: B ^ C stands for ( : A ) ^ ( : B ) ^ C which stands for (( : A ) ^ ( : B )) ^ C – The derivation tree is given by the following abstract grammar: ffi ::= X j ffi 1 ^ ffi 2 j : ffi — — 9 — ľ P. Cousot
Propositional identities Abbreviations (de Morgan laws) def ffi 1 _ ffi 2 = : ( : ffi 1 ^ : ffi 2 ) def ffi 1 = ) ffi 2 = : ffi 1 _ ffi 2 def ffi 1 ( = ffi 2 = ffi 2 = ) ffi 1 def ffi 1 ( ) ffi 2 = ( ffi 1 = ) ffi 2 ) ^ ( ffi 1 ( = ffi 2 ) def ffi 1 _ ffi 2 = ( ffi 1 _ ffi 2 ) ^ : ( ffi 1 ^ ffi 2 ) — — 10 — ľ P. Cousot
Free variables of proopositional formulae The set FV( ffi ) of free variables appearing in a formula ffi is defined by structural induction as follows: def FV( X ) = f X g def FV( : ffi ) = FV( ffi ) def FV( ffi 1 ^ ffi 2 ) = FV( ffi 1 ) [ FV( ffi 2 ) — — — 11 — ľ P. Cousot
Semantics of the propositional classical logic — 12 — ľ P. Cousot
Booleans def We define the booleans B = f tt ; ¸ g and boolean opera- tors by the following truth table: & tt ¸ : tt tt ¸ tt ¸ ¸ ¸ ¸ ¸ tt — 13 — ľ P. Cousot
Environment/Assignment – An environment 1 2 V 7! B assigns boolean values n ( X ) to free propositional variables X . – An example of assignment is = f X ! tt ; Y ! ¸ g such that ( X ) = tt , ( Y ) = ¸ and the value for all other propositional variables Z 2 V n f X; Y g is unde- fined 1 Also called assignment in logic. — 14 — ľ P. Cousot
Tarskian/model-theoretic semantics of the classical propositional logic The semantics 2 S 2 F 7! ( V 7! B ) 7! B of a proposi- tional formula ffi assign a meaning S � ffi � to the formula for any given environment 3 : def S � X � = ( X ) def S � : ffi � = : ( S � ffi � ) def S � ffi 1 ^ ffi 2 � = S � ffi 1 � & S � ffi 2 � 2 Also called an interpretation in logic 3 Hilbert used instead an arithmetic interpretation where 0 is true and 1 is false. — 15 — ľ P. Cousot
Models is a model of ffi (or that satisfies ffi ) if and only if: S � ffi � = tt which is written: ‚ ffi — 16 — ľ P. Cousot
Entailment – A set ` 2 } ( F ) of formulae entails ffi whenever: 8 : ( 8 ffi 0 2 ` : ‚ ffi 0 ) = ) ‚ ffi which is written: ` ‚ ffi — 17 — ľ P. Cousot
Validity – We say that ffi is valid if and only if: 8 2 (V 7! B ) : S � ffi � = tt which is written: ‚ ffi (i.e. ffi is a tautaulogy, always true) — 18 — ľ P. Cousot
Examples of tautologies P = ) P ( : ( P = ) Q )) = ) P ( :: P ) = ) P ( : ( P = ) Q )) = ) ( :: P ) P = ) ( :: P ) ( : ( P = ) Q )) = ) : Q P = ) ( Q = ) P ) ( P = ) : P ) = ) ( P = ) Q ) ) ( Q = ) Q ) ) Q ) = ) ( : Q = ) : P ) P = ( P = ( : P = ) P ) = ) P ( P = ) : Q ) = ) ( Q = ) : P ) P = ) ( : P = ) Q ) ( : P = ) : Q ) = ) ( Q = ) P ) : P = ) ( P = ) Q ) ( : P = ) : Q ) = ) ( : P = ) Q ) = ) P ) ( : ( P = ) P )) = ) Q ( : ( P = ) Q )) = ) ( Q = ) R ) P = ) ( : ( P = ) : P )) ( : ( P = ) Q )) = ) ( : P = ) R ) ( P = ) : P ) = ) : P ( P = ) Q ) = ) (( Q = ) R ) = ) ( P = ) R )) — 19 — ľ P. Cousot
Satisfiability/Unsatisfiability – A formula ffi 2 F is satisfiable if and only if: 9 2 (V 7! B ) : S � ffi � = tt – A formula ffi 2 F is unsatisfiable if and only if: 8 2 (V 7! B ) : S � ffi � = tt (i.e. ffi is a antilogy, always false) — 20 — ľ P. Cousot
Satisfiability/Validity/Unsatisfiability �������� ����������� ������������� ��������������� ��������������� ������������ ����� ����������� — 21 — ľ P. Cousot
Deductive system for the classical propositional logic — 22 — ľ P. Cousot
Hilbert deductive system – Axiom schemata 4 : (1) ffi _ ffi = ) ffi 5 ) ffi 0 _ ffi 6 (2) ffi = ) ( ffi 00 _ ffi = ) ffi 0 _ ffi 00 ) 7 ) ffi 0 ) = (3) ( ffi = – Inference rule schema 4 : ) ffi 0 ffi; ffi = (MP) 8 modus ponens ffi 0 4 to be instanciated for all possible formulae ffi; ffi 0 ; ffi 00 2 F 5 i.e. : ( : ( : ffi ^ : ffi )) _ ffi ) 6 i.e. : ( :: ffi ^ :: ( : ffi ^ : ffi 0 )) 7 i.e; : ( : ffi _ ffi 0 ) _ ( : ( ffi 00 _ ffi ) _ ( ffi 0 _ ffi 00 )) where ffi 1 _ ffi 2 def = : ( : ffi 1 _ : ffi 2 ) ffi; : ffi _ ffi 0 8 i.e. ffi 0 — 23 — ľ P. Cousot
Hilbert derivation – A derivation from a set ` 2 } ( F ) of hypotheses is a finite nonempty sequence: n – 0 ffi 1 ; ffi 2 ; : : : ; ffi n of formulae such that for each ffi i , i = 1 ; : : : ; n , we have: - ffi i is a element of ` (hypothesis) - ffi i is an axiom - ffi i is the conclusion of an inference rule ffi 1 i ; : : : ; ffi k i such ffi i that f ffi 1 i ; : : : ; ffi k i g „ f ffi 1 ; ffi 2 ; : : : ; ffi n ` 1 g 9 9 So that the premises have already been proved. — 24 — ľ P. Cousot
Hilbert proof – A proof is a derivation from ; — 25 — ľ P. Cousot
Example of proof ( ffi _ ffi = ) ffi ) = ) ( : ffi _ ( ffi _ ffi ) = ) ffi _ : ffi ) � [instance of (3)] (a) � � [instance of (1)] (b) � ffi _ ffi = ) ffi � [(a), (b) and (MP)] (c) � : ffi _ ( ffi _ ffi ) = ) ( ffi _ : ffi ) = ( ffi = � def. = ) abbreviation � ) ( ffi _ ffi )) = ) ffi _ : ffi � [instance of (2)] (d) � ffi = ) ( ffi _ ffi ) � [(c), (d) and (MP)] � ffi _ : ffi
Hilbert provability – ffi 2 F is provable from ` 2 } (F) (or ` proves ffi ) iff there is a proof of ffi from ` , written: ` ‘ ffi where the deduction system (axioms and inference rules) are understood from the context. – ; ‘ ffi is written ‘ ffi This is the proof-theoretic semantics of first-order logic. — 27 — ľ P. Cousot
Example of provability ‘ : ffi _ :: ffi Proof. Replace ffi by : ffi is the previous proof of ffi _ : ffi . — 28 — ľ P. Cousot
Soundness of a deductive system Provable formulae do hold: ` ‘ ffi = ) ` ‚ ffi Proof. The proof for propositional logic is by induction on the length of the formal proof of ffi from ` . A proof of length one, can only use a formula ffi in ` which is assumed to hold (i.e. S � ffi � = tt ) or an axiom that does hold as shown below. – S � ffi _ ffi = ) ffi � = S � : ( : ( : ffi ^ : ffi )) � def. _ = : ( : ( : ( S � ffi � )& : ( S � ffi � ))) def. S = : ( S � ffi � )& : ( S � ffi � ) def. : = : (¸) def. & — 29 — ľ P. Cousot
= tt def. : – The proof is similar for the other two axioms. A proof of length n + 1 , n – 1 is an initial proof ffi 0 ; : : : ; ffi n ` 1 of length n followed by a formula ffi n . By induction hypothesis, we have S � ffi i � = tt , i = 1 ; : : : ; n ` 1 . If ffi n 2 ` or ffi n is an axiom then S � ffi n � = tt as shown above. Otherwise, ffi n is derived by the modus ponens inference rule (MP). In that case, we have k , 0 » k < n such that S � ffi k � = tt and S � ffi k = ) ffi n � = tt so ( S � ffi k � = ) S � ffi n � ) = tt where the truth table of = ) is derived from the definition of = ) and that of : and ^ as follows: = ) ¸ tt ¸ tt tt tt ¸ tt Since S � ffi k � = tt the truth table of = ) shows than the only possibility for ) S � ffi n � ) = tt is S � ffi n � = tt . ( S � ffi k � = — 30 — ľ P. Cousot
Recommend
More recommend