Vous êtes sur la page 1sur 18

4/15/2016

http://logic.stanford.edu/intrologic/notes/chapter_06.html

Chapter6RelationalLogic

1/18

4/15/2016

Chapter6RelationalLogic

CHAPTER6

RelationalLogic
6.1Introduction
PropositionalLogicallowsustotalkaboutrelationshipsamongindividualpropositions,andit
givesusthemachinerytoderivelogicalconclusionsbasedontheserelationships.Suppose,for
example,webelievethat,ifJackknowsJill,thenJillknowsJack.Supposewealsobelievethat
JackknowsJill.Fromthesetwofacts,wecanconcludethatJillknowsJackusingasimple
applicationofImplicationElimination.
Unfortunately,whenwewanttosaythingsmoregenerally,wefindthatPropositionalLogicis
inadequate.Suppose,forexample,thatwewantedtosaythat,ingeneral,ifonepersonknowsa
secondperson,thenthesecondpersonknowsthefirst.Suppose,asbefore,thatwebelievethat
JackknowsJill.HowdoweexpressthegeneralfactinawaythatallowsustoconcludethatJill
knowsJack?Here,PropositionalLogicisinadequateitgivesusnowayofsuccinctlyencoding
thismoregeneralbeliefinaformthatcapturesitsfullmeaningandallowsustoderivesuch
conclusions.
RelationalLogicisanalternativetoPropositionalLogicthatsolvesthisproblem.Thetrickisto
augmentourlanguagewithtwonewlinguisticfeatures,viz.variablesandquantifiers.Withthese
newfeatures,wecanexpressinformationaboutmultipleobjectswithoutenumeratingthose
objectsandwecanexpresstheexistenceofobjectsthatsatisfyspecifiedconditionswithout
sayingwhichobjectstheyare.
Inthischapter,weproceedthroughthesamestagesasintheintroductiontoPropositionalLogic.
Westartwithsyntaxandsemantics.Wethendiscussevaluationandsatisfaction.Welookatsome
examples.Then,wetalkaboutpropertiesofRelationalLogicsentencesandlogicalentailmentfor
RelationalLogic.Finally,wesayafewwordsabouttheequivalenceofRelationalLogicand
PropositionalLogicanditsdecidability.

6.2Syntax
InPropositionalLogic,sentencesareconstructedfromabasicvocabularyofpropositional
constants.InRelationalLogic,therearenopropositionalconstantsinsteadwehaveobject
constants,relationconstants,andvariables.
Inourexampleshere,wewritebothvariablesandconstantsasstringsofletters,digits,andafew
nonalphanumericcharacters(e.g."_").Byconvention,variablesbeginwithlettersfromtheendof
thealphabet(viz.u,v,w,x,y,z).Examplesincludex,ya,andz_2.Byconvention,allconstants
beginwitheitheralphabeticletters(otherthanu,v,w,x,y,z)ordigits.Examplesincludea,b,123,
comp225,andbarack_obama.
Notethatthereisnodistinctioninspellingbetweenobjectconstantsandrelationconstants.The
typeofeachsuchwordisdeterminedbyitsusageor,insomecases,inanexplicitspecification.
http://logic.stanford.edu/intrologic/notes/chapter_06.html

2/18

4/15/2016

Chapter6RelationalLogic

Asweshallsee,relationconstantsareusedinformingcomplexexpressionsbycombiningthem
withanappropriatenumberofarguments.Accordingly,eachrelationconstanthasanassociated
arity,i.e.thenumberofargumentswithwhichthatrelationconstantcanbecombined.Arelation
constantthatcancombinedwithasingleargumentissaidtobeunaryonethatcanbecombined
withtwoargumentsissaidtobebinaryonethatcanbecombinedwiththreeargumentsissaidto
beternarymoregenerally,arelationconstantthatcanbecombinedwithnargumentsissaidtobe
nary.
Avocabularyconsistsofasetofobjectconstants,asetofrelationconstants,andanassignmentof
aritiesforeachoftherelationconstantsinthevocabulary.(Notethatthisdefinitionhereisslightly
nontraditional.Inmanytextbooks,avocabulary(sometimescalledasignature)includesa
specificationofrelationconstantsbutnotobjectconstants,whereasourdefinitionhereincludes
bothtypesofconstants.)
Atermisdefinedtobeavariableoranobjectconstant.Termstypicallydenoteobjectspresumed
orhypothesizedtoexistintheworldand,assuch,theyareanalogoustonounphrasesinnatural
language,e.g.Joeorsomeone.
TherearethreetypesofsentencesinRelationalLogic,viz.relationalsentences(theanalogof
propositionsinPropositionalLogic),logicalsentences(analogoustothelogicalsentencesin
PropositionalLogic),andquantifiedsentences(whichhavenoanaloginPropositionalLogic).
Arelationalsentenceisanexpressionformedfromannaryrelationconstantandnterms.For
example,ifqisarelationconstantwitharity2andifaandyareterms,thentheexpressionshown
belowisasyntacticallylegalrelationalsentence.Relationalsentencesaresometimescalledatoms
todistinguishthemfromlogicalandquantifiedsentences.
q(a,y)
LogicalsentencesaredefinedasinPropositionalLogic.Therearenegations,conjunctions,
disjunctions,implications,andequivalences.Thesyntaxisexactlythesame,exceptthatthe
elementarycomponentsarerelationalsentencesratherthanpropositionconstants.
Quantifiedsentencesareformedfromaquantifier,avariable,andanembeddedsentence.The
embeddedsentenceiscalledthescopeofthequantifier.Therearetwotypesofquantified
sentencesinRelationalLogic,viz.universallyquantifiedsentencesandexistentiallyquantified
sentences.
Auniversallyquantifiedsentenceisusedtoassertthatallobjectshaveacertainproperty.For
example,thefollowingexpressionisauniversallyquantifiedsentenceassertingthat,ifpholdsof
anobject,thenqholdsofthatobjectanditself.
(x.(p(x)q(x,x)))
Anexistentiallyquantifiedsentenceisusedtoassertthatsomeobjecthasacertainproperty.For
example,thefollowingexpressionisanexistentiallyquantifiedsentenceassertingthatthereisan
objectthatsatisfiespand,whenpairedwithitself,satisfiesqaswell.
(x.(p(x)q(x,x)))
Notethatquantifiedsentencescanbenestedwithinothersentences.Forexample,inthefirst
sentencebelow,wehavequantifiedsentencesinsideofadisjunction.Inthesecondsentence,we
haveaquantifiedsentencenestedinsideofanotherquantifiedsentence.
http://logic.stanford.edu/intrologic/notes/chapter_06.html

3/18

4/15/2016

Chapter6RelationalLogic

((x.p(x))(x.q(x,x)))
(x.(y.q(x,y)))
AswithPropositionalLogic,wecandropunneededparenthesesinRelationalLogic,relyingon
precedencetodisambiguatethestructureofunparenthesizedsentences.InRelationalLogic,the
precedencerelationsofthelogicaloperatorsarethesameasinPropositionalLogic,andquantifiers
havehigherprecedencethanlogicaloperators.
Thefollowingexamplesshowhowtoparenthesizesentenceswithbothquantifiersandlogical
operators.Thesentencesontherightarepartiallyparenthesizedversionsofthesentencesonthe
left.(Tobefullyparenthesized,wewouldneedtoaddparenthesesaroundeachofthesentencesas
awhole.)
x.p(x)q(x)
x.p(x)q(x)

(x.p(x))q(x)
(x.p(x))q(x)

Noticethat,ineachoftheseexamples,thequantifierdoesnotapplytothesecondrelational
sentence,eventhough,ineachcase,thatsentencecontainsanoccurrenceofthevariablebeing
quantified.Ifwewanttoapplythequantifiertoalogicalsentence,wemustenclosethatsentence
inparentheses,asinthefollowingexamples.
x.(p(x)q(x))
x.(p(x)q(x))
AnexpressioninRelationalLogicisgroundifandonlyifitcontainsnovariables.Forexample,
thesentencep(a)isground,whereasthesentencex.p(x)isnot.
Anoccurrenceofavariableisfreeifandonlyifitisnotinthescopeofaquantifierofthat
variable.Otherwise,itisbound.Forexample,yisfreeandxisboundinthefollowingsentence.
x.q(x,y)
Asentenceisopenifandonlyifithasfreevariables.Otherwise,itisclosed.Forexample,thefirst
sentencebelowisopenandthesecondisclosed.
p(y)x.q(x,y)
y.(p(y)x.q(x,y))

6.3Semantics
ThesemanticsofRelationalLogicpresentedhereistermedHerbrandsemantics.Itisnamedafter
thelogicianHerbrand,whodevelopedsomeofitskeyconcepts.AsHerbrandisFrench,itshould
properlybepronounced"airbrahn".However,mostpeopleresorttotheAnglicizationofthis,
insteadpronouncingit"herbrand".(OneexceptionisStanleyPeters,whohasbeenknownattimes
topronounceit"harebrained".)
TheHerbrandbaseforavocabularyisthesetofallgroundrelationalsentencesthatcanbeformed
fromtheconstantsofthelanguage.Saidanotherway,itisthesetofallsentencesoftheform
r(t1,...,tn),whererisannaryrelationconstantandt1,...,tnareobjectconstants.
Foravocabularywithobjectconstantsaandbandrelationconstantspandqwherephasarity1
andqhasarity2,theHerbrandbaseisshownbelow.
http://logic.stanford.edu/intrologic/notes/chapter_06.html

4/18

4/15/2016

Chapter6RelationalLogic

{p(a),p(b),q(a,a),q(a,b),q(b,a),q(b,b)}
Itisworthwhiletonotethat,foragivenrelationconstantandafinitesetofterms,thereisanupper
boundonthenumberofgroundrelationalsentencesthatcanbeformedusingthatrelation
constant.Inparticular,forasetoftermsofsizeb,therearebndistinctntuplesofobjectconstants
andhencetherearebngroundrelationalsentencesforeachnaryrelationconstant.Sincethe
numberofrelationconstantsinavocabularyisfinite,thismeansthattheHerbrandbaseisalso
finite.
AtruthassignmentforaRelationalLogiclanguageisafunctionthatmapseachgroundrelational
sentenceintheHerbrandbasetoatruthvalue.AsinPropositionalLogic,weusethedigit1asa
synonymfortrueand0asasynonymforfalseandwerefertothevalueassignedtoaground
relationalsentencebywritingtherelationalsentencewiththenameofthetruthassignmentasa
superscript.Forexample,thetruthassignmentidefinedbelowisanexampleforthecaseofthe
languagementionedafewparagraphsabove.
p(a)i=1
p(b)i=0
q(a,a)i=1
q(a,b)i=0
q(b,a)i=1
q(b,b)i=0
AswithPropositionalLogic,oncewehaveatruthassignmentforthegroundrelationalsentences
ofalanguage,thesemanticsofouroperatorsprescribesauniqueextensionofthatassignmentto
thecomplexsentencesofthelanguage.
TherulesforlogicalsentencesinRelationalLogicarethesameasthoseforlogicalsentencesin
PropositionalLogic.Atruthassignmentisatisfiesanegationifandonlyifidoesnotsatisfy.
Truthassignmentisatisfiesaconjunction(1...n)ifandonlyifisatisfieseveryi.Truth
assignmentisatisfiesadisjunction(1...n)ifandonlyifisatisfiesatleastonei.Truth
assignmentisatisfiesanimplication()ifandonlyifidoesnotsatisfyordoessatisfy.
Truthassignmentisatisfiesanequivalence()ifandonlyifisatisfiesbothandorit
satisfiesneithernor.
Inordertodefinesatisfactionofquantifiedsentences,weneedthenotionofinstances.Aninstance
ofanexpressionisanexpressioninwhichallfreevariableshavebeenconsistentlyreplacedby
groundterms.Consistentreplacementheremeansthat,ifoneoccurrenceofavariableisreplaced
byagroundterm,thenalloccurrencesofthatvariablearereplacedbythesamegroundterm.
Auniversallyquantifiedsentenceistrueforatruthassignmentifandonlyifeveryinstanceofthe
scopeofthequantifiedsentenceistrueforthatassignment.Anexistentiallyquantifiedsentenceis
trueforatruthassignmentifandonlyifsomeinstanceofthescopeofthequantifiedsentenceis
trueforthatassignment.
Atruthassignmentisatisfiesasentencewithfreevariablesifandonlyifitsatisfieseveryinstance
ofthatsentence.Atruthassignmentisatisfiesasetofsentencesifandonlyifisatisfiesevery
sentenceintheset.

6.4Evaluation
http://logic.stanford.edu/intrologic/notes/chapter_06.html

5/18

4/15/2016

Chapter6RelationalLogic

EvaluationforRelationalLogicissimilartoevaluationforPropositionalLogic.Theonly
differenceisthatweneedtodealwithquantifiers.Inordertoevaluateauniversallyquantified
sentence,wecheckthatallinstancesofthescopearetrue.(Weareineffecttreatingitasthe
conjunctionofallthoseinstances.)Inordertoevaluateanexistentiallyquantifiedsentence,we
checkthatatleastoneinstanceofthescope.(Weareineffecttreatingitasthedisjunctionofthose
instances.)
Asanexample,considerthesentencex.(p(x)q(x,x)).Whatisthetruthvalueunderthetruth
assignmentshownintheprecedingsection?Forthislanguage,withobjectconstantsaandb,there
arejusttwoinstances.Seebelow.
p(a)q(a,a)
p(b)q(b,b)
Weknowthatp(a)istrueandq(a,a)istrue,sothefirstinstanceistrue.q(b,b)isfalse,butsois
p(b)sothesecondinstanceistrueaswell.Sincebothinstancesaretrue,theoriginalquantified
sentenceistrue.
Nowlet'sconsideracasewithnestedquantifiers.Isx.y.q(x,y)trueorfalseforthetruth
assignmentshownabove?Asbefore,weknowthatthissentenceistrueifeveryinstanceofits
scopeistrue.Thetwopossibleinstancesareshownbelow.
y.q(a,y)
y.q(b,y)
Todeterminethetruthofthefirstoftheseexistentialsentences,wemustfindatleastoneinstance
ofthescopethatistrue.Thepossibilitiesareshownbelow.Ofthese,thefirstistrueandsothe
firstexistentialsentenceistrue.
q(a,a)
q(a,b)
Now,wedothesameforthesecondexistentiallyquantified.Thepossibleinstancesfollow.Of
these,againthefirstistrueandsothesecondexistentialsentenceistrue.
q(b,a)
q(b,b)
Sincebothexistentialsentencesaretrue,theoriginaluniversallyquantifiedsentencemustbetrue
aswell.

6.5Satisfaction
AsinPropositionalLogic,itisinprinciplepossibletobuildatruthtableforanysetofsentencesin
RelationalLogic.Thistruthtablecanthenbeusedtodeterminewhichtruthassignmentssatisfya
givensetofsentences.
Asanexample,letusassumewehavealanguagewithjusttwoobjectconstantsaandbandtwo
unaryrelationconstantspandq.Nowconsiderthesentencesshownbelow,andassumeourjobis
tofindatruthassignmentthatsatisfiesthesesentences.
http://logic.stanford.edu/intrologic/notes/chapter_06.html

6/18

4/15/2016

Chapter6RelationalLogic

p(a)p(b)
x.(p(x)q(x))
x.q(x)
Atruthtableforthisproblemisshownbelow.Eachofthefourcolumnsontheleftrepresentsone
oftheelementsoftheHerbrandbaseforthislanguage.Thethreecolumnsontherightrepresent
oursentences.
p(a)

p(b)

q(a)

q(b)

1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0

1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0

1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0

1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0

p(a)p(b) x.(p(x)q(x)) x.q(x)


1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0

1
0
0
0
1
1
0
0
1
0
1
0
1
1
1
1

1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
0

Lookingatthetable,weseethattherearetwelvetruthassignmentsthatmakethefirstsentence
true,ninethatmakethesecondsentencetrue,12thatmakethethirdsentencetrue,andfivethat
makethemalltrue(rows1,5,6,9,and11).

6.6ExampleSororityWorld
ConsideronceagaintheSororityWorldexampleintroducedinChapter1.Recallthatthisworld
focussesontheinterpersonalrelationsofasmallsorority.TherearejustfourmembersAbby,
Bess,Cody,andDana.Ourgoalistorepresentinformationaboutwholikeswhom.
InordertoencodethisinformationinRelationalLogic,weadoptavocabularywithfourobject
constants(abby,bess,cody,dana)andonebinaryrelationconstant(likes).
Ifwehadcompleteinformationaboutthelikesanddislikesofthegirls,wecouldcompletely
characterizethestateofaffairsasasetofgroundrelationalsentencesornegationsofground
relationalsentences,liketheonesshownbelow,withonesentenceforeachmemberofthe
Herbrandbase.(Inourexamplehere,wehavewrittenthepositiveliteralsinblackandthenegative
literalsingreyinordertodistinguishthetwomoreeasily.)

http://logic.stanford.edu/intrologic/notes/chapter_06.html

7/18

4/15/2016

Chapter6RelationalLogic

likes(abby,abby)
likes(bess,abby)
likes(cody,abby)
likes(dana,abby)

likes(abby,bess)
likes(bess,bess)
likes(cody,bess)
likes(dana,bess)

likes(abby,cody)
likes(bess,cody)
likes(cody,cody)
likes(dana,cody)

likes(abby,dana)
likes(bess,dana)
likes(cody,dana)
likes(dana,dana)

Tomakethingsmoreinteresting,let'sassumethatwedonothavecompleteinformation,only
fragmentsofinformationaboutthegirlslikesanddislikes.Let'sseehowwecanencodesuch
fragmentsinRelationalLogic.
Let'sstartwithasimpledisjunction.BesslikesCodyorDana.Encodingasentencewitha
disjunctivenounphrase(suchasCodyorDana)isfacilitatedbyfirstrewritingthesentenceasa
disjunctionofsimplesentences.BesslikesCodyorBesslikesDana.InRelationalLogic,wecan
expressthisfactasasimpledisjunctionwiththetwopossibilitiesasdisjuncts.
likes(bess,cody)likes(bess,dana)
AbbylikeseveryoneBesslikes.Again,paraphrasinghelpstranslate.IfBesslikesagirl,thenAbby
alsolikesher.Sincethisisafactabouteveryone,weuseauniversalquantifier.
y.(likes(bess,y)likes(abby,y))
Codylikeseveryonewholikesher.Inotherwords,ifsomegirllikesCody,thenCodylikesthatgirl.
Again,weuseauniversalquantifier.
y.(likes(y,cody)likes(cody,y))
Besslikessomebodywholikesher.Thewordsomebodyhereisatipoffthatweneedtousean
existentialquantifier.
y.(likes(bess,y)likes(y,bess))
Nobodylikesherself.Theuseofthewordnobodyheresuggestsanegation.Agoodtechniquein
suchcasesistorewritetheEnglishsentenceasthenegationofapositiveversionofthesentence
beforetranslatingtoRelationalLogic.
x.likes(x,x)
Everybodylikessomebody.Herewehaveacaserequiringtwoquantifiers,oneuniversalandone
existential.Thekeytothiscaseisgettingthequantifiersintherightorder.Reversingthemleadsto
averydifferentstatement.
x.y.likes(x,y)
Thereissomeoneeveryonelikes.Theprecedingsentencetellsusthateveryonelikessomeone,but
thatsomeonecanbedifferentfordifferentpeople.Thissentencetellsusthateverybodylikesthe
sameperson.
y.x.likes(x,y)

6.7ExampleBlocksWorld
TheBlocksWorldisapopularapplicationareaforillustratingideasinthefieldofArtificial
Intelligence.AtypicalBlocksWorldsceneisshowninFigure1.
http://logic.stanford.edu/intrologic/notes/chapter_06.html

8/18

4/15/2016

Chapter6RelationalLogic

A
B

Figure1OnestateofBlocksWorld.
Mostpeoplelookingatthisfigureinterpretitasaconfigurationoffivetoyblocks.Somepeople
conceptualizethetableonwhichtheblocksarerestingasanobjectaswellbut,forsimplicity,we
ignoreithere.
Inordertodescribethisscene,weadoptavocabularywithfiveobjectconstants,asshownbelow,
withoneobjectconstantforeachofthefiveblocksinthescene.Theintenthereisforeachof
theseobjectconstantstorepresenttheblockmarkedwiththecorrespondingcapitalletterinthe
scene.
{a,b,c,d,e}
InaspatialconceptualizationoftheBlocksWorld,therearenumerousmeaningfulrelations.For
example,itmakessensetothinkabouttherelationthatholdsbetweentwoblocksifandonlyifone
isrestingontheother.Inwhatfollows,weusetherelationconstantontorefertothisrelation.We
mightalsothinkabouttherelationthatholdsbetweentwoblocksifandonlyifoneisanywhere
abovetheother,i.e.thefirstisrestingonthesecondorisrestingonablockthatisrestingonthe
second,andsoforth.Inwhatfollows,weusetherelationconstantabovetotalkaboutthisrelation.
Thereistherelationthatholdsofthreeblocksthatarestackedoneontopoftheother.Weusethe
relationconstantstackasanameforthisrelation.Weusetherelationconstantcleartodenotethe
relationthatholdsofablockifandonlyifthereisnoblockontopofit.Weusetherelation
constanttabletodenotetherelationthatholdsofablockifandonlyifthatblockisrestingonthe
table.Thesetofrelationconstantscorrespondingtothisconceptualizationisshownbelow.
{on,above,stack,clear,table}
Thearitiesoftheserelationconstantsaredeterminedbytheirintendeduse.Sinceonisintendedto
denotearelationbetweentwoblocks,ithasarity2.Similarly,abovehasarity2.Thestackrelation
constanthasarity3.Relationconstantsclearandtableeachhavearity1.
Giventhisvocabulary,wecandescribethesceneinFigure1bywritinggroundliteralsthatstate
whichrelationsholdofwhichobjectsorgroupsofobjects.Let'sstartwithon.Thefollowing
sentencestellusdirectlyforeachgroundrelationalsentencewhetheritistrueorfalse.(Once
again,wehavewrittenthepositiveliteralsinblackandthenegativeliteralsingreyinorderto
distinguishthetwomoreeasily.)
on(a,a)
on(b,a)
on(c,a)
on(d,a)
on(e,a)

on(a,b)
on(b,b)
on(c,b)
on(d,b)
on(e,b)

on(a,c)
on(b,c)
on(c,c)
on(d,c)
on(e,c)

on(a,d)
on(b,d)
on(c,d)
on(d,d)
on(e,d)

on(a,e)
on(b,e)
on(c,e)
on(d,e)
on(e,e)

Wecandothesamefortheotherrelations.However,thereisaneasierway.Eachoftheremaining
http://logic.stanford.edu/intrologic/notes/chapter_06.html

9/18

4/15/2016

Chapter6RelationalLogic

relationscanbedefinedintermsofon.Thesedefinitionstogetherwithourfactsabouttheon
relationlogicallyentaileveryothergroundrelationalsentenceoritsnegation.Hence,giventhese
definitions,wedonotneedtowriteoutanyadditionaldata.
Ablocksatisfiestheclearrelationifandonlyifthereisnothingonit.
y.(clear(y)x.on(x,y))
Ablocksatisfiesthetablerelationifandonlyifitisnotonsomeblock.
x.(table(x)y.on(x,y))
Threeblockssatisfythestackrelationifandonlyifthefirstisonthesecondandthesecondison
thethird.
x.y.z.(stack(x,y,z)on(x,y)on(y,z))
Theaboverelationisabittrickytodefinecorrectly.Oneblockisaboveanotherblockifandonly
ifthefirstblockisonthesecondblockoritisonanotherblockthatisabovethesecondblock.
Also,noblockcanbeaboveitself.Givenacompletedefinitionfortheonrelation,thesetwo
axiomsdetermineauniqueaboverelation.
x.z.(above(x,z)on(x,z)y.(on(x,y)above(y,z)))
x.above(x,x)
Oneadvantagetodefiningrelationsintermsofotherrelationsiseconomy.Ifwerecordon
informationforeveryobjectandencodetherelationshipbetweentheonrelationandtheseother
relations,thereisnoneedtorecordanygroundrelationalsentencesforthoserelations.
AnotheradvantageisthatthesegeneralsentencesapplytoBlocksWorldscenesotherthantheone
picturedhere.ItispossibletocreateaBlocksWorldsceneinwhichnoneoftheonsentenceswe
havelistedistrue,butthesegeneraldefinitionsarestillcorrect.

6.8ExampleModularArithmetic
Inthisexample,weshowhowtocharacterizeModularArithmeticinRelationalLogic.InModular
Arithmetic,thereareonlyfinitelymanyobjects.Forexample,inModularArithmeticwith
modulus4,wewouldhavejustfourintegers0,1,2,3andthat'sall.Ourgoalheretodefinethe
additionrelation.Admittedly,thisisamodestgoalbut,onceweseehowtodothiswecanusethe
sameapproachtodefineotherarithmeticrelations.
Let'sstartwiththesamerelation,whichistrueofeverynumberanditselfandisfalsefornumbers
thataredifferent.Wecancompletelycharacterizethesamerelationbywritinggroundrelational
sentences,onepositivesentenceforeachnumberanditselfandnegativesentencesforallofthe
othercases.
same(0,0)
same(1,0)
same(2,0)
same(3,0)

same(0,1)
same(1,1)
same(2,1)
same(3,1)

same(0,2)
same(1,2)
same(2,2)
same(3,2)

same(0,3)
same(1,3)
same(2,3)
same(3,3)

Now,let'saxiomatizethenextrelation,which,foreachnumber,givesthenextlargernumber,
wrappingbackto0afterwereach3.
http://logic.stanford.edu/intrologic/notes/chapter_06.html

10/18

4/15/2016

Chapter6RelationalLogic

next(0,1)
next(1,2)
next(2,3)
next(3,0)
Properly,weshouldwriteoutthenegativeliteralsaswell.However,wecansavethatworkby
writingasingleaxiomassertingthatnextisafunctionalrelation,i.e.,foreachmemberofthe
Herbrandbase,thereisjustonesuccessor.
x.y.z.(next(x,y)next(x,z)same(y,z)
Inordertoseewhythissavesustheworkofwritingoutthenegativeliterals,wecanwritethis
axiomintheequivalentformshownbelow.
x.y.z.(next(x,y)same(y,z)next(x,z))
TheadditiontableforModularArithmeticistheusualadditiontableforarbitrarynumbersexcept
thatwewraparoundwheneverwegetpast3.Forsuchasmallarithmetic,itiseasytowriteoutthe
groundrelationalsentencesforaddition,asshownbelow.
plus(0,0,0)
plus(0,1,1)
plus(0,2,2)
plus(0,3,3)

plus(1,0,1)
plus(1,1,2)
plus(1,2,3)
plus(1,3,0)

plus(2,0,2)
plus(2,1,3)
plus(2,2,0)
plus(2,3,1)

plus(3,0,3)
plus(3,1,0)
plus(3,2,1)
plus(3,3,2)

Aswithnext,weavoidwritingoutthenegativeliteralsbywritingasuitablefunctionalityaxiom
forplus.
x.y.z.w.(plus(x,y,z)same(z,w)plus(x,y,w))
That'sonewaytodothings,butwecandobetter.Ratherthanwritingoutallofthoserelational
sentences,wecanuseRelationalLogictodefineplusintermsofsameandnextandusethat
axiomatizationtodeducethegroundrelationalsentences.Thedefinitionisshownbelow.First,we
haveanidentityaxiom.Adding0toanynumberresultsinthesamenumber.Secondwehavea
successoraxiom.Ifzisthesumofxandy,thenthesumofthesuccessorofxandyisthesuccessor
ofz.Finally,wehaveourfunctionalityaxiomonceagain.
y.plus(0,y,y)
x.y.z.x2.z2.(plus(x,y,z)next(x,x2)next(z,z2)plus(x2,y,z2))
x.y.z.w.(plus(x,y,z)same(z,w)plus(x,y,w))
Oneadvantageofdoingthingsthiswayiseconomy.Withthesesentences,wedonotneedthe
groundrelationalsentencesaboutplusgivenabove.Theyarealllogicallyentailedbyour
sentencesaboutnextandthedefinitionalsentences.Asecondadvantageisversatility.Our
sentencesdefineplusintermsofnextforarithmeticwithanymodulus,notjustmodulus4.

6.9Validity,Contingency,andUnsatsfiability
Asentenceissatisfiableifandonlyifitissatisfiedbyatleastonetruthassignment.Asentenceis
falsifiableifandonlyifthereisatleastonetruthassignmentthatmakesitfalse.Wehavealready
seenseveralexamplesofsatisfiableandfalsifiablesentences.Asentenceisunsatisfiableifand
http://logic.stanford.edu/intrologic/notes/chapter_06.html

11/18

4/15/2016

Chapter6RelationalLogic

onlyifitisnotsatisfiedbyanytruthassignment,i.e.nomatterwhattruthassignmentwetake,the
sentenceisalwaysfalse.Asentenceiscontingentifandonlyifitisbothsatisfiableandfalsifiable,
i.e.itisneithervalidnorunsatisfiable.
Notonlyarethedefinitionsoftheseconceptsthesamesomeoftheresultsarethesameaswell.If
wethinkofgroundrelationalsentencesaspropositions,wegetsimilarresultsforthetwologicsa
groundsentenceinRelationalLogicisvalid/contingent/unsatisfiableifandonlyifthe
correspondingsentenceinPropositionalLogicisvalid/contingent/unsatisfiable.
Here,forexample,areRelationalLogicversionsofcommonPropositionalLogicvaliditiesthe
LawoftheExcludedMiddle,DoubleNegation,anddeMorgan'slawsfordistributingnegation
overconjunctionanddisjunction.
p(a)p(a)
p(a)p(a)
(p(a)q(a,b))(p(a)q(a,b))
(p(a)q(a,b))(p(a)q(a,b))
Ofcourse,notallsentencesinRelationalLogicareground.TherearevalidsentencesofRelational
LogicforwhichtherearenocorrespondingsentencesinPropositionalLogic.
TheCommonQuantifierReversaltellsusthatreversingquantifiersofthesametypehasnoeffect
ontruthassignment.
x.y.q(x,y)y.x.q(x,y)
x.y.q(x,y)y.x.q(x,y))
ExistentialDistributiontellsusthatitisokaytomoveanexistentialquantifierinsideofauniversal
quantifier.(Notethatthereverseisnotvalid,asweshallseelater.)
y.x.q(x,y)x.y.q(x,y)
Finally,NegationDistributiontellsusthatitisokaytodistributenegationoverquantifiersofeither
typebyflippingthequantifierandnegatingthescopeofthequantifiedsentence.
x.p(x)x.p(x)

6.10LogicalEntailment
AsetofRelationalLogicsentenceslogicallyentailsasentence(written|=)ifandonlyif
everytruthassignmentthatsatisfiesalsosatisfies.
Aswithvalidityandcontingencyandsatisfiability,thisdefinitionisthesameforRelationalLogic
asforPropositionalLogic.Asbefore,ifwetreatgroundrelationalsentencesaspropositions,we
getsimilarresults.Inparticular,asetofgroundpremisesinRelationalLogiclogicallyentailsa
groundconclusioninRelationalLogicifandonlyifthecorrespondingsetofPropositionalLogic
premiseslogicallyentailsthecorrespondingPropositionalLogicconclusion.
Forexample,wehavethefollowingresults.Thesentencep(a)logicallyentails(p(a)p(b)).The
sentencep(a)doesnotlogicallyentail(p(a)p(b)).However,anysetofsentencescontainingboth
p(a)andp(b)doeslogicallyentail(p(a)p(b)).
Thepresenceofvariablesallowsforadditionallogicalentailments.Forexample,thepremise
http://logic.stanford.edu/intrologic/notes/chapter_06.html

12/18

4/15/2016

Chapter6RelationalLogic

y.x.q(x,y)logicallyentailstheconclusionx.y.q(x,y).Ifthereissomeobjectythatispaired
witheveryx,theneveryxhassomeobjectthatitpairswith,viz.y.
Hereisanotherexample.Thepremisex.y.q(x,y)logicallyentailstheconclusionx.y.q(y,x).
Thefirstsentencesaysthatqistrueforallpairsofobjects,andthesecondsentencesaystheexact
samething.Incaseslikethis,wecaninterchangevariables.
UnderstandinglogicalentailmentforRelationalLogiciscomplicatedbythefactthatitispossible
tohavefreevariablesinRelationalLogicsentences.Consider,forexample,thepremiseq(x,y)and
theconclusionq(y,x).Doesq(x,y)logicallyentailq(y,x)ornot?
OurdefinitionforlogicalentailmentandthesemanticsofRelationalLogicgiveaclearanswerto
thisquestion.Logicalentailmentholdsifandonlyifeverytruthassignmentthatsatisfiesthe
premisesatisfiestheconclusion.Atruthassignmentsatisfiesasentencewithfreevariablesifand
onlyifitsatisfieseveryinstance.Inotherwords,asentencewithfreevariablesisequivalenttothe
sentenceinwhichallofthefreevariablesareuniversallyquantified.Inotherwords,q(x,y)is
satisfiedifandonlyifx.y.q(x,y)issatisfied,andsimilarlyforq(y,x).So,thefirstsentencehere
logicallyentailsthesecondifandonlyifx.y.q(x,y)logicallyentailsx.y.q(y,x)and,aswejust
saw,thisis,infact,thecase.

6.11RelationalLogicandPropositionalLogic
OneinterestingfeatureofRelationalLogic(RL)isthatitisexpressivelyequivalentto
PropositionalLogic(PL).ForanyRLlanguage,wecanproduceapairingbetweentheground
relationalsentencesinthatlanguageandthepropositionconstantsinaPropositionalLogic
language.Giventhiscorrespondence,foranysetofarbitrarysentencesinourRLlanguage,there
isacorrespondingsetofsentencesinthelanguageofPLsuchthatanyRLtruthassignmentthat
satisfiesourRLsentencesagreeswiththecorrespondingPropositionalLogictruthassignment
appliedtothePropositionalLogicsentences.
TheprocedurefortransformingourRLsentencestoPLhasmultiplesteps,buteachstepiseasy.
Wefirstconvertoursentencestoprenexform,thenwegroundtheresult,andwerewritein
PropositionalLogic.Let'slookatthesestepsinturn.
Asentenceisinprenexformifandonlyifitisclosedandallofthequantifiersareontheoutside
ofalllogicaloperators.
ConvertingasetofRLsentencestoalogicallyequivalentsetinprenexformissimple.First,we
renamevariablesindifferentquantifiedsentencestoeliminateanyduplicates.Wethenapply
quantifierdistributionrulesinreversetomovequantifiersoutsideoflogicaloperators.Finally,we
universallyquantifyanyfreevariablesinoursentences.
Forexample,toconvertthesentencey.p(x,y)y.q(y)toprenexform,wefirstrenameoneofthe
variables.Inthiscase,let'srenametheyintheseconddisjuncttoz.Thisresultsinthesentence
y.p(x,y)z.q(z).Wethenapplythedistributionrulesinreversetoproducey.z.(p(x,y)q(z)).
Finally,weuniversallyquantifythefreevariablextoproducetheprenexformofouroriginal
sentence,viz.x.y.z.(p(x,y)q(z))
Oncewehaveasetofsentencesinprenexform,wecomputethegrounding.Westartwithour
initialsetofsentencesandweincrementallybuildupourgrounding.Oneachstepweprocess
asentencein,usingtheproceduredescribedbelow.Theprocedureterminateswhenbecomes
empty.Thesetatthatpointisthegroundingoftheinput.
http://logic.stanford.edu/intrologic/notes/chapter_06.html

13/18

4/15/2016

Chapter6RelationalLogic

(1)Thefirstrulecoversthecasewhenthesentencebeingprocessedisground.Inthiscase,we
removethesentencefromDeltaandaddittoGamma.
i+1=i{}
i+1=i{}
(2)Ifoursentenceisoftheform.[],weeliminatethesentencefromiandreplaceitwith
copiesofthescope,onecopyforeachobjectconstantinourlanguage.
i+1=i{.[]}{[]|anobjectconstant}
i+1=i
(3)Ifoursentenceoftheform.[],weeliminatethesentencefromiandreplaceitwitha
disjunction,whereeachdisjunctisacopyofthescopeinwhichthequantifiedvariableisreplaced
byanobjectconstantinourlanguage.
i+1=i{.[]}{[1]...[n]}
i+1=i
Theprocedurehaltswhenibecomesempty.Thesetiisthegroundingoftheinput.Itiseasyto
seethatiislogicallyequivalenttotheinputset.
Hereisanexample.Supposewehavealanguagewithjusttwoobjectconstantsaandb.And
supposewehavethesetofsentencesshownbelow.Wehaveonegroundsentence,oneuniversally
quantifiedsentence,andoneexistentiallyquantifiedsentence.Allareinprenexform.
{p(a),x.(p(x)q(x)),x.q(x)}
Atraceoftheprocedureisshownbelow.Thefirstsentenceisground,soweremoveitfromadd
itto.Thesecondsentenceisuniversallyquantified,sowereplaceitwithacopyforeachofour
twoobjectconstants.Theresultingsentencesareground,andsowemovethemonebyonefrom
to.Finally,wegroundtheexistentialsentenceandaddtheresulttoandthenmovetheground
sentenceto.Atthispoint,sinceisempty,isourgrounding.

http://logic.stanford.edu/intrologic/notes/chapter_06.html

14/18

4/15/2016

Chapter6RelationalLogic

0={{p(a),x.(p(x)q(x)),x.q(x)}
0={}

1={x.(p(x)q(x)),x.q(x)}
1={p(a)}

2={p(a)q(a),p(b)q(b),x.q(x)}
2={p(a)}

3={p(b)q(b),x.q(x)}
3={p(a),p(a)q(a)}

4={x.q(x)}
4={p(a),p(a)q(a),p(b)q(b)}

5={q(a)q(b)}
5={p(a),p(a)q(a),p(b)q(b)}

6={}
6={p(a),p(a)q(a),p(b)q(b),q(a)q(b)}
Oncewehaveagrounding,wereplaceeachgroundrelationalsentenceinbyaproposition
constant.TheresultingsentencesareallinPropositionalLogicandthesetisequivalenttothe
sentencesininthatanyRLtruthassignmentthatsatisfiesourRLsentencesagreeswiththe
correspondingPropositionalLogictruthassignmentappliedtothePropositionalLogicsentences.
Forexample,let'srepresenttheRLsentencep(a)withthepropositionpalet'srepresentp(b)with
pblet'srepresentq(a)withqaandlet'srepresentq(b)withqb.Withthiscorrespondence,wecan
representthesentencesinourgroundingwiththePropositionalLogicsentencesshownbelow.
{pa,paqa,pbqb,qaqb}
SincethequestionofunsatisfiabilityforPLisdecidable,thenthequestionofunsatisfiabilityfor
RLisalsodecidable.Sincelogicalentailmentandunsatisfiabilityarecorrelated,wealsoknowthat
thequestionoflogicalentailmentforRLisdecidable.
AnotherconsequenceofthiscorrespondencebetweenRLandPListhat,likePL,RLiscompact
everyunsatisfiablesetofsentencescontainsafinitesubsetthatisunsatisfiable.Thisisimportant
asitassuresusthatwecandemonstratetheunsatisfiabilitybyanalyzingjustafinitesetof
sentencesand,asweshallseeinthenextchapter,logicalentailmentcanbedemonstratedwith
finiteproofs.

Recap
RelationalLogicisanalternativetoPropositionalLogicthatincludessomelinguisticfeatures,viz.
constantsandvariablesandquantifiers.InRelationalLogic,simplesentenceshavemorestructure
http://logic.stanford.edu/intrologic/notes/chapter_06.html

15/18

4/15/2016

Chapter6RelationalLogic

thaninPropositionalLogic.Furthermore,usingvariablesandquantifiers,wecanexpress
informationaboutmultipleobjectswithoutenumeratingthoseobjectsandwecanexpressthe
existenceofobjectsthatsatisfyspecifiedconditionswithoutsayingwhichobjectstheyare.The
syntaxofRelationalLogicbeginswithobjectconstantsandrelationconstants.Relational
sentencesaretheatomicelementsfromwhichmorecomplexsentencesarebuilt.Logicalsentences
areformedbycombiningsimplersentenceswithlogicaloperators.IntheversionofRelational
Logicusedhere,therearefivetypesoflogicalsentencesnegations,conjunctions,disjunctions,
implications,andequivalences.Therearetwotypesofquantifiedsentences,viz.universal
sentencesandexistentialsentences.TheHerbrandbaseforaRelationalLogiclanguageistheset
ofallgroundrelationalsentencesinthelanguage.AtruthassignmentforaRelationalLogic
languageisamappingthatassignsatruthvaluetoeachelementofitHerbrandbase.Thetruthor
falsityofcompoundsentencesisdeterminedfromantruthassignmentusingrulesbasedonthefive
logicaloperatorsofthelanguage.Atruthassignmentisatisfiesasentenceifandonlyifthe
sentencesistrueunderthattruthassignment.Asentenceisvalidifandonlyifitissatisfiedby
everytruthassignment.Asentenceissatisfiableifandonlyifitissatisfiedbyatleastonetruth
assignment.Asentenceisfalsifiableifandonlyifthereisatleastonetruthassignmentthatmakes
itfalse.Asentenceisunsatisfiableifandonlyifitisnotsatisfiedbyanytruthassignment.A
sentenceiscontingentifandonlyifitisbothsatisfiableandfalsifiable,i.e.itisneithervalidnor
unsatisfiable.Asetofsentenceslogicallyentailsasentence(written|=)ifandonlyif
everytruthassignmentthatsatisfiesalsosatisfies.

Exercises
Exercise6.1:Saywhethereachofthefollowingexpressionsisasyntacticallylegalsentenceof
RelationalLogic.Assumethatjimandmollyareobjectconstantsassumethatpersonisaunary
relationconstantandassumethatparentisabinaryrelationconstant.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)

parent(jim,molly)
parent(molly,molly)
person(jim)
person(jim,molly)
parent(molly,z)
x.parent(molly,x)
y.parent(molly,jim)
z.(z(jim,molly)z(molly,jim))

Exercise6.2:Consideralanguagewithnobjectconstantsandasinglebinaryrelationconstant.
2

(a) Howmanygroundtermsarethereinthislanguagen,n2,2n,2n ,22 ?


2

(b) Howmanygroundatomicsentencesarethereinthislanguagen,n2,2n,2n ,22 ?


2

(c) Howmanydistincttruthassignmentsarepossibleforthislanguagen,n2,2n,2n ,22 ?


Exercise6.3:Consideralanguagewithobjectconstantsaandbandrelationconstantspandq
wherephasarity1andqhasarity2.Imagineatruthassignmentthatmakesp(a),q(a,b),q(b,a)
trueandallothergroundatomsfalse.Saywhethereachofthefollowingsentencesistrueorfalse
underthistruthassignment.

http://logic.stanford.edu/intrologic/notes/chapter_06.html

16/18

4/15/2016

Chapter6RelationalLogic

(a)
(b)
(c)
(d)
(e)

x.(p(x)q(x,x))
x.y.q(x,y)
y.x.q(x,y)
x.(p(x)y.q(x,y))
x.p(x)y.q(y,y)

Exercise6.4:ConsiderastateoftheSororityWorldthatsatisfiesthefollowingsentences.
likes(abby,abby)
likes(bess,abby)
likes(cody,abby)
likes(dana,abby)

likes(abby,bess)
likes(bess,bess)
likes(cody,bess)
likes(dana,bess)

likes(abby,cody)
likes(bess,cody)
likes(cody,cody)
likes(dana,cody)

likes(abby,dana)
likes(bess,dana)
likes(cody,dana)
likes(dana,dana)

Saywhichofthefollowingsentencesissatisfiedbythisstateoftheworld.
(a)
(b)
(c)
(d)

likes(dana,cody)
likes(abby,dana)
likes(bess,cody)likes(bess,dana)
y.(likes(bess,y)=>likes(abby,y))
(e) y.(likes(y,cody)likes(cody,y))
(f) x.likes(x,x)
Exercise6.5:ConsideraversionoftheBlocksWorldwithjustthreeblocksa,b,andc.Theon
relationisaxiomatizedbelow.
on(a,a)
on(b,a)
on(c,a)

on(a,b)
on(b,b)
on(c,b)

on(a,c)
on(b,c)
on(c,c)

Let'ssupposethattheaboverelationisdefinedasfollows.
x.z.(above(x,z)on(x,z)y.(above(x,y)above(y,z)))
Asentenceisconsistentwithasetofsentencesifandonlyifthereisatruthassignmentthat
satisfiesallofthesentencesin{}.Saywhethereachofthefollowingsentencesisconsistent
withthesentencesaboutonandaboveshownabove.
(a) above(a,c)
(b) above(a,a)
(c) above(c,a)
Exercise6.6:Saywhethereachofthefollowingsentencesisvalid,contingent,orunsatisfiable.

http://logic.stanford.edu/intrologic/notes/chapter_06.html

17/18

4/15/2016

Chapter6RelationalLogic

(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
(j)

x.p(x)x.p(x)
x.p(x)x.p(x)
x.p(x)p(x)
x.p(x)p(x)
p(x)x.p(x)
p(x)x.p(x)
x.y.p(x,y)y.x.p(x,y)
x.(p(x)q(x))x.(p(x)q(x))
x.(p(x)q(x))x.(p(x)q(x))
(x.p(x)x.q(x))(x.q(x)x.r(x))

Exercise6.7:LetbeasetofRelationalLogicsentences,andletandbeindividualRelational
Logicsentences.Foreachofthefollowingclaims,statewhetheritistrueorfalse.
(a)
(b)
(c)
(d)
(e)

x.|=
|=x.
If|=[]forsomegroundterm,then|#x.[x]
If|=[]forsomegroundterm,then|=x.[x]
If|=[]foreverygroundterm,then|=x.[x]

http://logic.stanford.edu/intrologic/notes/chapter_06.html

18/18

Vous aimerez peut-être aussi