Resolution in Propositional Logic - PowerPoint PPT Presentation

1 / 48
About This Presentation
Title:

Resolution in Propositional Logic

Description:

Proof by contradiction: 1) negate the statement to be proved: ~(p or r) ... Negate (p and (q or r)) and convert to clause form: ... – PowerPoint PPT presentation

Number of Views:85
Avg rating:3.0/5.0
Slides: 49
Provided by: douglasa2
Category:

less

Transcript and Presenter's Notes

Title: Resolution in Propositional Logic


1
Resolution in Propositional Logic
  • Includes slides from
  • CSC 4240 TTU Fall 2002.ppt,
  • 433-255 Propositional logic 5.ppt,
  • Intermediate logic Feb 18 2003.ppt

2
  • Resolution is a refutation procedure.
  • For a set of clauses (disjunctions of literals)
    tests satisfiability.
  • Refutation complete.

3
Convert KB into CNF -- clause form, and break
into clauses
a. Replace equivalence signs by equivalent
implication expressions p q p ? q
and q ? p) b. Replace implication signs by
equivalent or expressions (p?q) or (r?
p) (p or q) or (r or p) c. Push
negations in and eliminate (p or q) or
(r or p) (p and q) or (r or p)
(p and q)
or (r or p)
d. Convert to CNF by using associative and
distributive laws (p and q) or (r or p)
(p or r or p) and (q or r or p)
(p or r) and (q
or r or p) e. Write as a list (conjunction) of
clauses (p or r), (q or r or p)
4
The key idea behind resolution
  • consider the formulae (?A ? B) and (?B ? C)
  • If B is true then ?B is false and the truth of
    the second formula depends only on C.
  • If B is false then the truth of the first formula
    depends only on A.
  • only one of B, ?B is true, so if (?A ? B) and
    (?B ? C) are both true, theneither ?A is true
    or C is true, i.e. (?A ? C) is true.

WHY??
both these true
this true
5
The Resolution Principle/Rule
  • Given a set of clauses, where
  • a clause is a set of literals.
  • Clauses C1 and C2 are resolved using the
    resolution rule. The resulting clause is the
    resolvent of C1 and C2 res(C1 , C2).

? ? C1
? ? C2
res(C1, C2) C1- ? ? C2- ?
  • C1 and C2 might have many resolvents.
  • In a set of clauses the set stands for
    conjunction.
  • In a clause is a set of literals the set
    stands for disjunction.

6
Resolution terminology
  • clause -- a finite set of literals represents a
    disjunction e.g. A, ?B represents A ? ? B
  • clause set -- a set of clauses represents a CNF
    formula e.g. A, ?B, B, C, A for (A
    ? ? B)?(B ? C)?A
  • empty clause is denoted ?. It represents an
    always false formula, since
  • A, ?B A ? ? B A ? ? B ? False A, ?B,
    False
  • Therefore ? False False
  • Property of the resolution rule C1 ? C2
    res(C1 , C2 )
  • ? resolution is a sound rule of inference.

7
The key idea behind refutations
both these true
this true
  • If (?A ? C) is false, then one of (?A ? B) or
    (?B ? C) must be false -- using the
    contrapositive of the observation before.

8
The key idea behind refutations, ctd.
  • If there is a model for C1 and C2, then there is
    a model for C1, C2, res(C1, C2).
  • In resolution refutations, you repeatedly
    cancel out B with ?B and seek ?.
  • If you reach ? you can argue backwards to
    concludethe starting formulae were
    inconsistent they have no model!

9
  • Literals L and ?L are called complementary.
  • Resolvent of two clauses containing complementary
    literals is their union omitting L and ?L.
  • eg., C1A, B, C2?A,E resolvent B,E
  • eg., C3 A,B, ?C, C4 ?A,C
  • one resolvent of C3 and C4 is B, ?C, C
  • another resolvent of C3 and C4 is A,B, ?A
  • but B is not a resolvent of C3 and C4

10
Using resolution to establish unsatisfiability
  • show A,B, ?C, ?A, A,B,C, A, ?B
    unsat

11
Using resolution to establish unsatisfiability
  • show A,B, ?C, ?A, A,B,C, A, ?B unsat
  • B, ?C B, C
    ?B

12
Using resolution to establish unsatisfiability
  • show A,B, ?C, ?A, A,B,C, A, ?B unsat
  • B, ?C B, C
    ?B
  • ?C
    C

13
Using resolution to establish unsatisfiability
  • show A,B, ?C, ?A, A,B,C, A, ?B unsat
  • B, ?C B, C
    ?B
  • ?C
    C

  • ?

14
Using resolution to establish unsatisfiability
  • show A,B, ?C, ?A, A,B,C, A, ?B unsat
  • 1. A, B, ?C2. ?A3. A,B,C4. A, ?B
  • 5. ?B 2, 4
  • 6. B, C 2, 3
  • 7. B, ?C 2, 1
  • 8. C 5, 6
  • 9. ?C 5, 7
  • 10. ? 8, 9

15
Using resolution to establish logical implication
  • Algorithm for establishing KB F
  • Negate F.
  • put KB ? ?F in conjunctive normal form.
  • put this in clause form.
  • apply resolution repeatedly.
  • if eventually you get ? then KB F.
  • otherwise KB F .
  • How can you be sure that this procedure
    terminates?

16
Using resolution to establish logical implication
  • show (? B ? (A ?? B)) ?A.

17
Using resolution to establish logical implication
  • show (? B ? (A ?? B)) ?A valid
  • consider ?(? B ? (A ?? B)), ? ? A
  • convert to CNF
  • ?B ? (?A ? B)) ? A
  • clausal form is then ?B, ?A, B, A

18
Using resolution to establish logical implication
  • show (? B ? (A ?? B)) ?A.
  • consider ? (? B ? (A ?? B)), ? ? A
  • convert to CNF
  • ?B ? (?A ? B)) ? A
  • clausal form is then ?B, ?A, B, A

  • B
  • ?
  • i.e. the original formula is logically implied.

19
Using resolution to establish logical implication
  • show (? B ? (A ?? B)) ?A.
  • consider ?(? B ? (A ?? B)), ? ? A.
  • convert to CNF
  • ?B ? (?A ? B)) ? A

  • alternative layout
  • clausal form is then ?B, ?A, B, A
    1. ?B

  • 2. ?A, B

  • B 3. A

  • 4. ?A 1, 2
    ?
    5. ? 3,4
  • i.e. the original formula is valid

20
Soundness and Completeness of Resolution
  • It can be shown that a clause set is
    unsatisfiable if and only if the empty clause
    (which is a generalized disjunction of 0
    disjuncts, which is a contradiction) can be
    resolved from that clause set.

21
Resolutions as Derivations
A, B
1.
A ? (B ? C)
(A ? B) ? (A ? C)
?
?
A, C
2.
?A, D, E
3.
(A ? B) ? (D ? E)
(?A ? D ? E) ? (?B ? D ? E)
?
?B, D, E
4.
?
?
?E
?E
?
5.
?(A ? B) ? (D ? E)
(?A ? ?B) ? (D ? E)
?
?A
?A
?
6.
?C, ?D
?(C ? D)
?
?C ? ?D
?
7.
B
1,6
8.
C
2,6
9.
D, E
4,8
10.
D
5,10
11.
?D
7,9
12.

11,12
13.
22
Resolution is not complete For example, we
cannot prove p and r - p or r using resolution
alone (there is nothing to resolve). However,
resolution is refutation complete. That is,
resolution can be used alone in proofs by
contradiction (refutation) to prove statements
that logically follow from the axioms. Given p
and r, which is written in clause form as p,
r Prove (p or r) Proof by contradiction 1)
negate the statement to be proved (p or r)
2) write the
negated statement in clause form
(p or r) p and r ?
p, r 3)
add these new clauses to set of axioms (KB)
4) show a
contradiction p (axiom) resolved with p ?
contradiction (conclude (p or r) true)
23
Axioms(KB) s or p u or s u w
or r w Prove p and (q or r) We cannot
prove with resolution alone without refutation,
since we have no way of introducing q, though we
can make use of resolution and other inference
rules to show that it must be true. p must be
true u or s u s or p r must be
true w or r w
s
r
p
so (q or r) is true


by the inference

rule of
or-introduction
so p
and (q or r) is true by

inference rule of and-introduction
24
Axioms(KB) s or p u or s u w
or r w Prove p and (q or r) (prove with
resolution alone under refutation)
Negate (p and (q or r)) and convert to clause
form (p and (q or r)) p or (q or r)
p or (q and r) (p or q) and
(p or r) two clauses (p or q),
(p or r)
w or r p or r s or p u or s
u w p or q w or p
w or s
w or u
w

Contradiction
25
Axioms s or p, u or s, u, w or r, w
Negated Sentence p or q, p or r
Search for a resolution-refutation proof
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvants
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
26
Axioms s or p, u or s, u, w or r, w
Negated Sentence p or q, p or r
Search for a resolution-refutation proof
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
27
Axioms s or p, u or s, u, w or r, w
Negated Sentence p or q, p or r
Search for a resolution-refutation proof
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u)
w ..
28
Axioms s or p, u or s, u, w or r, w
Negated Sentence p or q, p or r
Search for a resolution-refutation proof
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u)
w ..
NULL (Contradiction)
29
Breadth-first search start with 0-level
resolvents, I -1
do II1
Initialize I1 level resolvents
for each I-level
resolvent, R
if R is contradiction then exit
(proposition true)
for each other J-level resolvent (J
lt I), S
add resolve(R,S) to I1 level
resolvents
until no change in I and I1 level resolvents
exit (proposition
false) Depth-first search(0-level resolvents)
for each resolvent, R P DFS(R, 0-level
resolvents) if P indicates success
(contradiction found) then exit success exit
failure DFS(R, resolvents) if R a contradiction
then exit/return (proposition true) for each
resolvent, S xresolve(R,S)
if x NOT IN resolvents P
DFS(x, resolventsx) if P
indicates success (contradiction found) then exit
success exit failure (no contradiction found)

30
Illustration of depth-first search for proof
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u)
w ..
NULL
31
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u)
w ..
NULL
32
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u)
w ..
NULL
33
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u) (p or
s).. w ..
NULL
34
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u) (p or s)(p or
u or s) w ..
NULL
35
After much search
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u)
w ..
NULL
36
After more search
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r u or r..
(p or s or u) . (p or u)
w ..
NULL
37
After more search
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r u or r..
(p or s or u) . (p or u)
w r..
NULL
38
After more search
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r u or r..
(p or s or u) . (p or u)
w r..
NULL w
39
After more search
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r u or r..
(p or s or u) . (p or u)
w r..
NULL w
NULL
40
You might be tempted to think from the last
example, that in a DFS we need only resolve the
current clause (R is pseudocode earlier) with the
0-level clauses (axioms negated sentence). If
you restricted yourself to this, then your
algorithm would certainly not be
complete. Consider the following axioms p or
q, p or q, p or q Prove p and q
Negation (p and q) equivalent to (p or
q) Attempt a DFS proof in which the current
clause is always paired with a level-0 clause
p or q p or q p or q p or q
q p
q
p
Start repeating and conclude no proof after much
search
41
You might be tempted to think from the last
example, that in a DFS we need only resolve the
current clause (R is pseudocode earlier) with the
0-level clauses (axioms negated sentence). If
you restricted yourself to this, then your
algorithm would certainly not be
complete. Consider the following axioms p or
q, p or q, p or q Prove p and q
Negation (p and q) equivalent to (p or
q) Attempt a DFS proof in which the current
clause is always paired with a level-0 clause
p or q p or q p or q p or q
p or q p or q p or q p or q
q
q
p
p q

q
p
NULL
Start repeating and conclude no proof after much
search
These in resolvents set too
42
Set of support strategy at least one resolvent
is a clause of the original negated sentence or a
descendent of such a clause. The DFS-generated
proofs of the previous pages satisfy the
set-of-support constraint, as does the proof
below, but the one below could not have been
found by DFS (as defined earlier).
s or p, u or s, u, w or r, w, p or q, p
or r 0-level resolvents
(p or u) (s or p or u) (s or p or w or r)
(s or p or w) (s or q) (s or r) s (p or
q or r)
(p or s or u) (p or u or s) p (p or s)
(p or u or s or w or r) . r ..
(p or s or u) . (p or u)
w ..
NULL
43
Depth-first search(0-level resolvents) for
each resolvent, R P DFS(R, 0-level
resolvents) if P indicates success
(contradiction found) then exit success exit
failure DFS(R, resolvents) if R a
contradiction then exit/return (proposition
true) for each resolvent, S
xresolve(R,S) if x NOT IN
resolvents P DFS(x,
resolventsx) if P indicates
success (contradiction found) then exit
success exit failure (no contradiction found)

Distinguish axioms and clauses of negated
sentence and Axioms and set-of-support
Add x to set-of-support for recursive calls to
DFS, but this addition needs to be
retracted after the recursive call terminates
Return proof steps, not simply success or failure
44
Resolutions as Decision Procedures
  • Resolution can be made into a decision procedure
    by systematically exhausting all possible
    resolvents (of which there are finitely many).
  • This will not be very efficient unless we add
    some resolution strategies.

45
Resolution Strategies
  • Clause Elimination Strategies
  • Tautology Elimination
  • Subsumption Elimination
  • Pure Literal Elimination
  • Resolving Strategies
  • Unit Preference Resolution
  • Linear Resolution
  • Ordered Resolution
  • Etc.

46
Tautology Elimination
  • A tautologous clause is a clause that contains an
    atomic statement as well as the negation of that
    atomic statement.
  • Obviously, for any tautologous clause C, any
    truth-value assignment is going to satisfy C.
  • Hence, with S any clause set, and with S the
    clause set S with all tautologous clauses
    removed S is satisfiable if and only if S is
    satisfiable.

47
Subsumption Elimination
  • A clause C1 subsumes a clause C2 if and only if
    every literal contained in C1 is contained in C1,
    i.e. C1 ? C2.
  • Obviously, if C1 subsumes C2 , then any
    truth-value assignment that satisfies C1 will
    satisfy C2.
  • Hence, with S any clause set, and S the clause
    set S with all subsumed clauses removed S is
    satisfiable if and only if S is satisfiable.

48
Pure Literal Elimination
  • A literal L is pure with regard to a clause set S
    if and only if L is contained in at least one
    clause in S, but ?L is not.
  • A clause is pure with regard to a clause set S if
    and only if it contains a pure literal.
  • Obviously, with S any clause set, and with S the
    clause set S with all pure clauses removed S is
    satisfiable if and only if S is satisfiable.

49
Unit Preference Resolution
  • A unit clause is a clause that contains one
    literal.
  • Unit preference resolution tries to resolve using
    unit clauses first.
Write a Comment
User Comments (0)
About PowerShow.com