CS206 Lecture 03 Propositional Logic Proofs G. Sivakumar Computer Science Department IIT Bombay siva@iitb.ac.in http://www.cse.iitb.ac.in/ siva Page 1 of 12 Fri, Jan 03, 2003 Plan for Lecture 03 Axioms Normal Forms
Semantics How to assign a meaning to a formula? Base Case Page 2 of 12 An interpretation, or truth assignment, is a function from a set of propositional symbols to {t, f}. Inductive Case Truth Tables for Connectives f 1 f 2 f 1 f 1 f 2 f 1 f 2 f 1 f 2 f 1 f 2 t t f t t t t t f f f t f f f t t f t t f f f t f f t t
Page 3 of 12 Some Denitions An interpretation satises a formula if the formula evaluates to t (1) under the interpretation. A set S of formulae is valid (or a tautology) if every interpretation for S satises every formula in S. A set S of formulae is satisable (or consistent) if there is some interpretation for S that satises every formula in S. A set S of formulae is unsatisable (or inconsistent) if it is not satisable. A set S of formulae entails A if every interpretation that satises all elements of S, also satises A. We write S = A Formulae A and B are equivalent, A B, provided A = B and B = A. Note: = and are metasymbols and not logical connectives.
Some Examples Valid p p (q (q)) Satisable p q (p) (q r) Neither is valid. Page 4 of 12 Unsatisable (r (r)) {p, q, (p) (q)}
Equivalence Axioms Can you prove the following equivalences? Page 5 of 12 Idempotency Laws P P P P P P Commutativity Laws P Q Q P P Q Q P Associativity Laws (P Q) R P (Q R) (P Q) R P (Q R) Direct use of truth tables!
Distributive Laws More Axioms (P Q) R (P R) (Q R) (P Q) R (P R) (Q R) De Morgan Laws (P Q) (P ) (Q) (P Q) (P ) (Q) Connectives Elimination Page 6 of 12 P Q (P Q) (Q P ) P Q (P ) Q...
Page 7 of 12 Simplicatoin Axioms P f f P t P P f P P t t ( (P )) P P (P ) t P (P ) f... Is there a complete set?
Normal Forms Use a set of axioms to simplify a formula into a normal form. Page 8 of 12
Page 9 of 12 Normal Form Denition A literal is an atomic formula or its negation. A maxterm is a literal or a disjunction of literals. A minterm is a literal or a conjunction of literals. A formula is in Negation Normal Form (NNF) if the only connectives in it are,, and, where is only applied to atomic formulae. A formula is in Conjunctive Normal Form (CNF) if it has the form A 1 A 2... A m (any parenthesization), where each A i is maxterm. A formula is in Disjunctive Normal Form (DNF) if it has the form A 1 A 2... A m (any parenthesization), where each A i is minterm.
Normal Forms Top level description only (ll in details). 1. Eliminate other connectives (, ). Page 10 of 12 P Q (P Q) (Q P ) P Q (P ) Q... 2. Push negation inside. (P Q) (P ) (Q) (P Q) (P ) (Q) ( (P )) P 3. Distribute Or over And (for CNF) (P Q) R (P R) (Q R) P (Q R) (P Q) (P R) 4. Simplify P f P P t t P (P ) t
Why Normal Forms Ideally, we would like the following. If a formula F is valid, its only normal form should be t. If a formula F is unsatisable, its only normal form should be f. If a formula F is satisable (but not valid), its (unique) normal form should allow us to nd interpretations that satisfy the formula. This would give a nice decision procedure for propositional logic. But, CNF and DNF do not have these properties! Quiz: Find a formula with two dierent normal forms! Page 11 of 12
Exclusive-OR to the rescue A decision procedure for propositional logic using rewriting. Choose exclusive-or (denoted + below) and and (denoted by concatenation) as the basis set of operators. x1 x x0 0 xx x x + x 0 x + 0 x Page 12 of 12 Just like polynomials we work with in algebra. Interesting rules neg(x) x + 1 x y x + y + xy All tautologies simplify to 1. All contradictions simplify to 0. Other normal forms mean the formula is satisable.