resolution for first order logic
play

Resolution for First Order Logic Meghdad Ghari Institute for - PowerPoint PPT Presentation

Resolution for First Order Logic Meghdad Ghari Institute for Research in Fundamental Sciences (IPM) School of Mathematics-Isfahan Branch Logic Group http://math.ipm.ac.ir/Isfahan/Logic-Group.htm Logic Short Course II, Computational Predicate


  1. Resolution for First Order Logic Meghdad Ghari Institute for Research in Fundamental Sciences (IPM) School of Mathematics-Isfahan Branch Logic Group http://math.ipm.ac.ir/Isfahan/Logic-Group.htm Logic Short Course II, Computational Predicate Logic March 9, 2017 Meghdad Ghari (IPM) Resolution Logic Short Course 2017 1 / 82

  2. Outline Propositional Logic 1 Conjunctive Normal Form Propositional Resolution First Order Logic 2 Syntax Semantics Resolution for FOL PROLOG Meghdad Ghari (IPM) Resolution Logic Short Course 2017 2 / 82

  3. Language Atom = { p 1 , p 2 , p 3 , . . . } , A (finite or infinite) set of atomic propositions (or propositional variables). L = Atom ∪ { ( , ) , ¬ , ∧ , ∨ , →} Formulas of propositional logic are defined by the following grammar in Backus Naur form (BNF): φ ::= p | ( ¬ φ ) | ( φ ∧ φ ) | ( φ ∨ φ ) | ( φ → φ ) , p ∈ Atom Meghdad Ghari (IPM) Resolution Logic Short Course 2017 3 / 82

  4. Semantics: principle of compositionality The meaning of a complex expression is determined by the meanings of its constituent expressions and the rules used to combine them. Valuations: v : Atom → { T , F } Valuations can be extended to the set of all formulas as follows: v ( ¬ φ ) = 1 − v ( φ ) v ( φ ∧ ψ ) = min ( v ( φ ) , v ( ψ )) v ( φ ∨ ψ ) = max ( v ( φ ) , v ( ψ )) v ( φ → ψ ) = min ( 1 , 1 − v ( φ ) + v ( ψ )) Meghdad Ghari (IPM) Resolution Logic Short Course 2017 4 / 82

  5. Decideability Definition A logical system is decidable if there is an effective method (or algorithm) for determining whether arbitrary formulas are theorems of the logical system. Truth tables provide a decision procedure for propositional logic. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 5 / 82

  6. Validity and satisfiability Theorem Let φ be a formula of propositional logic. Then φ is satisfiable iff ¬ φ is not valid. Theorem Given formulas φ 1 , φ 2 , . . . , φ n and ψ of propositional logic, φ 1 , φ 2 , . . . , φ n | | = φ 1 ∧ φ 2 ∧ . . . ∧ φ n → ψ = ψ iff Meghdad Ghari (IPM) Resolution Logic Short Course 2017 6 / 82

  7. Validity and satisfiability Theorem Let φ be a formula of propositional logic. Then φ is satisfiable iff ¬ φ is not valid. Theorem Given formulas φ 1 , φ 2 , . . . , φ n and ψ of propositional logic, φ 1 , φ 2 , . . . , φ n | | = φ 1 ∧ φ 2 ∧ . . . ∧ φ n → ψ = ψ iff Meghdad Ghari (IPM) Resolution Logic Short Course 2017 6 / 82

  8. Conjunctive Normal Form (CNF) L ::= p | ¬ p , p ∈ Atom Literal D ::= L | L ∨ D Clause C ::= D | D ∧ C Conjunctive normal form Example (Set representation) CNF � Clausal form ( ¬ q ∨ p ∨ r ) ∧ ( ¬ p ∨ r ) ∧ q ∧ ( r ∨ ¬ p ) � {{¬ q , p , r } , {¬ p , r } , { q }} Facts The empty clsuse � is always false and unsatisfiable. The empty clause form ∅ is valid. A clause form that has � is a contradiction, and hence unsatisfiable. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 7 / 82

  9. Converting formulas to CNF Theorem Every formula in propositional logic can be transformed into an equivalent formula in CNF Step 1. Elimination of → and ↔ : φ → ψ ≡ ¬ φ ∨ ψ φ ↔ ψ ≡ ( ¬ φ ∨ ψ ) ∧ ( φ ∨ ¬ ψ ) Step 2. Converting to negation normal forms (NNF): ¬¬ φ ≡ φ ¬ ( φ ∧ ψ ) ≡ ¬ φ ∨ ¬ ψ ¬ ( φ ∨ ψ ) ≡ ¬ φ ∧ ¬ ψ Step 3. Distributivity rules: φ ∧ ( ψ ∨ σ ) ≡ ( φ ∧ ψ ) ∨ ( φ ∧ σ ) φ ∨ ( ψ ∧ σ ) ≡ ( φ ∨ ψ ) ∧ ( φ ∨ σ ) Meghdad Ghari (IPM) Resolution Logic Short Course 2017 8 / 82

  10. Resolution John Alan Robinson, A Machine-Oriented Logic Based on the Resolution Principle J. ACM. 12 (1): 23-41, 1965. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 9 / 82

  11. Propositional Resolution Resolution is a refutation procedure used to check if a formula in clausal form is unsatisfiable. The resolution procedure consists of a sequence of applications of the resolution rule to a set of clauses. The rule maintains satisfiability: if a set of clauses is satisfiable, so is the set of clauses produced by an application of the rule. Therefore, if the (unsatisfiable) empty clause is ever obtained, the original set of clauses must have been unsatisfiable. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 10 / 82

  12. Propositional Resolution Rule Resolution: ¬ φ ∨ ψ φ ∨ χ ψ ∨ χ Resolution is sound (preserves validity). Modus Ponens: φ → ψ φ ψ ¬ φ ∨ ψ φ ∨ ⊤ ψ ∨ χ Modus Ponens is a special case of resolution. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 11 / 82

  13. Propositional Resolution Rule Resolution: ¬ φ ∨ ψ φ ∨ χ ψ ∨ χ Resolution is sound (preserves validity). Modus Ponens: φ → ψ φ ψ ¬ φ ∨ ψ φ ∨ ⊤ ψ ∨ χ Modus Ponens is a special case of resolution. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 11 / 82

  14. Propositional Resolution Rule Propositional Resolution Rule: C ⊔ { p } D ⊔ {¬ p } C ∪ D where C and D are clauses and ⊔ denotes disjoint union. C ∪ D is called the resolvent of C ⊔ { p } and D ⊔ {¬ p } : C ∪ D = Res ( C ⊔ { p } , D ⊔ {¬ p } ) Resolution on clause forms: { C 1 , . . . , C ⊔ { p } , D ⊔ {¬ p } , . . . , C n } { C 1 , . . . , C ∪ D , . . . , C n } Resolution on clause forms preserves satisfiability. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 12 / 82

  15. Proof by resolution Definition A resolution refutation of S is a resolution proof of empty clause � from S . Theorem S is unsatisfiable iff there is a resolution refutation of S. Checking validity φ is valid, if ¬ φ is unsatisfiable or there is a resolution refutation of ¬ φ . Meghdad Ghari (IPM) Resolution Logic Short Course 2017 13 / 82

  16. Proof by resolution In order to show that φ 1 , φ 2 , . . . , φ n | = ψ, we show that φ 1 ∧ φ 2 ∧ . . . ∧ φ n ∧ ¬ ψ is unsatisfiable. First, φ 1 ∧ φ 2 ∧ . . . ∧ φ n ∧ ¬ ψ is converted into CNF . 1 Then, the resolution rule is applied to the resulting clauses. 2 The process continues until one of two things happens: 3 ◮ two clauses resolve to yield the empty clause � , in which case φ 1 , φ 2 , . . . , φ n | = ψ . ◮ there are no new clauses that can be added, in which case φ 1 , φ 2 , . . . , φ n �| = ψ ; Meghdad Ghari (IPM) Resolution Logic Short Course 2017 14 / 82

  17. Resolution algorithm /* Input: A set of clauses S */ /* Output: S is satisfiable or unsatisfiable */ while there are clauses C 1 , C 2 ∈ S and C := Res ( C 1 , C 2 ) such that C �∈ S do S := S ∪ { C } If � ∈ S then return unsatisfiable else (i.e. if � �∈ S ) return satisfiable. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 15 / 82

  18. Example I We prove that | = ¬ ( p ∨ q ) → ( ¬ p ∧ ¬ q ) . To this end, we show that ¬ [ ¬ ( p ∨ q ) → ( ¬ p ∧ ¬ q )] (1) is unsatisfiable. The CNF of (1) is: ¬ p ∧ ¬ q ∧ ( p ∨ q ) , and in clausal form: {{¬ p } , {¬ q } , { p , q }} . The following is a resolution refutation of it: {¬ p } { p , q } { q } {¬ q } � Meghdad Ghari (IPM) Resolution Logic Short Course 2017 16 / 82

  19. Example II We show that p �| = p ∧ q . To this end, we show that p ∧ ¬ ( p ∧ q ) (2) is satisfiable. The CNF of (2) is: p ∧ ( ¬ p ∨ ¬ q ) , and in clausal form: S = {{ p } , {¬ p , ¬ q }} . Using resolution algorithm we update S as follows: { p } a clause of S 1 {¬ p , ¬ q } a clause of S 2 {¬ q } resolvent of clauses 1 and 2 3 S is satisfiable, since there are no new resolvents that can be added and � �∈ S . Meghdad Ghari (IPM) Resolution Logic Short Course 2017 17 / 82

  20. Resolution refutation as a tree In order to prove that ( p → ( q → r )) → (( p → q ) → ( p → r )) is valid, we show that its negation is unsatisfiable. The following is a resolution refutation tree of its negation: � ✟ ❍❍❍❍❍ ✟ ✟ ✟ ✟ ✟ ❍ ¯ p p � ❅ � ❅ � ❅ � ❅ ¯ p ¯ ¯ q pq ✁ ❆ ✁ ❆ ✁ ❆ ✁ ❆ p ¯ ¯ qr ¯ r ¯ p denotes ¬ p . ¯ pq denotes the clause {¬ p , q } . Meghdad Ghari (IPM) Resolution Logic Short Course 2017 18 / 82

  21. Exercise By the resolution algorithm show that: ¬ ( p → ¬ q ) | = p . 1 Counterexample in natural language: it is not the case that if it is raining then the ground is not wet | = it is raining. p → q �| = ¬ ( p → ¬ q ) . 2 Counterexample in natural language: if it is raining then the ground is wet | = it is not the case that if it is raining then the ground is not wet. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 19 / 82

  22. Ontological commitment Ontological commitment: what the logic assumes about the nature of reality: propositional logic assumes that there are facts that either hold or do not hold in the world. First-order logic assumes that the world consists of objects with certain relations among them that do or do not hold. Meghdad Ghari (IPM) Resolution Logic Short Course 2017 20 / 82

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend