290 likes | 473 Vues
University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal Methods Propositional logic Part 2. Outlines. Implication Equivalence. Negation Tautologies and contradictions. Implication.
E N D
University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal Methods Propositional logic Part 2 Instructor: Tasneem Darwish
Outlines • Implication • Equivalence. • Negation • Tautologies and contradictions. Instructor: Tasneem Darwish
Implication • The implication may be viewed as expressing an ordering between the antecedent p and the consequent q. • The implication has the value true if the antecedent is stronger than or equal to the consequent: • False is stronger than true. • True is weaker than false. • Anything is as strong as itself. • The truth table for the implication is as follows: Instructor: Tasneem Darwish
Implication • The inference rules for implication are: • The introduction rule is: • The elimination rule is: Instructor: Tasneem Darwish
Implication • Example 2.7: using truth tables prove that a conjunction of antecedents in an implication can be replaced by separate antecedents: • We need to prove that the proposition always implies to the proposition Instructor: Tasneem Darwish
Implication • Example 2.8:Using inference rules prove the implication • To prove the implication , it has to be the root of the proof tree. • We can start by applying the implication introduction rule. Instructor: Tasneem Darwish
Implication • Now we can apply the implication introduction rule again to get: • By applying the implication introduction rule again we get: Instructor: Tasneem Darwish
Implication • Since one of the assumptions has an implication we will try to eliminate it using the implication elimination rule • At this stage, we have a new premiss (p ˄ q), also we have two assumptions which are not used yet. • By using the introduction rule [˄ -intro] we can discharge (p ˄ q) as a conclusion for the rule, also the two assumptions can be used as premisses. Instructor: Tasneem Darwish
Implication • Although the proof tree doesn’t has any leaf but it is a complete proof tree since the rule that we wanted to prove doesn’t have premisses. Instructor: Tasneem Darwish
Equivalence • The equivalence p q means that p and q are of the same strength. • The equivalence can be called bi-implication because p q is equivalent to p q and q p. • The equivalence truth table is as follows: • The equivalence introduction rule is: • The equivalence elimination rules are: Instructor: Tasneem Darwish
Equivalence • Example 2.9: Using the inference rules, prove that if p is stronger than q, then p ^ q and p have the same strength: • The sentence “p is stronger than q. “can be written as: p q. • The sentence “p ^ q and p have the same strength” can be written as: p ^ q p • The conclusion that we want to deduce is p ^ q p, and the given premiss is p q. thus, the rule that we are going to prove is: Instructor: Tasneem Darwish
Equivalence • The rule that we are going to prove is: • First lets consider the goal (the proof tree root) • The major connective is the equivalence, so let's try to introduce it using the equivalence introduction rule Instructor: Tasneem Darwish
Equivalence • In the left-hand subtree, the main connective is an implication so lets try to introduce it using the implication introduction rule • The proof tree is still not complete since we didn’t reach the required premiss yet. • In the left-hand side we can get rid of the new premiss p and the assumption by applying the conjunction elimination rule Instructor: Tasneem Darwish
Equivalence • Now we have a complete left-hand side of the proof tree because all the new premisses and assumptions are used within a rule. • we still have to work on the right-hand side of the tree, and we can start by applying the implication introduction rule: • Now the main connective is the conjunction, so we will use the conjunction introduction rule to introduce it: Instructor: Tasneem Darwish
Equivalence • Now the main connective is the conjunction, so we will use the conjunction introduction rule to introduce it: • After applying the conjunction introduction rule, we have two new premisses p and q, and an assumption for p. The assumption p can be used as a substitution for the premiss p : Instructor: Tasneem Darwish
Equivalence • Since we can’t do anything with the q premiss, we will try to work from the given premiss p q. The given premiss can help us to discover which rule we can use to dispose the premiss q. • Question: What is the rule that can use p q as a premiss and q as a conclusion? • Answer: The implication elimination rule. Instructor: Tasneem Darwish
Equivalence • By applying the implication elimination rule we will get: • Now we have two premisses p q and p. the premiss p q is the given premiss, thus we will keep it, but the other premiss p must be disposed. • We can dispose p by taking an instance of the assumption p and substitute it for the premiss p. Instructor: Tasneem Darwish
Equivalence • After proving the rule we can use it as an inference rule. • Notes: • You can use instances of an assumption anywhere in the proof tree without affecting it. • You can use an assumption as a substitution for a premiss if the assumption is for the same premiss. But after substitution the premiss is not a leaf any longer. Instructor: Tasneem Darwish
Negation • The negation ¬p is true if and only if p is false. • The negation truth table is as follows: • Our rules for negation make use of a special proposition called false, which stands for a contradiction (it is false in every situation). • The negation inference rules are different from the other inference rules since their premisses and conclusion can be false • The introduction rule is: • The negation elimination rule is: • The false elimination rule is: Instructor: Tasneem Darwish
Negation • Example 2.10: One of de Morgan's Laws states that the negation of a disjunction is the conjunction of negations. Using inference rules prove this law • We start by considering the goal (the root of the proof tree): • The main connective is the conjunction, so we will try to break it using the conjunction introduction rule. Instructor: Tasneem Darwish
Negation • Now let’s work on the left subtree. We can apply the negation introduction rule : • Now to apply the negation elimination rule on the false proposition, the new premisses should cause a contradiction . Instructor: Tasneem Darwish
Negation • To dispose the premiss (p ˅ q) we can use the disjunction introduction first rule. • Now we can substitute the assumption p for the new premiss p to get a complete proof for the left-hand side of the proof tree. Instructor: Tasneem Darwish
Negation • The right-hand side of the proof tree can be constructed in the same way as the left-hand side. Instructor: Tasneem Darwish
Tautologies and Contradiction • Tautologies are propositions which evaluate to true in every combination of their propositional variables (they are always true). • Contradictions are propositions that evaluate to false in every combination of their propositional variables. • Of course, the negation of a contradiction is a tautology, and vice versa. Instructor: Tasneem Darwish
Tautologies and Contradiction • Example 2.12 • The following propositions are tautologies: • The following propositions are contradictions Instructor: Tasneem Darwish
Tautologies and Contradiction • To prove that a proposition is a tautology, we have to produce a truth table and check that the major connective takes the value t for each combination of propositional variables. • Example 2.13: We prove that is a tautology by exhibiting the following truth table: Instructor: Tasneem Darwish
Tautologies and Contradiction • Tautologies involving equivalences are particularly useful in proofs; they can be used to rewrite goals and assumptions to facilitate the completion of an argument. • For any pair of propositions a and b, the tautology a b corresponds to a pair of inference rules. • A logical equivalence may be used to justify rewriting even when the proposition involved is only part of the goal or assumption. Instructor: Tasneem Darwish
Tautologies and Contradiction • Example: if we have the tautology then we can rewrite part of the goal (conclusion) as follows: • Tautologies involving implications also correspond to inference rules: if a b is a tautology, then may be used as a derived rule. • An implication alone is not enough to justify rewriting part of a goal. Instructor: Tasneem Darwish
Tautologies and Contradiction • Example: consider the following proposition: • The proposition is a tautology. • But the proof step: is invalid. • Because the statement doesn’t follow from , since p˄q can be false while p is true. • Example 2.14: The tautology corresponds to another of de Morgan’s law: • A proposition which is neither • a tautology nor a contradiction is said to be a contingency. Instructor: Tasneem Darwish