Applying Modus Ponens Soundness of Modus Ponens Completeness of Modus Ponens Non-Horn Clause Example Normal Form o Normal Form Conversion Algorithm: Example of Normal Form Conversion Soundness and Completeness of Resolution Applying Resolution Key points
We shall use the example in (Ginsberg, 1993, Page 126) to introduce these ideas. Suppose we have the situation described below: 1. 2. 3. 4. John is a lawyer Lawyers are rich Rich people have big houses Big houses are a lot of work to maintain
2. 3. 4.
This is not sufficient to represent the English since we must ensure that John has a house. So we ensure that the house-of function generates houses:
P.house(P,house-of(P))
2.
P.lawyer(P)
rich(P)
3.
1. 2. 4.
P.house(P,house-of(P)) PH.house(P,H) rich(P) big(H) P.house(P,H) work(H)
H.big(H)
By writing these sentences in terms of john we have ground sentences and we can apply Modus Ponens as stated above.
1. lawyer(john)
2. lawyer(john)
rich(john)
3.
1. house(john,house-of(john))
2. house(john,house-of(john)) 4. big(house-of(john))
of(john))
rich(john)
big(house-of(john)) work(house-
house(john,house-of(john))
(2)
lawyer(john)
(1)
rich(john)
(5)
2.
3.
Now we need to apply Modus Ponens to 3a, 5, and 3b, so we introduce an extended form of Modus Ponens:
4.
5.
(3b)
house(john,house-of(john)) rich(john)
(3a)
(5) (6).
big(house-of(john))
(4)
big(house-of(john))
(6) (3a)
house(john,house-of(john))
work(house-of(john))
We in fact can give a generalised form of Modus Ponens that is equivalent to the earlier versions.
We can apply this rule three times to shorten the inference that John's house is a lot of work in the example above.
Proposition: Modus Ponens is sound. Proof: Suppose it is not sound. Then there is some model in which the premises of the Modus Ponens rule holds but the conclusion does not. Since the conclusion fails then it must be the case that holds - but It must also be the case that does not.
hold. Furthermore, since the 2nd premise in the Modus Ponens rule holds in this model then also holds. Therefore
This is a contradiction and so we have shown that every model in which the premises of Modus Ponens holds is also a model in which the conclusion holds. Therefore Modus Ponens is sound.
We should note that not all rules of inference are sound. As an example let us consider the very useful but unsound rule of inference - Abduction.
Proposition: Abduction is not sound. Proof: There is a model in which the premises of the Abductive rule holds but the conclusion does not; i.e. is false, and is true.
Examples include: If it rains then the pavements are wet the pavements are wet therefore it has rained! But the pavements may be wet for a completely different reason. However we may argue that this is a useful (despite being unsound) rule of inference since it is plausible to reason that it has rained. Now consider a doctor's diagnostic rule
If the patient has red spots then the patient has measles. Is the doctor applying a sound rule of inference when he is faced with a patient covered in red spots?
are atoms.
The facts like lawyer(john) fit this definition: T lawyer(john) The ``rules'' are also expressed as implications and so fit this definition. But what if we know only
lawyer(john) lecturer(john) rich(john) rich(john) rich(john)
or
lecturer(john) lawyer(john)
and so clearly does. We shall see that sentences of this form are important and so we name the class.
Proposition: Modus Ponens is complete for Horn databases. Proof: Suppose D is a Horn Clauses database and
hold but
Next apply Modus Ponens for each of the trivial Horn Clauses
for
The remaining task is to remove ``spare'' s. Suppose D must contain a Horn Clause of the form
for
. Then
otherwise any model in which hold but Apply Modus Ponens does not.
hold, but
and
Horn databases and Modus Ponens are important because Horn Databases provide a effective representation; non-Horn implications are rare. Also notice that Horn databases with Modus Ponens are sound and complete. Furthermore, there is a simple deduction mechanism to apply using Modus Ponens: Deduction Algorithm: For each sentence in the database:
This means that every consequent of a Horn database containing no function constants is either in the database originally or added during the procedure. It can also be shown that determining whether an atom follows or not takes at most ND steps where N is the maximum number of antecedents in any implication and D is the number of Horn clauses in the database.
T T T
tt(ikbp, 0900)
mf(ikbp, 0900)
booked(tuesday, 0900) booked(friday, 0900) booked(tuesday, 0900) booked(friday, 0900) conflict(ikbp) conflict(ikbp)
It is clear that IKBP cannot be scheduled for Tuesday / Thursday at 9am or Monday / Friday at 9am. But we have to reason by cases. The problem is that we need a more general representation than Horn clauses; here we need disjunctions as conclusions of
implications. If we enlarge the sentences to include disjunctions then we need a more general rule of inference to achieve completeness.
Normal Form
We need to define a more general form of sentence than Horn clauses that allow us to handle examples like the timetabling one above.
Although Horn Clauses are a proper subset of Predicate Logic, in fact any Predicate Logic database can be re-written in Normal Form using the following algorithm. Therefore, unlike Horn databases, databases in Normal Form are just as expressive as Predicate Logic. Normal Form Conversion Algorithm:
1. Eliminate using the 2. Use de Morgan's Laws1
fact that
is equivalent to
6. Re-introduce
(cleaner(house)
1.
Eliminate
(big(house) work(house) old(house)) (cleaner(house) garden(house))
2. De Morgan
big(house) work(house) old(house) (cleaner(house) garden(house))
3. Distribute ( (
big(house) big(house) old(house) old(house) work(house) work(house) cleaner(house)) garden(house))
4. Split
big(house) big(house) old(house) old(house) work(house) work(house) cleaner(house) garden(house)
5. De Morgan
(big(house) (big(house) old(house)) old(house) work(house) garden(house)) cleaner(house) work(house)
6.
Re-introduce
(big(house) (big(house) old(house)) old(house) (work(house) garden(house)) cleaner(house)) work(house)
Applying the Resolution Rule to our timetabling example we can infer that
T T mf(ikbp, 0900) conflict(ikbp) T conflict(ikbp) conflict(ikbp)
Proof: See (Ginsberg, 1993, Pages 139-140) for a proof with respect to Normal Form databases. However any Predicate Logic database can be converted to Normal Form and so the result holds in general.
Applying Resolution
Suppose we have a database derive a contradiction ( and a query . We add ) using resolution; thus to our database and then is true.
i.e.
work(house-of(john))
but this is not in Normal Form since the conclusion of the implication is not a disjunction of atoms. However it is equivalent to
work(house-of(john)) F
This is in Normal Form and so can be used with Resolution. Our database is:
1. T lawyer(john) 2. lawyer(john) rich(john)
3.
1. T house(john,house-of(john)) 2. house(john,house-of(john)) rich(john) 4. big(house-of(john))
of(john)) house(john,house-of(john)) big(house-of(john)) work(house-
F F F F F F F
negated query resolve (i),4 resolve (ii), 3a resolve (iii), 3b resolve (iv), 3a resolve (v), 2 resolve (vi), 1
Key points
Modus Ponens is sound for Propositional Logic. Modus Ponens is complete for Propositional Horn Clause databases. Resolution is both sound and complete for Propositional Logic.
Next: First Order Logic - Up: Advanced Knowledge Base Programming Previous: Propositional and Predicate Logic Susan Craw (s.craw@comp.rgu.ac.uk)
sdd