320 likes | 523 Views
Computational Logic Lecture 3. Truth Table Method and Propositional Proofs. Michael Genesereth Autumn 2006. Deduction. In deduction, the conclusion is true whenever the premises are true. Premise: p Conclusion: ( p q ) Premise: p Non-Conclusion: ( p q )
E N D
Computational Logic Lecture 3 Truth Table MethodandPropositional Proofs Michael Genesereth Autumn 2006
Deduction In deduction, the conclusion is true whenever the premises are true. Premise: p Conclusion: (p q) Premise: p Non-Conclusion: (p q) Premises: p, q Conclusion: (p q)
Logical Entailment A set of premises logically entails a conclusion (written as |= ) if and only if every interpretation that satisfies the premises also satisfies the conclusion. {p} |= (p q) {p} |# (p q) {p, q} |= (p q)
Logical Entailment Logical Equivalence {p} |= (p q) {p q)} |# p Analogy in arithmetic: inequalities rather than equations
Truth Table Method We can check for logical entailment by comparing tables of all possible interpretations. In the first table, eliminate all rows that do not satisfy premises. In the second table, eliminate all rows that do not satisfy the conclusion. If the remaining rows in the first table are a subset of the remaining rows in the second table, then the premises logically entail the conclusion.
Example Does p logically entail (p q)?
Example Does p logically entail (p q)? Does {p,q} logically entail (p q)?
Example If Mary loves Pat, then Mary loves Quincy. If it is Monday, then Mary loves Pat or Quincy. If it is Monday, does Mary love Pat?
Logical Entailment and Satisfiability Theorem: |= if and only if {} is unsatisfiable. Suppose that |= . If an interpretation satisfies , then it must also satisfy . But then it cannot satisfy . Therefore, {} is unsatisfiable. Suppose that {} is unsatisfiable. Then every interpretation that satisfies must fail to satisfy , i.e. it must satisfy . Therefore, |= . Upshot: We can determine logical entailment by determining unsatisfiability.
Example Problem: {(pq), (m pq)} |= (mq)? Or: Is {(pq), (m pq),(mq)} unsatisfiable?
Problem There can be many, many interpretations for a Propositional Language. Remember that, for a language with n constants, there are 2n possible interpretations. Sometimes there are many constants among premises that are irrelevant to the conclusion. Much wasted work. Answer: Proofs
Patterns A pattern is a parameterized expression, i.e. an expression satisfying the grammatical rules of our language except for the use of meta-variables (Greek letters) in place of various subparts of the expression. Sample Pattern: ( ) Instance: p (q p) Instance: (p r) ((pq) (p r))
Rules of Inference A rule of inference is a rule of reasoning consisting of one set of sentence patterns, called premises, and a second set of sentence patterns, called conclusions.
Rule Instances An instance of a rule of inference is a rule in which all meta-variables have been consistently replaced by expressions in such a way that all premises and conclusions are syntactically legal sentences.
Sound Rules of Inference A rule of inference is sound if and only if the premises in any instance of the rule logically entail the conclusions. Modus Ponens (MP) Modus Tolens (MT) Equivalence Elimination (EE) Double Negation (DN)
Proof (Version 1) A proof of a conclusion from a set of premises is a sequence of sentences terminating in the conclusion in which each item is either: 1. a premise 2. the result of applying a rule of inference to earlier items in sequence.
Example When it is raining, the ground is wet. When the ground is wet, it is slippery. It is raining. Prove that it is slippery.
Error Note: Rules of inference apply only to top-level sentences in a proof. Sometimes works but sometimes fails. No! No!
Example Heads you win. Tails I lose. Suppose the coin comes up tails. Show that you win.
Axiom Schemata Fact: If a sentence is valid, then it is true under all interpretations. Consequently, there should be a proof without making any assumptions at all. Fact: (p (q p)) is a valid sentence. Problem: Prove (p (q p)). Solution: We need some rules of inference without premises to get started. An axiom schema is sentence pattern construed as a rule of inference without premises.
Rules and Schemata Axiom Schemata as Rules of Inference ( ) Rules of Inference as Axiom Schemata ( ) ( ) Note: Of course, we must keep a least one rule of inference to use the schemata. By convention, we retain Modus Ponens.
Valid Axiom Schemata A valid axiom schema is a sentence pattern denoting an infinite set of sentences, all of which are valid. ( )
Standard Axiom Schemata II: ( ) ID: ( ( )) (( ) ( )) CR: ( ) (( ) ) ( ) (( ) ) EQ: ( ) ( ) ( ) ( ) ( ) (( ) ( )) OQ:( ) ( ) ( ) ( ) ( ) ( )
Sample Proof Whenever p is true, q is true. Whenever q is true, r is true. Prove that, whenever p is true, r is true.
Proof (Official Version) A proof of a conclusion from a set of premises is a sequence of sentences terminating in the conclusion in which each item is either: 1. a premise 2. An instance of an axiom schema 3. the result of applying a rule of inference to earlier items in sequence.
Provability A conclusion is said to be provable from a set of premises (written |- ) if and only if there is a finite proof of the conclusion from the premises using only Modus Ponens and the Standard Axiom Schemata.
Soundness and Completeness Soundness: Our proof system is sound, i.e. if the conclusion is provable from the premises, then the premises propositionally entail the conclusion. ( |- ) ( |= ) Completeness: Our proof system is complete, i.e. if the premises propositionally entail the conclusion, then the conclusion is provable from the premises. ( |= ) ( |- )
Truth Tables and Proofs The truth table method and the proof method succeed in exactly the same cases. On large problems, the proof method often takes fewer steps than the truth table method. However, in the worst case, the proof method may take just as many or more steps to find an answer as the truth table method. Usually, proofs are much smaller than the corresponding truth tables. So writing an argument to convince others does not take as much space.
Metatheorems Deduction Theorem: |- ( ) if and only if {} |- . Equivalence Theorem: |- ( ) and |- , then it is the case that |- .
Proof Without Deduction Theorem Problem: {p q, q r} |- (p r)?
Proof Using Deduction Theorem Problem: {p q, q r} |- (p r)?
TA Appeasement Rules When we ask you to show that something is true, you may use metatheorems. When we ask you to give a formal proof, it means you should write out the entire proof. When we ask you to give a formal proof using certain rules of inference or axiom schemata, it means you should do so using only those rules of inference and axiom schemata and no others.