/
conditional conditional

conditional - PDF document

carla
carla . @carla
Follow
371 views
Uploaded On 2021-07-05

conditional - PPT Presentation

expired active ful2lled violated expire detach discharge cancel Figure1LifecycleofacommitmentholdsiftheuserpurchasestheitemiepaidholdsWhilethegoalsofanagentcanbeprivateacommitmentbetween ID: 854026

buyer item x0000 150 item buyer 150 x0000 estherationalbeliefconstraintoverlanguagel cithatsatis givenanagenthx deadline tmod7 pst proposition nition confirmed exec proofsketch

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "conditional" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1 conditional expired active fullled v
conditional expired active fullled violated expire detach discharge cancel Figure1.Lifecycleofacommitment.holds),iftheuserpurchasestheitem(i.e.,paidholds).Whilethegoalsofanagentcanbeprivate,acommitmentbetweentwoagentsispublicsuchthatbothpartiesareawareofitsexistence.Temporalconstraintsmaybeassociatedwiththeantecedentandconsequentofacommitment,inordertocapturerealworldsitua-tions,suchasbusinesscontracts,moreprecisely.Inthispaperweconsiderintervalconstraintsovertheantecedentsandconsequentsofcommitments.Thesetemporalconstraintscorrespondtothefactthattheantecedentortheconsequentneedtoberealizedduringtheassociatedinterval.Forinstance,inordertogetadiscount,theusermighthavetoacceptanofferwithin24hours.Inanotherexample,theserviceprovidermightbecommittedtodeliverapurchaseditemwithinthreedaysafterthepayment.Thelifecycleofacommitmenthasbeenstudiedextensivelyintheliterature,e.g.,[1,15].Here,weuseasimpliedcommitmentlifecy-clethatissufcienttostudywhetheranagentcansupportagoalofinterestwithrespecttoitscommitments.Figure1showsthislifecy-cle,whereroundedrectanglesrepresentthestatesofthecommitment(boldonesareterminalstates)andedgelabelsaretheoperationsonthecommitment.Initially,thecommitmentiscreatedinconditionalstate.Iftheantecedentstartstohold(e.g.,providergetspaid),thecommitmentisdetachedandbecomesactive.Iftheantecedentfailstohold(e.g.,userdoesnotpay),thecommitmentbecomesexpired.Iftheconsequentstartstohold(e.g.,theitemisdeliveredontime),thecommitmentisdischargedandbecomesfullled.Finally,iftheconsequentfailstoholdwhilethecommitmentisactive(e.g.,theitemisnotdeliveredontime),itbecomesviolated.2.1FormalizationInthissectionweformalizeourframeworkelements(e.g.,goals,commitments,etc.).Below,isasetofpropositionalsymbolsandLisalanguageofpropositionallogicover,withoperators^;_;!;:intraditionalsemanticsandsymbols�and?todenote

2 trueandfalsesentences,respectively.Agnis
trueandfalsesentences,respectively.AgnisasetofagentidentiersandActisasetofactionsymbols.P(;ts;te)denotesapropertywhereisadisjunctivenormalformformulainLandts;te2Z+.Apropertydenesanintervalconstraintforthesatisfactionofapropositionalformula.Technically,thepropertyissatised,ifholdsatsometimetbetweentsandte(i.e.,tstte).Ifdoesnotholdataparticulartimebetweentsandte,thenthepropertyispending.Ontheotherhand,ifdoesnotholdatanytimebetweentsandte,thenthepropertyisfailed.A(x;p;a;e)denotesanactionwherex2Agnistheagentthatcantaketheactiona2Act,ifpropertyp,whichistheprecondition,holds.eisaconjunctioninLthatrepresentstheeffectofthisac-tion.G(p)denotesagoalwherepisaproperty.Thegoalissatisedifpissatisedandfailedifpisfailed.C(x;y;pant;pcon)denotesacommitment.x;y2Agnarethedebtorandcreditoragents,respec-tively.pantandpconarepropertiesthatrepresenttheantecedentandconsequentofthecommitment,respectively.Anagentisatuplehx;G;A;Ci,wherex2Agnisanagentiden-tier,Gisasetofgoals,AisasetofactionsandCisasetofcom-mitments.xistheuniqueidentieroftheagent.Gistheagent'sgoalset.AistheunionoftwodisjointactionsetsAxActandAxAct.Axconsistsoftheactionsthatcanbeperformedbyx(i.e.,8A(y;p;a;e)2Ax:y=x).Axconsistsoftheactionsthatcanbetakenbytheotheragents(i.e.,8A(y;p;a;e)2Ax:y6=x).Intuitively,thelattersetcapturesthebeliefsofxabouttheotheragents'actions.Finally,Cisthesetofcommitmentsthatxenacts.Below,weusePxasthesetofallpropertiesinagivenagentx(i.e.,propertiesconsideredinx'sgoals,actionsandcommitments).Now,wedenethesemanticsofanagentspecicationwithre-specttoatransitionsystem.GivenLandanagenthx;G;A;Ci,atransitionsystemisatuplehS;s0;T;;Li,where:Sisasetofstatessuchthateachstates2Sisacompositionofthefollowingvariables:–Avariableforeachproposition

3 0;2thatcapturesthevalueof,which
0;2thatcapturesthevalueof,whichisequaltoeither�or?.–Avariableforeachp2Pxthatcapturesthestateofp,whichisequaltooneofthevaluesPending,SatisfiedorFailed.–Avariableforeachgoalg2Gthatcapturesthestateofg,whichisequaltooneofthevaluesActive,SatisfiedorFaied.–Avariableforeachcommitmentc2Cthatcapturesthestateofc,whichisequaltooneofthefollowingvaluesConditional,Active,Expired,FulfilledorViolated.–Avariableclockthatrepresentsthetimeassociatedtothestateasanintegervalue.s0Sistheinitialstateofthetransitionsystem.T=ActisthesetoftransitionlabelsthatisidenticaltoAct.:SAct7!Sisthetransitionfunction.LisalabelingfunctionthatassignsthevaluestothevariablesofthestatesinS.Below,theentailmentrelationsj=denotesthattheformula2Lholdsinstateswithrespecttothelabelingofthevariablesthatcorrespondtothepropositionsofins.ForconvenienceweusepSt,gSt,cSt,andclkfunctionstoaccessthevariablesthatcapturethestatesoftheproperties,goals,commitmentsandclockinagivenstates,respectively(e.g.,cSt(s;c)isthevalueofthevariablethatrepresentsthestateofthecommitmentcinstates).Atransitiona2TisenabledinastatesonlyifthepreconditionofthecorrespondingactioninAholdsins.Technically,transitionaisenabledins,ifA(x;p;a;e)2AandpST(p;s)=Satisfied.Whenatransitionafromstatestos0happens,thelabelingfunc-tionLassignsthevaluesofthevariablesins0withrespecttosandaasfollows.Thepropositionsinareassignedto�and?val-ueswithrespecttotheeffectsofa.Thevariableclockins0issettoclk(s)+1.Thevalueofavariablethatcapturethestatesofapendingpropertyp=P(;ts;te)issetbythefollowingrules:pSt(p;s)=Pendingands0j=andtsclk(s0)te pSt(p;s0) SatisfiedApendingpropertyissatised,ifthepropositionofthepropertyholdswithinitstimeinterval.pSt(p;s)=Pendingandteclk(s0) pSt(p;s0) Failed functionhereforbrevity.Afters0iscrea

4 ted,GOSUcheckswhethergissupportedins0(li
ted,GOSUcheckswhethergissupportedins0(line8).Thisrecursiveprocessgoesonuntilastates0isfoundinwhichgissatised.Inthiscase,GOSUreturnstrue(line9).Thisconcludesthatgissupportedgiventhecurrentcontextoftheagent.Ontheotherhand,ifalltheactionsthatcanbeperformedinsareconsidered,butnoneofthemreachesastates0inwhichgissatised,GOSUreturnsfalse(line10).Thatis,theredoesnotexistanaccessiblestates0fromthecurrentstatesinwhichgissatised.Thisconcludesthatgisnotsupportedintheagent'scurrentcontext.Next,wepresentformalpropertiesofGOSUandprovideproofsketches.Proposition:Givenanagenthx;G;A;CithatsatisestherationalbeliefconstraintoverlanguageLasinput,GOSUterminates.Proofsketch:GOSUisadepth-rstsearchprocedurethatterminatesifthestatespaceisnite.Thestatespacemaybeinniteintwositua-tions:(i)thereareinnitelymanyactionsinA,or(ii)therearecyclesinthestatespace.WeassumethatAisnite.Hence,rstsituationisnotpossible.Moreover,themonotonicallyincreasingclockvariablesinthestatesmakethemuniqueandpreventcycleswhichmayoccurduetonon-monotonicityofpropositionalsymbols.Hence,secondsituationisnotpossibleeither.Therefore,GOSUterminates.Notethatcyclesmayoccurbetweencommitments.However,thoseareeventuallyviolatedduetotemporalconstraints.Iftheprop-ertyinvolvedinsuchcycliccommitmentsaffectsagent'sgoal,thenGOSUreturnsfalse.Moreover,agentscanrepeatedlytakethesameactioncausingloops.However,sinceourgoaldenitionistemporal,thosebrancheswillterminatewhengoalbecomesfailedovertime.Soundness:Givenanagenthx;G;A;CithatsatisestherationalbeliefconstraintoverlanguageLandthecorrespondingtransitionsystemT,GOSUissoundifthefollowingconditionshold:ifGOSU(g;s;A;C)returnstrue,thengissupportedinsofTwithrespecttothesupportdenition(seeSection2.2),ifGOSU(g;s;A;C)returnsfalse,thengisnotsupportedinsofTwithrespecttothesupportdenition.Propositio

5 n:Givenanagenthx;G;A;Cithatsatisesth
n:Givenanagenthx;G;A;CithatsatisestherationalbeliefconstraintoverlanguageLasinput,GOSUissound.Proofsketch:SupposethatS0TisthesetofdirectlyaccessiblestatesfromsintransitionsystemTthatcorrespondstohx;G;A;CiandS0GOSUisthesetofdirectlyaccessiblestatesfromswhichiscre-atedbyGOSUusingprogressfunction.TherstconditiondoesnotholdonlyifGOSUcreatessomeextrastates(i.e.,S0GOSUnS0T6=;).ThesecondconditiondoesnotholdonlyifGOSUdoesnotcreateallstates(i.e.,S0TnS0GOSU6=;).NeitherrstnorthesecondcaseispossiblesinceprogressfunctionutilizesthesamerulesthatareusedbyTtocreateaccessiblestates.Completeness:Givenanagenthx;G;A;CithatsatisestherationalbeliefconstraintoverlanguageLandthecorrespondingtransitionsystemT,GOSUiscompleteifthefollowingconditionshold:ifgissupportedinsofTwithrespecttothesupportdenition(seeSection2.2),thenGOSU(g;s;A;C)returnstrue,ifgisnotsupportedinsofTwithrespecttothesupportdeni-tion,thenGOSU(g;s;A;C)returnsfalse.Proposition:Givenanagenthx;G;A;CithatsatisestherationalbeliefconstraintoverlanguageLasinput,GOSUiscomplete.Proofsketch:Completenesscanbeprovedinasimilarmannertosoundness.4ImplementationandCaseStudyWeusethedealingsofaserviceprovider(seller)withauser(buyer)todemonstratetheworkingsofourapproach.Accordingtothecon-tractamongthem,thesellercommitstoitsprimecustomers(whopayayearlypremium)thattheirorderswillbedeliveredwithinthefollowingday.However,thesellerrequirespaymentstobeconrmedbeforedispatchingtheitems.Inourscenario,thebankhasthecon-straintthatitconrmsbuyers'paymentsduringweekdaysonly.  initiates(_,goalNotSupported,T):- \+goalSupported(T). terminates(_,goalNotSupported,T):- goalSupported(T). initiates(exec(confirm(bank,buyer,Item)), confirmed(Item), T):- item(Item), (Tmod7)�=1, (Tmod7)=5. ccreate( exec(offer(Seller,Buyer,Item,Deadline)), c(T,Seller,Buyer,and(paid(

6 Item),confirmed(Item)), delivered(Item),
Item),confirmed(Item)), delivered(Item),Deadline), T):- prime(Buyer), item(Item). ccreate(exec(offer(Bank,Buyer,Item,Deadline)), c(T,Bank,Buyer,paid(Item), confirmed(Item),Deadline), T):- item(Item). Listing1.DomainmodelinREC.WehaveimplementedaprototypeofourframeworkusingtheRe-activeEventCalculus(REC),whichisatoolfortrackingcommit-mentsatruntime[1].TheEventCalculus[7]isalogicformod-ellingeventsandtheireffectsthroughtime.Thisisasuitablelogictorealiseourtransitionsystemaswellasdescribinganagent'scon-text.Listing1presentsasamplecodefragmentfromREC,showinghowtheagent'sdomaincanbemodelledaspartofabovescenario.Eventsandtheircaneffectscanbedescribedusingtheinitiates=3andterminates=3predicatesinPrologfashion(head body),e,g,.aneventinitiatesauentataspecictimeifthecertainpre-conditionsholdatthattime.Similarly,aneventcanterminatetheexistenceofauent.Notethat,eventsanduentscorrespondtotheactionsandpropositionsofourtransitionsystemdescribedinSec-tion2.1,respectively.Thecurrentstateofaagentcanbequeriedusingtheholds at=2predicate.Forbrevity,weomitthedetailsoftheECformalisationhere4.Inourscenario,wedescribethebank'sconstraintonconrmingpaymentsasapreconditionoftheconfirmevent(seeListing1).Notethatexecistheprextodescribeevents.Accordingtotheiniti-atesclause,theuentconfirmedisonlyinitiatedbetweenMondayandFriday((Tmod7)�=1and(Tmod7)=5).Similarly,com-mitmentsarerepresentedasuentsandtheychangestatebasedonevents.Forexample,theseller'scommitmenttothebuyerisinitiatedusinganofferevent.Notethatforthiscommitmenttobecreated,thebuyerhastobeaprimecustomerasaprecondition.Next,weconsiderseveralcasesforthescenario.ThefollowingisanexamplenarrativeofeventsthatwecanfeedRECwith.Forsimplicity,wetreattimepointsasdaysinthefollowingdiscussion. 4Thecompleteimplementationcanbedownloadedfromhttp://mas.cmpe.boun.edu.tr/ozgur/code.htm