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

_ RESOLUTION IN FIRST.ORDER LOGIC, MFCS 2010.

Lupea \lihaiela

Resolution in predicate loqic.


R.esolution as a formal (axiomatic) system:
ResP' =

(rl'",, Fi{J,, r{l,, nii,),


xP,

where:

t .

tR:, FilJ,

-{-),<),n}:

alPhabet

u {l}:the

set of well formed formulas

ffJ,
n

the set of all clauses built using the alphabet

ti:"

empty clause, does not contain any literal, symbolizes inconsisten$'

' ,aii, =a the set of axioms . Rii, =1resP' ,fact)the set of inference rules containing
factoring rule (fact).

the resolution rule (res

:nd

cl : f

v /1 and

c2:

g v .-12 ,

c\,cz

are called clashing clauses if the

literals l1 and 12 ate unifiable'


The binary resolvent rs C:ResP'(Cl,C2):1(-f)u

)"(9

'

=ltv it u ...v Ilrv lk*tv "'Y l,r' )"= mgu(\,12,"',lp)

C'=

i-(l)v

)"(11,*1)v ...v ),(l,r)

We can combine these two inference tules and obtain thre definition of a resolvei: resolvent of tvvo clauses C1 and C2 can be:

--e

1) the binary resolvent of C1 and

C2;

2) the binary resolvent of C1 and a factor of C2; 3) the binary resolvent of a factor of C1 and C2; 4) the binary resolvent cf a factor of C1 and a factor

of C2.

RESOLUTION

I\

FIRST-ORDER LOGIC. MFCS

2010. Luoea \fihaiela

Example 9.

a)

C1

=p(f(x),qiil)v q(x,y);

C2=

- p(f(f(a)),q(z))

v q(f(a), g(z))

Res''(C1,CZ)=y(-r(a),y <-21 Q(f(a),2) v q(f(a),g(z)) b) C=p(x,g(y),2) .', p(a,g(b),a) 1zq(x,Z), g'=p(a,g(b),a)

v q(a,a) is a factorof C

Theorem 3. Let U1,U2,..,Un,V be first-order formulas.

1. V is a theorem if and only if (-U)'l-n.,tr.

2. (Jl,(J2,...,(Jnl--V if and only if

{{i1" ,U2' ,...,Lin'

,(- Z)'} l-n., n.

Resolution procedure for predicate logic


lnpr.rt: U'1,U2,..,Un,V - first-order fornrulas.

Output: message: "U1,U2,..,Un l- V" or "not U1,U2,..,Un l- V" or "we cannot decide if U1,U2, ,Un l- V or not U1,U2,..,Un lBegin

t1"

Build the set of clauses: 5= {Ulc, (J2' ,... .Un" oo

,(-,V)'i

select

lr1,12,

C1,C2 such that:

C1, C2 are clauses or factors of clauses of S;


11

C1, and

l2eC2:

if (11 and 12 are unifiable with 9=mgu(11,12)) then

C=Res(0(C1), e(C2))',

if(C=l) then write "U1,U2,..,Un l- V"; exit;


else S=S endil endif until( no new resolvenis can be derived or a predefined quantity of effort was done)
if (no new resolvents can be derived) then write "not U1,U2,..,Un l- V";

{C};

else write "we cannot decide


endif
Encl

if

U1,U2,..,Un l- V ar not U1,U2,..,Un l- V"

1 <

RESOLUTION IN FIR.ST-ORDER LOGIC, MFCS

2010. Lupea \lihaiela

The resolution procedure for predicate logic is a semi-decision procedure.


Theorem (Church 1936) The problem of validity of a first-order formuia ts undecidable, but is semi-decidable.
procedure P is used to check the validity of a formula we have the following situations:

If

" .

if a formula A is valid, then P ends with the corresponding answer.

if the formula A is not valid, then P ends with the conesponding answer or P may never

stop.

Example 10.
Check if

Al:8,

where

A: (Yx)(p(") -+ q(x)) and B: (Vx)p(x) +


A
and

(Vx)q(.x)

We transform the formulas

-.8

into clausal normal forms:

prenex normal forms: Ae: (Yx,\(--'p(x) v q(x)) = -((Y z) p(z) -+ (vy)q(v)) = (v = (Vz)(3y)( p(x) n -q(y))
z)

(-B)'

p(z)

'x

()v)-q(v) =

Skolem normal forms: " : ,as 1vx;1--p(x) v q(x)), (-3)t : (Y z)(p(z) n -q(f

(z))) , f is a unary Skolem function

.
A'

clausal normal forms:

: -p(x)v q(x) (-B)" : p(z) n-q(f


Cl: -p(x) v q(x) , C2: p(z),
C3:

(z))

We consider the following set of clauses: S:{C1,C2,C3}

-q(f

(z))

We derive the empty clause using resolution:

cr,czl -f:.:'r c4: q(x)


C4,C31 -[x,+'/(z)l

According to Theorem 3 we have that

Al:8.

RESOLUTION

FIRST-ORDER LOGIC, N/IFCS

- -0i0. Lupea tr,iihaiela

Example 11. Check the inconsistency of the set S using lock resolertion. S={--p(x) v q(x) v r(x),--q(.y) v r(y'), p(a),_-r(a)} a) We index the literals as follows: C1= (3) --p(x).v e1a@)v lLy r(x)
C2= (s) C3=
1o)

--q(y)v

gr(il
(7)--r(a)

p@)

C4=

The follovuing resolvents are obtained: C5= ResP,1C1,C41


f

riote)--p(a)v @q(a)

C6=

ResP'1cZ,C4;
=

(s\--q(a)

lv+-ol
C7= ResP'(C5,C6)

p.--p(.a)

cg= ResP'1C6,C7) = o

Si-if=, o

D-

and S is inconsistent.

b) another indexing:
C1= C2=

e)--p(x)v
$)--Q(y)v

1t7A@)v

67r(x)

er(y)

C3= (6) C4=

pla)

e)-,r(a)

The following resolvents are obtained:

C5= ResP'1C1,C2;

- - _ (21 -.p(x)v13;r(x) Ly<-xl


6r(a)

C6= ResP'(C3,Cs) = fx+-al c7= ResP'1C4,C6; = o

Was obtained another lock refutation from S.

RESOLUTION IN FIRST-ORDER LOGIC, MFCS

2010, Lupea lv{ihaiela

Example 12. Using resolution check the validity of the formula: U = (Y y)(1x)---,(p(x, y) e -,p(x, x))
--(J =
=

-'.((Vy)(f{--(p(*,/)

+>

'-p(x,x))) = (Iy)(Vx)(p(*,y)

e--p(x,x)'):

(ly)(VxX(--p(",
=

y)v

-',p(x,x)) n (p(*,x)v p(x,y))) prenex normal form


a- Skolem constant

$flfa
CI=

(--p(x,a)v --p(x,x)) n (p(*,*)v p(x,a)),

From the above clausal normal form we consider the clauses: ---,p(x,a)v

--p(x,x) and C2 = p(x,x)v p(x,a)

Resolving these two clauses we can derive only tautologies.

It is important to apply the factoriing rule for C1 and C2 and try to resolve their
factors.

ul-t;;a)

C3 =

-p(a,a),

C3 is a factor of

Cl.

r-.t lx<-al a,, -- p(a,a), C4.is a factor af C2. u.t- faci \-T C3,C4l

-rrrn, So -r'U is inconsistent and U is a valid formula.


4:{Cl
,C2,C3,C4} is an inconsistent set of

Exarnple 13. Using linear resolution prove,nut


clauses:

CI: P(x,I(x),e) C2:-S(:r) v -S(y) v -P(x, I(y),") v S(z) C3:S(a) C4:-S(e)


Constants: a,e, function symbols: predicate symbols: P,S For linear resolution we choose the top clause: C4

C2l

-r|;'t

C5: -S(.r) v -P(x,I (x), r) v S(z) , j5 ir

a factor

of C2

C4,C5l-ni"t C6:-S(x) v -P(x,I(x),e), central clause


C6,C3l

-l::"r C7: -P(a,I(a),e), c7,cli-t:":") cg:l

central clause

f-'#,

n:

-:)

A is an inconsistent set of clauses.

RESOLUTION IN FIRST-oRDER

LocIC,

MFCS

20r0, Lupea Mihaiera

C4

The refutation tree from

is:

lt

C5

top clause: C4
side clauses: C5, C3,Cl

C6 C7
C8:

C3

lt lt lt

central clauses: C6,C7,CB

CI

I
l

Example 14. Using general resolution prove that the followins S:{C 1,C2,C3,C4,C5,C6,C7 }

set

of clauses is

inconsistent.

Cl:--p(x)v q(x)v r(x,_f (x)),


C3: t(a)
,

C5:-r(a,y)v t(y) C7=-t(x) v -s(x)

C2: -p(x) v q(x) v s(/(x)) C4: p(a), C6: -t(x) v -q(x) ,

Constants: a, function symbols:l predicate symbols: p,q,r,s,t Durin-e the resolution process we obtain the followingieiolvents:

C8:Res(C3: r(a) ,C6:

-t(x) v -q(x)) v7^ -A(7)


,C4=

C9:Res(C2:-p(x)v q(x)v s(/("r))


C 1 O:Res(C 8=

p(a))
s

,,;,

q(a)v

s(_f

(a))

- q (a),C9 : q (a) v s ( f (a)) ):

(_f

(a))

Cll:Res(C1:-p(x)v q(x)v r(x,_f (x)),C4: p(a))


,.,_1,,
C
I

q(a)v r(a..f (a))


(o))
t

2:Res(C 8: -q (a),C I 1 :

(a) v r (a,

f (a)) ):,

(a,

"f

C I 3:Res(C

5:

-r

(a,

y) v t (y),C I 2:

r (a,

f (a)) )
r_u_

rr,,

(-f (a))

Cl4:Res(C7:-t(x)v -s(x) ,C13:t(f (a))): (a)) y,u,".t -s(f


C

15:Res(C 1A:

sff(a)),C14: -s(f(a)) ):n

We havethat S

l-R."n,

and thus ,S is inconsistent accdrding to the theorem of soundness and

completness of resolution.

/rt

RESOLUTION IN FIRST-ORDER LOGIC, MFCS

2010, Lupea Mihaiela

Example 15 - formalization of common-sense reasoning. From H1 , H2 and H3 can be derived the conclusion C? H1. All hummingbirds are richly colored. H2: No large birds live on honeY. H3: Birds that do not live on honey are dull in color. C: All hummingbirds are small.
Predicate formulas:

H1

-colored(x)) -+--lives H2: (Vx)(--,small -on -honey(x)) -bird(x) + --richly -colored(x)) H3: (Vx)(--lives -on _honey(x) C: (Vx)(ftummrngbird(x) --> small

:(Yx)(hummingbird(") -+ richly

We transform the formulas H1, H2, H3 and -.C into clausal normal forms: H1 "= --hummin gbird(") t richly _colored(x)) . C1

-bird(x))

-on -honey(x)): H3'= lives _on _honey(x)v '-richley _colored(x)): C3 -- C= --((Yx)(hummin gbird(x) -+ small =

H2"= small

-bird(x)v

--lives

C2

: (1x)(hummin
(

gbird(x)

---tsmall

-- C) " = hum mrn gbird (o) n --small _bird (a) =C4 nCS, a=S kolem con sta nt

-bird(x))) -bird(x))

The set of clauses corresponding to the formula H1 nH2nH3A--C is: 5={Cl,C2,C3,C4,Csi, having as a support-s"1 1={C4,C5}. We will not resolve
two clauses belonging both to the consistent set S-T={C1,C2,C3} corresponding to the hypothesis. C6=Res(C 1,C4) = yr*o1 richly-colored(a) C7=Res(C6,C3)= ft+_allives-on-honey(a) small-bi rd(a) CB=Res(C7,C2)=
[x+_a)

Cg=Res(C8,C5;= o

Sl-l:"r,
holds.

therefore S is an inconsistent set and the deduction H1,H2,H3 l-

A,L

You might also like