DOC PREVIEW
Stanford CS 157 - Lecture 10 - Computational Logic

This preview shows page 1-2-22-23 out of 23 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Resolution Theorem ProvingComputational Logic Lecture 10Michael Genesereth Autumn 20052PlanFirst Lecture - Resolution PreliminariesRelational Clausal FormUnificationSecond Lecture - ResolutionResolution Principle and FactoringSatisfiability and Logical EntailmentAnswer ExtractionReductionThird Lecture - Resolution StrategiesElimination Strategies (tautology elimination, subsumption, …)Restriction Strategies (ancestry-filtering, set of support, …)Fourth Lecture- Ordered ResolutionOrdered ResolutionModel Elimination23Propositional Resolution€ {ϕ1,...,ϕ,...,ϕm}{ψ1,...,¬ϕ,...,ψn}{ϕ1,...,ϕm,ψ1,...,ψn}4Relational Resolution I€ {ϕ1,...,ϕ,...,ϕm}{ψ1,...,¬ψ,...,ψn}{ϕ1,...,ϕm,ψ1,...,ψn}σwhere σ= mgu(ϕ,ψ)35Example€ { p(a, y),r(y)}{¬p(x,b)}{r(y)}{x ← a, y ← b}{r(b)}6Example€ { p(a, y), r(y)}{¬p(x, f (x)),q(g(x))}{r(y),q(g(x))}{x ← a, y ← f (a)}{r( f (a)),q(g( a))}47ExampleEverybody loves somebody. Everybody loves alover. Show that everybody loves everybody.€ ∀x.∃y.loves(x , y)∀u.∀v.∀w.(loves(v,w) ⇒ loves(u,v))¬∀x.∀y.loves(x, y)8Example (continued)€ ∀x.∃y.loves(x , y)∀u.∀v.∀w.(loves(v,w) ⇒ loves(u,v))¬∀x.∀y.loves(x, y){loves(x, f (x))}{¬loves(v,w),loves(u,v)}{¬loves( jack, jill)}59Example (concluded)€ 1. {loves(x, f (x))} Premise2. {¬loves(v,w),loves(u,v)} Premise3. {¬loves( jack, jill)} Goal4. {loves(u, x)} 1,25. {} 4,310Harry and RalphEvery horse can outrun every dog. Some greyhoundcan outrun every rabbit. Show that every horse canoutrun every rabbit.€ ∀x.∀y.(h(x)∧ d(y) ⇒ f (x, y))∃y.(g(y)∧∀z.(r(z) ⇒ f (y, z)))∀y.(g(y) ⇒ d(y))∀x.∀y.∀z.( f (x, y)∧ f (y,z) ⇒ f (x, z))¬∀x.∀y.(h(x)∧ r(y) ⇒ f (x, y))611Harry and Ralph (continued)€ ∀x.∀y.(h(x)∧ d(y) ⇒ f (x, y))∃y.(g(y)∧∀z.(r(z) ⇒ f (y, z)))∀y.(g(y) ⇒ d(y))∀x.∀y.∀z.( f (x, y)∧ f (y, z) ⇒ f (x, z)){¬h(x),¬d(y), f (x, y)}{g(greg)}{¬r(z), f (greg,z)}{¬g(y),d(y)}{¬f (x, y),¬f (y, z), f (x, z)}12Harry and Ralph (continued)€ ¬∀x.∀y.(h(x)∧ r(y) ⇒ f (x, y)){h(harry)}{r(ralph)}{¬f (harry,ralph)}713Harry and Ralph (concluded)€ 1. {¬h(x),¬d(y), f (x, y)}2. {g(greg)}3. {¬r(z), f (greg, z)}4. {¬g(y),d(y)}5. {¬f (x , y),¬f (y, z), f (x,z)}6. {h(harry)}7. {r(ralph)}8. {¬f (harry,ralph)}€ 9. {d(greg)}10. {¬d(y), f (harry, y)}11. { f (harry,greg)}12. { f (greg,ralph)}13. {¬f (greg, z), f (harry, z)}14. { f (harry,ralph)}15. {}14ExampleGiven:∃x.∀y.(p(x,y) ⇔ q(x,y))∀x.∃y.(p(x,y) ∨ q(x,y))Prove:∃x.∃y.(p(x,y) ∧ q(x,y))815Example (continued)∃x.∀y.(p(x,y) ⇔ q(x,y)) ∃x.∀y.((¬p(x,y) ∨ q(x,y)) ∧ (p(x,y) ∨ ¬q(x,y))) (¬p(a,y) ∨ q(a,y)) ∧ (p(a,y) ∨ ¬q(a,y)) {¬p(a,y), q(a,y)} {p(a,y), ¬q(a,y)}∀x.∃y.(p(x,y) ∨ q(x,y)) p(x, f(x)) ∨ q(x, f(x)) {p(a,f(x)), q(a,f(x))}16Example (continued)Negate the goal: ∃x.∃y.(p(x,y) ∧ q(x,y)) → ¬∃x.∃y.(p(x,y) ∧ q(x,y))Convert to Clausal Form: ¬∃x.∃y.(p(x,y) ∧ q(x,y)) ∀x.∀y.¬(p(x,y) ∧ q(x,y)) ∀x.∀y.(¬p(x,y) ∨ ¬ q(x,y)) ¬p(x,y) ∨ ¬q(x,y) {¬p(x,y), ¬q(x,y)}917Example (concluded)1. {¬p(a,y), q(a,y)} Premise2. {p(a,y), ¬q(a,y)} Premise3. {p(x, f(x)), q(x, f(x))} Premise4. {¬p(x,y), ¬q(x,y)} Negated Goal5. {q(a, f(a))} 1, 36. {p(a, f(a))} 2, 37. {¬p(a, f(a))} 4, 58. {} 6, 718Example∀x.p(x) ⇒ ∀y.p(y)1019Example (continued)¬(∀x.p(x) ⇒ ∀ y.p(y)) I: ¬(¬∀x.p(x) ∨ ∀ y.p(y)) N: ¬¬∀x.p(x) ∧ ¬∀y.p(y)∀x.p(x) ∧ ∃y.¬p(y) S: ∀x.p(x) ∧ ∃y.¬p(y) E: ∀x.p(x) ∧ ¬p(a) A: p(x) ∧ ¬p(a) D: p(x) ∧ ¬p(a) O: {p(x)} and {¬p(a)}20Example (concluded)Resolution:1. {p(x)} Premise2. {¬p(a)} Premise3. {} 1,2 {x←a}1121Problem€ { p(a, x)}{¬p(x,b)}Failure22Relational Resolution II€ {ϕ1,...,ϕ,...,ϕm}{ψ1,...,¬ψ,...,ψn}{ϕ1τ,...,ϕmτ,ψ1,...,ψn}σwhere σ= mgu(ϕτ,ψ)where τ is a variable renaming on ϕ1223Example€ { p(a, x)}{¬p(x,b)}Failure€ { p(a, y)}{¬p(x,b)}{}{x ← a, y ← b}24Solution With Repeated Renaming1. {r(a,b,u1)} Premise2. {r(b,c,u2)} Premise3. {r(c,d,u3)} Premise4. {r(x,z,f(v)),¬r(x,y,f(f(v))),¬r(y,z,f(f(v)))} Premise5. {¬r(a,d,w)} Goal6. {¬r(a,y6,f(f(v6))),¬r(y6,d,f(f(v6)))} 4,57. {¬r(b,d,f(f(v7)))} 1,68. {¬r(b,y8,f(f(f(v8)))),¬r(y8,d,f(f(f(v8))))} 4,79. {¬r(c,d,f(f(f(v9))))} 2,810. {} 3,91325Problem Without Repeated Renaming1. {r(a,b,u1)} Premise2. {r(b,c,u2)} Premise3. {r(c,d,u3)} Premise4. {r(x,z,f(v)),¬r(x,y,f(f(v))),¬r(y,z,f(f(v)))} Premise5. {¬r(a,d,w)} Goal6. {¬r(a,y,f(f(v))),¬r(y,d,f(f(v)))} 1,47. {¬r(b,d,f(f(v)))} 1,68. Failure 4,726Problem€ {p (x), p(y)}{¬p(u),¬p(v)}{p (y),¬p(v)}{p (x),¬p(v)}{p (y),¬p(u)}{p (x),¬p(u)}1427FactorsIf a subset of the literals in a clause Φ has a mostgeneral unifier γ, then the clause Φ' obtained byapplying γ to Φ is called a factor of Φ.Clause{p(x),p(f(y)),r(x,y)}Factors{p(f(y)),r(f(y),y)}{p(x),p(f(y)),r(x,y)}28Relational Resolution III (Final Version)€ ΦΨ((Φ'−{φ})τ∪ (Ψ'−{¬ψ}))σwhere φ∈ Φ', a factor of Φ where ¬ψ∈ Ψ', a factor of Ψ where σ= mgu(ϕτ,ψ)where τ is a variable renaming on ϕ1529Example€ {p (x), p(y)}{¬p(u),¬p(v)}{p (y),¬p(v)}{p (x),¬p(v)}{p (y),¬p(u)}{p (x),¬p(u)}€ {p (x)}{¬p(u)}{}30Need for Original Clauses1. {p(a,y), p(x,b)} Premise2. {¬p(a,d)} Premise3. {¬p(c,b)} Premise4. {p(x,b)} 1,25. {} 3,41. {p(a,y), p(x,b)} Premise2. {¬p(a,d)} Premise3. {¬p(c,b)} Premise4. {p(a,b)} Factor of 11631ProvabilityA resolution derivation of a clause ϕ from a set Δ ofclauses is a sequence of clauses terminating in ϕ inwhich each item is(1) a member of Δ or(2) the result of applying the resolution to earlier items.A sentence ϕ is provable from a set of sentences Δ byresolution if and only if there is a derivation of theempty clause from the clausal form of Δ∪{¬ϕ}.A resolution proof is a derivation of the empty clausefrom the clausal form of the premises and the negationof the desired conclusion.32Soundness and CompletenessMetatheorem: Provability using the RelationalResolution Principle is sound and complete forRelational Logic (without equality).1733Determining Logical EntailmentTo determine whether a set Δ of sentences logicallyentails a closed sentence ϕ, rewrite Δ∪{¬ϕ} inclausal form and try to derive the empty clause.34ExampleShow that {(p(x) ⇒ q(x)), p(a)} logically entails ∃z.q(z).€


View Full Document

Stanford CS 157 - Lecture 10 - Computational Logic

Documents in this Course
Lecture 1

Lecture 1

15 pages

Equality

Equality

32 pages

Lecture 19

Lecture 19

100 pages

Epilog

Epilog

29 pages

Equality

Equality

34 pages

Load more
Download Lecture 10 - Computational Logic
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 10 - Computational Logic and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 10 - Computational Logic 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?