Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logical Inference: Through Proof to Truth

Similar presentations


Presentation on theme: "Logical Inference: Through Proof to Truth"— Presentation transcript:

1 Logical Inference: Through Proof to Truth
CMPT 310 CHAPTERS 7, 8 Oliver Schulte Propositional logic. 1st-order logic. Resolution. DPLL WalkSat. Title alludes to book by Peter Andrews.

2 Active Field: Automated Deductive Proof
Call for Papers

3 The Satisfiability Problem

4 Satisfiability problems
Consider a CNF sentence, e.g., (D  B  C)  (B  A  C)  (C  B  E)  (E  D  B)  (B  E  C) Satisfiability: Is there a model consistent with this sentence? The basic NP-hard problem (Cook’s theorem). Many practically important problems can be represented this way. SAT Competition page. By the CNF theorem, all formulas can be written as a CNF sentence. [A  B]  [¬B  ¬C]  [A  C]  [¬D]  [¬D  ¬A]

5 Exercise: Satisfiability
Is the following sentence satisfiable? [A  B]  [¬B  ¬C]  [A  C]  [¬D]  [¬D  ¬A]

6 Proof Methods Overview
generate new sentences from given sentences try to find a satisfying model most useful if we expect no solution to exist most useful if we expect a solution to exist Inference Rules Model Checking WalkSat Forward/Backward Chaining DPLL Resolution improved depth-first search heuristic probabilistic search Proof by Contradiction not covered

7 Resolution

8 Entailment and Satisfiability
A sentence is satisfiable if it is true in some model. e.g., A B, C are satisfiable A sentence is unsatisfiable if it is false in all models. e.g., AA. Satisfiability and entailment: KB entails sentence α if and only if the sentence (KB α) is unsatisfiable There is no model for which KB=true and a is false. Demo using tarki’s world. Take the entailment A & B => A or B.

9 Proof by Contradiction
Want to prove: KB α is unsatisfiable. Strategy: Derive new sentences from KB, α. One of two things can happen: We derive ⇒ unsatisfiable. We find no contradiction ⇒ satisfiable. Resolution is a rule for deriving new disjunctions from previous ones.

10 Resolution: Spot the Pattern
Premise 1 Premise 2 Conclusion A  B  C A B  C A  B A  B B A  D  E B  C  D  E What is the rule to get from the two premises to the conclusion? pattern: cancel out common negated literal.

11 Resolution Inference Rule for CNF
“If A or B or C is true, but not A, then B or C must be true.” “If A is false then B or C must be true, or if A is true then D or E must be true, hence since A is either true or false, B or C or D or E must be true.” Can rewrite as A -> Not A -> Disjoin the consequents. A special case is Modus Ponens: from A implies B, and A, infer B.

12 Resolution Step 1: Conversion to CNF
B1,1  (P1,2  P2,1). Equivalent conjunctive normal form formula? Eliminate , replacing α  β with (α  β)(β  α). (B1,1  (P1,2  P2,1))  ((P1,2  P2,1)  B1,1) 2. Eliminate , replacing α  β with α β. (B1,1  P1,2  P2,1)  ((P1,2  P2,1)  B1,1) 3. Move  inwards using de Morgan's rules and double-negation: (B1,1  P1,2  P2,1)  ((P1,2  P2,1)  B1,1) 4. Apply distributive law ( over ) and flatten: (B1,1  P1,2  P2,1)  (P1,2  B1,1)  (P2,1  B1,1)

13 Resolution Step 2: Generate new disjunctions
KB = (B1,1  (P1,2 P2,1))  B1,1 α = P1,2 True False in all worlds

14 More on Resolution Resolution is complete for propositional logic.
Resolution in general can take up exponential space and time. (Hard proof!) Main method for the SAT problem: is a CNF formula satisfiable? Typically most useful when we expect the formula to be unsatisfiable. Single inference rule is complete! If all clauses are Horn clauses, then resolution is linear in space and time.

15 Why many problems are satisfiability problems
Logic and Clauses Why many problems are satisfiability problems

16 Normal Clausal Form Rewrite into conjunctive normal form (CNF).
Eventually we want to prove: Knowledge base KB entails sentence α Rewrite into conjunctive normal form (CNF). Apply resolution. literals A “conjunction of disjunctions” Can you prove this? k-CNF: exactly k literals per clause (A  B)  (B  C  D) Clause Clause Theorem: Any KB can be converted into an equivalent CNF.

17 Logical equivalence To manipulate logical sentences we need some rewrite rules. Two sentences are logically equivalent iff they are true in same models: α ≡ ß iff α╞ β and β╞ α Another example: solve equation in 1 unknown. Demonstrate in tarksi demo.

18 Horn Clauses Horn Clause = A clause with at most 1 positive literal.
e.g. Every Horn clause can be rewritten as an implication with a conjunction of positive literals in the premises and at most a single positive literal as a conclusion. e.g. Psychologically natural: a condition implies (causes) a single fact. The basis of logic programming (the prolog language). SWI Prolog. Prolog and the Semantic Web. Prolog Applications Resolution for Horn clauses is fast (linear time and space cost). Show Aispace demo. In application, easy to specify rules, interchange format. See especially “Air” application, .e.g. Boeing. 1 positive literal: definite clause 0 positive literals: Fact or integrity constraint: e.g.

19 Summary Determining the satisfiability of a CNF formula is the basic problem of propositional logic (and of many reasoning/scheduling problems). Any propositional formula can be converted to CNF format. Resolution is complete for propositional logic. Can use search methods + inference (e.g. unit propagation): DPLL. Can also use stochastic local search methods: WALKSAT.


Download ppt "Logical Inference: Through Proof to Truth"

Similar presentations


Ads by Google