Вы находитесь на странице: 1из 3

Logic SampleQuestions

1. T/F:
a. ( A B ) C entails ( A C ) ( B C ) True,actuallyequivalent usetruth
tablesorconverttoCNF
b. ( P R ) ( Q R ) canbeconvertedintoaHornclause. True usinglogical
equivalences: P Q R
c. ( "x P ( x) ) ( "x P ( x)) is avalidsentence. False P couldbetruesometimesbutnot
always
d. "x x = x issatisfiable. True(alsovalid)
2. Consider ( A B ) ( A C ) ( B D ) ( C G ) ( D G )
Useresolutiontoprovethatthesentenceentails G.
clauses1and2resolveto ( B C )thisresolveswithclause4togive ( B G )thisresolves

withclause3togive ( G D )which resolveswithclause5togive,whichresolveswiththe


negatedquerytogivetheemptyclause
3. Correcteachlogicrepresentation ofthefollowingsentences:
a. Notwopeoplehavethesamesocialsecuritynumber
$x, y , n Person ( x ) Person ( y ) ( HasSS #( x, n ) HasSS #( y, n ))
incorrect usesimplicationwithexistential.Correctis
$x , y , n Person( x ) Person ( y ) ( x = y ) ( HasSS #( x , n) HasSS #( y , n ))
b. JohnssocialsecuritynumberisthesameasMarys
$n HasSS #( John, n ) HasSS #( Mary , n )
correct
c. Everyonessocialsecuritynumberhas9digits
"x, n Person ( x) ( HasSS #( x, n) Digits ( n, 9))
Incorrect sayseveryonehasanumber.Correctis:
"x , n ( Person( x ) HasSS #( x, n ) ) Digits ( n, 9)
d. Rewritetheabovesentences(uncorrected)usingthefunctionsymbolsSS#insteadof
thepredicateHasSS#.
$x, y Person ( x) Person ( y ) SS #( x ) =SS #( y )
SS #( John ) = SS #( Mary )
"x Person ( x) Digits ( SS #( x),9)
4. TranslatethefollowingsentencesintoFOLusingthepredicates French,Chilean,Wine,>, andthe
functions Price and Quality:
a. AllFrenchwinescostmorethanChileanwines.
"x French( x) Wine( x ) ( "y Chilean( y ) Wine( y ) >( Price( x), Price( y )))
b. ThebestChileanwinesarebetterthansomeFrenchwines.
$x Chilean( x) Wine( x) ( "y Chilean( y ) Wine( y ) > (Quality ( y ), Quality ( x)) ) ($z Frenc

5. Showthatthesentences:
a. "x ( "y P ( x, y ) ) Q( x)

= "x ( "y P( x, y ) ) Q( x)
= "x ( $y P( x, y ) )Q( x)
= P ( x, f ( x)) Q ( x)
b. "x $y ( P ( x, y ) Q( x))

= "x$y ( P( x, y ) Q ( x ))
= P ( x, f ( x)) Q ( x)
are logicallyequivalentbyconvertingthemtoCNF.GiveEnglishsentencesthatinterpret
P and Q tomakethesentencestrueintherealworld.
P couldbe hatesand Q couldbemisanthrope,or P couldbelovesand Q could
bephilanthrope
6. Assumethefollowingpropositions: BatteryDead, RadioWorks,OutOfGas, and CarStarts.
a. Whatisthetotalnumberofmodels? 24 =16models
b. Howmanymodelsarethereinwhichthefollowingsentenceisfalse?
( RadioWorks CarStarts ) ( OutOfGas BatteryDead )
R C istruein4 models, ( O B )= O B isfalseinthreeofthefourmodels
c. IsthesentenceaboveequivalenttoasetofHornclauses?
Yes, R C O and R C B
d. Showthatthesentenceaboveisnotentailedbythesentence
RadioWorks BatteryDead
Findamodelinwhichsentence 2 istrueandsentence1 isfalse,i.e.R,C,Oaretrue,B
isfalse
7. Let M(x) betrueifxisamailcarrier, B(x) istrueifxlivesinBerkeley,and K(x,y) betrueifx
knowsy.TranslatethefollowingintoFOL:
a. ThereareatleasttwomailcarrierswholiveinBerkeley.
$x, y M ( x) M ( y ) B( x) B( y ) ( x = y )
b. AllthemailcarrierswholiveinBerkeleyknoweachother.
"x, y M ( x) M ( y ) B ( x) B ( y ) K ( x, y )
8. Considerthefollowingsentence:
( ( Food Party) ( Drinks Party) ) ( ( Food Drinks) Party )
a. Determine,usingenumeration,whetherthesentenceisvalid,satisfiableor
unsatisfiable. Valid
b. ConverttheleftandrighthandsidesofthemainimplicationtoCNFandverifyyour
answertoa.
F D P forLHS andsameforRHS.Thusthisislike Q Q whichisvalid
c. Useresolutiontoprovea.
NegateandconverttoCNF:
( ( Food Party ) ( Drinks Party ) ( ( Food Drinks)Party ) )
= (( F P ) ( D P )) ( F D P )
= ( F D P ) ( F ) ( D ) ( P ) whichresolvestoemptyclause,thusthe
originalsentenceisvalid
9. CorrectthefollowingFOLtranslationsasnecessary:
a. AnyapartmentinBerkeleyhaslowerrentthansomeapartmentsinPaloAlto.
"x ( Apt ( x ) In( x, Berkeley ) $y ( ( Apt ( y ) In( x, PaloAlto)) <( Rnt ( x ), Rnt ( y )))

Incorrect,shouldbe
"x ( Apt ( x ) In( x, Berkeley ) $y ( ( Apt ( y ) In( y, PaloAlto)) <( Rnt ( x), Rnt ( y )))

b. ThereisexactlyoneapartmentinPaloAltowithrentbelow$1000.
$x Apt ( x) In( x, PaloAlto) "y ( Apt ( y ) In( y, PaloAlto) < ( Rnt ( y ), Dollars (1000)) ) y = x

Incorrect,shouldbe
(
$x Apt ( x) In( x, PaloAlto) < ( Rnt ( x), Dollars (1000)) "y ( Apt ( y ) In( y, PaloAlto) < ( Rnt (

c. IfanapartmentismoreexpensivethanallapartmentsinBerkeley,itmustbeinSan
Francisco
"x Apt ( x) ( "y Apt ( y ) In( y, Berkeley ) > ( Rnt ( x ), Rnt ( y ) ) ) In( x, SanFrancisco)

Incorrect,shouldbe
"x Apt ( x) ( "y Apt ( y ) In( y, Berkeley ) > ( Rnt ( x), Rnt ( y ) ) ) In( x, SanFrancisco)

Вам также может понравиться