Introduction to Theorem Proving

Slides:



Advertisements
Similar presentations
Automated Reasoning Systems For first order Predicate Logic.
Advertisements

1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Logic Use mathematical deduction to derive new knowledge.
1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
Logic Concepts Lecture Module 11.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
CS128 – Discrete Mathematics for Computer Science
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Logic 3 Tautological Implications and Tautological Equivalences
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
Knoweldge Representation & Reasoning
Chapter 3 Propositional Logic
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Introduction to Logic Logical Form: general rules
EE1J2 – Discrete Maths Lecture 4 Analysis of arguments Logical consequence Rules of deduction Rules of equivalence Formal proof of arguments See: Anderson,
Methods of Proof & Proof Strategies
Copyright © Curt Hill Truth Tables A way to show Boolean Operations.
Propositional Equivalences
Chap. 2 Fundamentals of Logic. Proposition Proposition (or statement): an declarative sentence that is either true or false, but not both. e.g. –Margret.
CSci 2011 Discrete Mathematics Lecture 6
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Discrete Structures (DS)
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
Propositional Calculus – Methods of Proof Predicate Calculus Math Foundations of Computer Science.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Ch 1.4: Basic Proof Methods I A theorem is a proposition, often of special interest. A proof is a logically valid deduction of a theorem, using axioms,
Section 1.2: Propositional Equivalences In the process of reasoning, we often replace a known statement with an equivalent statement that more closely.
CS6133 Software Specification and Verification
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 3 The Foundations: Logic and Proof,
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
Outline Logic Propositional Logic Well formed formula Truth table
Today’s Topics Argument forms and rules (review)
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Sound Arguments and Derivations. Topics Sound Arguments Derivations Proofs –Inference rules –Deduction.
Chapter 1 Logic and proofs
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
March 23 rd. Four Additional Rules of Inference  Constructive Dilemma (CD): (p  q) (r  s) p v r q v s.
2. The Logic of Compound Statements Summary
Knowledge Representation and Reasoning
Truth Tables and Equivalent Statements
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
Information Technology Department
7.1 Rules of Implication I Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.
CS201: Data Structures and Discrete Mathematics I
Logic Use mathematical deduction to derive new knowledge.
CS 270 Math Foundations of CS
Propositional Equivalences
CS 220: Discrete Structures and their Applications
Applied Discrete Mathematics Week 1: Logic
TRUTH TABLES continued.
Back to “Serious” Topics…
The Method of Deduction
Computer Security: Art and Science, 2nd Edition
Discrete Mathematics Logic.
Foundations of Discrete Mathematics
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

Introduction to Theorem Proving Suppose p1, p2, - - - -, pn and C are propositions for which (p1 /\ p2 /\ - - - - -/\ pn) -> C is a tautology. Then: p1 /\ p2 /\ - - - /\ pn is called the premise C is called the conclusion of a syllogism. - So, a syllogism is a deductive reasoning “scheme” composed of premises and a conclusion. We also say that p1,p2, - - - -, C is a Theorem. Then we can represent the theorem as follows. p1, p2, - - - , pn =>C Note that I switched -> to mean “implies” and => to mean a “theorem” because I could not find the “right” symbol on my keyboard for “├ ”

Checking for Theorem There are 2 “standard” ways to check for theorems using the Truth-Table: for: p1, p2, -----, pn => C Forward chaining Check to see that whenever p1, p2, - - -, pn are all True, then C is also True Backward chaining Check to see that whenever C is False, there is at least one of the p1, p2, - - - , pn is also False

“Strange” Example 1 So, p1, p2, C is not a theorem or p1, p2 =/=> C Let’s try a little “strange” set of premises and conclusion. (Note that premises and conclusions are all propositions and the truth value of a compound proposition depends on that of its components.) let p1 : a printer is a device p2 : if Ram is in class, then a printer is a device C : Ram is in class p1 C p2: (C->p1) Forward chaining: p1 and p2 are T in rows 1 and 2 but C is F in row 2. T T T T T F Also Backward chaining: C is F in rows 2 and 4, but in row 2 both p1 and p2 are T. F T F F F T So, p1, p2, C is not a theorem or p1, p2 =/=> C

Rewording Example 1 So, p1, p2, C is a theorem or p1, p2 => C Let’s reword this to a more “normal” look let p1 : Ram is in class p2 : if Ram is in class, then a printer is a device C : a printer is a device Forward chaining: p1 and p2 are T in row 1 and C is also T in row 1. There is no other row with p1 and p2 both having T value. p1 C P2: (p1 -> C) T T T F T F Also Backward chaining: C is F in rows 2 and 4. In row 2, p2 is also F, and in row 4, p1 is also F. F T T F F T So, p1, p2, C is a theorem or p1, p2 => C This is an example of : modus ponens where we have p1, p1->C => C.

Theorem Proving by Manipulating Syntax We have used the Truth table for demonstrating tautologies, proof with forward chaining, and proof with backward chaining. Can we demonstrate an expression or set of statements to be a theorem by “manipulating the syntax” ? An expression or a set of statements is proven to be a theorem if we show that the expression is derived (using replacement rules) from a set of premises. 1) A procedure often used in derivation is : Start with a premise which may be a given axiom or a previously proven theorem Utilize a logical sequence of tautologies or previously proven theorems to arrive at the expression which needs to be proven. 2) Another procedure often used is the reverse of above: Start with the expression that needs to be proven as theorem Utilize a sequence of tautologies or previously proven theorems to arrive at a known theorem or axiom. The term “utilize a sequence of - - -” means to replace any of the expression by any statement that is logically equivalent. (a natural starting place may be modus ponens)

List of Some Tautologies ~~p <-> p p /\ q < - > q /\ p p \/ q < - > q \/ p (p /\ q) /\ r < - > p /\ (q /\ r) (associative law) (p \/ q) \/ r < - > p \/ (q \/ r) (associative law) p /\ (q \/ r) < - > (p /\ q) \/ (p/\ r) (distributive law) p \/ (q /\ r) < - > (p \/ q) /\ (p \/ r) (distributive law) ~ (p /\ q) < - > ~p \/ ~q (De Morgan) ~ (p \/ q) < - > ~p /\ ~q (De Morgan) p \/ p < - > p p /\ p < - > p p /\ q -> q p /\ q -> p p \/ False <- > p p /\ True <-> p p -> p \/ q q -> p v q Note that these are almost reversed

2. p, p- >q => q (modus ponens) 3. ~p, p \/ q = > q List of Some Theorems 1. p, q => p/\ q (obvious: because p /\ q <-> p /\ q is a tautology ) 2. p, p- >q => q (modus ponens) 3. ~p, p \/ q = > q 4. ~q, p->q => ~p (modus tollens) 5. p \/ q, p-> r, q -> r => r 6. p –> q, q -> r => p -> r 7. p, p ->q, q -> r => r 8. p \/ ( q /\ ~ q)  p 9. p /\ ( q \/ ~q)  p 10. p -> q  ~p \/ q 11. p -> q  ~q -> ~p 12 ~ (p -> q)  p /\ ~q 13. p <-> q  (p -> q) /\ ( q -> p) 14. p<->q  (p /\ q) \/ (~p /\ ~q) 15. p -> ( q -> r)  (p /\q) ->r Note the symbolisms: => means is a theorem  means is the same or equals this is saying: (( p->q  ~q v p) -> True) is a tautology or ( p->q  ~q v p) => True

Some Examples of proving theorems with “manipulating symbols” ~p, p v q => q [ ~p Λ ( p v q) ] -> q ~ [ ~p Λ ( p v q) ] v q p v ~(p v q) v q p v q v ~(p v q) (p v q ) v ~ (p v q) True thus [ ~p Λ ( p v q) ] -> q is a tautology p, q => ( p Λ q) p Λq -> (p Λ q) ~(p Λ q) V (p Λ q) True thus p ,q -> (p Λ q) is a tautology

More example of proving with “manipulating symbols” 14. P<->Q  (PΛQ) V (~P Λ ~Q) P<->Q (P->Q) Λ (Q->P) (~P VQ) Λ (~Q V P) [~P Λ (~Q V P)] V [Q Λ (~Q v P)] [ (~P Λ ~Q) V(~P Λ P)] V [ (Q Λ ~Q) V (Q Λ P)] [ (~P Λ ~Q) V (F) ] V [ ( F) V (Q Λ P)] [ (~P Λ ~Q) ] V [ (Q Λ P) ] (Q Λ P ) V (~P Λ ~Q) (P Λ Q ) V (~P Λ ~Q) P V (Q Λ ~Q)  P P v ( Q Λ ~Q) P v (False) P

Conjunctive Normal Form & Disjunctive Normal Form Conjunctive Normal Form is a conjunction (AND) of expressions where each expression is a disjunction (Or) of literals. note: a literal is a proposition such as P, Q, or ~P. Example of Conjunctive Normal Form : (A V B V C) Λ (~B V C) Disjunctive Normal Form is a disjunction (OR) of expressions where each expression is a conjunction (AND) of literals. note: a literal is a proposition such as P, Q, or ~P. Example of Disjunctive Normal Form : (A Λ B Λ C) V (~B Λ C)

Can Any Logical Expression be Expressed in either Disjunctive Normal Form or Conjunctive Normal Form? Let’s look at an example with truth table: A B “Exp” Exp is true on 1, 3rd, 4th line: (A Λ B) or (~A ΛB) or (~A Λ~B) are true. T T T T F F F T T F F T Note: This is one of the 16 possible combinations. We could pick another combination We can express “Exp” with the following Disjunctive Normal Form: “Exp” = (A Λ B) V (~A ΛB) V (~A Λ~B)

Simplify the sample Disjunctive Normal Form (A Λ B) V (~A ΛB) V (~A Λ~B) { [ A V(~A ΛB) ] Λ [ B V (~A ΛB) ] } V (~A Λ ~B) { [ (AV~A) Λ (AVB) ] Λ [ (BV~A) Λ(BVB)] } V (~A Λ~B) { [ T Λ (AVB) ] Λ [ (BV~A) Λ (B) ] } V (~A Λ~B) { [ (A V B) ] Λ [ ( B) ] } V (~A Λ~B) { (A Λ B) V (B Λ B) } V (~A Λ~B) { (A Λ B) V (B) } V (~A Λ~B) (B) V (~A Λ~B) (B V ~A) Λ (B V ~B) (B V ~A) Λ T ( B V ~ A ) which is ( ~A V B ) or A -> B or the “Exp” expression of the truth table in the previous slide We used the following absorption rules in the above derivation: (see page 46 of your text book) P V (P Λ Q ) <-> P P Λ (P V Q ) <-> P Check the absorption rules out with truth table to satisfy yourself.

Truth Table for “Absorption Rule” Q P /\ Q P \/ (P /\ Q) PPV(P /\ Q) P \/ Q P /\ (P \/ Q) T T T T T T T T F F T T T T F T F F T T F F F F F T F F tautology

Can we turn the Disjunctive Normal Form of Exp to Conjunctive Normal Form? Recall that from the Truth Table, Exp = (A Λ B) V (~A ΛB) V (~A Λ~B) To turn this into Conjunctive Normal Form, let’s look at using DeMorgan Law. So let’s look at ~ Exp. ~ Exp = ~ [ (A Λ B) V (~A Λ B) V (~A Λ ~B) ] = [ ~ (A Λ B) ] Λ [~ (~A Λ B) ] Λ [~ (~A Λ ~B) ] = (~A V ~B ) Λ ( A V ~B) Λ (A V B) = (~A V ~B ) Λ ( A v (~B Λ B) ) = (~A V ~B ) Λ ( A V False ) = (~A v ~B ) Λ (A) = (~A Λ A) V ( A Λ ~B) = F V ( A Λ ~B) = ( A Λ ~B) But ---- we want Exp, which is ~ (~Exp) So, Exp = ~ (A Λ ~B) Exp = ~A V B or A -> B This is the same as the truth table expression, Exp. Conjunctive Normal Form Show the replacement sequence --- Relationship of Conjunctive Normal form and Disjunctive Normal form ?

Recapture the Steps From the Truth Table Expression, Exp, pick all the rows where the Exp has the value True. Express each of those True rows as an expression of conjunction of the literals, based on the truth values of the literals for that row. The disjunction of the expressions formulate the Disjunctive Normal Form of that Exp. To obtain the Conjunctive Normal Form we need to apply the DeMorgan Law to convert Exp to ~Exp.

Introduction to Resolution Theorem A Popular Theorem used in A.I. is the Resolution Theorem ( a simplified version) p \/ r, q \/ ~r => p \/ q Let’s look at the first term , p \/ r. Start with the known theorem, p->r is equal to ~p \/ r, thus we have (~p) -> r  ~(~p) \/ r Using the tautology, ~~p <-> p, we can convert the above to the (~p) -> r  p \/ r. So we can replace the p \/ r with (~p) ->r in the original expression. Next, q \/ ~r is the same as ~r \/ q from one of the known tautologies. And ~r \/ q can be replaced with r -> q from the same earlier theorem. Now we have : (~p) -> r, r -> q => p v q Finally replace p \/ q with ~p -> q and we have : (~p) -> r, r -> q => ~p -> q which is the same as one of the earlier known theorem (-> is transitive) in the form of p -> q, q -> r => p -> r Thus p \/ r, q \/ ~r => p \/ q.

General Resolution Theorem The General form of Resolution theorem states that there may be any number of disjuncts, including the case of just one, in either of the two expressions. The only requirements is that one expression must have a disjunct that is the negation of a disjunct in the other. E1 \/ E2 \/ - - - \/ Ek - - - \/ En, E1 \/ E2 \/ - - - \/ ~Ek - - -\/ En => E1 \/ E2 - - - \/ En Note that the Ek is the disjunct that is dropped. Special Case 1: E1, ~E1 \/ E2 => E2 this is the same as E1, E1 -> E2 => E2 (modus ponens) Special Case 2: ~E1 \/ E2, ~E2 => ~E1 This is the same as E1 -> E2, ~E2 => ~E1 (modus tollens) Note that we are dealing with Conjunctive Normal Form

Refutation Principle or Proof by Contradiction AI and many other fields use a method called Refutation Principle together with the Resolution Theorem. Show that the negation of the conclusion is inconsistent with the premise(s). Example : (premise) local database \/ remote database prove : local database v remote database, ~(local database) => remote database Proof: 1. Assume : (~ remote database) is true (negation of conclusion) 2. (local database \/ remote database) is true (premise) 3. (~ local database) is true (premise from the prove statement) 4. local database \/ remote database, ~local database is true (combine 2 and 3 above) 5. remote database is true (4 above and resolution theorem) 6. remote database, ~remote base is true (1 and 5 above ------ contradiction) 7. empty (or False) ( 6 above and resolution theorem or (a Λ ~a) is F )

General Approach to Utilizing Refutation Principle 1. Express the premises and conclusion in disjunctive form . 2. Assume the negation of the conclusion and show inconsistency via utilizing the Resolution Theorem. Show that the negation of the conclusion leads to inconsistency (False), thus the conclusion must be True

Resolution-Refutation Tree with Modus Ponens - The familiar modus ponens: A -> B A --------- B - Express the premise in disjunctive form along with negation of conclusion: ~A V B A V False Assume ~B ~ A V B A V False ~B B V False False The Resolution-Refutation tree shows that ~B assumption is False; thus B must be True

Example of a Resolution-Refutation Tree used in A.I. Prove: A->B, B->C, C->D => A->D Assume ~( A -> D) ~A\/B, ~B\/C, ~C\/D => ~(~A \/ D) We have 3 disjunctive terms and 1 conjunctive term ~A\/B, ~B\/C, ~C\/D, ~~A /\ ~D ~A\/B, ~B\/C, ~C\/D, A /\ ~D ~A\/B, ~B\/C, ~C\/D, A, ~D Place these on a “reverse” tree Process using Resolution Theorem ~A\/B ~B\/C ~C\/D ~A\/C A ~A\/D D ~D Again, note that ~D is (~D \/ False) Empty (False)