Unit-3 - C - Resolution in Propositional Logic in Detail
Unit-3 - C - Resolution in Propositional Logic in Detail
Inference by Resolution
• KB is represented in CNF
– KB = AND of all the sentences in KB
– KB sentence = clause = OR of literals
– Literal = propositional symbol or its negation
• Find two clauses in KB, one of which contains a literal and the
other its negation
– Cancel the literal and its negation
– Bundle everything else into a new clause
– Add the new clause to KB
– Repeat
Conjunctive Normal Form (CNF)
• Boolean formulae are central to CS
– Boolean logic is the way our discipline works
• Two canonical Boolean formulae representations:
– CNF = Conjunctive Normal Form
Clause
• A conjunct of disjuncts = (AND (OR …) (OR …) )
• “…” = a list of literals (= a variable or its negation)
• CNF is used by Resolution Theorem Proving
– DNF = Disjunctive Normal Form
• A disjunct of conjuncts = (OR (AND …) (AND …) ) Term
• DNF is used by Decision Trees in Machine Learning
• Can convert any Boolean formula to CNF or DNF
Conjunctive Normal Form (CNF)
KB |=
We’d like to prove:
(This is equivalent to KB is unsatisfiable.)
Is the conclusion
literals
A “conjunction of disjunctions”
(A B) (B C D)
Clause Clause
– (X Y) = [(X Y) (Y X)]
– (X Y) = (X Y)
Review: de Morgan's rules
• How to bring inside parentheses
– (1) Negate everything inside the parentheses
– (2) Change operators to “the other operator”
• Find two clauses in KB, one of which contains a literal and the
other its negation
– Cancel the literal and its negation
– Bundle everything else into a new clause
– Add the new clause to KB
– Repeat
Resolution = Efficient Implication
Recall that (A => B) = ( (NOT A) OR B)
and so:
(Y OR X) = ( (NOT X) => Y)
( (NOT Y) OR Z) = (Y => Z)
which yields:
( (Y OR X) AND ( (NOT Y) OR Z) ) |= ( (NOT X) => Z) = (X OR Z)
P2,1 P1,2
True!
A sentence in KB is not “used up” when it is used in a False in
resolution step. It is true, remains true, and is still in KB. all worlds
Detailed Resolution Proof Example
• In words: If the unicorn is mythical, then it is immortal, but if
it is not mythical, then it is a mortal mammal. If the unicorn is
either immortal or a mammal, then it is horned. The unicorn is
magical if it is horned.
Prove that the unicorn is both magical and horned.
• Of course, there are many other proofs, which are OK iff correct.
Detailed Resolution Proof Example
Graph view of proof
( ¬ Y ¬ R ) ( Y R ) ( Y M ) ( R H ) ( ¬ M H ) ( ¬ H G ) (¬ G ¬ H )
( ¬R M ) (¬H)
(HM)
(H)
( )
Detailed Resolution Proof Example
Graph view of a different proof
• ( ¬ Y ¬ R ) ( Y R ) ( Y M ) ( R H ) ( ¬ M H ) ( ¬ H G ) (¬ G ¬ H )
(¬H)
(¬M)
(Y)
(¬R)
(H)
( )