180 likes | 424 Views
Algebra of propositional wffs. Sections 1.2-1.3 13 May. 1. Substitution Rules. Let H be a wff and w be a proposition variable in H . If H is a tautology, then the wff Q obtained from H by replacing every occurrence of w by another proposition r is also a tautology. Example:
E N D
Algebra of propositional wffs Sections 1.2-1.3 13 May PROPOSITIONAL LOGIC 1
Substitution Rules LetH be a wff and w be a proposition variable inH. If H is a tautology, then the wff Q obtained from H by replacing every occurrence of w by another proposition r is also a tautology. Example: (p (p q) ) qis a tautology. Replacingp with (q s), gives((q s) ((q s) q)) q This shows that((q s) ((q s) q)) q is also a tautology. 2 PROPOSITIONAL LOGIC
Substitution Rules… Let H be a wff; w be a (sub)formula in H; and u be any formula that is equivalent to w. Then the wff Q obtained from H by replacing an occurrence ofw withu is logically equivalent to H. Example: ¬ [(p q) (p r)] [q (p r)] ≡ ¬ [(¬p q) (p r)] [q (p r)] Note that for this rule, H does not have to be a tautology. 3 PROPOSITIONAL LOGIC
Duality Law Let H be a wff. The wff Q obtained from H by replacing: each with , each with , eachT with F,and each F with T, is called the dual of H. Example: The dual of (p q) r is(p q) r. If H(p1 ,p2 ,…,pn) and Q (p1 ,p2 ,…,pn) are duals, then ¬H(p1 ,p2 ,…,pn)≡Q(¬p1 ,¬p2 ,…,¬pn). Example: ¬((p q) r ) ≡ (¬p ¬q )¬ r Example:De Morgans Laws ! 4 PROPOSITIONAL LOGIC
From Truth Table to wff Given a Truth Table, how would you find a wff that produces it? 5 PROPOSITIONAL LOGIC
From Truth Table to wff Given a Truth Table, how would you find a wff that produces it? 6 PROPOSITIONAL LOGIC
From Truth Table to wff Given a Truth Table, how would you find a wff that produces it? p q r p ¬ q ¬ r ¬ p q r ¬ p ¬ q ¬ r 7 PROPOSITIONAL LOGIC
From Truth Table to wff Given a Truth Table, how would you find a wff that produces it? p q r p ¬ q ¬ r ¬ p q r ¬ p ¬ q ¬ r 8 PROPOSITIONAL LOGIC
Aside: Quantifying a problems’ hardness The Satisfiability problem: Is there a truth assignment that would make an input wff have truth value True? Example: (pq¬ r ) (p¬q¬ s ) (p¬ r¬ s ) (¬p¬q¬ s ) (pq¬ s ) Distinction between: Verifying a solution Finding a solution How can it be done? Verifying a solution – and how much effort? Finding a solution – and how much effort? 9 PROPOSITIONAL LOGIC
Logical Implication (see also Sec 1.5) We say that flogically impliesg, writtenf g, if whenever f is trueg is also true. Note:f g precisely if the propositionf g is a tautology. The left hand side of is called the set of premises and the right hand side is called the conclusion. A proofestablishes a chain of logical implications! PROPOSITIONAL LOGIC
Logical Implications ? #1 #2 11 PROPOSITIONAL LOGIC
Logical Implications ? #1 #2 12 PROPOSITIONAL LOGIC
Does ((p q) p)q ? PROPOSITIONAL LOGIC
Does ((p q) p)q ? Yes! PROPOSITIONAL LOGIC
Does ((p q) q)p ? No! 15 PROPOSITIONAL LOGIC
Example p = “You are born in U.S.” q = “You are a U.S. citizen.” Based on the current laws, clearly p q. Note that, if are not born in the U.S., you may or may not be a U.S. citizen. In general, if p is false, then knowing p q does not let you conclude anything about q. When the premise is false anything can be concluded ! 16 PROPOSITIONAL LOGIC
How are these questions related? Doesplogically implyc? Is the proposition(p c) a tautology? Is the proposition (¬p c) is a tautology? Is the proposition (¬ c ¬p)is a tautology? Is the proposition (p ¬c) is a contradiction? 17 PROPOSITIONAL LOGIC
Some Big ideas to remember • For propositional logic, there is an algorithm to determine if a wff is a tautology (or contradiction, or contingency): the propositional logic is thus decidable. • The algorithm takes at most 2n effort if there are n propositions in the wff. • Using algebra, we can sometimes decide that a particular wff is a tautology in less than 2n effort. PROPOSITIONAL LOGIC