Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Logic in Computer Science
Chapter 3
Propositional Logic
3.6. Propositional Resolution
Transparency No. 3.3-1
Logic in Computer Science
Ch 3. Propositional Logic
Propositional Resolution (another Propositinal calculus)
a single rule of inference:
P => Q , Q => R
-------------------------P => R
Using propositional resolution alone (without axiom schemata
or other rules of inference), it is possible to build a theorem
prover that is sound and complete for All propositional
Calculus .
The search space using propositional resolution is much
smaller than for standard propositional calculus (like H).
works only on expressions in clausal form.
General procedure to convert wffs into clausal forms
introduced before.
Transparency No. 3.1-2
Logic in Computer Science
Ch 3. Propositional Logic
Clausal Form revisited
A literal is either an atomic sentence or a negation of an
atomic sentence.
p
-p
A clause is either a literal or a disjunction of literals.
p
-p
p \/ q \/ r
Clauses are usually written as sets of literals.
{ p} ,
{ -p} ,
{ p,q,r }
A database in clausal form is a set of clauses.
{{-p,q},{r,-q}}
Transparency No. 3.1-3
Empty Sets
Logic in Computer Science
Ch 3. Propositional Logic
The empty clause {} is unsatisfiable.
Why: It is equivalent to an empty disjunction.
The empty database {} is valid.
Why: It is equivalent to an empty conjunction.
What about a database consisting of an empty clause {{}}?
Transparency No. 3.1-4
Conversion to Clausal Form
Logic in Computer Science
Ch 3. Propositional Logic
Implications out:
P1 -> P2 ---> ~P1 \/ P2
P1 <-> P2 ---> (~P1 \/ P2) /\ (P1 \/ ~P2)
Negations in:
~~P
---> P
~(P1 /\ P2) ---> ~P1 \/ ~P2
~(P1 \/ P2) ---> ~P1 /\ ~P2
Disjunctions in:
P1 \/ (P2 /\ P3) ---> (P1 \/ P2) /\ (P1\/ P3)
Operators out:
P1 \/ P2
P1 /\ P2
--->
--->
{P1,P2}
{P1} , {P2}
Transparency No. 3.1-5
Logic in Computer Science
Ch 3. Propositional Logic
Examples
Example 1:
I (g & (~r | f))
N
D
O { g} , {~r,f}
Example 2:
(g & (r -> f))
~(g & (r -> f))
I ~(g & (~r | f))
N (~g | ~(~r | f))
(~g | (~~r & ~f))
(~g | (r & ~f))
D (~g | r) & (~g | ~f)
O {~g, r} , {~g, ~f}
Transparency No. 3.1-6
Propositional Resolution
Logic in Computer Science
Ch 3. Propositional Logic
General form:
{p1,..., r,...,pm}
{q1,...,~r,...,qn}
--------------------{p1,...,pm,q1,...,qn}
Example:
{Office, Home}
{~Home,Sick}
---------------------{Office,Sick}
Transparency No. 3.1-7
Logic in Computer Science
Ch 3. Propositional Logic
Issues
Collapse:
{~p,q}
{p,q}
-----------{q}
Multiple Conclusions:
{p,q}
{~p,~q}
------------{p,~p}
{q,~q}
Single Application Only:
{p,q}
{~p,~q}
------------{}
NO!
Transparency No. 3.1-8
Special Cases of Propositional Resolution
Logic in Computer Science
Ch 3. Propositional Logic
Modus Ponens:
p => q
p
---------q
{-p,q}
{p}
----------------{q}
Modus Tollens:
p => q
-q
----------p
Chaining:
{-p,q}
{-q}
-----------{-p}
p => q
q => r
---------p => r
{-p,q}
{-q,r}
------------{-p,r}
Transparency No. 3.1-9
Unsatisfiability
Example:
1. {p,q}
2. {-p,q}
3. {p,-q}
4. {-p,-q}
5. {q}
6. {-q}
7. {}
Logic in Computer Science
Ch 3. Propositional Logic
premise
premise
premise
premise
1,2
3,4
5,6
Transparency No. 3.1-10
True or False Questions
Logic in Computer Science
Ch 3. Propositional Logic
Theorem: T |= A iff T U {~A} is unsatisfiable.
Application: To determine whether a set T of sentences
logically implies a sentence A, rewrite T U {-s} in clausal form
and try to derive the empty clause.
Transparency No. 3.1-11
True or False Example
Logic in Computer Science
Ch 3. Propositional Logic
{p -> q, q -> r} |= p -> r ?
1.
2.
3.
4.
5.
6.
7.
p -> q ==> {-p,q}
q -> r ==> {-q,r}
-(p -> r) ==> {p} , {-r}
{~p,q} premise
{~q,r} premise
{p}
negated goal
{~r}
negated goal
{q}
1,3
{r}
2,5
{}
4,6
Transparency No. 3.1-12
Logic in Computer Science
Ch 3. Propositional Logic
True or False Example
{p -> q,m -> p \/ q} |= m -> q?
p -> q
==>
m -> p \/ q ==>
~ (m -> q) ==>
1.
2.
3.
4.
5.
6.
7.
{~p,q}
{~m,p,q}
{m} , {~q}
{~p,q} premise
{~m,p,q} premise
{m}
negated goal
{~q}
negated goal
{p,q} 2,3
{q}
1,5
{}
4,6
Transparency No. 3.1-13
Incompleteness?
Logic in Computer Science
Ch 3. Propositional Logic
Theorem: Propositional Resolution is not generatively
complete. I.e., the statement:
“If T |= A then there is a proof of A from T using Propositional
Resolution only.”
is not true.
Pf: Show that {} |= p => (q => p) using propositional resolution.
Note since there are no premises, there are no conclusions
that can be generated. QED
However it can be show that Propositional Resolution is
refutation complete. Namely, if T is unsatisfiable, then there is
a resolution proof of {} (contradiction) from T. Hence
T |= A iff T U {~A} is unsatisfiable iff there is a resolution proof
of {} from T U {~A}.
Transparency No. 3.1-14
Resolution proof of {} |= p->(q->p)
Logic in Computer Science
Ch 3. Propositional Logic
I ~(p -> (q -> p)) : ~A
N ~(~p \/ (~q \/ p))
(~~p /\ ~(~q \/ p))
(~~p /\ (~~q /\ ~p))
(p /\ (q /\ ~p))
D
O {p}, {q}, {-p}
1.
2.
3.
4.
{p} negated goal
{q} negated goal
{-p} negated goal
{} 1,3
Transparency No. 3.1-15
Resolution Provability
Logic in Computer Science
Ch 3. Propositional Logic
Definition: A sentence A is provable from a set of sentences T
by propositional resolution (written T |-p A) iff there is a
derivation of the empty clause from the clausal from of T U
{~A} using resolution rule only.
Soundness and Completeness of Resolution:
Soundness Theorem: Proposition resolution is sound.
T |-r A => T |= A
Completeness Theorem: Our proof system is complete.
T |= A => T |-r A
Transparency No. 3.1-16
Logic in Computer Science
Ch 3. Propositional Logic
Termination
Two finger method:
1. {P,Q}
2. {-P,Q}
3. {P,-Q}
4. {-P,-Q}
5. {Q}
6. {P}
7. {Q,-Q}
8. {P,-P}
9. {-P}
10. {-Q}
11. {}
Premise
Premise
Premise
Premise
1,2
1,3
1,4; 2,3
1,4; 2,3
2,4
3,4
6,9
Theorem: There is a resolution
derivation of a conclusion from a set
of premises if and only if there is a
derivation using the two finger
method.
Theorem: Propositional resolution
using the two-finger method always
terminates.
Proof: There are only finitely many
clauses that can be constructed from
a finite set of logical constants.
Transparency No. 3.1-17