Concurrent-Software-Synthesis-Old-Challenge-–-New-Ideas并行软件合成的老–新观念的挑战资料课件_第1页
Concurrent-Software-Synthesis-Old-Challenge-–-New-Ideas并行软件合成的老–新观念的挑战资料课件_第2页
Concurrent-Software-Synthesis-Old-Challenge-–-New-Ideas并行软件合成的老–新观念的挑战资料课件_第3页
Concurrent-Software-Synthesis-Old-Challenge-–-New-Ideas并行软件合成的老–新观念的挑战资料课件_第4页
Concurrent-Software-Synthesis-Old-Challenge-–-New-Ideas并行软件合成的老–新观念的挑战资料课件_第5页
已阅读5页,还剩54页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

ComponentsbasedsystemswithProbabilisticchoiceDoronPeledBarIlanUniversityStructureDevelopmentofreliablesystems.Implementingcomponentsbasedsystems.Componentsbasedsystemswithprobabilisticchoices.Historyof(concurrent)softwaredevelopmentEarlysoftwaredevelopment:programming[AdaLovelance].Testingintroducedintothesoftwaredevelopmentcycle(inspection,walkthrough)[Meyer].Programverificationisinvented[Floyd,Hoare].Automaticverification(modelchecking)isinvented[Clarke+Emerson,Quelle+Sifakis].Automaticsynthesis?Whynotsynthesizethesoftwaredirectlyfromspecification?SpecificationSystemModelchecking/

testingYes!!No+

CounterexampleRevisionSpecificationSynthesisSystemAlessdirectapproachSpecificationSystemModelchecking/

testingYes!!No+

CounterexampleRevisionSpecificationSynthesisSystemCompilationIntermediatedescriptionInfact,synthesiswasattemptedquiteearlyFirstmodelcheckingpaperby[Clark+Emerson]wasalsoaboutsynthesis.Similaridea(differentformalism)by[Manna+Wolper].Translatethespecificationintoanautomaton(tableau)thatacceptsthesameexecutions.Thentranslatethisautomatonintocode.Thecodeissequential,orcontrolledbyacentralizedscheduler.R::P!4;

Q:R!x+5P::R?yR::Q?zReactivesequentialsystemssynthesisProblem[Buchi,Rabin]:Howtoautomaticallyconstructanautomatonthatinteractswithanuncontrolledenvironmentandguaranteesthattogethertheywillsatisfysomeregularproperty.[Pnueli+Rosner]:Similarfortheallowedexecutionstosatisfysometemporal(LTL)property*.Solution:Translation(LTLAutomata)+Determinization+Gametheoryconstruction.*Thisisasubproblemoftheabove,asLTLpropertiesarestar-freeregular.Complexityofsequentialsynthesisishigh2EXPTIMECompleteforLTLspecification.…But,thereareprovablesystemswherethenumberofstatesisdoublyexponential.Butmustthesizeofacircuitthatimplementssuchasystembealsodoublyexponential?[Fearnly+Peled+Schewe]:

Ifweknew,wecouldhavedecidedwhetherEXPSPACE=2EXPTIMEornot.ConcurrentsynthesisSeveralprocesses,withsomecommunicationarchitecture.WewantthesystemtosatisfysomeLTLproperty.[Pnueli+Rosner]:ItisundecidableeventocheckwhetherthereisasystemwiththegivenarchitecturethatsatisfiestheLTLproperty.Butundersomestrongassumptions(e.g.,hierarchicalsystems)wecansolvethis

[Pnueli+Rosner],[Finkbeiner+Schewe],[Thiagarajan+Madhusudan],[Kupferman+Vardi].Mostly,negativeresultsaboutsynthesisofconcurrentsystems.Fewpositiveresults:…,itisdecidableforsomeverylimitedarchitectures,mostlywhenthereisahierarchybetweentheprocesses.…inthesecases,thecomplexityisveryhigh…AlternativeAllowaformalismthatishighlevelbutalreadyincludesadistributionofthetastksamongautonomouscomponents.Providesasimpleautomaticwaytotransformthedesignintoimplementation.ComponentbasedsystemsAcomponent(process)isanautomaton.

Fromthemarkedstate,aandbareenabledlocally.dbafeC1Componentsmaysharetransitions,onwhichtheycoordinate.hcbgakjcabcmndbafeC1C2C3Verimag’sBIP(BehaviorInteractionsPriorities)arecomponentbasedsystems!BIPBIPAglobalstateisacombinationoflocalstateshdcbbagfeakjcabcmnC1C2C3Fromthegivenglobalstate,dandcareenabled.Thelocalviewofacomponentinaglobalstateisthelocalstate+enabledactions.hdcbbagfes4akjcabcmnC1C2C3ThelocalviewofC3hereis<s4,{c}>.AssumeamechanismwhereacomponentcansenseitslocalviewHowtoimplementscheduling?hdcbbagfeakjcabcmnC1C2C3C1maypickupa,whileC2maypickupb,butC3willpickupc.Notworking..Howtoimplementscheduling?hdcbbagfeakjcabcmnC1C2C3SoC1picksupb,C2picksupcandC3picksupa.Notworkingagain…WeneedsomemechanismfordecisionsMichaelRabinshowedthatasymmetricnon-probabilisticalgorithmcannotbegiven.Synchronizerslikeα–core,canbeused.Thisisinteraction-centricview.

Considerthecasethatwewanttoguaranteeselectionsbycomponents(e.g.,whenweneedtomakesomeprobabilisticchoices).Thisisacomponent-centricscheduling.SomeretrospectImplementingconcurrentsystemsfromasimplemodelofcomponentautomataisnotassimpleasthought.SimilarproblemsexistwhenimplementingmultiplechoicesynchronouscommunicationasinCSPorADA

R::[P?x[]Q?y]||P::R!3||Q::R!zInteractionbasedschedulingusing

α-coredbafeakjcabcmC1C3C1sendsOFFERtoa-interactionC2sendsOFFERtoa-interactiona-interactionsendsLOCKtoC1a-interactionsendsLOCKtoC2C1sendsOKtoa-interactionC2sendsOKtoa-interactiona-interactionsendsSTARTtoC1a-interactionsendsSTARTtoC2Moremessagesforcancellingcommunicationorfinishingit.Problemswiththeinteraction-basedschedulingExpensive:requiresquitealotofmessagepassing,andaprocessforeachcoordination.Doesnotsupportprobabilisticdecisions.Anerrorisidentifiedintheα-corealgoritmandwasfixedautomaticallyusingageneticprogrammingtoolbasedonmodelchecking[Katz+Peled].Considerthefollowingsituationa–Iwillwritealoneapapertoaconference.b–Wewillwritetogetherapapertoaconference.c–Youwillwritealoneapapertoaconference.Neitheryouormehavetimetowritetwopapers

(butwecanwriteoneeach,separately).cbbabC1C2Difficultsituation:whattodo?Wecandecideseparately,butneedtodecideconsistently:cannotbethatC1decidesonworkingseparatelyandC2decidestocollaborate.Todecideoncollaboration,weneedstocoordinate.cbbabC1C2Difficultsituation:whattodo?Perhapsweneedtothrowacoin.Saywebothhaveafaircoin.So,thechanceofcollaborationis50-50?Oneofusthrowsthecoinfaster…cbbabC1C20.50.50.50.5Howtomodelthisw.r.t.thestatespace?cbbabC1C20.50.50.50.5aabccMarkovProcess?

Agraph+adistributionfunctionfromeachstatetothesetofstatescbbabC1C20.50.50.50.5aabcc???Certainlynot…distributionmustsumsupto1!!cbbabC1C20.50.50.50.5aaccb0.50.50.5No,weusefaircoins…cbbabC1C20.50.50.50.5aaccb0.3330.3330.333OnlyifthechanceofC1andC2tothrowthecoinfirstis0.5each!cbbabC1C20.50.50.50.5aaccb0.50.250.25Amorerealisticmodel:

dependsonwhichcomponentthrowsthecoinfirst.cbbabC1C20.50.50.50.5aabcc0.50.50.50.5bC1C2C1C2Whatisthechanceofatooccur?

btooccur?ctooccur?cbbabC1C20.50.50.50.5aabcc0.50.50.50.5bC1C2C1C2Whatisthechanceofatooccur?

btooccur?ctooccur?cbbabC1C20.50.50.50.5aabcc0.50.50.50.5bC1C2C1C2Itreallydependsontheschedulingofthrowingthecoin.Ifwedonothavetheprobabilitiesforthat,wecanonlyprovidelowerandupperbound.Chanceofa(ofc)tooccurimmediatelybetween0and0.5.

Chancebtooccur0.5.cbbabC1C20.50.50.50.5aabcc0.50.50.50.5bC1C2C1C2MarkovDecisionProcessaabcc0.50.50.50.5bC1C2C1C2SetofstatesS.[Initialstates0.]ActionsA.ForeachstatesinS,A(s)isadistributionfunctiononS.

I.e.,0≤A(s)[s’]≤1and

ΣsinSA(s)[s’]=1.MarkovDecisionProcessModelingcomponentbasedsystemsaabcc0.50.50.50.5bC1C2C1C2SetofstatesS.ActionsA:inourcase,actionsarecomponentsmakingaprobabilitsticdecision.Theprobabilityofanactionmadebyacomponentonlydependsonitslocalview:

Foreachstates,s’inSwiththesamelocalviewforcomponentA,A(s)=A(s’).Adifferentscenario:

Theexecutionofcwillallowanalternativechoicefora.cbbabC1C20.50.5aaccbReflectingthechoicescbbabC1C20.50.5aacc0.50.5bC1C2C1C2Howtoimplementacomponentbasedsystem?hdcbbagfeakjcabcmnC1C2C3Howtoallowatleastonecomponenttheselection?Avoidacentralized(sequential)solution.Lockthechoicesofatleastonecomponent.ThenotionofaconflicthdcbbagfeakjcabcmnC1C2C3Transitionsofacomponentare“dependent”,whentheysharethesamecomponent,e.g.,aandb,ordandbinC1.Wesaythataandbareinconflictandthatdandbaresequential.Otherwisetheyare“independent”or“concurrent”.Thenotionofa“confusion”hdcbbagfeakjcabcmnC1C2C3Isapairoftransitionsofdifferentcomponents(a,c)suchthatexecutingcwilleitheraddorremoveaconflictingchoicetoa.Thenotionofa“confusion”hdcbbagfebcnC1C2Transitionsarein“confusion”iftheyareindependentbuttheexecutionofonecanchangethealternativechoicesfortheother.Symmetricconfusion:(a,c)

Transitionsareindependentbuttheexecutionofonecandecreasethealternativechoicesfortheother.Considernandc.Thenotionofa“confusion”hdcbbagfeakjcabcmnC1C2C3Transitionsarein“confusion”iftheyareindependentbuttheexecutionofonecanchangethealternativechoicesfortheother.Asymmetricconfusion:(n,a)Transitionsareindependentbuttheexecutionofonecanincreasethealternativechoicesfortheother.Executingnenablesbasadditionalalternativetoa.A“microscheduler”usingsemaphoresFirst,weneedtofreezethelocalviewofcomponents.

Thisincludesthelocalstateandenabledtransitions.Thenacomponentcanmakeadecisionbasedonthedistributionthatdependsonitslocalview.Whatcanmakeachangetothelocalview?

-anothercomponentmakingadifferentchoiceaboutanenabledjoinedtransition.

-duetoasymmetricconfusion,somejointtransitionsdisabled.

-duetoanasymmetricconfusion,somejointtransitionsenabled.A“microscheduler”usingsemaphoresProvidesemaphorespereachcomponent.Providesemaphorespereachconfusion.Inordertomakeadecisionaboutsomechoice,acomponentneedstocatchtherelevantsemaphores.Checklocalview.Catchthesemaphoresrelatedtocomponentsandconfusionsinvovledinview.Checkthattheviewhasnotchanged.Topreventdeadlocks,numberthesemaphoresandcatchtheminascendingorder,releaseindescendingorder[Dijkstra].A“microscheduler”usingsemaphoresOptimization:wedononeedsemaphoresforsymmetricconfusions:casewouldbeeliminatedbycapturingsemaphoreforcomponents.Couldalternativelycatchsemaphoresforthecomponentsthatsharethelocallybutnotgloballyenabledtransitions.

Thendonotneedsemaphoresforasymmetricconfusion.

Butthiswillreduceconcurrency.ForC2tomove…hdcbbagfeakjcabcmnC1C2C3cisenabeld.CatchessemaphoresonC2,onC3andontheconfusion(d,c).Why?ImplementationComponentsserveinamaster–slavemechanism.Aslaveoffersupdatesonlocallyenabledtransitionsthroughsharedvariablesandexecuteitspartinaselectedtransition.Alsosolvesalong-lastingproblemonmodelingandimplementingconcurrentsystemswithprobabilisticchoices[Katoen+Peled].Allowsparallelism.Nodeadlocks.Previoussolutionsinvolvedallowingonlyonetransitiontofireintheentiresystem.Simpletoimplement(implementedbyAyoubNouri)usingstandardsemaphoreoperations.Ifprobabilisticchoiceisnotnecessary,wecanremovesemaphoresforasymmetricconfusion.ImplementationAllowsparallelism.Transitionsarenotnecessarilysmallorsimple.Behavesasifatomic;linerarizability.Nodeadlocks.Previoussolutionsinvolvedallowingonlyonetransitiontofireintheentiresystem[Lynchetal].Simpletoimplement(implementedwithVerimag)usingstandardsemaphoreoperations.Ifprobabilisticchoiceisnotnecessary,wecanremovesemaphoresforasymmetricconfusion.SharedtransitionsEachcomponentsetsupasharedflagtoindicatewhenasharedtransitionaislocallyenabled(andresetswhenitbecomesdisabled).Tocheckitsview,acomponentneedstocheckwhichothercomponentsthatshareitslocallyenabledtransitionshavesetuptheirsharedflags.Canweeliminatetheseexpensivechecks?Howtoeliminaterepeatedchecksforenablednessofsharedtransitions?Canuseasynchronizerlikeα-core(notcheap…).Canuse«

knowledge

»toeliminatesomeofthechecks;Whatisknowledge?AcomponentX“knows”apropertypaboutthesystemifevery(global)stateofthesystemthatincludesthecurrentlocalstateofX,pholds.Jointknowledgeofcomponents:whencombiningtheirlocalstates.Morecomponentsknowtogethermore.CalculatethereachablestatesthathavethesamecurrentlocalstateofcomponentX.Thencheckwhetherthesestatessatisfyp.Canbedoneusingmodelcheckingtechniques,e.g.,basedonBDDs.Whentheleftcomponentisinlocalstates,itknowsthatthemiddlecomponentcannotbeinstatet.shdcbbagfeakjcabcmntqC1C3C2Howtouseprecalculatedknowled

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论