Transcription of 7 LOGICAL AGENTS
1 7 LOGICALAGENTSI nwhich wedesignagentsthatcanformrepresentations oftheworld,usea pro-cessof inferenceto derivenew representationsabouttheworld, therepre-sentationofknowledgeandthereaso ningprocessesthatbringknowledgeto life ,it seems, enablesuccessfulbehaviorsthatwouldbevery hardto achieve have seenthatknowledgeofactionoutcomesenables problem-solvingagentstoperformwellincomp lex reflex ,however, ,butdoesnotknowinany usefulsensethatnopiececanbeontwo , ,thisprocesscanbequitefarremovedfromthen eedsofthemoment aswhena mathematicianprovesa theoremoranastronomercalculatestheearth s ,aphysiciandiagnosesa patient thatis,infersa diseasestatethatis notdirectlyobservable priortochoosinga ,andsomeis itsinsidethephysician s head,it ,namely, theinten-tionofthespeaker.
2 Whenwehear, Johnsaw thediamondthroughthewindow andcovetedit, weknow it referstothediamondandnotthewindow wereason,perhapsuncon-sciously, withourknowledgeofrelative , whenwehear, Johnthrewthebrickthroughthewindow andbroke it, weknow it refersto thewindow. difficultywiththiskindofambiguitybecause theirrepresentationofcontingency problemsis theirflexibility. They areabletoacceptnewtasksintheformofexplic itlydescribedgoals,they canachieve competencequicklybybeingtoldorlearningne w knowledgeabouttheenvironment,andthey simplenewenvironment,thewumpusworld,andi llustratestheoperationofa knowledge-basedagentwithoutgoingintoany , ,weexplainthegeneralprinciplesoflogic.
3 Alwaysdefinite eachpropositioniseithertrueorfalseinthew orld, representationforknowledge-basedagents, , a largeportionofthereasoningcarriedoutbyhu mansandotheragentsinpartiallyobservablee nvironmentsde-pendsonhandlingknowledgeth atisuncertain. Logiccannotrepresentthisuncertaintywell, soinPartVwecoverprobability, repre-sentations,includingsomebasedoncon tinuousmathematicssuchasmixturesofGaussi ans,neuralnetworks, simplelogiccalledpropositionallogic. Whilemuchlessexpressive thanfirst-orderlogic(Chapter8),propositi onallogicservesto alsoa well-developedtechnologyforreasoninginpr opositionallogic, , , knowledge-basedagentis itsknowledgebase, ,KNOWLEDGEBASEa knowledgebaseis a setofsentences.
4 (Here sentence is usedasa isSENTENCE relatedbut is notidenticalto thesentencesofEnglishandothernaturallang uages.)Eachsen-tenceis expressedin a waytoaddnewsentencestotheknowledgebasean da waytoquerywhatis , respectively. Bothtasksmayinvolveinference thatis, ,INFERENCELOGICALAGENTS whicharethemainsubjectofstudyinthischapt er, inferencemustobey thefundamentalrequirementthatwhenoneASKs a questionoftheknowledgebase,theanswershou ldfollowfromwhathasbeentold(orrather, TELLed)totheknowledgebasepreviously. (percept)returnsanactionstatic:KB, a knowledgebaset, a counter, initially0, indicatingtimeTELL(KB, MAKE-PERCEPT-SENTENCE(percept,t))action ASK(KB, MAKE-ACTION-QUERY(t))TELL(KB, MAKE-ACTION-SENTENCE(action,t))t t+ 1returnactionFigure , wewillbemorepreciseaboutthecrucialword follow.
5 Fornow, take it tomeanthattheinferenceprocessshouldnotju stmake thingsupasit allouragents,it takesa knowledgebase,KB,whichmayinitiallycontai nsomebackgroundknowledge. EachtimetheagentprogramisBACKGROUNDKNOWL EDGE called,it doestwo ,it TELLs theknowledgebasewhatit ,it ASKs theknowledgebasewhatactionit , extensive reasoningmaybedoneaboutthecurrentstateof theworld,abouttheoutcomesofpossibleactio nsequences, , necessarytolettheknowledgebaseknow perceptanda timeandreturnsa timeasinputandreturnsa , however, theknowledge-basedagentis is amenabletoa descriptionat theknowledgelevel, whereweneedspecifyonlywhattheagentknowsa ndwhatitsgoalsare,KNOWLEDGELEVEL inordertofixitsbehavior.
6 Forexample,anautomatedtaximighthave thegoalofdeliveringa passengertoMarinCountyandmightknow thatit is inSanFranciscoandthattheGoldenGateBridge is theonlylinkbetweenthetwo tocrosstheGoldenGateBridgebecauseit knowsthatthatwillachieveitsgoal. Noticethatthisanalysisis independentofhow thetaxiworksat theimplementationlevel. It doesn t matterwhetherIMPLEMENTATIONLEVEL itsgeographicalknowledgeis implementedaslinkedlistsorpixel maps,orwhetherit ,onecanbuilda knowledge-basedagentsimplybyTELL ingit whatit s initialprogram,beforeit startstoreceive percepts,isbuiltbyaddingonebyonethesente ncesthatrepresentthedesigner s iteasytoexpressthisknowledgeintheformofs entencessimplifiestheconstructionproblem enormously.
7 ,theDECLARATIVE proceduralapproachencodesdesiredbehavior sdirectlyasprogramcode;minimizingtherole ofexplicitrepresentationandreasoningcanr esultina , nowunderstandthata successfulagentmustcombinebothdeclarativ e whatit needstoknow, wecanprovidea knowledge-basedagentwithmechanismsthatal lowit ,whicharedis-cussedinChapter18,creategen eralknowledgeabouttheenvironmentoutofa s , representation,reasoning,andlearning , however, wewillcreatea a cave is thewumpus,a ,buttheagenthasonlyonearrow. Someroomscontainbottomlesspitsthatwilltr apanyonewhowandersintotheserooms(exceptf orthewumpus,whichistoobigtofallin).
8 Theonlymitigatingfeatureoflivinginthisen vironmentis thepossibilityoffindinga rathertamebymoderncomputergamestandards, it given,assuggestedinChapter2, bythePEAS description:}Performancemeasure: +1000forpickingupthegold, 1000forfallingintoa pitorbeingeatenbythewumpus, 1foreachactiontakenand 10forusingupthearrow.}Environment: A4 [1,1], , witha uniformdistribution, ,eachsquareotherthanthestartcanbea pit, }Actuators: Theagentcanmove forward,turnleftby90 , orturnrightby90 . Theagentdiesa miserabledeathif it entersa squarecontaininga pitora live wumpus.
9 (Itis safe,albeitsmelly, toentera squarewitha deadwumpus.) thereis a ina straightlineinthedirectiontheagentis continuesuntiliteitherhits(andhencekills )thewumpusorhitsa ,soonlythefirstShootactionhasany effect.}Sensors: Theagenthasfive sensors,eachofwhichgivesa singlebitofinformation: Inthesquarecontainingthewumpusandinthedi rectly(notdiagonally)adjacentsquaresthea gentwillperceive a stench. Inthesquaresdirectlyadjacenttoa pit,theagentwillperceive a breeze. Inthesquarewherethegoldis,theagentwillpe rceive a glitter. Whenanagentwalksintoa wall,it willperceive a bump.
10 Whenthewumpusis killed,it emitsa theagentin theformofa listoffive symbols;forexample,if thereis a stenchanda breeze,butnoglitter, bump,orscream,theagentwillreceivetheperc ept[Stench;Breeze;None;None;None]. itsinitialignoranceoftheconfigurationoft heenvironment; ,it is possiblefortheagenttoretrieve thegoldsafely. Occa-sionally, , becausethegoldis ina s initialknowledgebasecontainstherulesofth eenvironment,aslistedPIT12341234 STARTS tenchStenchBreezeGoldPITPITB reezeBreezeBreezeBreezeBreezeStenchFigur e ;inparticular, it knowsthatit is in[1,1]andthat[1,1]is a willseehow itsknowledgeevolvesasnew perceptsarrive [None;None;None;None.]