lecture 13 resolution based inference
play

Lecture 13 Resolution-Based Inference 11 th February 2020 - PowerPoint PPT Presentation

Claudia Chirita School of Informatics, University of Edinburgh Based on slides by: Jacques Fleuriot, Michael Rovatsos, Michael Herrmann, Vaishak Belle Informatics 2D Agents and Reasoning 2019/2020 Lecture 13 Resolution-Based Inference


  1. Claudia Chirita School of Informatics, University of Edinburgh Based on slides by: Jacques Fleuriot, Michael Rovatsos, Michael Herrmann, Vaishak Belle Informatics 2D ⋅ Agents and Reasoning ⋅ 2019/2020 Lecture 13 ⋅ Resolution-Based Inference 11 th February 2020

  2. Previously on INF2D Backward chaining – if Goal is known (goal directed) – can query for data Forward chaining – if specifjc Goal is not known, but the system needs to react to new facts (data driven) – can make suggestions What do users expect from the system? Which direction has the larger branching factor? 2 / 26

  3. Limitations ...due to restriction to defjnite clauses In order to apply GMP (works only if there is a rule for each variable) 3 / 26 • premises of rules contain only non-negated symbols • the conclusion of any rule is a non-negated symbol • facts are non-negated atomic sentences Possible solution: introduce more variables, e.g. 𝑅 ∶= ¬𝑄 What about: “If we cannot prove 𝐵 , then ¬𝐵 is true”?

  4. 4 / 26 Resolution one more time • Negate query 𝛽 . • Convert everything to CNF. • Repeat: Choose clauses and resolve (based on unifjcation). • If resolution results in empty clause, 𝛽 is proved. • Return all substitutions (or Fail).

  5. Ground Binary Resolution & Modus Ponens Ground binary resolution Modus ponens is a special case of binary resolution. 5 / 26 𝐷 ∨ 𝑄 𝐸 ∨ ¬𝑄 𝐷 ∨ 𝐸 Suppose 𝐷 = False . 𝑄 ¬𝑄 ∨ 𝐸 𝐸 i.e. 𝑄 and 𝑄 → 𝐸 entails 𝐸 .

  6. Full Resolution & Generalised Modus Ponens 6 / 26 GMP with 𝑞 � � 𝜄 = 𝑞 � 𝜄 𝑞 � � , 𝑞 � � , … , 𝑞 � (𝑞 � ∧ 𝑞 � ∧ … ∧ 𝑞 � → 𝑟) � 𝑟𝜄 𝑞 � � , 𝑞 � � , … , 𝑞 � (𝑟 ∨ ¬𝑞 � ∨ ¬𝑞 � ∨ … ∨ ¬𝑞 � ) � 𝑟𝜄 Full resolution with 𝜄 mgu of all 𝑄 � and 𝑄 � � 𝐸 ∨ ¬𝑄 � � ∨ … ∨ ¬𝑄 � 𝐷 ∨ 𝑄 � ∨ … ∨ 𝑄 � � (𝐷 ∨ 𝐸) 𝜄

  7. Resolution in Implication Form Ground binary resolution 7 / 26 𝐷 ∨ 𝑄 𝐸 ∨ ¬𝑄 𝐷 ∨ 𝐸 Set 𝐷 = ¬𝐵 . 𝐵 → 𝑄 𝑄 → 𝐸 𝐵 → 𝐸

  8. 8 / 26 Example ⋅ Memes and Theorems • Some students like all memes. 𝐺 � ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.𝑁(𝑧) → Likes (𝑦, 𝑧) • No student likes any theorem. 𝐺 � ∶ ∀𝑦, 𝑧.𝑇(𝑦) ∧ 𝑈(𝑧) → ¬ Likes (𝑦, 𝑧) • Show: No meme is a theorem. 𝐺 ∶ ∀𝑦.𝑁(𝑦) → ¬𝑈(𝑦)

  9. 9 / 26 Example ⋅ Memes and Theorems

  10. 10 / 26 Example ⋅ Memes and Theorems CNF ⋅ Eliminating implications 𝐺 � ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.𝑁(𝑧) → Likes (𝑦, 𝑧) ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.¬𝑁(𝑧) ∨ Likes (𝑦, 𝑧) 𝐺 � ∶ ∀𝑦, 𝑧.𝑇(𝑦) ∧ 𝑈(𝑧) → ¬ Likes (𝑦, 𝑧) ∀𝑦, 𝑧.¬𝑇(𝑦) ∨ ¬𝑈(𝑧) ∨ ¬ Likes (𝑦, 𝑧) 𝐺 ∶ ∀𝑦.𝑁(𝑦) → ¬𝑈(𝑦) ∀𝑦.¬𝑁(𝑦) ∨ ¬𝑈(𝑦)

  11. 11 / 26 universal quantifjers Example ⋅ Memes and Theorems CNF ⋅ Standardising variables apart, skolemising, dropping 𝐺 � ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.¬𝑁(𝑧) ∨ Likes (𝑦, 𝑧) 𝑇(𝐻) ∧ (¬𝑁(𝑧) ∨ Likes (𝐻, 𝑧)) 𝐺 � ∶ ∀𝑦, 𝑧.¬𝑇(𝑦) ∨ ¬𝑈(𝑧) ∨ ¬ Likes (𝑦, 𝑧) ¬𝑇(𝑥) ∨ ¬𝑈(𝑨) ∨ ¬ Likes (𝑥, 𝑨) 𝐺 ∶ ∀𝑦.¬𝑁(𝑦) ∨ ¬𝑈(𝑦) ¬𝑁(𝑦) ∨ ¬𝑈(𝑦)

  12. Unifjcation Negation of proof goal 12 / 26 Example ⋅ Memes and Theorems 𝐺 � ∶ 𝑇(𝐻) ∧ (¬𝑁(𝑧) ∨ Likes (𝐻, 𝑧)) 𝐺 � ∶ ¬𝑇(𝑥) ∨ ¬𝑈(𝑨) ∨ ¬ Likes (𝑥, 𝑨) 𝑥/𝐻 ∶ ¬𝑇(𝐻) ∨ ¬𝑈(𝑨) ∨ ¬ Likes (𝐻, 𝑨) ¬(¬𝑁(𝑦) ∨ ¬𝑈(𝑦)) ≡ 𝑁(𝑦) ∧ 𝑈(𝑦)

  13. 13 / 26 and Example ⋅ Memes and Theorems 𝑇(𝐻) ∧ (¬𝑁(𝑧) ∨ Likes (𝐻, 𝑧)) ¬𝑇(𝐻) ∨ ¬𝑈(𝑨) ∨ ¬ Likes (𝐻, 𝑨) 𝑁(𝑦) ∧ 𝑈(𝑦) Clauses: 𝑇(𝐻) , 𝑁(𝑦) , 𝑈(𝑦) , ¬𝑁(𝑧) ∨ Likes (𝐻, 𝑧) , ¬𝑇(𝐻) ∨ ¬𝑈(𝑨) ∨ ¬ Likes (𝐻, 𝑨) 𝑇(𝐻) ¬𝑇(𝐻) ∨ ¬𝑈(𝑨) ∨ ¬ Likes (𝐻, 𝑨) ¬𝑈(𝑨) ∨ ¬ Likes (𝐻, 𝑨) ¬𝑁(𝑧) ∨ Likes (𝐻, 𝑧) ¬𝑈(𝑨) ∨ ¬ Likes (𝐻, 𝑨) ¬𝑁(𝑨) ∨ ¬𝑈(𝑨) Substitute 𝑨/𝑦 ¬𝑁(𝑦) ∨ ¬𝑈(𝑦) 𝑁(𝑦) ¬𝑈(𝑦) 𝑈(𝑦) ¬𝑈(𝑦) � Therefore, ¬𝑁(𝑦) ∨ ¬𝑈(𝑦) , i.e. 𝑁(𝑦) → ¬𝑈(𝑦) .

  14. 14 / 26 Example ⋅ Memes and Theorems 2.0 • Some students like all memes. 𝐺 � ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.𝑁(𝑧) → Likes (𝑦, 𝑧) • No student likes any theorem. 𝐺 � ∶ ∀𝑦.𝑇(𝑦) → ∀𝑧.𝑈(𝑧) → ¬ Likes (𝑦, 𝑧) • Show: No meme is a theorem. 𝐺 ∶ ∀𝑦.𝑁(𝑦) → ¬𝑈(𝑦)

  15. 15 / 26 Example ⋅ Memes and Theorems 2.0 CNF ⋅ Eliminating implications 𝐺 � ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.𝑁(𝑧) → Likes (𝑦, 𝑧) ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.¬𝑁(𝑧) ∨ Likes (𝑦, 𝑧) 𝐺 � ∶ ∀𝑦.𝑇(𝑦) → ∀𝑧.𝑈(𝑧) → ¬ Likes (𝑦, 𝑧) ∀𝑦.¬𝑇(𝑦) ∨ ∀𝑧.¬𝑈(𝑧) ∨ ¬ Likes (𝑦, 𝑧) 𝐺 ∶ ∀𝑦.𝑁(𝑦) → ¬𝑈(𝑦) ∀𝑦.¬𝑁(𝑦) ∨ ¬𝑈(𝑦)

  16. 16 / 26 universal quantifjers Example ⋅ Memes and Theorems 2.0 CNF ⋅ Standardising variables apart, skolemising, dropping 𝐺 � ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.¬𝑁(𝑧) ∨ Likes (𝑦, 𝑧) 𝑇(𝐻) ∧ (¬𝑁(𝑧) ∨ Likes (𝐻, 𝑧)) 𝐺 � ∶ ∀𝑦.¬𝑇(𝑦) ∨ ∀𝑧.¬𝑈(𝑧) ∨ ¬ Likes (𝑦, 𝑧) ¬𝑇(𝑥) ∨ (¬𝑈(𝑨) ∨ ¬ Likes (𝑥, 𝑨)) 𝐺 ∶ ∀𝑦.¬𝑁(𝑦) ∨ ¬𝑈(𝑦) ¬𝑁(𝑦) ∨ ¬𝑈(𝑦)

  17. Resolution is sound and complete. Soundness: derivability of empty clause implies unsatisfjability. Can be proved by noticing that every model that satisfjes the premises of resolution satisfjes also satisfjes its conclusion. Completeness: every unsatisfjable clause can be refuted by resolution. Can be proved using completeness of propositional resolution the scope of this course). 17 / 26 Resolution ⋅ Soundness and completeness A set of clauses 𝑇 is unsatisfjable if and only if one can derive the empty clause (false) from 𝑇 . and lifting (as in the following slides; the full proof is beyond

  18. 18 / 26 Resolution ⋅ Completeness proof

  19. Example 19 / 26 Completeness proof ⋅ Step 1 For a set of clauses 𝑇 , we call the Herbrand universe of 𝑇 the set 𝐼 � of all ground terms that can be constructed from the function symbols in 𝑇 . For 𝑇 = {¬𝑄(𝑦, 𝐺(𝑦, 𝐵)) ∨ ¬𝑅(𝑦, 𝐵) ∨ 𝑆(𝑦, 𝐶)} we have 𝐼 � = {𝐵, 𝐶, 𝐺(𝐵, 𝐵), 𝐺(𝐵, 𝐶), 𝐺(𝐶, 𝐵), 𝐺(𝐶, 𝐶), 𝐺(𝐵, 𝐺(𝐵, 𝐵)), …}

  20. ground clauses obtained by applying all possible consistent Example 20 / 26 Completeness proof ⋅ Step 1 For a set of clauses 𝑇 and 𝑄 a set of ground terms, 𝑄(𝑇) , the saturation of 𝑇 with respect to 𝑄 , is the set of all substitutions of variables in 𝑇 with ground terms from 𝑄 . The saturation of a set 𝑇 with respect to its Herbrand universe is called the Herbrand base of 𝑇 and denoted 𝐼 � (𝑇) . 𝐼 � (𝑇) = {¬𝑄(𝐵, 𝐺(𝐵, 𝐵)) ∨ ¬𝑅(𝐵, 𝐵) ∨ 𝑆(𝐵, 𝐶), ¬𝑄(𝐶, 𝐺(𝐶, 𝐵)) ∨ ¬𝑅(𝐶, 𝐵) ∨ 𝑆(𝐶, 𝐶), ¬𝑄(𝐺(𝐵, 𝐵), 𝐺(𝐺(𝐵, 𝐵), 𝐵)) ∨ ¬𝑅(𝐺(𝐵, 𝐵), 𝐵) ∨ 𝑆(𝐺(𝐵, 𝐵), 𝐶), ¬𝑄(𝐺(𝐵, 𝐶), 𝐺(𝐺(𝐵, 𝐶), 𝐵)) ∨ ¬𝑅(𝐺(𝐵, 𝐶), 𝐵) ∨ 𝑆(𝐺(𝐵, 𝐶), 𝐶) , … }

  21. Herbrand’s theorem (1930) 21 / 26 Completeness proof ⋅ Step 1 If a set 𝑇 of clauses is unsatisfjable, then there exists a fjnite subset of 𝐼 � (𝑇) that is also unsatisfjable.

  22. derive a contradiction. 22 / 26 Completeness proof ⋅ Step 2 Let 𝑇 � be that fjnite unsatisfjable subset of ground sentences. Running propositional resolution to completion on 𝑇 � will

  23. 23 / 26 such that: instantiation lifting Lifting lemma instantiation Completeness proof ⋅ Step 3 Let 𝐷 � and 𝐷 � be two clauses with no shared variables, and let 𝐷 � � and 𝐷 � � ground instances of 𝐷 � and 𝐷 � . If 𝐷 � is a resolvent of 𝐷 � � and 𝐷 � � , then there exists a clause 𝐷 𝐷 is a resolvent of 𝐷 � and 𝐷 � 𝐷 � is a ground instance of 𝐷 . 𝐷 � � , 𝐷 � 𝐷 � , 𝐷 � � ↓ ↓ � � � � � � � � � � � � � ↓ ↓ 𝐷 � 𝐷

  24. 24 / 26 Example Completeness proof ⋅ Step 3 𝐷 � = ¬𝑄(𝑦, 𝐺(𝑦, 𝐵)) ∨ ¬𝑅(𝑦, 𝐵) ∨ 𝑆(𝑦, 𝐶) 𝐷 � = ¬𝑂(𝐻(𝑧), 𝑨) ∨ 𝑄(𝐼(𝑧), 𝑨) 𝐷 � � = ¬𝑄(𝐼(𝐶), 𝐺(𝐼(𝐶), 𝐵)) ∨ ¬𝑅(𝐼(𝐶), 𝐵) ∨ 𝑆(𝐼(𝐶), 𝐶) 𝐷 � � = ¬𝑂(𝐻(𝐶), 𝐺(𝐼(𝐶), 𝐵)) ∨ 𝑄(𝐼(𝐶), 𝐺(𝐼(𝐶), 𝐵)) 𝐷 � = ¬𝑂(𝐻(𝐶), 𝐺(𝐼(𝐶), 𝐵)) ∨ ¬𝑅(𝐼(𝐶), 𝐵) ∨ 𝑆(𝐼(𝐶), 𝐶) 𝐷 = ¬𝑂(𝐻(𝑧), 𝐺(𝐼(𝑧), 𝐵)) ∨ ¬𝑅(𝐼(𝑧), 𝐵) ∨ 𝑆(𝐼(𝑧), 𝐶)

Recommend


More recommend