1 / 39

Resolution Strategies

banes
Download Presentation

Resolution Strategies

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. One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original set, thus generating a new set of clause. The next step is trying to resolve every new clause against every new clause and every original clause, generating another new set. Then try to resolve those new clauses against themselves and the previous clauses. Resolution Strategies

  2. Several ways to restrict the possible resolutions are: Unit resolution – one of the two clauses resolved upon must be a unit clause (a single literal)‏ Input resolution – one of the two clauses resolved upon must be from the original set of clauses Linear resolution – after the first resolution step, one of the two clauses resolved upon must be the last clause generate. These restrictions are sound, but not complete. Why? Restrictions of Resolution

  3. One strategy that is complete is subsumption. On clause subsumes another (in proposition calculus) if it is a subset of the other clause. As we are trying to obtain the empty clauses, smaller clauses are better. So, if a clause subsumes another clauses, that other clause may be eliminated. This works in both the forward direction (a new clause is subsumed by and old clause) and the backward direction (an old clause is subsumed by a new clause). Subsumption

  4. Delete any tautology or clause subsumed by another. Deletion Strategy

  5. Resolution also works for the predicate calculus, but is more complicated (of course!). In particular, reducing a formula to a clause set requires more work, and we have to pay attention to the murder rule. Predicate Calculus

  6. (From Chang and Lee, Symbolic Logic and Mechanical Theorem Proving)‏ Prenex form occurs when the quantifiers all occur to the left of the formula, that is a formula of the form (Q1 x1) (Q2 x2) (Q3 x3) (M), where Q1, Q2, Q3, ... are either ∀ or ∃, and M is a quantifier-free formula, called the matrix. Prenex Form

  7. To put a formula into prenex form, we do the following steps: 1. Get rid of -> and <-> by using the equivalences F <->G = (F -> G) ^ (G -> F) and F -> G = ~F v G. 2. Push ~ in to the atoms by using the equivalences ~~F = F, ~(F v G) = ~F ^ ~G, ~(F ^ G) = ~F v ~G. 3. Rename bound variables if necessary. 4. Move the quantifiers to the outside. Prenex Form (cont'd)‏

  8. We use the following equivalences: (Q x) F(x) v G = (Q x) (F(x) v G)‏ (Q x) F(x) ^ G = (Q x) (F(x) ^ G (∀ x) F(x) ^ (∀ x) H(x) = (∀ x) (F(x) ^ H(x))‏ (∃ x) F(x) v (∃ x) H(x) = (∃ x) (F(x) v H(x))‏ (Q1 x) F(x) v (Q2 x) H(x) = (Q1 x) (Q2 z) (F(x) v H(z))‏ (Q1 x) F(x) ^ (Q2 x) H(x) = (Q1 x) (Q2 z) (F(x) ^ H(z))‏ Moving Quantifiers to the Outside

  9. (∀ x) (∀ y) ((∃ z) (P(x,z) ^ P(y,z)) -> (∃ u) Q(x,y,u))‏ Prenex Form - Example

  10. To achieve Skolem Standard form, we do the following; Transform the formula into prenex normal form. Put the matrix into conjunctive normal form (CNF). Eliminate the existentially quantified variables by using Skolem functions (and constants)‏ Drop the universal quantifiers as only universally quantified variables remain. Skolem Standard Form

  11. Consider the formula (∀ x) (∃ y) x >= y. That is, for every x, there is some y less than x. If that's the case, we could create a function smaller(x) that, given an x, returns some number smaller than x. There are many such functions, by the formula guarantees that one exists. Consider the formula (∀ x) x >= smaller(x). These two formulas are not equivalent under an interpretation (why?) but one is unsatisfiable iff the other is unsatisfiable (why?)‏ Skolem Functions

  12. We can replace each existentially quantified variable by a new Skolem function whose arguments are all the universally quantified variable to the left of its quantifier – as those are the values that the existentially quantified variable depends on. If there are no universally quantified variables to the left, we replace the variable by a function of no arguments, or a constant. Once we have no existentially quantified variables, we drop the ∀'s. Skolem Functions (cont'd)‏

  13. (∃ x) (∀ y) (∀ z) (∃ u) (∀ v) (∃ w) P(x,y,z,u,w)‏ Skolem Normal Form - Example

  14. The resolution procedure for predicate calculus is a refutation procedure. The steps are: Negate the formula Put the formula into Skolem Standard form (which requires putting it into prenex for first)‏ Write the formula as a set of clauses Use the resolution rule repeatedly to find the empty clause (box) if possible. Resolution

  15. The resolution rule for predicate calculus is a bit more complicated because of the presence of variables. Two literals don't have to be exactly the same, but rather could unify. The binary resolution rule corresponds to the marriage rule: If C1 and C2 are two clauses with no variables in common and L1 and L2 are two literals in C1 and C2, respectively, where L1 and ~L2 have the mgu σ, then the clause (σ(C1)-σ(L1) U (σ(C1)-σ(L1) is the binary resolvent of C1 and C2. Binary Resolution Rule

  16. For propositional calculus, the murder rule simply means that the clauses are sets. For predicate calculus, since we have variables, we must deal with the case when two (or more) literals in a single clause unify: If two (or more) literals (with the same sign) of a clause C have an mgu σ, then σ(C) is called a factor of C. Factors

  17. Remembering that a murder may only occur the night before a wedding, we now have the (full) resolution rule: A resolvent of two clauses C1 and C2 is a binary resolvent of C1 or a factor of C1 and C2 or a factor of C2. Resolution Rule for Pred. Calc.

  18. C1 = P(x) v P(f(y)) v R(g(y))‏ C2 = ~P(f(g(a))) v Q(b)‏ Resolution Rule - Example

  19. Resolution is sound and complete. Many of strategies used in propositional calculus resolution apply to predicate calculus (with modification). Level saturation is the same. A clause C1 subsumes a clause C2 iff there is a substitution σ such that σ(C1) ⊆ C2. The deletion strategy used this new definition of subsumption. Unit, input, and linear resolution are the same. Resolution Procedure

  20. Definitions: A clause is called positive is it does not contain any negative literals. A clause is called negative if it does not contain any negative literals. A clause is called mixed if it is neither positive nor negative. Other Strategies - Definitions

  21. In positive hyperresolution, a single step is a series of resolution steps between a nucleus, (a negative or mixed clause) and several electrons (positive clauses). The result must be a positive clause, i.e., the electrons must knock out all the negative literals in the nucleus. Example: R(x) v R(a), S(x), ~R(a) v ~S(a) -> □. Positive Hyperresolution

  22. Negative Hyperresolution is just like positive hyperresolution except that the nucleus is positive or mixed and the electrons are negative clauses. Negative Hyperresolution

  23. A subset T of a set of clauses S is called a set of support if S – T is satisfiable. For example, given a theorem with hypothesis and a conclusion, the hypotheses are normally satisfiable, so T could be the clauses formed by the conclusion. A set-of-support resolution is one in which both parent clauses are not from S – T. A set-of-support deduction is one where every resolution is a set-of-support resolution. Set of Support Resolution

  24. Otter – Argonne National Lab, McCune Prover9 - McCune SETHEO – Technical University of Munich E-SETHEO - TUM Vampire- Manchester University, Voronkov Automated Theorem Provers

  25. Mathematical Proof Proof-checking Program Verification Question Answering General Reasoning Combine with other Reasoning Modules Users of Automated Thm. Proving

  26. A Horn clause is a restricted predicate calculus formula of form P1 ^ P2 ^ P3 ^ ... Pn -> Q or just Q The formulas Pi and Q must be positive literals. Horn Clauses

  27. Given a set of Horn clauses (the hypotheses) and a query (the conclusion) , we can easily check if the query is true. A ^ B ^ C -> D B -> C A E A ^ E -> B ------------------------ D Queries

  28. One systematic way is to keep a stack of goals yet to be proved. Begin by pushing the conclusion (D) on the stack. While the stack is not empty, pop the stack to get the current goal. If a fact (atomic clause) matches the goal, return T. If not, search for an implication whose right-hand side matches the goal, and then push all the conjuncts from the left-hand side onto the stack (if not already there). Proof

  29. D (conclusion)‏ A B C (matches first clause)‏ B C (A is a fact)‏ A E C (matches fifth clause)‏ E C (A is a fact)‏ C (E is a fact)‏ B (matches second clause)‏ A E (matches fifth clause)‏ E (A is a fact)‏ (E is a fact)‏ Example

  30. Alternatively we could use resolution. Written as a clause set (with the conclusion negated) we have: ~A v ~B v ~C v D ~B v C A E ~A v ~E v B ~D A restricted form of resolution called LUSH or SLD works fine for these sets. Resolution

  31. We can add a list constructor to this language: [] means the empty list, and cons(x,y) means the list with first element x and the remainder is y (so x is added to the beginning of list y). We can use standard list notation as shorthand for our lists. So, the list cons(a, cons(b, cons(c, []))) would be written [a,b,c]. We also use the vertical bar (|) with brackets to be shorthand for cons – [x|y] means cons (x,y). Lists

  32. We can use this notation to define list operations: member(x, [x | y])‏ member(x, z) -> member(x, [y | z])‏ means that x is a member of a list which has x as its head, and if x is a member z, then x is a member of the list constructed by adding y to the head of z. Statements about Lists

  33. What does it mean if one list is the sorted version of another list? For example, consider [3,1,4,2] and [1,2,3,4]. The both must have the same members, and the second list must be in order. We assume that we have predicates for the usual mathematical relations such as <=. So, to state that a list is in order we could say: Sorting

  34. inOrder([y | z])^(x <= y)->inOrder([x, y | z])‏ inOrder([])‏ inOrder([x])‏ Sorting (cont'd)‏

  35. To check if two lists have exactly the same member is a little more complicated. To state this property, we use a three argument member predicate which removes the member of the list, i.e., member(x, y, z)‏ means that x is a member of y and that z is the result of removing (one instance of) x from y. So member(3,[1,2,3,4],[1,2,4]) is true. Same Elements

  36. member(x, [x | y], y)‏ member(x, y, z) -> member(x, [w | y], [w | z])‏ sameElements([], [])‏ sameElements(y, z), member(x, w, z) -> sameElements([x | y], w)‏ Same Elements (cont'd)‏

  37. sameElements(x,y) ^ inOrder(y) -> sorted(x,y)‏ sameElements([], [])‏ sameElements(y, z), member(x, w, z) -> sameElements([x | y], w)‏ member(x, [x | y], y)‏ member(x, y, z) -> member(x, [w | y], [w | z])‏ inOrder([y | z])^(x <= y)->inOrder([x, y | z])‏ inOrder([])‏ inOrder([x])‏ Sorting

  38. sorted(L1,L2) :- sameElements(L1,L2), inOrder(L2). inOrder([X,Y|L]) :- X =< Y, inOrder([Y|L]). inOrder([]). inOrder([_]). sameElements([],[]). sameElements([X|L1],L2) :- sameElements(L1,L3), member(X,L2,L3). member(X,[X|L],L). member(X,[Y|L],[Y|L1]) :- member(X,L,L1). Prolog

  39. Prolog is a language built on top of a resolution theorem prover. So the specification of the program is (or can be) the executable program. We blur the distinction between the declarative and the procedural. Prolog (cont'd)‏

More Related