Professional Documents
Culture Documents
Stlftlfflaria: To Hence
Stlftlfflaria: To Hence
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
\•
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:
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.
,
.
. CLEVER(bill) -, .S.UCCEED(bill)
=·CLEVER(bi~I_)_V :S.UCCEED(bill) '
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
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.
•
en the expression ·
3u Vv Vx 3y P(f(u), v, x, y) - Q(u, v,y)
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
-· -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)))).·
. .
·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
assertion: l:.ION(lcO, .
impfication~ .\/~ LION(.t} -. •FEROCIOUS(x•)
conclu~ion: FEROCIOUS(leo)
Unification
Unification algorithm: - 11
CP V Q) and CQ V R)
. 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
Ex.-npl~ of ·Resolutio~
... .
I.
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
VABIABlES
.. ·-
. {x,_.Y, z}
PREDICATES
{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
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
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-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
-
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
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 .
. \
scanning the next (Ules in sequence or restarting at the beg111nmg of the knowledge
base.
Ill
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)) . "
.
is pseudonom~!!- .
,.
· Figure 4.l A rule from the MYCIN system . .
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.