Presentation is loading. Please wait.

Presentation is loading. Please wait.

Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original.

Similar presentations


Presentation on theme: "Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original."— Presentation transcript:

1 Resolution Strategies 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.

2 Restrictions of Resolution 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?

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

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

5 Predicate Calculus 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.

6 Prenex Form (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 (Q 1 x 1 ) (Q 2 x 2 ) (Q 3 x 3 ) (M), where Q 1, Q 2, Q 3,... are either ∀ or ∃, and M is a quantifier-free formula, called the matrix.

7 Prenex Form (cont'd)‏ 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.

8 Moving Quantifiers to the Outside 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))‏ (Q 1 x) F(x) v (Q 2 x) H(x) = (Q 1 x) (Q 2 z) (F(x) v H(z))‏ (Q 1 x) F(x) ^ (Q 2 x) H(x) = (Q 1 x) (Q 2 z) (F(x) ^ H(z))‏

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

10 Skolem Standard Form 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.

11 Skolem Functions 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?)‏

12 Skolem Functions (cont'd)‏ 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.

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

14 Resolution 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.

15 Binary Resolution Rule 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 C 1 and C 2 are two clauses with no variables in common and L 1 and L 2 are two literals in C 1 and C 2, respectively, where L 1 and ~L 2 have the mgu σ, then the clause ( σ (C 1 )- σ (L 1 ) U ( σ (C 1 )- σ (L 1 ) is the binary resolvent of C 1 and C 2.

16 Factors 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.

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

18 Resolution Rule - Example C 1 = P(x) v P(f(y)) v R(g(y))‏ C 2 = ~P(f(g(a))) v Q(b)‏

19 Resolution Procedure 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 C 1 subsumes a clause C 2 iff there is a substitution σ such that σ (C 1 ) ⊆ C 2. The deletion strategy used this new definition of subsumption. Unit, input, and linear resolution are the same.

20 Other Strategies - Definitions 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.

21 Positive Hyperresolution 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) -> □.

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

23 Set of Support Resolution 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.

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

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

26 Horn Clauses A Horn clause is a restricted predicate calculus formula of form P 1 ^ P 2 ^ P 3 ^... P n -> Q or just Q The formulas P i and Q must be positive literals.

27 Queries 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

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

29 Example 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)‏

30 Resolution 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.

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

32 Statements about Lists 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.

33 Sorting 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:

34 Sorting (cont'd)‏ inOrder([y | z])^(x inOrder([x, y | z])‏ inOrder([])‏ inOrder([x])‏

35 Same Elements 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.

36 Same Elements (cont'd)‏ 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)‏

37 Sorting 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 inOrder([x, y | z])‏ inOrder([])‏ inOrder([x])‏

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

39 Prolog (cont'd)‏ 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.


Download ppt "Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original."

Similar presentations


Ads by Google