1 / 33

Resolution Preliminaries

Computational Logic Lecture 9. Resolution Preliminaries. Michael Genesereth Autumn 2011. Difficulty with Universal Instantiation. Resolution Principle. The Resolution Principle is a rule of inference.

finola
Download Presentation

Resolution Preliminaries

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computational Logic Lecture 9 Resolution Preliminaries Michael Genesereth Autumn 2011

  2. Difficulty with Universal Instantiation

  3. Resolution Principle The Resolution Principle is a rule of inference. Using the Resolution Principle alone (without axiom schemata or other rules of inference), it is possible to build a theorem prover that is sound and complete for all of Relational Logic. The search space using the Resolution Principle is much smaller than with standard axiom schemata.

  4. Plan • First Lecture - Resolution Preliminaries • Relational Clausal Form • Unification • Second Lecture - Resolution Principle • Resolution Principle and Factoring • Resolution Theorem Proving • Third Lecture - Resolution Applications • Theorem Proving • Answer Extraction • Reduction • Fourth Lecture - Resolution Strategies • Elimination Strategies (tautology elimination, subsumption, …) • Restriction Strategies (ancestry filtering, set of support, …)

  5. Clausal Form Relational resolution works only on expressions in clausal form. Fortunately, it is possible to convert any set of Relational Logic sentences into an equally satisfiable set of sentences in clausal form.

  6. Clausal Form A literal is either an atomic sentence or a negation of an atomic sentence. A clausal sentence is either a literal or a disjunction of literals. A clause is a set of literals (interpreted as disjunction). {p(a)} {p(a)} {p(x), q(x)} The empty clause {} is unsatisfiable.

  7. Inseado Implications Out: Negations In:

  8. Inseado (continued) Standardize variables Existentials Out (Outside in)

  9. Inseado (continued) Alls Out Distribution

  10. Inseado (concluded) Operators Out

  11. Example

  12. Example

  13. Example (concluded)

  14. Clausal Form Bad News: The result of converting a set of sentences is not necessarily logically equivalent to the original set of sentences. Why? Introduction of Skolem constants and functions. Good News: The result of converting a set of sentences is satisfiable if and only if the original set of sentences is satisfiable. Important because we use satisfiability to determine logical entailment.

  15. Substititions A substitution is a finite set of pairs of variables and terms, called replacements. {Xa, Yf(b), VW} The result of applying a substitution  to an expression  is the expression  obtained from  by replacing every occurrence of every variable in the substitution by its replacement. p(X,X,Y,Z){Xa,Yf(b),VW}=p(a,a,f(b),Z)

  16. Cascaded Substitutions r{x,y,z}{xa, yf(u), zv}=r{a,f(u),v} r{a,f(u),v}{ud, ve}=r(a,f(d),e) r{x,y,z}{xa,yf(d),ze}=r(a,f(d),e)

  17. Composition of Substitutions The composition of substitution  and  is the substitution (written compose(,) or, more simply,) obtained by (1) applying  to the replacements in  (2) adding to  pairs from  with different variables (3) deleting any assignments of a variable to itself. {xa, yf(u), zv}{ud,ve,zg} ={xa,yf(d),ze}{ud,ve,zg} ={xa,yf(d),ze,ud,ve}

  18. Unification A substitution  is a unifier for an expression  and an expression  if and only if =. p(X,Y){Xa,Yb,Vb}=p(a,b) p(a,V){Xa,Yb,Vb}=p(a,b) If two expressions have a unifier, they are said to be unifiable. Otherwise, they are nonunifiable. p(X,X) p(a,b)

  19. Non-Uniqueness of Unification Unifier 1: p(X,Y){Xa,Yb,Vb}=p(a,b) p(a,V){Xa,Yb,Vb}=p(a,b) Unifier 2: p(X,Y){Xa,Yf(W),Vf(W)}=p(a,f(W)) p(a,V){Xa,Yf(W),Vf(W)}=p(a,f(W)) Unifier 3: p(X,Y){Xa,YV}=p(a,V) p(a,V){Xa,YV}=p(a,V)

  20. Most General Unifier A substitution  is a most general unifier (mgu) of two expressions if and only if it is as general as or more general than any other unifier. Theorem: If two expressions are unifiable, then they have an mgu that is unique up to variable permutation. p(X,Y){Xa,YV}=p(a,V) p(a,V){Xa,YV}=p(a,V) p(X,Y){Xa,VY}=p(a,Y) p(a,V){Xa,VY}=p(a,Y)

  21. Expression Structure p a d f b c Each expression is treated as a sequence of its immediate subexpressions. Linear Version: p(a, f(b, c), d) Structured Version:

  22. Most General Unification (preliminary) functionmgu (x, y, s) {if (varp(x)) {return mguvar(x, y, s)}; if (atom(x)) {return mguatom(x, y, s)}; if (varp(y)) {return mguvar(y, x, s)}; if (atom(y)) {return false}; for (vari=0; i < x.length; i++) {s = mgu(x[i], y[i], s); if (s == false){returnfalse}}; returns}

  23. Most General Unification (preliminary) functionmguatom (x, y, s) {if (varp(y)) {return mguvar(y, x, s)}; if (x == y) {return s}; return false} functionmguvar (x, y, s) {if (x == y) {return s}; vardum = getbinding(x, s); if(dum != false) {returnmgu(dum, y, s)}; returncompose(s,{x plug(y, s)})}

  24. Example Call: mgu(p(X,b), p(a,Y), {}) Call: mgu(p, p, {})Exit: {} Call: mgu(X, a, {}) Exit:{Xa} Call:mgu(b, Y, {Xa}) Exit:{Xa,Yb} Exit:{Xa,Yb}

  25. Example Call: mgu(p(X,X), p(a,b), {}) Call: mgu(p, p, {}) Exit: {} Call: mgu(X, a, {}) Exit: {Xa} Call: mgu(X, b, {Xa}) Call: mgu(a, b, {Xa}) Exit: false Exit: false Exit: false

  26. Example Call: mgu(p(f(X),f(X)), p(Y,f(a)), {}) Call: mgu(p, p, {}) Exit:{} Call: mgu(f(X), Y, {}) Exit: {Yf(X)} Call: mgu(f(X), f(a), {Yf(X)}) Call: mgu(f, f, {Yf(X)}) Exit: {Yf(X)} Call: mgu(X, a, {Yf(X)}) Exit: {Yf(a),Xa} Exit: {Yf(a),Xa} Exit: {Yf(a),Xa}

  27. Example Call: mgu(p(X,X), p(Y,f(Y)), {}) Call: mgu(p, p, {}) Exit:{} Call: mgu(X, Y, {}) Exit:{XY} Call: mgu(X, f(Y), {XY}) Call: mgu(Y, f(Y), {XY}) Exit:{Xf(Y),Yf(Y)} Exit:{Xf(Y),Yf(Y)} Exit:{Xf(Y),Yf(Y)}

  28. Problem Circularity Problem: {Xf(Y),Yf(Y)} Unification Problem: p(X,X){Xf(Y),Yf(Y)}=p(f(Y),f(Y)) p(Y,f(Y)){Xf(Y),Yf(Y)}=p(f(Y),f(f(Y))) Semantic Problem: ~hates(X,X) hates(Y,f(Y))

  29. Solution Before assigning a variable to an expression, first check that the variable does not occur within that expression. This is called, oddly enough, the occur check test. Prolog does not do the occur check (and is proud of it).

  30. Most General Unification (revised) functionmguvar (x, y, s) {if (x == y) {return s}; vardum = getbinding(x, s); if(dum != false) {returnmgu(dum, y, s)}; if (mguchkp(x, y, s)) {return false}; returncompose(s,{x plug(y, s)})} functionmguchkp (x, y, s) {if (x == y) {return true}; if (varp(y)) {return mguchkp(x, right(assoc(y, s)), s)}; if (atom(y)) {return false}; for (vari=0; i < y.length; i++) {if (mguchkp(x, y[i], s)){returntrue}}; return false}

  31. Example Call: mgu(p(X,X), p(Y,f(Y)), {}) Call: mgu(p, p, {}) Exit:{} Call: mgu(X, Y, {}) Exit:{XY} Call: mgu(X, f(Y), {XY}) Call: mgu(Y, f(Y), {XY}) Exit:false Exit:false Exit:false

  32. Propositional Resolution

  33. Relational Resolution (sort of)

More Related