




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
IX.InferenceinFirst-orderlogic
Autumn2012Instructor:WangXiaolongHarbinInstituteofTechnology,ShenzhenGraduateSchoolIntelligentComputationResearchCenter(HITSGS)IX.InferenceinFirst-orderlOutlineReducingfirst-orderinferencetopropositionalinferenceUnificationGeneralizedModusPonensForwardchainingBackwardchainingResolutionOutlineReducingfirst-orderinUniversalinstantiation(UI)Everyinstantiationofauniversallyquantifiedsentenceisentailedbyit:v
α
Subst({v/g},α) foranyvariablevandgroundtermgE.g.,xKing(x)
Greedy(x)Evil(x)yields:King(John)
Greedy(John)
Evil(John)King(Richard)
Greedy(Richard)
Evil(Richard)King(Father(John))
Greedy(Father(John))
Evil(Father(John))Universalinstantiation(UI)EvExistentialinstantiation(EI)Foranysentenceα,variablev,andconstantsymbolkthatdoesnotappearelsewhereintheknowledgebase:v
αSubst({v/k},α)E.g.,x
Crown(x)
OnHead(x,John)yields:Crown(C1)
OnHead(C1,John) providedC1isanewconstantsymbol,calledaSkolemconstantExistentialinstantiation(EI)ReductiontopropositionalinferenceSupposetheKBcontainsjustthefollowing:xKing(x)Greedy(x)Evil(x)King(John)Greedy(John)Brother(Richard,John)Instantiatingtheuniversalsentenceinallpossibleways,wehave:King(John)Greedy(John)Evil(John)King(Richard)Greedy(Richard)Evil(Richard)King(John)Greedy(John)Brother(Richard,John)ThenewKBispropositionalized:propositionsymbolsare
King(John),Greedy(John),Evil(John),King(Richard),etc.ReductiontopropositionalinfReductioncontd.EveryFOLKBcanbepropositionalizedsoastopreserveentailment(AgroundsentenceisentailedbynewKBiffentailedbyoriginalKB)Idea:propositionalizeKBandquery,applyresolution,returnresultProblem:withfunctionsymbols,thereareinfinitelymanygroundterms,e.g.,Father(Father(Father(John)))Reductioncontd.EveryFOLKBcReductioncontd.Theorem:Herbrand(1930).IfasentenceαisentailedbyanFOLKB,itisentailedbyafinitesubsetofthepropositionalizedKBIdea:Forn=0to∞docreateapropositionalKBbyinstantiatingwithdepth(n)termsseeifαisentailedbythisKBProblem:worksifαisentailed,loopsifαisnotentailedTheorem:Turing(1936),Church(1936)EntailmentforFOLis
semidecidable(algorithmsexistthatsayyestoeveryentailedsentence,butnoalgorithmexiststhatalsosaysnotoeverynonentailedsentence.)Reductioncontd.Theorem:HerbrProblemswith
propositionalizationPropositionalizationseemstogeneratelotsofirrelevantsentences.E.g.,from:xKing(x)Greedy(x)Evil(x)King(John)yGreedy(y)Brother(Richard,John)itseemsobviousthatEvil(John),butpropositionalizationproduceslotsoffactssuchasGreedy(Richard)thatareirrelevantWithpk-arypredicatesandnconstants,therearep·nkinstantiations.ProblemswithpropositionalizaUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane) Knows(John,x) Knows(y,OJ) Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,OJ) UnificationWecangettheinfeUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane){x/Jane}Knows(John,x) Knows(y,OJ) Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,OJ) UnificationWecangettheinfeUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane){x/Jane}Knows(John,x) Knows(y,OJ) {x/OJ,y/John}Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,OJ) UnificationWecangettheinfeUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane){x/Jane}Knows(John,x) Knows(y,OJ) {x/OJ,y/John}Knows(John,x)Knows(y,Mother(y)){y/John,x/Mother(John)}Knows(John,x) Knows(x,OJ) UnificationWecangettheinfeUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane) {x/Jane}Knows(John,x) Knows(y,OJ) {x/OJ,y/John}Knows(John,x) Knows(y,Mother(y)) {y/John,x/Mother(John)}Knows(John,x) Knows(x,OJ) {fail}Standardizingaparteliminatesoverlapofvariables,e.g.,Knows(z17,OJ)UnificationWecangettheinfeUnificationTounifyKnows(John,x)andKnows(y,z),
θ={y/John,x/z}orθ={y/John,x/John,z/John}Thefirstunifierismoregeneralthanthesecond.Thereisasinglemostgeneralunifier(MGU)thatisuniqueuptorenamingofvariables.MGU={y/John,x/z}UnificationTounifyKnows(JohnTheunificationalgorithmTheunificationalgorithmTheunificationalgorithmTheunificationalgorithmGeneralizedModusPonens(GMP)p1',p2',…,pn',(p1
p2
…
pn
q) Subst(θ,q)p1'isKing(John) p1isKing(x)p2'isGreedy(y) p2isGreedy(x)θis{x/John,y/John} qisEvil(x)Subst(θ,q)isEvil(John)GMPusedwithKBofdefiniteclauses(exactlyonepositiveliteral)AllvariablesassumeduniversallyquantifiedwhereSubst(θ,pi‘)=Subst(θ,pi)foralliGeneralizedModusPonens(GMP)SoundnessofGMPNeedtoshowthatp1',…,pn',(p1
…
pn
q)╞Subst(θ,q)
providedthatSubst(θ,pi‘)=Subst(θ,pi)foralliLemma:Foranysentencep,wehavep
╞Subst(θ,q)
byUI(p1
…pn
q)╞Subst(θ,(p1
…pn
q))=(Subst(θ,p1)
…Subst(θ,pn)
Subst(θ,q))p1',…,pn'╞p1'…pn'╞Subst(θ,p1')
…Subst(θ,pn')
From1and2,Subst(θ,q)followsbyordinaryModusPonensSoundnessofGMPNeedtoshowtFOLdefiniteclausesDisjunctionsofliteralsofwhichexactlyoneispositive.Adefiniteclauseeitherisatomicorisanimplicationwhoseantecedentisaconjunctionofpositiveliteralsandwhoseconsequentisasinglepositiveliteral.Eg. King(x)
Greedy(x)Evil(x)
King(John) Greedy(y)Unlikepropositionalliterals,FOLliteralscanincludevariables(universallyquantified).NoteveryKBcanbeconvertedintoasetofdefiniteclauses.Butmanycan.FOLdefiniteclausesDisjunctioExampleknowledgebaseThelawsaysthatitisacrimeforanAmericantosellweaponstohostilenations.ThecountryNono,anenemyofAmerica,hassomemissiles,andallofitsmissilesweresoldtoitbyColonelWest,whoisAmerican.ProvethatCol.Westisacriminal.ExampleknowledgebaseThelawExampleknowledgebasecontd....itisacrimeforanAmericantosellweaponstohostilenations:American(x)Weapon(y)Sells(x,y,z)Hostile(z)Criminal(x)Nono…h(huán)assomemissiles,i.e.,xOwns(Nono,x)Missile(x):Owns(Nono,M1)Missile(M1)…allofitsmissilesweresoldtoitbyColonelWestMissile(x)Owns(Nono,x)Sells(West,x,Nono)Missilesareweapons:Missile(x)Weapon(x)AnenemyofAmericacountsas"hostile“:Enemy(x,America)Hostile(x)West,whoisAmerican…American(West)ThecountryNono,anenemyofAmerica…Enemy(Nono,America)Exampleknowledgebasecontd..ForwardchainingalgorithmForwardchainingalgorithmForwardchainingproofForwardchainingproofForwardchainingproofMissile(x)Weapon(x)Missile(x)Owns(Nono,x)Sells(West,x,Nono)Enemy(x,America)Hostile(x)ForwardchainingproofMissile(ForwardchainingproofAmerican(x)Weapon(y)Sells(x,y,z)Hostile(z)Criminal(x)ForwardchainingproofAmericanPropertiesofforwardchainingSoundandcompleteforfirst-orderdefiniteclausesDatalog=first-orderdefiniteclauses+nofunctionsFCterminatesforDataloginfinitenumberofiterationsMaynotterminateingeneralifαisnotentailedThisisunavoidable:entailmentwithdefiniteclausesissemidecidablePropertiesofforwardchainingEfficiencyofforwardchainingIncrementalforwardchaining:noneedtomatcharuleoniterationkifapremisewasn'taddedoniterationk-1matcheachrulewhosepremisecontainsanewlyaddedpositiveliteralForwardchainingiswidelyusedindeductivedatabasesEfficiencyofforwardchainingHardmatchingexampleColorable()isinferredifftheCSPhasasolutionCSPsinclude3SATasaspecialcase,hencematchingisNP-hardNote:Referenceto:JohnE.Hopcroft,RajeevMotwani,JeffereyD.Ullman,“Introductiontoautomatatheory,language,andcomputation”(2nd),Tsinghuauniversitypress,Addison-Wesley.Diff(wa,nt)Diff(wa,sa)Diff(nt,q)Diff(nt,sa)Diff(q,nsw)Diff(q,sa)
Diff(nsw,v)Diff(nsw,sa)
Diff(v,sa)Colorable()Diff(Red,Blue) Diff(Red,Green)Diff(Green,Red)Diff(Green,Blue)Diff(Blue,Red) Diff(Blue,Green)HardmatchingexampleColorable
Examplesoflongdistancerestriction
Examplesoflongdistancer
Inthew-n-grammodel,findingcharacterorwordscorrespondingtothespeechsyllableinput yi(一,疑,以,已,衣,億,依,易,醫(yī),...) zhi(只,之,直,知,制,指,紙,支,芝,...) piaoliangde(漂亮的) xiao(小,笑,消,削,銷,蕭,效,宵,曉,...) hua(話,花,化,畫,華,劃,滑,嘩,猾,...) mao(毛,冒,帽,貓,矛,卯,貌,茂,貿(mào),...).Inthew-n-grammodel,findiandtherelevantrules花
plant貓
animal一
number小
adj漂亮的
adj花
adjadj+animalanimaladj+plantplantnumber+只+animalanimalnumber+枝+plantplant.andtherelevantrules
Agoodexampleofrecursivenatureisnumber.AgroupofsimplifiedrulesfordescribingChinesenumberaregivenbelow:MX={一,二,三,四,五,六,七,八,九}MX0={零}MW={十,百,千,萬,億,兆}MWW={萬,億,兆}MH={好些,許多,若干,幾,兩}MX->MX0 (r1)MX0+MX0->MMX (r2)MX0+MMX->MMX (r3)MX+MW+MX->MX (r4)MX+MW+零+MX->MX (r5)MW+MWW->MW (r6)MWW->MW (r7)MX+MW->M (r8)
Agoodexampleofrecursive
十+MX->MS (r9)MS+MWW->M (r10)MS+MWW+MX->MX (r11)MX0+點+MX->M (r12)MX0+點+MMX->M (r13)MS+點+MX->M (r14)MS+點+MMX->M (r15)M+倍->MB (r16)MX0->M (r17)MMX->M (r18)MW->M (r19)MB->M (r20)MH->M (r21)MS->M (r22)
十+MX->MS (r9)BackwardchainingalgorithmSUBST(COMPOSE(θ1,θ2),p)=SUBST(θ2,SUBST(θ1,p))BackwardchainingalgorithmBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexampleBackwardchainingexamplePropertiesofbackwardchainingDepth-firstrecursiveproofsearch:spaceislinearinsizeofproofIncompleteduetoinfiniteloopsfixbycheckingcurrentgoalagainsteverygoalonstackInefficientduetorepeatedsubgoals(bothsuccessandfailure)fixusingcachingofpreviousresults(extraspace)WidelyusedforlogicprogrammingPropertiesofbackwardchaininLogicprogramming:PrologAlgorithm=Logic+ControlProgram=setofclauses=head:-literal1,…literaln.criminal(X):-american(X),weapon(Y),sells(X,Y,Z),hostile(Z).Depth-first,left-to-rightbackwardchainingAsetofbuilt-infunctionsforarithmeticetc.,e.g.,XisY*Z+3Built-inpredicatesthathavesideeffects(e.g.,inputandoutput predicates,assert/retractpredicates)Closed-worldassumption("negationasfailure")e.g.,givenalive(X):-notdead(X).alive(joe)succeedsifdead(joe)failsLogicprogramming:PrologAlgorPrologAppendingtwoliststoproduceathird: append([],Y,Y). append([X|L],Y,[X|Z]):-append(L,Y,Z).query: append(A,B,[1,2])?
answers: A=[]B=[1,2] A=[1]B=[2] A=[1,2]B=[]PrologAppendingtwoliststopResolution:briefsummaryFullfirst-orderversion:l1
···
lk,m1
···
mnSubst(θ,
l1
···
li-1
li+1
···
lk
m1
···
mj-1
mj+1
···
mn) whereUnify(li,mj)=θ.Thetwoclausesareassumedtobestandardizedapartsothattheysharenovariables.Forexample,Rich(x)
Unhappy(x)
Rich(Ken)Unhappy(Ken) withθ={x/Ken}ApplyresolutionstepstoCNF(KB
α);completeforFOLResolution:briefsummaryFullConversiontoCNFEveryonewholovesallanimalsislovedbysomeone:x[yAnimal(y)
Loves(x,y)][yLoves(y,x)]1.Eliminatebiconditionalsandimplicationsx[yAnimal(y)
Loves(x,y)][y
Loves(y,x)]2.Moveinwards:xp≡
xp,xp≡
xpx[y(Animal(y)
Loves(x,y))][yLoves(y,x)]x[yAnimal(y)
Loves(x,y)][yLoves(y,x)]x[yAnimal(y)
Loves(x,y)][yLoves(y,x)]ConversiontoCNFEveryonewhoConversiontoCNFcontd.Standardizevariables:eachquantifiershoulduseadifferentonex[yAnimal(y)
Loves(x,y)][zLoves(z,x)]
Skolemize:amoregeneralformofexistentialinstantiation.EachexistentialvariableisreplacedbyaSkolemfunctionoftheenclosinguniversallyquantifiedvariables:
x[Animal(F(x))
Loves(x,F(x))]
Loves(G(x),x)Dropuniversalquantifiers:[Animal(F(x))
Loves(x,F(x))]
Loves(G(x),x)Distributeover:[Animal(F(x))
Loves(G(x),x)][Loves(x,F(x))
Loves(G(x),x)]ConversiontoCNFcontd.StandaResolutionproof:definiteclausesResolutionproof:definiteclaResolutionproofexample2Theproblemis:
Everyonewholovesallanimalsislovedbysomeone. Anyonewhokillsananimalislovedbynoone. Jacklovesallanimals. EitherJackorCuriositykilledthecat,whoisnamedTuna. DidCuriositykillthecat?Resolutionproofexample2TheResolutionproofexample2contd.First,weexpresstheoriginalsentences,somebackgroundknowledge,andthenegatedgoalGinFOL: A. x[yAnimal(y)
Loves(x,y)][yLoves(y,x)] B. x[yAnimal(y)kills(x,y)][zLoves(z,x)] C. xAnimal(x)Loves(Jack,x) D. kills(Jack,Tuna)kills(Curiosity,Tuna) E. Cat(Tuna) F. xCat(x)Animal(x) G. kills(Curiosity,Tuna)Resolutionproofexample2conResolutionproofexample2contd.Second,converteachsentencetoCNF
A1. Animal(F(x))
Loves(G(x),x) A2. Loves(x,F(x))
Loves(G(x),x) B. Animal(y)
kills(x,y)
Loves(z,x) C. Animal(x)
Loves(Jack,x) D. kills(Jack,Tuna)kills(Curiosity,Tuna) E. Cat(Tuna) F. Cat(x)Animal(x) G. kills(Curiosity,Tuna)Resolutionproofexample2conResolutionproofexample2contd.TheresolutionproofthatCuriositykilledthecatisgivenbelow.Resolutionproofexample2conAssignmentsEx9.11AssignmentsEx9.11IX.InferenceinFirst-orderlogic
Autumn2012Instructor:WangXiaolongHarbinInstituteofTechnology,ShenzhenGraduateSchoolIntelligentComputationResearchCenter(HITSGS)IX.InferenceinFirst-orderlOutlineReducingfirst-orderinferencetopropositionalinferenceUnificationGeneralizedModusPonensForwardchainingBackwardchainingResolutionOutlineReducingfirst-orderinUniversalinstantiation(UI)Everyinstantiationofauniversallyquantifiedsentenceisentailedbyit:v
α
Subst({v/g},α) foranyvariablevandgroundtermgE.g.,xKing(x)
Greedy(x)Evil(x)yields:King(John)
Greedy(John)
Evil(John)King(Richard)
Greedy(Richard)
Evil(Richard)King(Father(John))
Greedy(Father(John))
Evil(Father(John))Universalinstantiation(UI)EvExistentialinstantiation(EI)Foranysentenceα,variablev,andconstantsymbolkthatdoesnotappearelsewhereintheknowledgebase:v
αSubst({v/k},α)E.g.,x
Crown(x)
OnHead(x,John)yields:Crown(C1)
OnHead(C1,John) providedC1isanewconstantsymbol,calledaSkolemconstantExistentialinstantiation(EI)ReductiontopropositionalinferenceSupposetheKBcontainsjustthefollowing:xKing(x)Greedy(x)Evil(x)King(John)Greedy(John)Brother(Richard,John)Instantiatingtheuniversalsentenceinallpossibleways,wehave:King(John)Greedy(John)Evil(John)King(Richard)Greedy(Richard)Evil(Richard)King(John)Greedy(John)Brother(Richard,John)ThenewKBispropositionalized:propositionsymbolsare
King(John),Greedy(John),Evil(John),King(Richard),etc.ReductiontopropositionalinfReductioncontd.EveryFOLKBcanbepropositionalizedsoastopreserveentailment(AgroundsentenceisentailedbynewKBiffentailedbyoriginalKB)Idea:propositionalizeKBandquery,applyresolution,returnresultProblem:withfunctionsymbols,thereareinfinitelymanygroundterms,e.g.,Father(Father(Father(John)))Reductioncontd.EveryFOLKBcReductioncontd.Theorem:Herbrand(1930).IfasentenceαisentailedbyanFOLKB,itisentailedbyafinitesubsetofthepropositionalizedKBIdea:Forn=0to∞docreateapropositionalKBbyinstantiatingwithdepth(n)termsseeifαisentailedbythisKBProblem:worksifαisentailed,loopsifαisnotentailedTheorem:Turing(1936),Church(1936)EntailmentforFOLis
semidecidable(algorithmsexistthatsayyestoeveryentailedsentence,butnoalgorithmexiststhatalsosaysnotoeverynonentailedsentence.)Reductioncontd.Theorem:HerbrProblemswith
propositionalizationPropositionalizationseemstogeneratelotsofirrelevantsentences.E.g.,from:xKing(x)Greedy(x)Evil(x)King(John)yGreedy(y)Brother(Richard,John)itseemsobviousthatEvil(John),butpropositionalizationproduceslotsoffactssuchasGreedy(Richard)thatareirrelevantWithpk-arypredicatesandnconstants,therearep·nkinstantiations.ProblemswithpropositionalizaUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane) Knows(John,x) Knows(y,OJ) Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,OJ) UnificationWecangettheinfeUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane){x/Jane}Knows(John,x) Knows(y,OJ) Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,OJ) UnificationWecangettheinfeUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane){x/Jane}Knows(John,x) Knows(y,OJ) {x/OJ,y/John}Knows(John,x) Knows(y,Mother(y)) Knows(John,x) Knows(x,OJ) UnificationWecangettheinfeUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane){x/Jane}Knows(John,x) Knows(y,OJ) {x/OJ,y/John}Knows(John,x)Knows(y,Mother(y)){y/John,x/Mother(John)}Knows(John,x) Knows(x,OJ) UnificationWecangettheinfeUnificationWecangettheinferenceimmediatelyifwecanfindasubstitutionθsuchthatKing(x)andGreedy(x)matchKing(John)andGreedy(y)θ={x/John,y/John}worksUnify(p,q)=θifSubst
(θ,p)=Subst
(θ,q)
p q θ
Knows(John,x) Knows(John,Jane) {x/Jane}Knows(John,x) Knows(y,OJ) {x/OJ,y/John}Knows(John,x) Knows(y,Mother(y)) {y/John,x/Mother(John)}Knows(John,x) Knows(x,OJ) {fail}Standardizingaparteliminatesoverlapofvariables,e.g.,Knows(z17,OJ)UnificationWecangettheinfeUnificationTounifyKnows(John,x)andKnows(y,z),
θ={y/John,x/z}orθ={y/John,x/John,z/John}Thefirstunifierismoregeneralthanthesecond.Thereisasinglemostgeneralunifier(MGU)thatisuniqueuptorenamingofvariables.MGU={y/John,x/z}UnificationTounifyKnows(JohnTheunificationalgorithmTheunificationalgorithmTheunificationalgorithmTheunificationalgorithmGeneralizedModusPonens(GMP)p1',p2',…,pn',(p1
p2
…
pn
q) Subst(θ,q)p1'isKing(John) p1isKing(x)p2'isGreedy(y) p2isGreedy(x)θis{x/John,y/John} qisEvil(x)Subst(θ,q)isEvil(John)GMPusedwithKBofdefiniteclauses(exactlyonepositiveliteral)AllvariablesassumeduniversallyquantifiedwhereSubst(θ,pi‘)=Subst(θ,pi)foralliGeneralizedModusPonens(GMP)SoundnessofGMPNeedtoshowthatp1',…,pn',(p1
…
pn
q)╞Subst(θ,q)
providedthatSubst(θ,pi‘)=Subst(θ,pi)foralliLemma:Foranysentencep,wehavep
╞Subst(θ,q)
byUI(p1
…pn
q)╞Subst(θ,(p1
…pn
q))=(Subst(θ,p1)
…Subst(θ,pn)
Subst(θ,q))p1',…,pn'╞p1'…pn'╞Subst(θ,p1')
…Subst(θ,pn')
From1and2,Subst(θ,q)followsbyordinaryModusPonensSoundnessofGMPNeedtoshowtFOLdefiniteclausesDisjunctionsofliteralsofwhichexactlyoneispositive.Adefiniteclauseeitherisatomicorisanimplicationwhoseantecedentisaconjunctionofpositiveliteralsandwhoseconsequentisasinglepositiveliteral.Eg. King(x)
Greedy(x)Evil(x)
King(John) Greedy(y)Unlikepropositionalliterals,FOLliteralscanincludevariables(universallyquantified).NoteveryKBcanbeconvertedintoasetofdefiniteclauses.Butmanycan.FOLdefiniteclausesDisjunctioExampleknowledgebaseThelawsaysthatitisacrimeforanAmericantosellweaponstohostilenations.ThecountryNono,anenemyofAmerica,hassomemissiles,andallofitsmissilesweresoldtoitbyColonelWest,whoisAmerican.ProvethatCol.Westisacriminal.ExampleknowledgebaseThelawExampleknowledgebasecontd....itisacrimeforanAmericantosellweaponstohostilenations:American(x)Weapon(y)Sells(x,y,z)Hostile(z)Criminal(x)Nono…h(huán)assomemissiles,i.e.,xOwns(Nono,x)Missile(x):Owns(Nono,M1)Missile(M1)…allofitsmissilesweresoldtoitbyColonelWestMissile(x)Owns(Nono,x)Sells(West,x,Nono)Missilesareweapons:Missile(x)Weapon(x)AnenemyofAmericacountsas"hostile“:Enemy(x,America)Hostile(x)West,whoisAmerican…American(West)ThecountryNono,anenemyofAmerica…Enemy(Nono,America)Exampleknowledgebasecontd..ForwardchainingalgorithmForwardchainingalgorithmForwardchainingproofForwardchainingproofForwardchainingproofMissile(x)Weapon(x)Missile(x)Owns(Nono,x)Sells(West,x,Nono)Enemy(x,America)Hostile(x)ForwardchainingproofMissile(ForwardchainingproofAmerican(x)Weapon(y)Sells(x,y,z)Hostile(z)Criminal(x)ForwardchainingproofAmericanPropertiesofforwardchainingSoundandcompleteforfirst-orderdefiniteclausesDatalog=first-orderdefiniteclauses+nofunctionsFCterminatesforDataloginfinitenumberofiterationsMaynotterminateingeneralifαisnotentailedThisisunavoidable:entailmentwithdefiniteclausesissemidecidablePropertiesofforwardchainingEfficiencyofforwardchainingIncrementalforwardchaining:noneedtomatcharuleoniterationkifapremisewasn'taddedoniterationk-1matcheachrulewhosepremisecontainsanewlyaddedpositiveliteralForwardchainingiswidelyusedindeductivedatabasesEfficiencyofforwardchainingHardmatchingexampleColorable()isinferredifftheCSPhasasolutionCSPsinclude3SATasaspecialcase,hencematchingisNP-hardNote:Referenceto:JohnE.Hopcroft,RajeevMotwani,JeffereyD.Ullman,“Introductiontoautomatatheory,language,andcomputation”(2nd),Tsinghuauniversitypress,Addison-Wesley.Diff(wa,nt)Diff(wa,sa)Diff(nt,q)Diff(nt,sa)Diff(q,nsw)Diff(q,sa)
Diff(nsw,v)Diff(nsw,sa)
Diff(v,sa)Colorable()Diff(Red,Blue) Diff(Red,Green)Diff(Green,Red)Diff(Green,Blue)Diff(Blue,Red) Diff(Blue,Green)HardmatchingexampleColorable
Examplesoflongd
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年工業(yè)自動化儀表項目發(fā)展計劃
- 二零二五年度新能源車輛采購合同終止合同通知書
- 2025年度航空航天保險合同
- 二零二五年度物流信息化運輸合同及大數(shù)據(jù)分析服務(wù)協(xié)議
- 2025年度雇主責(zé)任保險賠償協(xié)議書模板
- 二零二五年度影視演員合同終止合同
- 2025年度科研實驗樓空間方式租賃服務(wù)協(xié)議
- 二零二五年度房地產(chǎn)貸款合同變更協(xié)議
- 二零二五年度個人出租車夜間服務(wù)承包協(xié)議
- 二零二五年度新型環(huán)保材料工業(yè)產(chǎn)品購銷合同范本
- 《抽樣技術(shù)》課件(完整版)
- 工程力學(xué)ppt課件(完整版)
- 思想政治教育學(xué)原理整套課件完整版電子教案課件匯總(最新)
- 關(guān)鍵過程(工序)和特殊過程(工序)管理辦法
- 高考新材料作文——如何處理材料作文所給材料
- 220kV輸電線路工程質(zhì)量通病防治措施
- 【EHS流程圖】建設(shè)項目職業(yè)衛(wèi)生“三同時”工作流程圖(9頁)
- 邁達(dá)斯建模(貝雷梁、鋼棧橋)
- [考研英語]商志英語作文模板
- Fluent出入口邊界條件設(shè)置及實例解析
- 模擬追溯演練報告(成品到原料)
評論
0/150
提交評論