Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

,,'I

l
I
Formalized Symbolic.Logics Chap.
J 4
I the outer; parentheses. (the. antecedent· of E) evaluates to true.. Hence, since
I · O( I) evaluates to false, the expression E evaluates to false. .
bi [n; a. sinuhlr· wa, ,· iii .t. = 2:, the express.ion can be shown to evaluate to true
Corisequently,•,, since£. is, not~true fet aU .x, the e"pression·_E evaluates ~
falS&~ . .

. ,
,., .PROPER"RES-E>& ·wss.
.. .
case
\•

As in the of PL, the cv,aluation of complex fonnulas in FOPL ,can often be


facilitated.through, the substitutiOJI:of equivalent fomwJas. •Table 4.l lists a number
·of ~uivalent _etpressjons·. In the t-able F, (l'·1JJd·,H._den0tc wffs not containing
variables and'F '(%)!'denotes, the wff ,:·which,e0n•-~ :.the variable x-: The equi~alences
can easily·;t,e verified with truth tables·such as.Table 4..3 and simple arguments for
. the ·express·ien& containing quantifiers. -Although Tables.4_.4 ~d 4.3 are similar,
thMc ~ some ootable -differenc~s •. par.ticuJ~l.Y-.in ·tJte wffs conta_i~ing. quantifiers.

in'f.()fvmg:.J'.iegllUd; ~
. and·d i~i:
..w.Jc.;.._n\lC' .
OORll8Ctwes. ·
t•
FOf CXQ.mple, attent:ion is called to tbe last four express-ions wbich gov~ substitutions·
,ad. 1901fCJlleRl ·ef.q.uantifit~ armss. conjunctive
·. · . . .
·· We stlftlfflaria·iae. SOine ~~ whim·are: siffl:idar·to those of _the previous
SCCJ-ion. ·A wff i-s said tc, l!fe ,'Mlid n'.it i,. uw~.llfflla1.cvcsy iateqvetation. · A wtf that
is false .._r e,ery,, i'n~tp.r.eFati• is. said. to- . be ineomistint. .(or unsatisfiable). -A
w1f that ii ,_ valid·tone thal. ~ faJ:• :(oi; ~ interpretation) is-inwlid. Likewise,
a.wtf dial is not inc0nsistent (011¢ ·that, is.true foF ~ - inte,pre_tatjon} is SIJJisjiablt.
··A"gain•, this ..-S ·t1rat a,·vaJ.idt wf.f' .is satisfiable amt an ·il)c~n~istent wtf is invalid,

1· 1'Altl
- . U .
.
EQtffltA'I.ENT
-
LOGICAL
. ·EXPfll:SSIONS
.

TF) =· F . , .· <double·ncP'ion> •
f·&G = Gel F. f VG= G' V-f · (conumuativity) •
(.f & O)·A ff.'= f & (-0 & H).
Cf VG) V H = F V (G V H) (associativity)
F V-(0 & H) = (FY f/} A..(F V·H),
F & fQ V H> := tF & G> Y <f·A Hl: (di&rribucivily)
-tf A-0> = ·;; V ·a..
"ff V <il = "f .& ·c; ·_ <De Morgan's La;ws)
F-G = "FVG
F ... G = rF V G) & ro V F)
V1 F(1I VG = Yx <·F(xJ V G> •
.3x Ft•I VO • :?a <Flxl V.G>
Vi fix) & G = Vx <ff xi '& G).
3l Ff xi & Q = 3x <fix) & G)
-cYxl Ffxl = 3x <"flJtl). ·
-,~, ff 1I = .. Vx .rflxl)
Vx Fix] & "x Glxl = -Vx Cf{1I-& Glxl>
I
31 fix) V 3x 01~1 = 3x <Flitl V Glxl'>
I
Sec.4.4 ~operties of Wffs
. . . fl
~t i~e -respective conv..erse.statements do . . . ·.
-a ~•cal-mnsequence ,Of the ,wffs .P }' .not hold. ,F~nally • w~ .say tl!at a .wlf Q is
p'2 & · · -· .,& Pn .is...true under .an in~• · ·2' •. • ' · ' •~,, ,if .and only if whenever p ,~&
. To illustrate ·some of these ~. . _rpre1at1Qn,_ Q.- 1s ,a~o true. .
. · · . . oncepts, cansader thdollowing examples:

•~ p · & ..,p is inconsistent a~d P 'V _., . .. ~ . . . ·


every· interpretat-ie5n ·and th~ sec d . is valid ·Sance the •_first is false under
. . . Qn as t~e under every-interpretation.
.. .

b~ .from .the two wffs

CLEVEA(·bill) .and .
~x-ClEVER(~l ~ •~UCCEEO(x)
. . . .

tliat,,bolh . ·SUCCEED(biU)·
. that
we .can•.show . .,as ·. · ·
•. .a.·Iog10alj1QllacqueRCC-, . · .assume
'l\u$.

·CL:l:VEfJ(-biH) .ar,d ·
. "'x~C\,;EV·ER(~) ➔ ED(.x)
. ·:sucee.
,
.

are t~e under an in~eg>re~ation. ~he~ .


' .
-CLEVER(biJI) ...:. SUCCEED(bill) '
. . . •. . . .
is certainly· true
· x = bill. But,
since the wfLwas assumed to 'he 'true for all
· '
· I d"
x, me u mg

. CLEVER(bill) -, .S.UCCEED(bill)
=·CLEVER(bi~I_)_V :S.UCCEED(bill) '

are equivalent and. since 'CLEVER(-biU) is true, ..;.CLEVER(bill) • is false


~nd. therefore, SUCCEED(biH) must be true:Thus; we CQllClude SUCCEED-
(bill). is a logical CQJlS.equence of
CLEVER(bill) and·.Y>( CLEVER(x) - :SUCCEED(><).
' ( .

Suppose the wff f [.r] contains the variable x. We say xis "'1Mnd if it follows
or. is within the scope of a quantifier naming the variable. If a variable is not
' . bound, it is said to be free. For example, in the expression 'r/x (P(.r) - Q(x,v)l, x
is bound, ·bat y is free since every occurrence of x ·follliws the quanu1ier and y is
not within the scope of any quantifier. Clearly, an expression can be evaluated
only when .all the variables in ibat expression are bound. Theref()I'!', we shall require
that .all wffs contain only .IJo\lnd variables. Vfe will .ab<> call such expressions a
sentence.
We conclude this ,;ection with a few OlO(C · . Given .wlfs F, , Fl•
defilliti0ns.
12 Formalized Symbolic.Logics Cha_p.
4

• • • , _- Fn eacb possibly' consisting of the disjunction of iitcqals only, we say_F ·&


· F2 .& .· . .. & Fn is i_n conjunctive_normal form (CNF). On the other.hand if e~h
F;, i = 1, . . . , · n ·consists only of the. cqrijunction of literals, we say F I V F V
,. . : VF,, is '. in disjunctive normal fo':"' (DNF). For example, the wffs CP V QV
R) ~ - CP V -QJ & -Rand (P & Q & R) ._ V ((J & R) VP are in conjunctive and
disj~nctiye normal f<?mis ~spectively. If can ~ shown _that any wff can be transformed
into either. normal:fann. ·

.4~5 CONVERSION TO CLAUSAL FORM

~s-~ _earlier, we are _i~terested in ~~hanical ·inference by programs using


symbolic·FOPL expre~sions. One·method we. shall examine ·is called resolution. It
requires that all-statements.be _converted into a normalized clausal-form. We define
a -c_lause as the disjunction of a µumber· of -literals. :·A gro"und clause is one in
. which no ·variables _occur in · the-·exp~ssion. A .Horr, clause is a clause. with •t
rm,st one po,itive ~itera.l. _. -- · _. · · , . _· . • _ '
.To.transform a_sentence_-into dausal form requires the following steps:
. . . ~

_eliminate a11 ·implication ~~d equivalence _symbols,· -


move negation·symbols irito. i_ndividual .ato~s, - . ,_.
·_ ~ame variables .if necessary so ·th~t all ren1aining quantifiers have different
. variable .as..signments, . . . - , . .
. replace ·existentially quantified variabl~s with ·special _fu_nctionsand eli.minate
the corresPQnding quantifiers, ·
drop ail univ~ai quantifiers and put the"reinaining eXFCSSion into CNF (disjunc-
tioqs are .moved·
. .
.down to litenlls),' and - . . · . .
· •
· drop a.II conjunction symbols writing -each claus~ ·previously corfnected by the
-conjuqctions on a separate 'Jin~ . ..

These steps are described in more detail below. But first. we describe the
·process of eHminating_the existential quantifiers ~hrQugh a ·substitution p~ss. This
process ,·req1.;1ires _that all ·such varia~les be replaced by something called Skolem
fuDf,tions... arbitrary functions which can always assu·me a correct value required of
~ .existenti,uJy quantified. varia~lc, · · . ·
· for si-mpli~ity ira what follows, assume that all ·quantjfiers have been properly
moved to .the left side of ~e expres_sion, and eacb quantifies a different variable.
Skolf?mization. the replacement of existentially -quantifted variables with Slcolem
f
(uoctio~s and deletion -of the respective quantifiers, 'is then accomplished·as follows:
an
I. If the ti.:St (leftmost) qua~t;fier in ·expression is _an e~istential-quantifier;
replace aU occurrences of the v~iable it qu~ntifies with ~n arbitrary constant not
ap~aring elsewhere in the expre·ssion and delete the quantifier..This same procedu~
.Sec. 4.5 Conversion to Clausal Form
. 13
s~l ~ be ~~llowed for all _other_ exis~ential quan
tifiers n~ preceded by a univ enal •
quan tifie r. m each case , usm g ddfercnt constant
symbols in the substitution.
. - ~- For _·eac~ ~xistential qu_antifier ihat is ·prec
eded by one or more universal
.quantifiers· (1s ~.ithm the scope of. one or mor
e universal quantifiers), replace all
~ur ren ce~ of the existentially quantified"vari
able by a function symbol JlOt appearing
elsc ~he ~ m the expression. The arguments assi
gned to the· function sboukl match
all the variables appearing•in each .universal 1quantifie
r which precedes the existential
quantifier. This existential quantifier sh~uld then
be deleted. The same process should
be repe ated for each remaining existential quan
tifier ~sing a different function symbol
-and cho osin g function_arguments that corrcspon~ to
all universally quantified variables
that prec ede the existentiall.y quantified vu4 lble
...
'
• • . p
being replaced.

An example wiH help to clarify this process: Giv


• •

en the expression ·
3u Vv Vx 3y P(f(u), v, x, y) - Q(u, v,y)

the Sko lem form is determined as

Vv Vx P(f(a),v,x,g(v,x)) - O(a,v,g(v,x)). .

In-mak ing the· substitutions, it should be .noted that-. the variable u appearing after
the first existential _quantifier has- been replaced
in the.'. second expression-by the
arbitJ;WY constant a :·Th is constant ~id ·not ·ap~
ar elscwhe.r e in the first cx~ ion .
The vari able y has been replaced by the function
symbol :8 having the ,cariables v
and x as argu men ts, since both of these variable
$ arc universally quantified to the
· left of the existential quantifier for y. .Replac~
ment .of y by an arbitrary function ·
~i.t h argu men ~ v and x is justified ~n the basi
s that y, .following 11 and x, may be
func tion ally dependent on
them and, if so, the arbitrary function g can acco
unt for
this depcndeoc_y. The.· complete procedure can
now be given to convert any ·FOPL
sent ence into clausal form. ·
Clausal Con ve" ion Procedure
·ste p 1. Elim inat e· all implication and 'equivale
ncy connectives (use -p V Qin
plac e of p-. Q. and rP V Q) & ra
VP ) iQ. p~ace of P ++ -~ - .
. . Step 2. Move· all negati<?ns •in to i~i at~ l~
plac e of -rP ). a~d DeM orga n's· laws_, 3.t F
~ ~ ato ; ~us :n: ~:
{x) -in plo of (Vx) ( )
-F (x]. in place of (lx) F (x]).
· _: . .
· · I ·f essary so that all quantifiers have different
Step 3. Rename v~a b cs• , ~ b es~ that v~a
bles bound by one quantifier
are nQt the same a~ vana es u
':i
v_ariable assignments; lba~ ren ~;~ •; diffe~nt quan
tifier. For example, io ~ -
. the second· udummy" ~ l o x whidl
exp ress ion Vx (P(x~--+ <.~
(Q(x)~~ re~ ::
is bound by the ex1stenua~ quanta er adifferent variable, ,ay y,. tQ. g,ve "'~
.
· (P(·x ) ·--+ (3~, Q(y ))).
Formalized Symbolic_Logics Chap. 4

· Step4.Skolcmize by replacing all exi~tenti~ly_quan~i~ed v~~a~l~s with Skol~m


'functions as described above, and deleti~g the corresponding ~x1stenuaJ qu.antifiers.
. . ..
· Step .5. Moye_all uilive~ quantifiers to _the le~t of the expression and put
the expression on ~ right into·CNF. ·· · ·
. . . .

-· -Step -~. Elimiaate all universal quantifiers_ and c~.njunctions since they are
retained. implicitly. The.resulting expressions (the .expressions ·previously connected
by the conjunctions) · are clauses and ·the -set _of such -expressions ,-i~ .said. to. be in
clausal form. -:
As.an .example of this p~ess, l_et ·us convert the=.·expression
• I • •

'
3x Vy (Vz P(f(x),y,z) ~ (3u O(x,u)_& 3v R(y,v)))
. -
.into· clausal form. We have after application of Step I - . ·
: .·
.
,;. .
. . ..
3x Vy
. -
f(Y.z)-P(f(x),y,z) V (3u .O(x,u) & (3v) R(y,v)))).·
. .

After application of step 2 we obtain


. . . .

3x Vy (3z-P(f(x)ry,z) V (3u-Oix,u).- & (3v) R(y,vn,.

After application of step 4 '(step.3 is not· requi~d)

V.y rP(f(a),y,g(y)) .V (O(a,h(y)) & R(y,l(y.))). . '


. , .

~fter.applicatiQn. of step 5 uie ~•t _is _


.. .
Vy (fP(f(a),y,g(y)) V O(~,h(y)) & C-P(f(a),y,g(y)) ~
R(y,l(yU,. . . . . •.

Finally, after. application 6f step 6 we ·o.btain the clausal form

·P(t(a)rY,9(y)) V O(a,h(y))
-:P(f(a);y,g(y) V R(y,l(y)')

· The last two oJauses of our final form ve understood to be universally quantified
in the .variable Y and to have the. conjunction·symbol cpnnecting them.
. It ~hould -be noted that. the set of clauses produced by the above ·process arc
not ~qu~v~k,u tQ the o_riginal expression, but satisfiability is retained. That is; the
set of cl~~s ~ satisfiable if and only if the original sentence is satisfiable. .
Hav~J:now ta_~ red through the tedious steps abeve, we point out that i! · 15
often possible to wnte down s~tements directly in clausal fonn without working
thro~gh the above process stes>:-by-step. We illustrate how this may be done in
~ect1on 4. 7 ·when we create a sample know ledge base.
Inference Rules 15
Sec. 4.6

4.6 INF~RENCE R~LES .

~i.1.(.-e ~L. a ~ey .inference rule in FOPL is modus


ponens. From the assenion · 'Leo
1s a hon " and the implication ~'all lions are. fero
cious" we can conclude that Leo
· ·
i_s ferocious. Wr:i·tten in .symbol.ic ·form we have

assertion: l:.ION(lcO, .
impfication~ .\/~ LION(.t} -. •FEROCIOUS(x•)
conclu~ion: FEROCIOUS(leo)

In general. if a has p~operty P and all object.s


that have property Pal so have
·
property·Q. we., c_onclude th~t a has .propeny :Q.
· P(a) ·
"t/:c P(x) ~ ·Q(.f)
.Q(a )
'
X was nec~ssary. This
.

Note that i_n concluding Q(a)·~· a substitution· of a for


-. Q(x ) is assumed .true for all
•was possible. ·of course. since··the implication P(x) e
·X. and in :particular for.x -:- a .
.S1:1bstitudons are an essential part of the inferenc
lifications or the, reduction of
. · process . .When properly ·applied; '. they permit simp ry literals. We say that two
·expressions· through the cancellation of com.plementa
of opposiJe sig~; that is, P and
ljter,als ~ compleme.ntary. if they are .identical bur ••
-P ~re cQmplcmerjtary. .i
V; where-v; are .distinct var iab ~
_A · sl4hsti1utia11 is detinc;d as a. set of.pairs t; and_
_a.nd t;:are terms ·not containing the ;V; . .-The ti
replace or · are substituted _for the
substitution is applied. A ·set of
corresponding ti; ·in· aoy ~xpression ft.?r >which the
substitu.tioris ,{t 1/vi: ttJ/v2 • • • . • r,,J'u.,} ,wber.e,,i >-
l ~pplied to an expression wilt
be denoted by Greek letters a. •J3. and 6. For. example., if '3= {alx. g(b)ly}~ then
e obtain C' = Cl3 = P(a.,g(b)J
applying f3 to the•clause .C = P(x .•y) V Q(xJty)) ,w .
V- Qta.J,(gfb)) )'. .

Unification

Any substitution that makes two or more expr


essions equal is calied a unifier for ·
ithe expressions. Applying a,substitution ~o an expressi~ £ ·produc~s u , ins t~e
~um fiab tc. such as expressions
E' of E where.£ ' = £(3. Given two expressions that
-.c, and ~C2 with a unifer ·~ with C·1~ ;;: :{;2•ofwe'3.sayF-0rthatexam
pis a most g~ne,:al wn.ifer
pl~ two unifiers for ~
(mgu) if any other unif ~ a is an in~tance
literals P(u ,b,v ) and P(a ,x.y ) are a ::; {alu •.~..-~,y~
and _'3 = {czlu,blx,clv,cly}. The
an_ i~ta nct of the_ former. _
fomter is an mgu whereas the latter is ~t smc~. 1t 1s
m the same smgl~ cla\lse.
Unification can sometimes be apphed to literals w1tb
within ~ cltl l~ arc ~nli\ed. the
When an mgu exists such that two oi ijl()JC literals
· · · g ·. aft·er dclet·,on of all· but one
. of the uni:fied Uterus 1s caalled a
I se rema,~m
cau .
Formalized Sy mb olic Logic~ Chap.
86 4
· • . . . Thus •give
fac·(or of th~ ~agma~claus:· ) V Q(/(:). n the clause C - . P(x) V Q( x:y ) V P(J(z))
_v) is ootained where (3 = if(z~/x
the factor C - C'3 P(f ( ) . }. .
be set of expression5 • We def ine the dis agr e~m ent s~t of Sa s the set
. Let S 8 . · each symbol of all exp
· . . .
ob_tam~d ,by compan 0!be x ssians wh ressions .m S from left to ngh t and
1 ose firSt symbols do not agree. For ex.a
extractang fro~ S :~: ), PJ ;;) ,z, a), P(f mple,
(x) ,b, h(u )). - For the ~ -t S, th~ disa
let ~ -{ {P(f(.b).gh~( )} ·We can now sta gre ement
set as glv),a, ,z, u · te a· unificati~n algontbi:n which retu
: rns the
mgu for a·given s~ of express1on_s S. · .

Unification algorithm: - 11

1. Set k = O and a1 -:-- t ·(the empty _set


). _ •.
2. ·1f the set Sai: is· a singleton, then sto
p; a, is an mgu _of_S. Otherwise, find
the dis·agreement set {).k · of Sak·
· . ·
3; If there is a variable 'I! and teqn t
in D1c ~uch that v does not occur in t,
ai+ a = a1c{tlv}, set k = k + -1. put
and return to -step 2. Qt ~e ~is e, sto
not uniijable. p. S is
. . .

4.7 THE RESOLUTION PRINCIPLE

·W-e are now ready to consider tne resolution


...
.,
'

priJlciple, 1a syntactic ·inf~rence procedure


which, when applied to a set of ctaus~
s, determines if the set -is;u-nsatisfiablc.
. procedure is similar tp the-process of obt This
aining a proof by contrJdiction~ For examp
suppose. we have · the ·set of ·clauses (ax le,
ioms) C 1,-C2• • • ·• , . Cn and we wish
deduce or prove the. clause 'D; _thar is,~to -s~ow tha
t D· J s, a log ica l
to
c~nsequence of
Ca & C2 & . .. & Cn. First, we .negat
e D. and ad_d -v io the · set of clauses
C2-, •. . • Cn. Then, using resol~ 1
C,,
tion toge~r _. with factoring·, we can sl)o
the set is unsatisfiable by dedueing a :cont w that
radiction. Such a J)l'OOf. is ca ll~ a pro
by refutation which, if $Ucccssful, yie of
lds the empty clause denoted by ( ] .2 Res
with .factoring is complete in the sens~ olution
from a set of unsatisfiable clauses. tha t it wil l alw a'
y s gen era te the empty clause
· .
Resolution is very simple. Given two .cla
uses C and c., with ·no variables in
c~nunon, if thbre is a literal 11 in C wh
ich is-a com~lement of a literal 12 in
bo~ 1, ~ 12 ~ deleied and a disj_un 1
cted C is fonn~d.from the remaining red
C2•
· clauses. The_new _clause Ci ~ called
the rts olv tnt of C, and C • Rtsolutioo uced
process of generating these resolvents-_fro 2 is the
the two clauses • · m a set ·of clause s. Fo r example, to resolv~

CP V Q) and CQ V R)

comb' ~ The_emp~ ct,usc ( l ~ always fals


· mmg contradictory clauses such p and
15
e since no intelp'ctation can satisfy 1t.· It
-p, -is derived "°"'
l
. Sec . 4.1 The Res olu tion Principle 67

. we write
-p V Q. -Q V R
~-p V R
si~le depending on th~ number ·and type
s
. . _ Several. types_of_ resolution are poses ,below. · . ·
of parents. We _define a few of these. typ

· . . ~n ary res olu tion . Tw o clauses hav ing c


_ omplementary literals combi~edare.
d1s 1uncts to 1n· ~uc c a sing le clause after deleting the complementary literals
, as · ,
Fo r example, the binary resolve_n t·of
-P( x,a ) V Q(.x) and -Q(b) .V /t(x )
I
is jus t
. .."P( b,a ) V R(b_)•..
two p~n t-._clauses to produce the
.- Th~ substitution_-{blx} was . made jn the
ich_,w~re then ,deleted fro m the disjunction
·complementary. li~~rals:Q(b ) and -Q(b) wh
·_ of the tw~ parent clauses. ·

.A number of clauses are res olv ed sim


ulta-
• . _ Un it resultin_g (UR) resolution.
-a. t clause.· All exc ept _one of :the ,diu ses a.-e unii clauses,
neously: to~pro duc_e uni
the toi , nu~ ber of unit clauses.
one _clause-h as exa ctly one mo re literal than
·and tha t _ . · . ,
.
For cxampl,e_, resolving the s~J ·
rMAR_RIED(x.v·, V ~MOTHER(xi)-V FA,:HER
(v:Z).
MARRIED(sue,joe), "'FATHER(joe.bill)}
.
. .
unit clause
where the substitution. '3 = {sue/x, joe /y, . bill/z} is used, results in the
""MOTHEJt(sue,bill). . -

se C; is a parent to the cla ~


·Unear resolution, When each ~solved clau
ed linear. resolution. For ex~ plc ,
i$ _call
Ci+ 1 {i · 1, 2, ·.. _- ~ n - I) the p~ ess
given • · set S of clauses with C0 C S, C,.
is derived by a sequence of reso_lutions,
e cla~ se BI to get c.,,, and so
c0 with some ·clause lJo to ,get C 1, then. C I wit__h som .
.
·
.

on unt il C,. has .bee n der ived. _


I

. If o~ of the parents. in iinear reso


ays
lutiqn is alw......
· t resolution
&.
U
th
n••r·
·npu
1
· al set of clau
.•
.
ses (the B;) , we have linear inp
- V p V "Q -p V
·
·a}
F
ut reso1ut1otr. or- c~~
let C0 = t--•
(P V
1rom .. e oog m . ' th. •th· ,,.. c -""• -:n
g iv.en the set of cla uses S = {P V the Q, P - Q, rcso1v1(l g 1s w1 '-'o w uuu u _
- .• = -p v Q from set S and
sen from s and the resolvent of C1 and
Q). Choo~mg .B~ C 1•· 8 1 must. now be cho
the resolvent Q - _ . •
B 1 bec om es C and so on_ . blem of mechamcal
•ve us one ·approach to the pro
2
•.
t some further refinements , re.solution
Unification and res~lutio~ ga but withou .· ·
inference or aµtomated reasoning, ~
·
88 Formalized Symbolic Logics Chap,
4
can be intolerably jnefficient. Randomly resolving ·dauses in a large set can .
.
in inefficient or even 1mposs1 "ble proof:s.. Typ1ca
. 11y, the curse o f combinatorial
· exresult
sion occurs. So. methods which constrain the search in some way must be USed P10•
When attempting a -~ f ~y resolution, ~ne ideally would like a mini~all
unsati$fiable ·set of clauses which mcludes_the conJecturedclause. A minimally unsar:
~ fiable set is_~e w~ch_ is sati~fiab)e when aoy_me~ber of th~ set is omitted. The
reason for this choice 1s that irrelevant clauses which are not needed in the proof
but 'Vhich participate are unnecessary resolµtions. They contribute nothing toward
the ,p~f. Indeed,. they_can si~etrack . the Sea{ch direction resulting in a dead end
and ·Joss o~ ·resoun;es. Of course,. th_e set must be unsatisfiable otherwise a proof is
impossible. · ·
A ·mini'tnally unsatis1i~ble ·set ·is id~I ·in tire· sense that all ·clauses are essential
an~ -no others are needed. Thus, if --we wish to prove B, . we would like to -do 50
with a -s et of clauses S = {A.1 , A2 , • . •• , AA:} .-which becom~ minimally unsatisfiable
with the addition of -B. ' .
Cboosi~•the -arder ·i'J:l whictn:lauses-are~ soived is-known ·as.a-'se-arch-strategy.
While there .are ·many -such 'strategies -'~ow . available, ::we define only oqe of the
more important-ones, ·the-- set-of-support_str~tegy. This strate-gy -sepanttes a-set which
. is unsatisfiable into subsets, one of which is satisfiable. . ··

Set-of-support strategy: · Lef S·be an unsatisfia~le ·set -of ~lauses and T be


a subset of S. ·nien T is a $Ct-ef-support -fo~ S 1f S ·~ ·T is satisfiable. A set-of-
support resolution is a resolution :of two clauses .not both·fr(?m ~ - f . This essentially
means that given an unsatisfiable set -{A 1 t •. • . • , A,cl, resolu·tion should not be
perfomied directly ·m:non-g '1 he ·A; as ·nt>tea above;

Ex.-npl~ of ·Resolutio~
... .
I.

The ex.ample we present' here i~ one.to .which all


Al Students.-should be. ~xposed at
some point i~ their studies. It is the famous U.inonkey and bananas prqblem,"
another one of -~se comj>Jex real _life -problems splvable widl--AI techniques. We
envision a room containing a ·monkey, a chair,· and ·some ·baninas •that have been
hung _.from the center of the ceiling; out of reach ~from ·the ·monkey. If the monkey
is ·c1eyer enough, he can reach the bananas ·by placing. the :chair directly below
them and climbing on ·top ~f the chair. The · problem "'is ~ use FOPL to represent
this monkey-banana world and, using resolution, prove •the monkey can reach the
bananas. · · ·
a
.In· creating knowledge base, it is essential first to identify all TCJevant objects
which will play some role in the anticipated inferences. Where 'pOssibJe, irrelevant
~jects should be omitted, but, never at the · risk of incompleteness. For exam~
in .the current problem, the monkey, balUUlas, ·an\:! chair .arc essential. Also .nee .
is some refcrcnc.e object such as the floor or.ceiling to establish'the-heightrelattonsh•P
.between ·moJlkey and ba~as. Other objects such as windows_, w-11~ or doorS are
not ,relevant. . .
The next step is to establish important prop¢rties of objects, relati~ns between
Sec. 4.7 The Resolution Prin?ple

them, ·and any .asser.tioris. likely .to be needed. These include such facts as the chair
is tall enough to raise ~tho monkey within· reach. of the bananas, the mOnkey is
· dexterous, the chair caµ be moved under the bananas, and so on.
Again, all importan~
- properties, relations,,. and, assertions. should be includcd,and ·irrelcvant.oncs omitted.
Otherwise, unnecessary inference·steps may be taken. ·
Tbc important factors~ for· our. problem arc de.scribed· below, and all items
rieedect:_for the-actual kno.wledge base. are· listed as axioms. These arc the essential
facts'andmles. Althou&h,not explicitly indi~ 'all vari.able.s,.arc. universally q~anti-
fied-. .

Relevant,fectors·tot the·prioblem.•

CONSTANTS

· {floor, chair, banana, monk,y}' .. .· '

VABIABlES
.. ·-

. {x,_.Y, z}

PREDICATES

{can.reach(x-, yf ;:x can re_ach y .


~ u s. (x) ; x is, a.c,&>rterous ar)imal -
c:t_ose<x.vl . ; xis,close-to.y; .
get.on(x,y) ·;_JH:8J'l:I• on y .
under.(x.y) . :. .,J~under v . . ·.
tall(~) ;;~ is.tall
in.room(x). ;, x,JS; in;the. r~m
can.move(x,y,z) : x c&'1..mov.e,y nea~ z
can..dimb(-x,y)} · ; x can climb onto~y

.AXIOMS

{i_n.room(bananas)
in..room(chair)
iruoom(monkevJ
·dexterous(mo ,:,key)
taJUchaii)
,close(bananas,floor) ·
ca.n.move(monkey,c~air,~ananas) .
can..elimt>(monkey,chair) .
(dextar0usCx) & cl098(X.Yl - can-reach(x,y)
((get.on(x,y) • under(y,b.enanaa) & tall(y) - .~
·close(x,bananas)) . • ( ) • can.move<x,y,i))-
((in.roombd • _ln.room(y) a efU'QOm z . .
- cfou(z,floorl' 'fl' und!lr(y.z)l
(can.climb(x,y ) - get.on(x,y))}

I M M
Fo rm al iz ed Sy m bo ii
70 c l~ ic a Chap. 4
. . . a lcnOWlcd&e bale ca
4

. Using the a1,ove_ .ax n be written__down


iO fflS, direct
e the necessary subs ly in
th at is geedecl to m
-- ~ -t
the RIii... .- ctausal form. All ,.
ak
ti~tions
are· the equivalences
· .
.· p - Q • -p V. Q ·
.
· . _:_.1 .. .. .. ...: clauses
-w-
and pe Morgan's Ja ws ao ~ to a L IS P program
..L..:-1r f each 1: ... .~ as .....:... a
I.I A, -
li st of items. F or exam
, ·one may prcfct
to~O . . c~ ~1
would be written -as_- -
.. -
.
pl e, number 9, below
· · '
(o r rcan.climb(?x ?y
)_get.,on(?x ?y))

wh= ?.x and ?y,denote v ~ e


Note that clause 13 is s.
not one o f the o~.gi
·. · . , . ·
nal axioms. It ha s be
the proof as required
in refutation resolutio en added for
n proofs..
· ·
Clausal fo rm o f know
ledge -b a •
t. i~ lm on k1 ,v )
2. in..room(benanas)
_ 3. in.room(chair)
4. Ja ll( ~i r)
S. de xt er ou s( m on ke y)
6. ·can.move(monkey, ch
ai r, ban~nas)
7, can.climb(monkey,ch •
air) ·
8. ·close(bananas,floor)
9. ·caru:timb(x,y) V ge
t.o.n( x, y)
10: ·dexterous(><) V ·d os
11. ·get_on(x,y) v ·u n~
e( x, y) V can..reach(
,

x,y) .
(y ,b
an an as ) v --t al l(y )
12. 1n .r0 9f fi( X) V 1n..r
V cl os e( x. ~n an as
oom(y) V 1n.room ) .
(z) V ·can.move(x,y.
13. ·can..reach(monkey~ba z) V close(y,floor) V
under(y,z)
nanu)

Resolution proof.
A proof that th e m~n
rized below. As can key ca n reach th e bana
be ~ n , this is a re nas is summa-
proved (can..reach(m fu tation pr oo f where th
onkcy,bananas)) has
been negated an d ad e statement to ~
base (number 13). The de d to the knowledg
23, below). proof then follow, w
hen a contradiction is
found (see number .
14. ·can.move(monkey,ch
ai r,bananaa) V
close(baoanaa,floo ; 14 la • rMOlvent qf
f) V un de r 1,2.3 an d 12
(chair.bananas) w~th su ba ti tu ti ~ {m
oniWv/x, chair/y,
ba na na s/ z}
Sec. ~.'7 · The Resolution Principle
71
15.· clole(bana nu.ftoor) V under . : thi1 11 • rilolvent of 6 and 14
(chair.bananas)
16. under(chair.bananas) ; thi1 is a resolvent of 8 and 15
17. ·get.on(x.c hair) V -tall(chair) 'V ; this ii a resolvent of 11 and 18 with
dose(x.ban anas)
1ubltituti9n (chair/y}
18. ·get.on(x.c hair) V close(x,bananas)
• ,#> : a resolvent of 4 and 17
19. get.on(inon key,chair) : a resolvent of 7 and 9
·20. dose(monk ey.bananas)
: a resolvent of 18 and 19with substitution
~ • • I ,

(monkey/x}
21. ·c1°'8tmon kay,y) V can.reach : a resQlvent of 10 and 5 with substitution
(mortkey.y)
(monkey/x}
22. rJach(mon key,bananas) : a ~olvent of 20 and 21 ~ substitution
{bananas/y}
:-a-resolvent of 13 and 22

· In pctrionning the above proof, no parti~ular strategy was


follo~ed. Clearly,
however, ·good choices were· made in selec~g-parent ~lauses for resolution. Other-
wise, many unnecessary steps may have been taken before· completing the . proof. 1

Different f~s of resolution were completed in steps 1~ through 23. One of the.
exercises requires that the types of resolutions used be identiije,L · ·
. The Monkey-Banana Problem In· PR_OLOG .·.

Prolog was introduced in the previous chapter. It is· a logic programming language
· that is based ori the resolution principle. The ret\ltation proof strategy used in PROLO<J ·
is-resolution by selective linear with definite c l ~ or SI)) resolution. This is .
just a form of linear input. resolution using definite Hom clauses (clau~ with exactly
~ p:,sitive literal). In_finding a resolution proof, _PROLOG searches a data-base
of cl111ses in an exhaustive manner (guided by ,the SLD strategy) until a chain of
· unifications have been. found to produce a ,proof.
Next, we present ·a PROLOO program for the monkey-banana problem to
., il•ustrate-~ ease with which many logic programs may be fonnulated.

• % ConltantJ:
% {floor, chair, bananas, monkey}

% Variables:
% {X, Y, Z}
,
% ·.Predicates: -
- % {can-reach(X,Y) ; X can reach. Y
,i. c:1exterou1(X~ ; X i1 a dexterous animal
·,_ cloH(X,Y) : X ia close to Y
Formalized. Symbolic logics
Chap, 4
72
; XcangetonY
'f, get-on(X;Y)
; Xi• under Y
% underlX~Y)
; Xi■ tall
% ~(X)
% in-room(X) ; X i• in the room
% can-move(X,Y,Z)· ; )( can move Y near Z
-X. can.cfimb(X, Y)} . ; X can climb onto Y ·

.
in-room(bananas) .

in-room(chair).

. in-room(monkey) . ► -

dexterous~onke y). ·
..
tall(chairJ.

can-move(monkey, .chair, bananas).,


. ,
can-climb(monkey, ~air).

can-reach(X,Y). :-
. .
dexterous(X), cfose(X,Y).

clo~(X,Z) :-·

get-on(X, Y),

under(Y,Z),

tall(Y).

get-on(X,Y) :- . .

can-climb(X,VJ.

Under(Y,Z) :-

in-room(X),

in-room(Y),

in-room(Z),

can-move(X,y ,Z)•.
ethods
Sec. 4.8 Nondeducl'ive Inference M 73

se of facts and rui . various


This completes·the cl~taprba g system. es required. Now we can pose
.q~eries ·to our theorem ovin
l, 11-·can-reach(X,Y).
, .
X = montey, ..

-
Y·= bananas

11- can~reach(X,bananas).
,. . . •t•
.I • l I I

. =· monkey
X ~ ·. · • •
r

·I?- can-reach(monkey,Y).
Y= bananas • I
,,.),.
• If
,., i
as);
I l, can-reac~(monkey,banan

yes . '=' :

I • .I ?- ~n-~each(lion,bJnanas).
~I • . . ·'. \

no ' ~ ., .
• .I

j ·?- can..reach(monkey,apple).

no , I •

RENCE METHODS
4.8 NONDEDUCTIVE INFE
not
r th ~e no nd ed uc tiv e forms of inferencing. These are
In this sectiol) we conside are ne ve rtheles$ very important. We use aJI •
, but they
valid fonns of inferencing activities where we draw conclusions
and make
in ev ery da y
three methods often nside r he re are ab duction , induction, and ana)ogica)
_we co
decisions: The three m~thods
inference.

Abductive Inference
on the us e of kn ow n. ca us al knowledge to explain or
d
Abductive inference is base ion . Give n the tJU th of proposition Q and the
co nc lus
justify a (possibly invalid) Fo r ex am ple , ~~ le who have had too mµch
to
nc lud e P.
implication P ~ Q, co wa lk. Th erefo re, 1t 1s n~ unreasonabJe to
conclude
en the y
drink tend to stagger wh
is dr un k even tho ug h this may be an incorrect
ering
that a person ~ho is stagg
formal~~ Symbolic Logics Chap, 4

!' be they walk for other-reasons, includil)g dizzin


• J ystaggerW .n · bl CSS
conclusion. Pe:<>P ~ ma .from some physic~ em. F'.
from twirling in circles o:bductive inference wath the follow1~g, w~ere the cover
U/e may ~present •mply a possible causal relabonsh1p. .
. w is meant to i
the implication arro · . ,; , . • -
assertion Q
implication pt'_..., Q
conclusion P . .
Abductive infe~nce .is :~seful when know1n ca~sal relations are likely and deduc.
. tive inferencing is not possib_le for.- lack of facts. · .· · . .·
. , .
Inductive 1.nfe~nce·

Inductive inferencing is based on the assumption that a recuqing pattern, observed


for some.ev~nt qr .entity,-i'mplies tbat'th~ pattern is true .for all entities in the class.
Given instances P(a 1), P(a2), • • • , i'(a1c), conclude that 't/x P(x). More generally,
given P(a 1) ➔ Q(b 1), P(a2) ➔ Q.(b2),. • . • •. , P{a'ic) ~ Q (b1c), conclude ·Vx,y P(x)
➔ Q(y) : . : . '
Vfc.often make this fonn of genetalization after observing only· a_few instances
of a situation. ·It is known as the inductive leap. __For example,; after seeing a few
white swans, we incOJTeCtly infer that ail ·swans· are white (a .type of Australian
swan is black), or we· conclucle .that all. Iris~me1;1 · are stubborn after discussions
with only a few. · · · ·
We can rep-~nt inductive inferen~e using the follow~ng description:
P(a 1), • • • , P(a1c)
Vx P(x)
." . .
ts .
' \ ' '

Inductive inference, of course, not a, valid ,' form of 'inference, since it is


no( usually the case ~at al~ obj~ts of a cl~ .c~ ;be verified. as having a particular
pro~. Even so, this is an im~rtant and conu:rionly u~d form of inference.
.. ' .
,Analogical _1,nf~rence
. I

~~tc~ infei:en~e is a f~nn of ·experiential inference. ·Situa~ions ~r entities which


! ~ ~·some respects tend to be. similar. in other re
that situation (ob· t) A • · ·
. us when we find
· spects Th
,
context to A° jec as related m certarn ways to B' and Ar is sunilar in soJOC
· ev111-ple •o' wle .conclude that B' has a similar ~lation to A' in this context. ~
~.. ' ~ so ve, a. proble .th three . . . to
cxtcmhtie methods we kno m_ ~• . - equations 10 three unknowm, wt trf
Analogical inference wan iolvmg tw.o equations in two unkn{lwns. .. of
three other methods of inti appears to be: bas~ on tbe use .of a co-11binat1~n 1·ct
this form of · fi
sy~bol me;s C:~~:~:e
.. ~rence, abductave, deductiV,e, and in<hl,ctive. We de.P
following description, whe~ abQve·dle i,nplicatiOfl the.~
Sec. 4.9 Repr~sentations Using Rules 75

p'-+ Q
p'' ~ Q' .
Analogical inference, like abductive and inductive is a useful but invalid fonn
of commonsense inf~nce. -

. ,
4.9 REPRESENTATIONS USING RULES

Rules can be considered~ subset of predicate Iogjc. They -have become a popular
represen~tion scheme for expert _systems (al~o called rule-based systems). They
were first u~· in the G_eneraJ .Probl~m S,olver system in the .early 1970s (Newell
and Simon, 1972).
Rules have two component parts: a l~ft;band side (LHS) referred t~ as the .
antecedent, premise, condition, or situation:, ·and~a .right-hand· side (RHS) known
as the-consequ~'1t,.conclusion, action, or response. The LHS is also knpwn as the
if p~ and the RHS as the then part of the ·rvle .. Sor:ne ~Jes also 'include an else
part: .Examples of rules which might be used in expert systems are given bel~w .
. \

_IF: The temperature is greater t~an 95 degrees C,


THEN: Open the relief·va~V.e.
4 •

IF: The patient ha~ ~ high temperature,


and the stain·is gram;--positi_v~, ·
and the ~tient has a .sore thr~at,
THEN: The organism is streptococcus.

IF: The lights do not come .on, .


and the engine does n_ot -tum over,
THEN: .The battery·is dead or the cable is loose.

IF: A &.B & C


THEN: D
A &.B & (CV D)-+ D

The simplest form of a rule-based production system con_sists qf ~ pans,


a knowledge base (KB) consisting .of a set of rules (as few as 50 o~ as many as
several · thousand rule~ may be required in an ~~pert syst~m)., a working memory.
and a rule fnterpreter or inference engine. TI)e mtc1P,reter ms~c.t$ the ~HS of each
· l , · the KB until one is found which matches the c~ncents of workmg memory.
rue m . ,, . h. h he t f
This causes the rule to be activated or to ··fire m w 1c case t co~ten s o
by the RHS of the rule. The process continues by
w.ork.mg memory are repl!ll-ced
II" • • •

scanning the next (Ules in sequence or restarting at the beg111nmg of the knowledge
base.
Ill

Formalized Symbolic Logics


76" Chap, 4

INTEflNAL FOAM
RULE~7
Premise:
(($and (same cntxt site blood)
(notdefinite contxt ident)
(same cntxt morph rod)
,(same cntxt burn tl)
Action: (conclude cntxt ident pseudonop,as 0.4)) . "

ENGLISH TRANSLATION · . •'·.

· IF: 1) The site of'the-clilture.-is:b lood, and. _


2) The-identity of the organism' is not~known with eertai_n ty, and
. . . . . ~ .
3) The stain of the ~rganism is gramneg, and .
. 4) The·morphology of the organism is rod, and ·
5) The patient has beeh ·s eriously burned
THEN: There .is weakly suggestive evidence (_0 :4) that the· identity of the organism

.
is pseudonom~!!- .
,.
· Figure 4.l A rule from the MYCIN system . .

~h rule represents a chunk of knowledge as ~ conditio~al statement, and


eac.h invocation of the-rules.as a seqµence of act~s>ns. This is es·sentially an inference
process usint the chain rule as d~scribed· ·in Section~-4~2.--;Although there i~ no
cstabHshed syntax for rule-based sysfeins, the most commonly :used form pennits a
LHS ·consisting of a conjunction of several ·conditions and ~a single RHS action
term. . .
An .example of a rule used in the MYCIN 3 expert system (Shortliffe. 1976)
is illustrated in Figure 4. I . · . .
In RULE047_, the quantity 0~4 is known-as a confidenc~ factor (CF). Confidence
·factors range from - 1.0 (complete disbelief) to _1.0 (cc:Jtain ~lief). They pf<>vide
a measure of the experts· confidence that a rule is applicable or holds when the
conditions in the LHS have all been satisfied .
. We will see further examples ~f rules and ·confid~nce factors in later chapters-

4.10. SUMMARY
.

We ~ave considered propositional and first order predicate l~gics. in this chapte~c:
knowlc~~c ~~sentation sc~emes. We learned that while PL has a.sound ttieoret ttte
foundation, 1t 1s not expressive enough for many practical problems. FOPL, on
3 . ,i-:
MYCIN was one of the ·earliest expert systems. II was developed .at Stanford University ,n_IJ)
mi·d - 1970s. to de monstratc that a system could successfully
· · in
perform diagnoses <.>f ~ticnts bavanJ · fcc1~'
blood diseases.

You might also like