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

lecture 13 resolution based inference
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Informatics 2D ⋅ Agents and Reasoning ⋅ 2019/2020

Lecture 13 ⋅ Resolution-Based Inference

Claudia Chirita

School of Informatics, University of Edinburgh

11th February 2020

Based on slides by: Jacques Fleuriot, Michael Rovatsos, Michael Herrmann, Vaishak Belle

slide-2
SLIDE 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

slide-3
SLIDE 3

Limitations

...due to restriction to defjnite clauses In order to apply GMP

  • 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”? (works only if there is a rule for each variable)

3 / 26

slide-4
SLIDE 4

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).

4 / 26

slide-5
SLIDE 5

Ground Binary Resolution & Modus Ponens

Ground binary resolution

𝐷 ∨ 𝑄 𝐸 ∨ ¬𝑄 𝐷 ∨ 𝐸

Suppose 𝐷 = False.

𝑄 ¬𝑄 ∨ 𝐸 𝐸

i.e. 𝑄 and 𝑄 → 𝐸 entails 𝐸. Modus ponens is a special case of binary resolution.

5 / 26

slide-6
SLIDE 6

Full Resolution & Generalised Modus Ponens

GMP with 𝑞

𝜄 = 𝑞𝜄

𝑞

, 𝑞 , … , 𝑞

  • (𝑞 ∧ 𝑞 ∧ … ∧ 𝑞 → 𝑟)

𝑟𝜄 𝑞

, 𝑞 , … , 𝑞

  • (𝑟 ∨ ¬𝑞 ∨ ¬𝑞 ∨ … ∨ ¬𝑞)

𝑟𝜄

Full resolution with 𝜄 mgu of all 𝑄 and 𝑄

  • 𝐷 ∨ 𝑄 ∨ … ∨ 𝑄

𝐸 ∨ ¬𝑄

∨ … ∨ ¬𝑄

  • (𝐷 ∨ 𝐸) 𝜄

6 / 26

slide-7
SLIDE 7

Resolution in Implication Form

Ground binary resolution

𝐷 ∨ 𝑄 𝐸 ∨ ¬𝑄 𝐷 ∨ 𝐸

Set 𝐷 = ¬𝐵.

𝐵 → 𝑄 𝑄 → 𝐸 𝐵 → 𝐸

7 / 26

slide-8
SLIDE 8

Example ⋅ Memes and Theorems

  • Some students like all memes.

𝐺 ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.𝑁(𝑧) → Likes(𝑦, 𝑧)

  • No student likes any theorem.

𝐺 ∶ ∀𝑦, 𝑧.𝑇(𝑦) ∧ 𝑈(𝑧) → ¬Likes(𝑦, 𝑧)

  • Show: No meme is a theorem.

𝐺 ∶ ∀𝑦.𝑁(𝑦) → ¬𝑈(𝑦)

8 / 26

slide-9
SLIDE 9

Example ⋅ Memes and Theorems

9 / 26

slide-10
SLIDE 10

Example ⋅ Memes and Theorems

CNF ⋅ Eliminating implications

𝐺 ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.𝑁(𝑧) → Likes(𝑦, 𝑧) ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.¬𝑁(𝑧) ∨ Likes(𝑦, 𝑧) 𝐺 ∶ ∀𝑦, 𝑧.𝑇(𝑦) ∧ 𝑈(𝑧) → ¬Likes(𝑦, 𝑧) ∀𝑦, 𝑧.¬𝑇(𝑦) ∨ ¬𝑈(𝑧) ∨ ¬Likes(𝑦, 𝑧) 𝐺 ∶ ∀𝑦.𝑁(𝑦) → ¬𝑈(𝑦) ∀𝑦.¬𝑁(𝑦) ∨ ¬𝑈(𝑦)

10 / 26

slide-11
SLIDE 11

Example ⋅ Memes and Theorems

CNF ⋅ Standardising variables apart, skolemising, dropping universal quantifjers

𝐺 ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.¬𝑁(𝑧) ∨ Likes(𝑦, 𝑧) 𝑇(𝐻) ∧ (¬𝑁(𝑧) ∨ Likes(𝐻, 𝑧)) 𝐺 ∶ ∀𝑦, 𝑧.¬𝑇(𝑦) ∨ ¬𝑈(𝑧) ∨ ¬Likes(𝑦, 𝑧) ¬𝑇(𝑥) ∨ ¬𝑈(𝑨) ∨ ¬Likes(𝑥, 𝑨) 𝐺 ∶ ∀𝑦.¬𝑁(𝑦) ∨ ¬𝑈(𝑦) ¬𝑁(𝑦) ∨ ¬𝑈(𝑦)

11 / 26

slide-12
SLIDE 12

Example ⋅ Memes and Theorems

Unifjcation

𝐺 ∶ 𝑇(𝐻) ∧ (¬𝑁(𝑧) ∨ Likes(𝐻, 𝑧)) 𝐺 ∶ ¬𝑇(𝑥) ∨ ¬𝑈(𝑨) ∨ ¬Likes(𝑥, 𝑨) 𝑥/𝐻 ∶ ¬𝑇(𝐻) ∨ ¬𝑈(𝑨) ∨ ¬Likes(𝐻, 𝑨)

Negation of proof goal

¬(¬𝑁(𝑦) ∨ ¬𝑈(𝑦)) ≡ 𝑁(𝑦) ∧ 𝑈(𝑦)

12 / 26

slide-13
SLIDE 13

Example ⋅ Memes and Theorems

𝑇(𝐻) ∧ (¬𝑁(𝑧) ∨ Likes(𝐻, 𝑧)) ¬𝑇(𝐻) ∨ ¬𝑈(𝑨) ∨ ¬Likes(𝐻, 𝑨) 𝑁(𝑦) ∧ 𝑈(𝑦)

Clauses: 𝑇(𝐻), 𝑁(𝑦), 𝑈(𝑦), ¬𝑁(𝑧) ∨ Likes(𝐻, 𝑧),

¬𝑇(𝐻) ∨ ¬𝑈(𝑨) ∨ ¬Likes(𝐻, 𝑨) 𝑇(𝐻) ¬𝑇(𝐻) ∨ ¬𝑈(𝑨) ∨ ¬Likes(𝐻, 𝑨) ¬𝑈(𝑨) ∨ ¬Likes(𝐻, 𝑨) ¬𝑁(𝑧) ∨ Likes(𝐻, 𝑧) ¬𝑈(𝑨) ∨ ¬Likes(𝐻, 𝑨) ¬𝑁(𝑨) ∨ ¬𝑈(𝑨)

Substitute 𝑨/𝑦

¬𝑁(𝑦) ∨ ¬𝑈(𝑦) 𝑁(𝑦) ¬𝑈(𝑦)

and

¬𝑈(𝑦) 𝑈(𝑦)

  • Therefore, ¬𝑁(𝑦) ∨ ¬𝑈(𝑦), i.e. 𝑁(𝑦) → ¬𝑈(𝑦).

13 / 26

slide-14
SLIDE 14

Example ⋅ Memes and Theorems 2.0

  • Some students like all memes.

𝐺 ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.𝑁(𝑧) → Likes(𝑦, 𝑧)

  • No student likes any theorem.

𝐺 ∶ ∀𝑦.𝑇(𝑦) → ∀𝑧.𝑈(𝑧) → ¬Likes(𝑦, 𝑧)

  • Show: No meme is a theorem.

𝐺 ∶ ∀𝑦.𝑁(𝑦) → ¬𝑈(𝑦)

14 / 26

slide-15
SLIDE 15

Example ⋅ Memes and Theorems 2.0

CNF ⋅ Eliminating implications

𝐺 ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.𝑁(𝑧) → Likes(𝑦, 𝑧) ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.¬𝑁(𝑧) ∨ Likes(𝑦, 𝑧) 𝐺 ∶ ∀𝑦.𝑇(𝑦) → ∀𝑧.𝑈(𝑧) → ¬Likes(𝑦, 𝑧) ∀𝑦.¬𝑇(𝑦) ∨ ∀𝑧.¬𝑈(𝑧) ∨ ¬Likes(𝑦, 𝑧) 𝐺 ∶ ∀𝑦.𝑁(𝑦) → ¬𝑈(𝑦) ∀𝑦.¬𝑁(𝑦) ∨ ¬𝑈(𝑦)

15 / 26

slide-16
SLIDE 16

Example ⋅ Memes and Theorems 2.0

CNF ⋅ Standardising variables apart, skolemising, dropping universal quantifjers

𝐺 ∶ ∃𝑦.𝑇(𝑦) ∧ ∀𝑧.¬𝑁(𝑧) ∨ Likes(𝑦, 𝑧) 𝑇(𝐻) ∧ (¬𝑁(𝑧) ∨ Likes(𝐻, 𝑧)) 𝐺 ∶ ∀𝑦.¬𝑇(𝑦) ∨ ∀𝑧.¬𝑈(𝑧) ∨ ¬Likes(𝑦, 𝑧) ¬𝑇(𝑥) ∨ (¬𝑈(𝑨) ∨ ¬Likes(𝑥, 𝑨)) 𝐺 ∶ ∀𝑦.¬𝑁(𝑦) ∨ ¬𝑈(𝑦) ¬𝑁(𝑦) ∨ ¬𝑈(𝑦)

16 / 26

slide-17
SLIDE 17

Resolution ⋅ Soundness and completeness

Resolution is sound and complete. A set of clauses 𝑇 is unsatisfjable if and only if one can derive the empty clause (false) from 𝑇. 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 and lifting (as in the following slides; the full proof is beyond the scope of this course).

17 / 26

slide-18
SLIDE 18

Resolution ⋅ Completeness proof

18 / 26

slide-19
SLIDE 19

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 𝑇. Example For 𝑇 = {¬𝑄(𝑦, 𝐺(𝑦, 𝐵)) ∨ ¬𝑅(𝑦, 𝐵) ∨ 𝑆(𝑦, 𝐶)} we have

𝐼 = {𝐵, 𝐶, 𝐺(𝐵, 𝐵), 𝐺(𝐵, 𝐶), 𝐺(𝐶, 𝐵), 𝐺(𝐶, 𝐶), 𝐺(𝐵, 𝐺(𝐵, 𝐵)), …}

19 / 26

slide-20
SLIDE 20

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

ground clauses obtained by applying all possible consistent 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 𝐼(𝑇). Example

𝐼(𝑇) = {¬𝑄(𝐵, 𝐺(𝐵, 𝐵)) ∨ ¬𝑅(𝐵, 𝐵) ∨ 𝑆(𝐵, 𝐶), ¬𝑄(𝐶, 𝐺(𝐶, 𝐵)) ∨ ¬𝑅(𝐶, 𝐵) ∨ 𝑆(𝐶, 𝐶), ¬𝑄(𝐺(𝐵, 𝐵), 𝐺(𝐺(𝐵, 𝐵), 𝐵)) ∨ ¬𝑅(𝐺(𝐵, 𝐵), 𝐵) ∨ 𝑆(𝐺(𝐵, 𝐵), 𝐶), ¬𝑄(𝐺(𝐵, 𝐶), 𝐺(𝐺(𝐵, 𝐶), 𝐵)) ∨ ¬𝑅(𝐺(𝐵, 𝐶), 𝐵) ∨ 𝑆(𝐺(𝐵, 𝐶), 𝐶) , … }

20 / 26

slide-21
SLIDE 21

Completeness proof ⋅ Step 1

Herbrand’s theorem (1930) If a set 𝑇 of clauses is unsatisfjable, then there exists a fjnite subset of 𝐼(𝑇) that is also unsatisfjable.

21 / 26

slide-22
SLIDE 22

Completeness proof ⋅ Step 2

Let 𝑇 be that fjnite unsatisfjable subset of ground sentences. Running propositional resolution to completion on 𝑇 will derive a contradiction.

22 / 26

slide-23
SLIDE 23

Completeness proof ⋅ Step 3

Lifting lemma 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 𝐷

such that:

𝐷 is a resolvent of 𝐷 and 𝐷 𝐷 is a ground instance of 𝐷.

𝐷, 𝐷

instantiation

𝐷

, 𝐷

  • lifting

↓ 𝐷

instantiation

𝐷

23 / 26

slide-24
SLIDE 24

Completeness proof ⋅ Step 3

Example

𝐷 = ¬𝑄(𝑦, 𝐺(𝑦, 𝐵)) ∨ ¬𝑅(𝑦, 𝐵) ∨ 𝑆(𝑦, 𝐶) 𝐷 = ¬𝑂(𝐻(𝑧), 𝑨) ∨ 𝑄(𝐼(𝑧), 𝑨) 𝐷

= ¬𝑄(𝐼(𝐶), 𝐺(𝐼(𝐶), 𝐵)) ∨ ¬𝑅(𝐼(𝐶), 𝐵) ∨ 𝑆(𝐼(𝐶), 𝐶)

𝐷

= ¬𝑂(𝐻(𝐶), 𝐺(𝐼(𝐶), 𝐵)) ∨ 𝑄(𝐼(𝐶), 𝐺(𝐼(𝐶), 𝐵))

𝐷 = ¬𝑂(𝐻(𝐶), 𝐺(𝐼(𝐶), 𝐵)) ∨ ¬𝑅(𝐼(𝐶), 𝐵) ∨ 𝑆(𝐼(𝐶), 𝐶) 𝐷 = ¬𝑂(𝐻(𝑧), 𝐺(𝐼(𝑧), 𝐵)) ∨ ¬𝑅(𝐼(𝑧), 𝐵) ∨ 𝑆(𝐼(𝑧), 𝐶)

24 / 26

slide-25
SLIDE 25

Effjcient algorithms for resolution

Heuristics to make resolution more effjcient: Unit preference: prefer clauses with only one symbol. Pure clauses: a pure clause contains symbol 𝐵 which does not occur in any other clause. Cannot lead to contradiction. Tautology: clauses containing 𝐵 and ¬𝐵. Set of support: identify useful clauses and ignore the rest. Input resolution: intermediately generated clauses can only be combined with original input clauses. Subsumption: if a clause contains another one, use only the shorter clause. Prune unnecessary facts from the KB. Including heuristics, resolution is more effjcient than DPLL.

25 / 26

slide-26
SLIDE 26

Summary

  • Limitations of GMP
  • Relationship between inference rules
  • Completeness of resolution – the lifting lemma
  • Effjcient algorithms for resolution

26 / 26