Download presentation
Presentation is loading. Please wait.
1
Resolution Refutation Formal Aspects of Computer Science - Week 9 Resolution Refutation, Relation with Prolog Lee McCluskey, room 2/07 Email lee@hud.ac.uklee@hud.ac.uk http://scom.hud.ac.uk/scomtlm/cia2326/
2
Resolution Refutation Recap Last Week we covered: -Resolution -Resolution Refutation This week -Relationship with Prolog -How to get answers from Resolution Refutation (and Prolog) -Another Example
3
Resolution Refutation Back to Student Example Again ! Put it into Prolog S = student, D = academic, T = teaches Ax ( S(x)=>D(x) ) ; Ax ( (Ey (T(x,y) & D(y) ) => D(x) ) S(Fred) ; T(Jeff,Fred) CLAUSAL FORM: 1.~S(z) V D(z) d(Z) :- s(Z). 2. ~T(x,y) V ~D(y) V D(x) d(X) :- t(X,Y),d(Y). 3. S(Fred) s(fred). 4. T(Jeff,Fred) t(jeff,fred). Query ------------------------- ?d(jeff)
4
Resolution Refutation How does Prolog Work? d(Z) :- s(Z). d(X) :- t(X,Y),d(Y). s(fred). t(jeff,fred). ? d(jeff) ~d(jeff)d(Z) V ~s(Z). s(jeff)? d(X) V ~t(X,Y) V ~d(Y). ~d(jeff) ~t(jeff,Y) V ~d(Y)t(jeff,fred) ~d(fred)d(Z) V ~s(Z). ~s(fred) dead end Prolog Execution Tree s(fred) contradiction)
5
Resolution Refutation Example 1. ~S(x) V D(x)3. S(Fred) D(Fred) 2. ~T(x,y) V ~D(y) V D(x) ~T(x,Fred) V D(x)5. ~D(Jeff) ~T(Jeff,Fred)4. T(Jeff,Fred) Subs = Fred / x Subs = Fred / y Subs = Jeff / x..So D(Jeff) follows from our premises
6
Resolution Refutation Answer Extraction Resolution Refutation (and the PL Prolog) uses the unifications (instantiations via matching) to extract an answer from queries of the form Ex Query-Wff(x) ? (eg member(X, [1,2,3]) ?) The idea is as follows: (1)Attach Query-Wff(x) to the negated query and all its ancestors down the tree to the null clause. (2)Apply all the substitutions to w that were used in the proof tree. This will give an instance of x, say A, such that wff[A/x] follows from W. (3)Of course, if it is possible to reach a contradiction (the null clause) using more than one proof tree then more than one instantiation will be obtained.
7
Resolution Refutation One More (hard) Example The Martians Problem … Imagine Deep Space 1 travels to Mars and observes many things about the Martians, including the fact that some seem very hostile towards humans. Concrete observations are as follows: (a) All green Martians have antennae. (b) A Martian is friendly to humans if all of its children have antennae. (c) A Martian is green if at least one of its parents is green. On its way back from Mars the robot is hotly pursued by a spacecraft containing green Martians only. Should the robot suspect it is being attacked? Or can the robot reason with its observations to answer the question: `Are all green Martians friendly?'' and hence avert an inter-planetary conflict.
8
Resolution Refutation Summary Prolog uses a form of resolution within a constrained “search strategy” to work: this is called “SLD” resolution – single literal, depth first”. The refutation procedure is therefore NOT complete. To obtain answers from queries of the form Ex wff(x), we use the answer extraction technique.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.