0% found this document useful (0 votes)
31 views21 pages

Pred Resolution

Uploaded by

Karus Insania
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views21 pages

Pred Resolution

Uploaded by

Karus Insania
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Proofs in Predicate Logic:

Extending Resolution

Resolution 315/448
Resolution Reprise

Recall resolution for propositional logic:

• Convert the premises and the negation of the conclusion into


Conjunctive Normal Form.
• Use the resolution rule α ∨ p ¬p ∨ β repeatedly.
α∨β
• One of the following will happen.
− The empty clause is derived. The conclusion is proved.
− No new clauses can be formed. A satisfying valuation exists.

Enhancements for predicate logic:

• In conversion to CNF, allow for quantifiers on variables.


• Resolve on atomic formulas, containing arbitrary terms.
• Re-assess the possible outcomes.

Resolution 316/448
Literals in Predicate Logic

In predicate logic, a literal is an atomic formula or the negation of one.


When do literals comflict?

• R(c) and ¬R(c) definitely conflict.


• Q( f (c)) and ¬Q(c) are compatible, in general.
• P( f (c)) and ¬P(x) conflict when x has value f (c).

Convention:

All variables are treated as universally quantified (by ∀).

We deal with possible values of variables by substitution.

Resolution Extending the Resolution Rule 317/448


Substitution: Example

Given: two clauses P( f (c)) ∨ Q( y) and ¬P(x) ∨ R(g(x)).


Replace x by f (c) in the second clause: ¬P( f (c)) ∨ R(g( f (c))).
Now apply the resolution rule, yielding the new clause Q( y) ∨ R(g( f (c))).

In some cases, we must make several substitutions in order to apply the


resolution rule. E.g., if we have Q(x, c) and ¬Q(a, y), then we must
substitute for both x and y .

Resolution Extending the Resolution Rule 318/448


Unification of Terms

Goal: given terms t 1 and t 2 , determine whether there are substitutions


for the variables that make the terms the same.

Finding such a substitution is called unification of the terms.


The substitution itself is called a unifier.

Resolution Extending the Resolution Rule 319/448


Examplecises
Unify the literals P( f (x), g( y)) and ¬P( f ( f (a)), g(z)).

Resolution Extending the Resolution Rule 320/448


Examplecises
Unify the literals P( f (x), g( y)) and ¬P( f ( f (a)), g(z)).

Substitution: [ f (a)/x] [z/ y]


(or [ f (a)/x] [ y/z], or [ f (a)/x] [u/ y] [u/z])

What clause results from resolving the clauses

P( f (x), g( y)) ∨ Q(x, y) and ¬P( f ( f (a)), g(z)) ∨ Q( f (a), z) ?

Resolution Extending the Resolution Rule 320/448


Examplecises
Unify the literals P( f (x), g( y)) and ¬P( f ( f (a)), g(z)).

Substitution: [ f (a)/x] [z/ y]


(or [ f (a)/x] [ y/z], or [ f (a)/x] [u/ y] [u/z])

What clause results from resolving the clauses

P( f (x), g( y)) ∨ Q(x, y) and ¬P( f ( f (a)), g(z)) ∨ Q( f (a), z) ?

Q( f (a), z) ∨ Q( f (a), z), which is equivalent to simply Q( f (a), z).

Resolution Extending the Resolution Rule 320/448


Examplecises
Unify the literals P( f (x), g( y)) and ¬P( f ( f (a)), g(z)).

Substitution: [ f (a)/x] [z/ y]


(or [ f (a)/x] [ y/z], or [ f (a)/x] [u/ y] [u/z])

What clause results from resolving the clauses

P( f (x), g( y)) ∨ Q(x, y) and ¬P( f ( f (a)), g(z)) ∨ Q( f (a), z) ?

Q( f (a), z) ∨ Q( f (a), z), which is equivalent to simply Q( f (a), z).

Literals P(g( y), f (x, h(x), y)) and P(u, f (g(z), w, z)).

Resolution Extending the Resolution Rule 320/448


Examplecises
Unify the literals P( f (x), g( y)) and ¬P( f ( f (a)), g(z)).

Substitution: [ f (a)/x] [z/ y]


(or [ f (a)/x] [ y/z], or [ f (a)/x] [u/ y] [u/z])

What clause results from resolving the clauses

P( f (x), g( y)) ∨ Q(x, y) and ¬P( f ( f (a)), g(z)) ∨ Q( f (a), z) ?

Q( f (a), z) ∨ Q( f (a), z), which is equivalent to simply Q( f (a), z).

Literals P(g( y), f (x, h(x), y)) and P(u, f (g(z), w, z)).

Substitution: [g( y)/u] [g(z)/x] [h(g(z))/w] [z/ y]


(or variations).
Resolution Extending the Resolution Rule 320/448
A Full Refutation
1. ¬P1 (x) ∨ Q(x) ∨ R1 (x, f (x)) Premise
2. ¬P1 (x) ∨ Q(x) ∨ R2 ( f (x)) Premise
3. P2 (a) Premise
4. P1 (a) Premise
5. ¬R1 (a, y) ∨ P2 ( y) Premise
6. ¬P2 (x) ∨ ¬Q(x) Premise
7. ¬P2 (x) ∨ ¬R2 (x) Premise
8. ¬Q(a) 3, 6; [a/x]
9. Q(a) ∨ R2 ( f (a)) 2, 4; [a/x]
10. R2 ( f (a)) 8, 9
11. Q(a) ∨ R1 (a, f (a)) 1, 4; [a/x]
12. R1 (a, f (a)) 8, 11
13. P2 ( f (a)) 5, 12; [ f (a)/ y]
14. ¬R2 ( f (a)) 7, 13; [ f (a)/x]
15. ⊥ 10, 14

Resolution Extending the Resolution Rule 321/448


The Resolution Rule, with Unification

Consider an atomic formula and a negated atomic formula with the


same predicate:
R(t 1 , . . . , t k ) and ¬R(s1 , . . . sk ) .
where the free variables are x 1 , . . . , x i .
Suppose there are terms r1 , . . . , ri such that the substitutions

[r1 /x 1 ] ... [ri /x i ]

yield t j [r1 /x 1 ] . . . [ri /x i ] = s j [r1 /x 1 ] . . . [ri /x i ], for each 1 ≤ j ≤ k. Then

α ∨ R(t 1 , . . . , t k ) ¬R(s1 , . . . sk ) ∨ β
(α ∨ β)[r1 /x 1 ] . . . [ri /x i ]

is an instance of the resolution rule.

Resolution Extending the Resolution Rule 322/448


Why Does the Rule Work?

Lemma: If some interpretation I and environment E satisfy


 
∀x 1 · . . . ∀x i · R(t 1 , . . . , t k ) ∨ α ∧ ∀x 1 · . . . ∀x i · ¬R(s1 , . . . , sk ) ∨ β ,

and for every j we have t j [r1 /x 1 ] . . . [ri /x i ] = s j [r1 /x 1 ] . . . [ri /x i ], then I


and E also satisfy
(α ∨ β)[r1 /x 1 ] . . . [ri /x i ] .

Proof (outline): The assumption implies that I and E satisfy

(R(t 1 , . . . , t k ) ∨ α)[r1 /x 1 ] . . . [ri /x i ] ∧


(¬R(s1 , . . . , sk ) ∨ β)[r1 /x 1 ] . . . [ri /x i ].

The simple resolution rule gives the result.

Resolution Extending the Resolution Rule 323/448


Handling Quantifiers

Recall that we have assumed that all variables have universal quantifiers.

• If a given formula contains a free variable, we replace it by a fresh


constant.
(Equivalently, simply declare the symbol to be a constant.)
• If a given formula contains “ ∀”, then we will simply remove it.
• But what about “ ∃”?

If we have only ∃ quantifiers, we can replace the variables by fresh


constants. If ∃x · α is satisfiable, and constant symbol c does not occur
in α, then α[c/x] is satisfiable.
But this fails if ∀ quantifiers are present. . . .

Resolution Conversion to CNF 324/448


Skolem Functions
In general, a quantifier ∃x is replaced by a “Skolem function”.∗
Suppose that a formula has an existential quantifier inside of k universal
quantifiers:
∀ y1 · . . . ∀ yk · ∃x · α .
Let “ f (k) ” be a fresh function symbol, not used elsewhere. The Skolem
form of the formula is
∀ y1 · . . . ∀ yk · α[ f ( y1 , . . . , yk )/x] .

Example: The Skolem form of



∀ y · ∃x · P( y) → Q(x, y)

is 
∀ y · P( y) → Q( f ( y), y) .

∗ Named for Thoralf Skolem, who invented this technique.


Resolution Conversion to CNF 325/448
Why Do Skolem Functions Work?

Lemma: If I |= E ∀ y1 · . . . ∀ yk · ∃x · α, and f is a fresh function symbol,


then I can be augmented to I 0 (with a definition of f ) such that

I 0 |= E ∀ y1 · . . . ∀ yk · α[ f ( y1 , . . . , yk )/x] .

“Proof by example”: Let k = 1 and α is (P( y) → Q(x, y)). Suppose that

P I is the predicate “is even”, and


QI is “twice the first number equals the second”,
0
then a suitable function for f I is “half-of”:
¨
z/2 if z is even
f (z) =
〈arbitrary 〉 otherwise.

Resolution Conversion to CNF 326/448


Conversion to CNF

1. Re-name bound variables, so that each quantifier uses a different


variable.
2. Eliminate → and ↔ as before.
3. Push negation to literals.
Replace ¬(∃x · α) by ∀x · ¬α.
Replace ¬(∀x · α) by ∃x · ¬α.
4. Replace existentially quantified variables by their Skolem functions.
Then remove universal quantifiers.
5. Transform into a conjunction of clauses, and simplify.

Resolution Conversion to CNF 327/448


Possible Outcomes of Resolution

When doing a resolution proof, there are three things that might
happen.

1. A contradiction is reached.
2. No new formulas can be derived by resolution.
3. Neither of the above — the process simply continues.

In the first case, the original set of formulas was inconsistent.


(Proof from the two lemmas.)

Resolution Conversion to CNF 328/448


When Resolution “Gets Stuck”

As in the propositional case, when no further formulas can be derived,


and no contradition has been found, we can find a satisfying
interpretation and environment.

Domain: the set of ground terms that appear.


(A “ground” term is one that has no variables.)
Values of constants: themselves.
Values of functions: themselves.
Values of relations: as required.

When a choice exists, any one can work.

Resolution Conversion to CNF 329/448


Resolution May Not Terminate

Since there are function symbols, the number of possible terms (and
atomic formulas) is infinite. Sometimes, applying resolution may never
end—there are always new formulas to create.
Example: Assume PA1 and PA2. In CNF, these are

1. ¬ s(x) = 0

2. ¬ s( y) = s(z) ∨ y = z .

Steps of resolution:

3. ¬ s(s(x)) = s(0) 1, 2: [s(x)/ y] [0/z]

4. ¬ s(s(s(x))) = s(s(0)) 2, 3: [s(s(x))/ y] [s(0)/z]

5. ¬ s(s(s(s(x)))) = s(s(s(0))) 2, 4: [s(s(s(x)))/ y] [s(s(0))/z]
..
. etc.

Resolution Conversion to CNF 330/448


Resolution for Predicate Logic Is Not an Algorithm

By definition, an “algorithm” must always produce an answer eventually.


The resolution method sometimes continues forever.
It is not an algorithm.
We shall see later:

No algorithm exists, that can always determine whether or not


Σ |= ϕ , for given assumptions Σ and conclusion ϕ .

In other words, entailment of formulas in Predicate Logic is undecidable.

Resolution Conversion to CNF 331/448

You might also like