I Rule of resolution III Resolution refutation Figures are from the textbook site unless the source is specifically cited IV Horn clauses II Conjunctive normal forms I Resolution An inference algorithm ID: 929417
Download Presentation The PPT/PDF document "Proof Using Resolution Outline" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Proof Using Resolution
Outline
I. Rule of resolution
III. Resolution refutation
* Figures are from the
textbook site
unless the source is specifically cited.
IV. Horn clauses
II. Conjunctive normal forms
Slide2I. Resolution
An inference algorithm
is
sound
if
whenever
complete
if
whenever
resolution
+ a complete search algorithm
a complete inference algorithm
single inference rule
Inference rules covered so far are sound.
The inference algorithms using them may not be complete.
Slide3Wumpus World Revisited
Agent:
//
Rules
KB:
Added to KB via inferences
Slide4(cont’d)
Add to KB:
stench but no breeze
Similarly, as in deriving
biconditional elimination
Slide5Resolvent
resolving the two literals that are
negations of each other
(
resolvent
)
If there’s a pit in one of
and
and it’s not in
then it’s in
or
Simple Resolution Rule
(
and
are complementary
literals, i.e.,
or
.)
Since
is true, then
must be false. But one of
must be true.
Therefore, we can exclude
and assert that one of the remaining
literals must be true.
Clause
: a disjunction of literals.
Unit clause
: a single literal.
Full Resolution Rule
If
is true, then
is false. Hence
must be true.
If
is false, then
must be true.
and
are complementary literals:
One Pair at a Time
Only one pair of complementary literals can be resolved at each step.
true
Incorrect conclusion!
Slide9II. Conjunctive Normal Form
The resolution rule applies to clauses only.
Every sentence of propositional logic is equivalent to a
CNF.
Conjunctive normal form
(CNF): a conjunction of clauses
Slide10Converting to CNF
1. Eliminate
.
replaced with
2. Eliminate
.
3. Move
inwards, repeatedly applying
4. Apply the distributivity law
CNF Conversion Algorithm (Optional)
C
onstruction is similar to the algorithm employing
a stack
to convert an infix expression into a postfix
expression (Com S 228).
Instead of outputting an operator after its two operands in the postfix format,
now you just make the logical operator the parent of the two roots of the subtrees
that store the same operator’s subexpression operands.
(infix expression)
(postfix expression)
Operators (connectives):
Operands (atomic sentences):
Parse every propositional sentence in the KB as an arithmetic
expression to construct an
expression tree
(Com S 228).
Slide12Postorder Traversal
Perform a
postorder
traversal of the expression tree.
Conversion is done in five cases depending on the logical operator
stored at
.
When visiting
an internal node
(representing a connective), its left
and right children (or its unique child in the case of a
node)
store the CNFs for the expressions represented by the left and right subtrees.
Case 1
The node
stores
.
CNF
Slide14Case 2
The node
stores
.
Case 3
The node
stores
.
If
is a negative literal, i.e.,
, then
reduces to
because the two occurrences of
cancel out.
Case 4
The node
stores
.
Logically equivalent to
First, c
onvert
into conjunctive normal form
(see case 3).
Then,
convert the disjunction
into conjunctive normal
form (see case 2)
Case 5
The node
stores
.
Logically equivalent to
C
onvert
and
separately into conjunctive
normal forms
and
(see case 4).
Return
Example
has the following conjunctive normal form:
III. Proof by Resolution – An Example
KB
:
Q
:
KB
?
Converting sentences to CNF
Spilt each conjunction into clauses.
KB
:
KB
:
Proof by Resolution
KB
(updated):
(1)
(2)
(3)
(4
)
(5)
(6)
(7)
(8)
(1)
(2)
(3)
(4)
resolve
Resolution tree
Slide21Resolution Refutation
(Proof by contradiction)
To show that
KB
, we show that
KB
is unsatisfiable. .
KB (about a summer day):
(1) If it is raining and you are outside then you will get wet.
(2) If it is warm and there is no rain then it is a pleasant day.
(3) You are not wet.
(4) You are outside.
(5) It is a warm day.
It is a pleasant day.
Prove
* Example taken from http://watson.latech.edu/book/intelligence/intelligenceApproaches2b2.html
Slide22KB in Propositional Sentences
(1) ( rain ∧ outside ) ⇒ wet
(2) ( warm ∧
rain ) ⇒ pleasant
(3)
wet
(4) outside
(5) warm
KB (rewritten):
We add
pleasant
to KB and try to derive an
empty clause
.
(1)
rain ∨ outside ∨ wet(2)
warm ∨ rain ∨ pleasant
(3)
wet
(4) outside (5) warm
converted into clauses
Slide23Resolution Refutation Tree
pleasant
(2)
warm ∨ rain ∨
pleasant
warm
∨ rain
(5)
warm
rain
(1)
rain
∨
outside ∨ wet
outside
∨ wet
(4)
outside
wet
(3)
wet
contradiction!
(empty clause)
Slide24Proving
in the Wumpus World
Resolution Algorithm
The process ends in one of two situations below:
No new clauses can be added, in which case
KB
does not entail
Two clauses resolve to yield the empty clause, in which case
KB
entails
.
// no new clauses can be added.
Slide26Completeness of Resolution
Given a set of clauses
S
, its
resolution closure RC
includes all theclauses in
as well as all the resolvents from repeated applicationsof the resolution rule.
RC
is
finite
because only
distinct clauses can be constructed out of
propositional symbols appearing in
S
.
Ground Resolution Theorem: If is unsatisfiable, then RCcontains the empty clause
.
Constructive proof by explicitly generating an assignment for
if RC
IV. Horn Clauses
A clause is called a
Horn clause
if it contains
positive literal.
rain ∨
outside ∨ wet
rain
outside
wet
true
Definite clause
(
positive literal and
negative literal)
Fact
(
positive literal and
negative literal)
Goal clause
(
positive literal and
negative literal)
false
: positive literal
: negative literal
Why Horn Clauses?
Every definite clause can be written as an implication.
Horn clauses are the basis of logic programming, and play an
important role in automated theorem proving.
Q :- P1, P2, …, Pk.
(Prolog programming language)
Horn clauses are
closed
under resolution, i.e., the resolvent of a Horn
clause is still a Horn clause.
(cont’d)
Inferences with Horn clauses are through
forward- and backward-
chaining algorithms.
Logic programming
(natural inference steps easy for humans to follow)
Low computational complexity
: deciding entailment with Horn clauses
takes
time.
size of the KB