will be inserted by the editor Proof Pearl A Formal Proof of Dally and Seitz Necessary and Su64259cient Condition for DeadlockFree Routing in Interconn ection Networks Freek Verbeek Julien Schmaltz Received date Accepted date Abstract Avoiding dead ID: 73634
Download Pdf The PPT/PDF document "Journal of Automated Reasoning manuscrip..." 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.
JournalofAutomatedReasoningmanuscriptNo.(willbeinsertedbytheeditor) ProofPearl:AFormalProofofDallyandSeitz'NecessaryandSucientConditionforDeadlock-FreeRoutinginInterconnectionNetworksFreekVerbeekJulienSchmaltzReceived:date/Accepted:dateAbstractAvoidingdeadlockiscrucialtointerconnectionnetworks.In'87,DallyandSeitzproposedanecessaryandsucientconditionfordeadlock-freerouting.Thisconditionstatesthataroutingfunctionisdeadlock-freeifandonlyifitschanneldependencygraphisacyclic.WeformallydeneandproveaslightlydierentconditionfromwhichtheoriginalconditionofDallyandSeitzcanbederived.DallyandSeitzprovethatadeadlocksituationinducescyclicdependenciesbyreductioadabsurdum.Incontrastweintroducethenotionofawaitinggraphfromwhichweexplicitlyconstructacyclicdependencyfromadeadlocksituation.Moreover,ourproofisstructuredinsuchawaythatitonlydependsonasmallsetofproofobligationsassociatedtoarbitraryroutingfunctionsandswitchingpolicies.Dischargingtheseproofobligationsissucienttoinstantiateourconditionfordeadlock-freeroutingonparticularnetworks.OurconditionanditsproofhavebeenformalizedusingtheACL2theoremprovingsystem.KeywordsDeadlock-freeroutingInteractivetheoremprovingACL21IntroductionAnecessaryandsucientconditiontoguaranteefreedomfromdeadlocksincomputingsystemsistoshowthatdependenciesbetween"processes"and"resources"areacyclic.Inthecontextofinterconnectionnetworks,dependenciesarecapturedinthechanneldependencygraphinducedbytheroutingfunction.Thelatterisdeadlock-freeifandonlyifitschanneldependencygraphisacyclic.Chen[4]rststatessuchanecessaryandsucientconditionfordeadlock-freerouting.Hisconditionappliedtostore-and-forwardormessage-switchednetworks.In1987,DallyandSeitz[6]extendedthisconditiontonetworksbasedonwormholeswitching.TheseminalpaperofDallyandSeitzinspiredallsubsequentstudiesondeadlock-freeroutingininterconnectionnetworks,e.g.,[8,9,10,19].OurcontributionisaformalproofofDallyandSeitz'conditionfordeadlockfreerouting.TheproofhasbeenformalizedintheACL2theoremprovingsystem[11].Theformalproofconsistsof3638linesofACL2-codeand339theorems.Itisavailableathttp://www.cs.ru.nl/julien/Julien at Nijmegen/JAR09.html.DallyandSeitzreasonadabsurdumfromanorderingofresources.Incontrast,ourproofusesadynamicallydenedwaitinggraphasanintuitiveintermediatebetweenadeadlockedsetofmessagesandacycleinthedependencygraph.Therefore,ourproofisfullyconstructive(inthesenseofDuato[8]).Moreover,we ThisresearchissupportedbyNWO/EWprojectFormalValidationofDeadlockAvoidanceMechanisms(FVDAM)undergrantno.612.064.811. F.VerbeekandJ.SchmaltzInstituteforComputingandInformationSciences,RadboudUniversityNijmegenP.O.Box90106500GLNijmegen,TheNetherlandsSchoolofComputerScience,OpenUniversityofTheNetherlandsP.O.Box6401DLHeerlen,TheNetherlandsE-mail:ff.verbeek,julieng@cs.ru.nl 2haveextractedconstraintsorproofobligationsonarbitraryswitchingpoliciesandroutingfunctionsthataresucienttoproveourdeadlock-freecondition.Thus,ourconditionisasecond-ordertheoremwhichholdsforallconcretenetworkdenitionsprovidedthesedenitionssatisfythecorrespondinginstancesoftheseproofobligations.Thepaperisorganizedasfollows.ThenextSectionpresentstheACL2theoremprovingsystemandthemainfeaturesweusedinourproof.Section3introducespacketandwormholeswitchingpolicies.ThenecessaryandsucientconditionanditsproofproposedbyDallyandSeitzarepresentedinSection4.DallyandSeitzconditionisnotcompletelycorrect.Werevisetheirconditionandpresenttherevisedconditionandourproofinusualmathematicalnotation.InSection5wepresentourformalmodelofnetworksandourformalizationofDallyandSeitz'revisedcondition.OurformalconditionisproveninSection6.WediscusstherelationbetweenourworkandthatofDallyandSeitzinSection7.InSection8wepresentsomedetailsontheACL2theoremprovingeort.WeconcludeinSection9.2ACL2ACL2[11,12]standsfor"AComputationalLogicforApplicativeCommonLisp".Itdenotesaprogramminglanguage,arstorderlogic,andamechanicalreasoningengineforthatlogic.Thelogic[3,13]isaquantier-freerstorderlogicwithinduction.Functionsmustbetotalandterminationofrecursivefunctionsmustbeprovenbeforeaddingthemtothelogic.Nevertheless,ACL2providesmechanismstoovercometheselimitations,e.g.,boundedquantiersorpartialfunctions[2,14].Inourproofwemakeintensiveuseoftheencapsulationprincipleandthederivedruleofinferencefunctionalinstantiationto"simulate"second-orderfunctions.Wenowdetailthismechanism.InthissectionweusetheACL2inxsyntaxwherea+biswritten(+ab).Theencapsulationprincipleallowstheintroductionofundenedfunctionsthatsatisfyoneormoretheoremsprovidedonewitnesscanbeexhibited.Considerasanexamplethefollowingstatement:Letfbeafunctionovertwoargumentssuchthatfiscommutative,thatis,f(a;b)=f(b;a).Thissecond-orderstatementtranslatestotheencapsulateeventbelow.First,onedenesthesignaturesoftheconstrainedfunctions,e.g.,functionf.Thenonehastoprovideawitnessdenition.Finally,oneintroducestheconstraints,e.g.,functionfiscommutative.Afterthesuccessfulcompletionoftheencap-sulate,thelogicisextendedwiththenewfunctionsymbols,e.g.,f,andtheconstraintsonthesesymbols,e.g.,(fab)=(fba).Notethatthewitnessdenitionislocaltotheeventandnotaddedtothelogic.Itisonlycheckedduringtheencapsulatethatthiswitnesssatisesalltheconstraints.(encapsulate(((f**)=*));;functionsignatures(local(defunf(ab)(declare(ignoreab))nil));;localwitness(defthmf-commute(equal(fab)(fba))));;constraintAftersuchanencapsulateevent,theACL2logiconlycontainsthenewfunctionsymbolsandtheirassociatedconstraints.Anytheoremprovenonthesefunctionsholdsforallconcretedenitionsthatsatisfythecorrespondingconstraints.Forinstance,onecoulddenefunctionaddbelow:(defunadd(ab)(+ab))Thisfunctioniscommutativeandcanbeconsideredavalidinstanceofabstractfunctionf.Anyproventheoremoffcanbeappliedtoaddbyusingafunctionalinstantiationhint.ThishintwillcauseACL2toproduceproofrequirementstoshowthataddsatisestheconstraintsoff.Thisidiomisusedintensivelyinourproof.Werefertoconstraintsalsoas"proofobligations".Moredetailsaboutthisuseofencapsulationandfunctionalinstantiationcanbefoundinanotherpublication[17]. 3 Y Y Z ZCAB XX (a)WHSExample AB (b)PSexampleFigure1:Interconnectionnetworkexamples3SwitchingpoliciesAninterconnectionnetworkisdenedbyasetofprocessingnodesandasetofcommunicationchannels.Withaninterconnectionnetwork,aswitchingpolicyandaroutingfunctionareassociated.Aswitchingpolicydetermineshowmessagespassthroughthenetwork.Aroutingfunctiondetermineshowmessagesareroutedfromsourcetodestination.AcommonlyusedswitchingpolicyisWormholeSwitching(WHS).Packetsaredecomposedintosmal-lerdataunitscalled\rits.A\ritconstitutestheatomicobjectthatistransferredbetweenanytwonodes.Typically,thereisaheader\ritfollowedbyasequelofdata\rits.Theendofapacketismarkedbyatail\rit.Forsimplicity,wedonotdistinguishbetweendata\ritsandthetail\rit.Werefertoallofthemasthetailortail\rits.Theheader\ritonlycontainsinformationonthedestinationofthemessage.Theheader\ritadvancesalongthespeciedroute,whilethetailfollowsinapipe-linefashion.Whentheheader\ritisblocked,all\ritsofthemessageareblocked.Achannelcanonlystore\ritsbelongingtoatmostonemessage.Therefore,tail\ritsblockheader\ritsofothermessages.Example1Figure1ashowsaninterconnectionnetworkwithwormholeswitching.MessagesX,Y,ZandaredestinedrespectivelyfornodeA,BandC.Assumechannelscanstoreatmostone\rit.Theheader\ritsofXandYareblocked,whichmeansthatthetail\ritsareblockedaswell.MessageZcanadvanceandreachitsdestination,thenmessageYcanadvanceandatlastXwilladvance,resultinginanemptynetwork.AnothercommonlyusedswitchingpolicyisPacketSwitching(PS),alsocalledstore-and-forward.Incontrasttowormholeswitching,packetsaretheatomicobjecttransferredbetweenanytwonodes.Apacketcontainsaheaderandapayload,i.e.,theactualdata.Theheadercontainsroutinginformatione.g.,destinationnode.Ateachintermediatenode,apacketisfullystoredandanalyzed.Oncethenextchanneloftherouteisavailable,itissenttotheneighboringnode.Example2Figure1bshowsanexampleofaninterconnectionnetworkwithpacketswitching.Eachboxrepresentsthestoragespaceofanoutgoingchannel.Inourexample,eachoutgoingchannelcanstoreonepacket.Thecrossedboxescontainpackets.AllpacketsaredestinedtonodeD.Inthecurrentconguration,allpacketsareblockedexcepttheoneinnodeC.Thatpacketcanarriveatitsdestination,afterwhichtheotherpacketswillfollow.Foranin-depthdiscussiononpacketswitchingandwormholeswitching,wereferthereadertosurveys(e.g.,byNiandMcKinley[15])andstandardtextbooks[9,7].4DallyandSeitzDallyandSeitzdenedanecessaryandsucientconditiontoguaranteedeadlock-freeroutingininter-connectionnetworkswithwormholeswitching.WeprovidetheconditionaspresentedbyDallyandSeitzandtheirproof.Thisconditionisnotcompletelycorrect.Wepresentarevisedversionandaddressthisconditionanditsproofinmathematicalnotation. 44.1OriginalversionThedenitions,thetheoremanditsproofareverbatimcopiesfromDallyandSeitz'paper[6].Denition1Aninterconnectionnetworkisastronglyconnecteddirectedgraph,I=(N;C).Thever-tices,N,representthesetofprocessingnodes.Theedges,C,representthecommunicationchannels.RoutingfunctionRisdenedasR:CN7!C.ThisrestrictsRtodeterministicroutingandprovidesitwithmoreinformationthanjustthecurrentnode:thenextchannelisbasedonthecurrentchannelandthedestination.GivenaninterconnectionnetworkIandroutingfunctionR:CN7!C,achanneldependencygraphcanbedened:Denition2AchanneldependencygraphDisagraphwiththechannelsofIasvertices.Thereisanedge(c0;c1)inthechanneldependencygraphifandonlyifthereexistsadestinationnodedsuchthatR(c0;d)=c1.ThefollowingtheoremisthenecessaryandsucientconditionfromDallyandSeitz.Theorem1AroutingfunctionR:CN7!C,foraninterconnectionnetworkI(withwormholeswitching),isdeadlock-freeifandonlyifthereisnocycleinthechanneldependencygraphD.ProofSupposethenetworkhasacycleinD.Itispossibletoconstructadeadlock-congurationbyllingthechannelsinthecyclewithmessages.Thedestinationsofthesemessagesmustbechoseninsuchawaythatforallmessages,thenextchannelcomputedbyRisonthecycle.SupposeanetworkhasnocycleinD.ThisimpliesthatthereexistsatotalorderoverthechannelsofC.Thusthereexistsafullchannelclthatistheleastchannelinthisorder.Everychannelafterclisempty,thusnomessageinclisblocked,andthecurrentcongurationisnotadeadlock.Thisconditioncanbeappliedtocreatedeadlock-freenetworksbybreakingthecyclesinthechanneldependencygraph.4.2RevisedversionTheorem1isfalse.ThedeadlockcongurationcreatedintheproofofTheorem1islegal,i.e.,buercapacitiesarenotexceededandwormsconsistofvalidpathsinthenetwork.Itishowevernotnecessarilyareachableconguration,i.e.,itisnotnecessarilypossibletoobtainthiscongurationstartingfromanemptynetwork.Figure2agivesanexampleofadeadlock-freeanddeterministicroutingfunctionwithacyclicchanneldependencygraph.ThenetworkcouldbeindeadlockifchannelacontainsmessagesdestinedforXandchannelbcontainsmessagesdestinedforY.ThiscongurationcanhoweverneverbereachedasXconsumesmessagesdestinedforXimmediatelyandneversendsthemtochannela. X Y a (a)NetworkR XY a bb a(b)RoutingfunctionFigure2:CounterexampletoTheorem1.TheissueisthatroutingfunctionsoftypeR:CN7!Cdonotunambiguouslydenewhattodowithnewlyinjectedmessages.Asthesearenotinachannel,theroutingfunctionmustsupplyanext 5channelbasedonthecurrentnodeinsteadofthecurrentchannel.Thus,routingmustalsobedenedasR:NN7!C.Givenadestinationnoded,routingfromachannel(i.e.,R(c;d)withcsomechannel)isnotnecessarilyequaltoroutingfromthesourcenodeofthatchannel(i.e.,R(s;d)withsthesourcenodeofchannelc).Consequently,Theorem1isnottrue.Formemorylessroutingfunctions,i.e.,routingfunctionsdenedcompletelyasR:NN7!C,anylegalcongurationisalsoreachable[8].Thisholdsforbothpacketswitchingandwormholeswitching.WeredeneTheorem1withthecorrecttypingoftheroutingfunction.Intheremainderofthissectionwepresenttherevisedtheoremanditsproofinmathematicalnotation.Sections5and6presenttheconditionanditsproofasformalizedinACL2.ThedenitionsinthisSectionarecopiesofDuato'spaperonanecessaryandsucientconditionforadaptiveroutingfunctions[8].Denition3AninterconnectionnetworkIisastronglyconnecteddirectedmultigraphI=(N;C).TheverticesNrepresentthesetofprocessingnodes.ThearcsCrepresentthesetofcommunicationchannels.Givenachannelci2C,letsianddidenotethenodesatrespectivelythesourceanddestinationofchannelci.Eachchannelchasacertaincapacity,denotedcap(c).Denition4AdeterministicroutingfunctionR:NN7!CisafunctionsuchthatR(s;d)suppliesachannelforamessagelocatedinprocessingnodesanddestinedforprocessingnoded.Ifamessageisatitsdestinationitisconsumed.Thusforallnodesn,R(n;n)=;.Denition5ThechanneldependencygraphisagraphGdep=(C;Edep).TheverticesofGdeparethechannelsofI.ThearcsofGdeparethedependenciesinI.Adependencyisapairofchannels(ci;cj)suchthat:9x2Nci2R(si;x)^cj2R(di;x)Inwords,thereisadependencyfromcitocjifcjcanbeusedaftercibysomemessage.Denition6Acongurationisanassignmentof\ritsorpacketstochannels.Thus(c)returnsthesetof\ritsorpacketslocatedinchannelc.Denition7Achannelisunavailable,notationunav(c;)ifitcannotacceptnewheader\ritsorpackets.Forpacketswitchingnetworks,achannelcisunavailableifandonlyifitisfull,i.e.ifandonlyifj(c)j=cap(c).Forwormholeswitchingnetworks,achannelcisunavailableifandonlyifitcontainsatleastone\rit,i.e.ifandonlyifj(c)j0.Givena\ritf,lethd(f)returntrueifandonlyiffisaheader\ritorapacketandlettl(f)returntrueifandonlyiffisatail\rit.Denition8Aroutingfunctionisdeadlock-freeifandonlyifthereexistsnodeadlockconguration.Adeadlockcongurationisacongurationthatsatisesthefollowingproperties:8ci2C8.93;ㅐ.93;ㅐ.93;ㅐ.93;ㅐ:j(ci)jcap(ci)(1)8f2(ci)ci2R(si;dest(f))(2)8f2(ci)hd(f)=)di=dest(f)(3)8f2(ci)hd(f)=)8cn2R(di;dest(f))unav(cn;)(4)8f2(ci)tl(f)=)j(next(ci))j=cap(next(ci))(5)Properties(1)and(2)statethatthecongurationmustbelegal,i.e.,thebuercapacitiesarenotexceededandthemessagesinthenetworkcanreachtheircurrentchannelfromthepreviousnode.Properties(3)through(5)statethatthecongurationisindeadlock.Header\ritshavenotarrivedattheirdestination(3)andcannotmovetoanavailablenexthop(4).Lastly,alltail\ritsarestuckasthenextchannelinthewormisfull(5).Therevisedtheoremisdenedformemorylessroutingandusesthecorrespondingchanneldependencygraph. 6Theorem2AroutingfunctionR:NN7!Cisdeadlock-freeifandonlyiftherearenocyclesinitschanneldependencygraphGdep.TheproofofTheorem2belowpresentsinusualmathematicalnotationtheproofformalizedinACL2.Section6containsfurtherdetails.Proof(=))Supposethereisadeadlock-conguration.All\ritsofallmessagesinwaitforsomechanneltobecomeavailable.ConsideragraphGwait=(C;Ewait)wherethereisanedge(ci;cj)ifandonlyifincongurationa\ritinciwaitsforchannelcjtobecomeavailable.InthisgraphthesetofunavailablechannelsUcontainsitsownneighbors.Thiscanbeseenbycontradiction:saythereisachannelcithathasaneighborcnoutsideU.ChannelcnisavailableasitisnotinthesetofunavailablechannelsU.Thusciwaitsforachannelthatisavailable,whichmeansthateventuallythe\ritsinchannelciwillbeabletoproceed.Thiscontradictstheassumptionthatisadeadlockconguration.Inanygraph,anysubgraphofparentverticesthatcontainsitsownneighborsnecessarilycontainsacycle.AssubgraphUinthewaitinggraphconsistsofparentverticesonlyandsinceUcontainsitsownneighbors,Ucontainsacycle.ThusgraphGwaitcontainsacycle.SinceGwaitisasubgraphofGdep,thereisacycleinGdep.((=)SupposethereisadependencycycleDinGdep.Thiscyclecanbelledwitheitherpacketsorwormsoflength1.Foreachdependency(ci;cj)2Dthereisadestinationxsuchthatci2R(si;x)andcj2R(di;x).Channelciislledwithamessagedestinedforx.Theresultingcongurationclearlysatisesproperties(1),(2)and(5).Property(3)issatised,sinceotherwisedi=xwhichwouldimplyR(di;x)=;whichwouldcontradictthatcj2R(di;x).Toprovethatproperty(4)issatised,weneeddeterminism.FordeterministicroutingfunctionR,cj2R(di;x)impliesR(di;x)=fcjg.Sincecj2DandallchannelsinDarelled,cjisunavailable.Sincetheresultingcongurationislegalandsinceroutingismemoryless,thecongurationisalsoreachable.5FormaltheoremanddenitionsInthissection,wegiveaformalandmoreprecisedenitionofanecessaryandsucientconditionfordeadlock-freerouting.Werstdeneournetworkmodel.Insteadofabstractnodesandchannels,weconsidertheinternalstructureofnodeswhichismadeofportswithbuers.Anetworkisthusrepresentedasagraphwhereverticesareinternalportsandedgesarelinksbetweentheseports.Routingfunctionsaredenedbetweenports,i.e.,overPPwherePdenotesthesetofports.Thesedierencesleadtoadierentdependencygraph,adierentstatement,andadierentproof.WediscussinSection7howtoderivetheoriginalconditionfromours.5.1FormalnetworkmodelPortsAninterconnectionnetworkconsistsofprocessingnodes,connectedbychannels.Thesenodesconsistofportsandacentralswitch(seeFigure3).Theswitchcontainstheroutingfunctionandtheswitchingpolicy.Thereisaportforeachin-andoutgoingchannel.Furthermore,eachnodehasalocalin-andout-port,respectivelyforinjectingandremovingmessagesfromthenetwork.Eachportisassociatedwithalistofbuers(ofsizeatleast1).Onebuercanstoreone\ritoronepacket.Buerlessswitchingcanberepresentedbyassociatingexactlyonebuerperport.Weassumethatifamessageislocatedinabuerofitsdestinationport,itisconsumedimmediately.Furthermore,weassumethatalldestinationportsareterminal,i.e.,theyarenotconnectedtootherports.Adestinationportisthereforeneverblocked. 7 Switch ChannelsChannelsoutLocalinIn-portsOut-ports Figure3:Processingnode,whereeachporthastwobuers.TravelsAtraveltisadatastructurewhichstorestheprogressofsendingamessageacrossanetwork.Itisatripleid;d;L-364;.958;whereidisauniqueidentier,disthedestinationportofthetravel,andLisalistcontainingforeach\rittheportwhichcurrentlystoresit.Forpacketswitching,thislisthassize1(thepacket).Forwormholeswitching,thelistisofarbitrarysizebutmustbeatleastofsize1asthereisatleastaheader\rit.Tdenotesthelistoftravelsinjectedintothenetwork.Functionscurr(t)anddest(t)denoterespectivelythecurrentlocationoftheheader\ritoftandthedestinationportoft.StateAstateSTisadatastructurewhichstoresthecurrentnetworkstate.Thestateisdenedasthelistofalltheportsofthenetwork.Eachportisassociatedtothelistofitsbuers.Functionbuers(p;ST)returnsthelistofbuersofportpinstateST.Function(b)returnstrueifandonlyifbuerbisempty.Forsakeofsimulation,abuerstoresbotha\ritandtheidofthecorrespondingtravel.CongurationAcongurationisdenedasalistoftravelsTandastateST,suchthatSThasabuerlledwith\ritfandidiifandonlyifthereisatravelinTwithidithathas\ritfcurrentlylocatedintheportcorrespondingtothebuer.NetworkDenitionAninterconnectionnetworkisadirectedgraph,I=(P;C).Thevertices,P,representthesetofports.Theedges,C,representthelinksbetweentheports.Wedonotrequiretheinterconnectionnetworktobestronglyconnected.Insteadweassumethatforalltravels,thedestinationportisreachablefromthesourceport.ReachabilityisformallydenedinSection5.3.5.2GraphtheoryWedeneagraphGbytwofunctions:functionVreturnsthesetoftheverticesofGandfunctionE(VV)returnsthesetoftheedgesofG.Acycleisapathwheretherstvertexisaneighborofthelast.Denition9LetG=(V;E)beagraphandletV0beasetofverticesfv0v1:::vn 1gforn1.cycle(V0)def=80in:(vi;vi+1(modn))2EDenition10LetGbeagraph.AsetofverticesVVGissaturatedifandonlyif8v2V:EG(v)V.Asetofverticesissaturatedifitcontainsallitsneighbors. 8Denition11LetGbeagraphandletPbeapredicateovertheverticesofgraphG.AP-chainisthesmallestsetofverticesforwhichallpairsofmembersareinthetransitiveclosureofE0G,where(n0;n1)2E0Gifandonlyif(n0;n1)2EG^P(n0)^P(n1).Inotherwords,ifaP-chaincontainsvertexv,thenallneighborsofvforwhichpredicatePholdsareinthechainaswell.Forexample,letparent(n)returntrueifandonlyifnhasatleastoneneighbor.PortsfA;B;C;DginFigure4bconstituteaparent-chain.5.3RoutinganddependencygraphRoutingfunctionRisdenedasR:PP7!PsuchthatR(s;d)returnsthenextportleadingfromstod,i.e.,thenexthop.OurgoalistodeneaportdependencygraphforRfromwhichwewilldeneanecessaryandsucientconditionensuringRisdeadlock-free.ThestandarddenitionwouldstatethatsuchadependencygraphhasthesetofportsasverticesandedgesarepairsofportsconnectedbyR.However,aswedonotassumeastronglyconnectednetwork,theremightbeportsconnectedbyR(s;d)foradestinationdthatisactuallynotreachable.Toovercomethisissue,weassumetheexistenceofafunctionR,whichrepresentsreachability.WeassumesRdreturnstrueifandonlyifdisreachablefroms.Usingthisfunction,wedenetheportdependencygraphasfollows:Denition12LetI=(P;C)beanetwork.TheportdependencygraphcorrespondingtoroutingfunctionR:PP7!P,isthegraphGdep=(P;Edep)withthesetofportsPasverticesandthepairsofportsconnectedbyRasedges.FunctionEdepisdenedbythefollowingconstraintsorproofobligations:8s;d8p2R(s;d):sRd=)(s;p)2Edep(PO-I)8(p0;p1)2Edep9d:p0Rd^p12R(p0;d)(PO-II)Constraint[PO-I]statesthatforanyports,allnexthopsareneighborsintheportdependencygraph.Weconsideronlythosenexthopsleadingtoreachabledestinations.Constraint[PO-II]statesthatforanypair(p0;p1)connectedintheportdependencygraph,thereexistsareachabledestinationportsuchthatp1isanexthopleadingtothatdestination.5.4DeadlockTheexactandrealisticdenitionofadeadlockinanetworkdependsontheunderlyingdata-linkprotocolusedtoexchangemessagesbetweenports.Wewanttoabstractfromtheseunderlyingmechanismstokeeptheproofasgenericaspossible.Weproveourtheoremforanyswitchingpolicywhere{onthelevelofthenetworklayer{advancementofatraveldependsonlyontheavailabilityofthenexthops.Letrealdeadlock()returntrueifandonlyifisindeadlock.Atraveliscalledstuckifandonlyifthereexistsnonexthop(oftheheader\rit)thathasanemptybuer.Notethatthisdoesnotgiveanyinformationonthestateofthedata-linklayer.Aportisstuckifandonlyifitisnon-emptyandalltravelsinthebuersoftheportarestuck.Denition13AswitchingpolicySisnext-hop-basedifandonlyif:(9:8t2:T:stuck(t;:ST))()(90:realdeadlock(0))Aswitchingpolicyisnext-hop-basedifandonlyifadvancementofatraveldependsonlyonthenexthopsoftheheadersofthetravels.Weproveourtheoremforanynext-hop-basedswitchingpolicy.Thishastwoadvantages:(1)theproofbecomesgenericwithrespecttothedata-linklayerandlowerlayersand(2)theproofbecomeseasierasarealisticandconcretedeadlockcongurationisreducedtoacongurationwhereallmessageshavenoavailablenexthops.Notethatallnecessaryandsucientconditionsfordeadlock-freedomininterconnectionnetworksaredenedatthesamelevelofabstraction[6,8,10,19].Wewillnowshowthatbothpacketswitchingandwormholeswitchingpoliciessatisfyourdenitionofnext-hop-based. 9Packetswitchingisnext-hop-based:assumeacongurationwhereforallmessagesallnexthopsareunavailable.Regardlessofwhatdata-link-layerisused,inorderforamessagetoadvanceitneedsanexthopwithanavailablebuer.Asnobuerwilleverbecomeavailable,thecongurationcanberegardedasadeadlockconguration,regardlessofthestateofthedata-linklayer.Thus0=inDenition13.Forwormholeswitchingnetworksthereisasubtlety:thedeadlockconguration0isnotnecessarilyequaltocongurationwhereallheader\ritsarestuck.Assumeacongurationwhereforallmessagesallnexthopsareunavailable.Noheader\ritcanmove.Thiscongurationisnotnecessarilyindeadlock,astail\ritsmaybeabletoprogresscausingthetailtoshrink.Still,wormholeswitchingisnext-hop-based.Assumeacongurationwhereallnexthopsareunavailable.Thereexistsaconguration0wherenotail\ritcanadvanceaswell.Conguration0hastheexactsamewormsasbuthasallportslledcompletely.Wormsinmayconsistofmore\ritsthantheyoriginallyconsistedofin.Sinceisalegalandreachableconguration,0islegalandreachableaswell.Asanycongurationwhereallheader\ritsarestuckimpliesalegalandreachabledeadlockconguration,wormholeswitchingisnext-hop-based.Thusbothpacketswitchingandwormholeswitchingarenext-hop-based.CircuitSwitching[9,7],whereatravelcanadvanceifandonlyifitsentirerouteisfree,isnotnext-hop-based.Denition14Let=(T;ST).GivenfunctionR,functiondeadlock-conguration()isdenedas:jTj0^8t2T8p2R(curr(t);dest(t))8b2buers(p;S)::(b)Adeadlock-congurationisanon-emptynetworkwhereforallmessagestraversingthenetworkthereexistsnonexthopwithanemptybuer.Thisdenitionisabstractwithrespecttothedata-linklayer.Thisispossibleasweproveourtheoremforanynext-hop-basedswitchingpolicy,i.e.,anyswitchingpolicywheresuchacongurationislogicallyequivalenttoarealisticdeadlock.Eachtravelhasaheaderandatail.Forourproof,weneedtoassumethattailsarecontinuous,i.e.,allconsecutiveportsinatailareconnected.Letloc(f)denotethecurrentlocationof\ritf.Letatravelbedividedinaheader\rithandtail\rits[f0;f1;:::;fk].Thenext\ritofatail\ritfiisdenedasfi 1fori0andhfori=0.Denition15Atravelhasavalidtail,ifandonlyif80ik:(loc(fi);loc(next\rit(fi)))2Edep_loc(fi)=loc(next\rit(fi))Atailmustbeapathintheportdependencygraphafterallconsecutiveequalshavebeenremoved.Theorem3Forallnext-hop-basedswitchingpoliciesSandforalldeterministicroutingfunctionsR:9:deadlock-conguration()^8t2T:valid-tail(t)^8t2T:curr(t)Rdest(t)()9cN:cycledep(c)Theorem3isourformalizationofDallyandSeitz'condition(Theorem2).Foranydeterministicroutingfunction,thereisadeadlock-conguration-wheretravelshavevalidtailsandreachabledestinations-possibleifandonlyifthereisacycleinthedependencygraph.DallyandSeitzstatedthecontrapositiveform:aroutingfunctionisdeadlock-freeifandonlyifthereisnocycleinitsdependencygraph.6FormalproofOurproofhastwopeculiaraspects.First,wehaveidentiedaxedsetofproofobligationsthataresucienttoproveTheorem3.Second,weuseawaitinggraphinsteadofatotalordertomakeourprooffullyconstructive.BeforeprovingthenecessityandsuciencyofTheorem3wepresenttheproofobligations,deneourwaitinggraph,andgiveanoverviewoftheproof. 106.1PreliminariesProofobligationsApplyingTheorem3,provingdeadlock-freedomofaninterconnectionnetworkwithroutingfunctionRandnext-hop-basedswitchingpolicySreducestodeningfunctionRandtheportdependencygraphGdepanddischargingeachofthefollowingproofobligations:[PO-I]EachpairofportsconnectedbyRareedgesofGdep;[PO-II]AlledgesofGdepareconnectedbyR;[PO-III]RisoftypePP7!P;[PO-IV]ThereisnocycleinGdep.Theseproofobligationsareusedasassumptionsintheformalproof.Inparticular,intheproofofthesuciencyofourconditionthatisdiscussedinSection6.3.Weprovideashortexampletodemonstrateoneinstanceoftheseproofobligations.Moredetailsaboutthemethodologyderivedfromourprooffalloutsidethescopeofthispaper.Theinterestedreadercanndmoreinformationinanotherpublication[21].Example3A2D-Meshnetworkconsistsofrowsandcolumnsofprocessingnodes.Figure5adepictsthetopologyofa222D-Mesh.AcommonlyusedroutingfunctionisXY-routing[15].Messagesareroutedrstalongthex-axistothecorrectcolumn,thenalongthey-axistothecorrectprocessingnode.Wedemonstratetheinstantiatedfunctionxybysomeexamples.Fromawest-outport,onlyportswithalowerx-coordinatearereachable.Fromasouth-outportonlyportswithalowery-coordinateandwiththesamex-coordinatearereachable,sinceXY-routingroutesrstalongthex-axisandthenalongthey-axis.Fromawest-inportanyportwithx-coordinatelessorequaltothecurrentx-coordinateisreachable.XY-routingcomputesonerouteforeachsource-destinationpair,sinceeachmessagecanmakeonlyoneturn.ThusConstraint[PO-III]issatised.Usingfunctionxyaportdependencygraphcanbedenedwhichsatises[PO-I],[PO-II]and[PO-IV].TheintuitionbehindtheproofofConstraint[PO-IV]isthataturnfromeitherthenorthernorsoutherndirectiontothewesterndirectionisnotpossible.Sinceacycleinameshcontainseitheranorth-westorasouth-westturn,thedependencygraphcannotcontainacycle.WaitinggraphIncontrasttothedependencygraph,thewaitinggraphisdynamicallydenedbyaconguration.Denition16AwaitinggraphGwaitisagraphwhichisdeneddynamicallybyconguration.Ithasasverticestheportsofthenetwork.Pair(p0;p1)isanedgeinthewaitinggraphifandonlyifp0=p1andoneofthefollowingconditionshold:{inthereisaheader\ritinp0routedtop1;{inthereisatail\ritinp0andthenext\ritislocatedinp1.Example4Figure4agivesanexampleofapacketswitchingconguration,whereeachporthastwobuers.Thearrowsaredirectedtothenexthopsofthetravelsinthebuers.Figure4bshowsthecorrespondingwaitinggraph.Itcontainstwocyclicwaitingchains.ChainfA;B;C;D;Eghasanescapeline(portE),whichmeansthatprogressionispossible.ChainfF;Gghasnoescapeline,thesemessagesaredeadlocked.Figure4cgivesanexampleofawormholeswitchingcongurationinabuerlessnetwork.TwomessagesXandYaresentacrossthenetwork,bothhavetwo\rits.Figure4dshowsthecorrespondingwaiting-graph.Nochainhasanescapeline,itisadeadlock-conguration. 11 (a)PSConguration ABCDEFG (b)Waitinggraph XXY Y (c)WHSConguration ABCDE (d)WaitinggraphFigure4:CongurationsandtheirwaitinggraphsProofsketchofTheorem3Assumeadeadlock-conguration=(T;ST).Weshowthatthewaitinggraphofcontainssaturatedchains(seesection5.2).Fromsuchachain,weconstructacycle.Thewaitinggraphisasubgraphoftheportdependencygraph.Henceanycycleinthewaitinggraphisacycleintheportdependencygraphaswell.Thus,wehaveconstructedacycleinthedependencygraph.Assumeacycleintheportdependencygraph.Wecanlleachportofthiscyclewith\ritsinsuchawaythatthenexthopsarethenextportsinthecycle.Thiscongurationisdeadlocked,sincethenexthopsofalltravelsarefull.Insteadofreasoningbycontradictionusingatotalorderoverthechannels,thisdemonstratestheexistenceofacyclebyconstructingitfromalistofdeadlockedmessagesusingthewaitinggraphasintermediate.6.2Ourconditionisnecessary(=))Weconsiderstuck-chainsinthewaiting-graph,i.e.,chainsofstuckports.Lemma1statesthatadeadlockmeansthatallnon-emptyportsareinasaturatedstuck-chain.Lemma2statesthateachportinastuck-chainisaparent.Asaturatedsetofparent-portsalwayscontainsacycle.Lemma3statesthatthewaitinggraphisasubgraphoftheportdependencygraph,whichimpliesthatanycycleinthewaitinggraphisacycleintheportdependencygraph.Thus,ourreasoningisstructuredasfollows:deadlock()saturatedstuck-chainsinthewaitinggraph=)cyclewait=)cycledepExample5InFigure4btherearetwostuck-chains:fA;B;C;DgandfF;Gg.Therstisnotsaturated,thesecondis.ThismeansthatFigure4aisnotadeadlock-congurationsincenotallnon-emptyportsareinasaturatedstuck-chain.InFigure4dtherearetwostuck-chainsaswell:fA;B;C;DgandfE;D;C;Bg.Theyarebothsaturated,whichmeansFigure4cisadeadlock-conguration.Lemma1LetPndenotethesetofnon-emptyports.deadlock-conguration()()8p2Pn:p2saturatedstuck-chaininGwaitProof(=))Firstnotethatifanon-emptyportisnotstuck,thereexistsatravelinthatportthatisnotstuck,whichcontradictstheassumptionthatisadeadlock-conguration.Letp2Pnbeanon-emptyport.Sincepisstuck,itisamemberofsomestuck-chainc.Weprovethatchaincissaturatedbycontradiction:assumethereexistsaportp02cwithaneighborn=2c.Portnisnon-empty:byDenition16eitherncontainsthenext\ritofatail-\ritinp0,ornisthenexthopofaheader\ritinp0.Intheformercase,clearlynisnon-empty.Inthelattercase,nisnon-empty-evenfull-becauseotherwisep0wouldnothavebeenstuck.Portnishowevernotstuck,becauseotherwiseitwouldhavebeenaddedtothechain(Denition11).Thisisacontradictionandthuschaincissaturated.((=)Ifallnon-emptyportsareinastuck-chain,thenallnon-emptyportsarestuck,thusalltravelsarestuck,whichimpliesadeadlock-conguration. 12Lemma2Astuck-chainisaparent-chain.ProofLetpbeaportinastuck-chain.Bydenitionpisnon-empty.Foranytail-\ritinp,letndenotethenext\ritofthetail.ByDenition16,n2Ewait(p),thuspisaparent.Foranyheader\ritinp,letnbeanexthop.ByDenition16,n2Ewait(p).Lemma3Thewaitinggraphisasubgraphoftheportdependencygraph.ProofWeprovethatanypair(p0;p1)2EwaitisapairinEdep.ByDenition16atleastoneofthefollowingapplies:{p0containsaheader\ritroutedtop1.Furthermore,thedestinationofthetravelofthisheader\ritisreachablefromp0.ByConstraint[PO-I]pair(p0;p1)isinEdep;{p0containsatail\ritfandp1=loc(next\rit(f)).ByDenition15,eitherp1=p0inwhichcaseitisnotawaitinggraphedgeor(p0;p1)2Edep6.3Ourconditionissucient((=)Leteachporthavebbuers.Givenaportdependencycycle[p0;p1;:::;pk],awitnesscongurationw=(Tw;STw)canbebuiltwithTw=[t0;0;:::;t0;b 1;t1;0;:::;t1;b 1;:::;tk;b 1],suchthatforall0ikand0jb:{ti;jhasone1\rit,{curr(ti;j)=pi,{dest(ti;j)2fd2PjpiRd^R(pi;d)=pi+1(modk+1)g.STwisanemptystatelledwiththetravelsfromTw.Trivially,thewitnesscongurationhasvalidtailsandreachabledestinations.Furthermore,itisadeadlock-conguration:eachtravelti;jhasasnexthopni0forsome0i0kandallbuersofallportspi0arelledwithaheader\rit.Constraint[PO-II]statesthatthereexistsatleastonepossibledestinationportdest(ti;j),sincebyDenition9thenexthoppi+1(modk+1)isaneighborofpi.ByConstraint[PO-III],i.e.determinism,thereisnonexthopleadingtothedestinationportotherthantheoneinthecycle.7DiscussionFromTheorem3toTheorem2Theorem3ismeanttobeaformalizedversionofTheorem2.Itdiersfromitintwoaspects.Itismoregeneral:Theorem2isdenedforwormholeswitchingonly,whereasourtheoremisdenedforallnext-hop-basedswitchingpolicies,includingwormholeswitchingandpacketswitching.Itisdenedatalowerlevelofabstraction.Theorem2isdenedforroutingfunctionsoftypeR:NN7!C.Wehavedenedourtheoremonthelevelofports.WenowshowhowtoderivetheoriginalDallyandSeitz'conditionfromours.Port-basedroutingfunctionscanrepresentchannel-basedroutingfunctions.Figures5aand5bshowthesameinterconnectionnetworkrespectivelyonthelevelofprocessingnodesandchannels,andonthelevelofports.Figures5cand5dshowtherespectivedependencygraphs.Givenaportdependencygraph,achanneldependencygraphcanbecreatedby(1)contractingeachconnectedpairofportsofdierentprocessingnodesintoonevertexand(2)removingallotherportsandalledgesconnectedtothem.InFigures5cand5d,twoexamplepairsandtheircorrespondingchannelsaremarked.Thiswayacycleinthechanneldependencygraphcanbeconstructedfromacycleintheportdependencygraph.Ourproofassumesthatforallmessages,thedestinationportsarereachablefromtheirsources.ThisisimpliedbytheassumptionofDallyandSeitzthattheinterconnectionnetworkisstronglyconnectedonthelevelofprocessingnodes.Furthermore,weassumethatdestinationportsareterminalandthatmessagesinthebueroftheirdestinationportareimmediatelyconsumed.ThisisalsoassumedbyDallyandSeitz. 13 B (a)Networkofprocessingnodesandchannels (b)Networkofports B (c)Channeldependencygraph (d)PortdependencygraphFigure5:A2by2meshnetworktopologyonthelevelofprocessingnodesandonthelevelofports.TheroutingalgorithmdoesnotroutefromWesttoSouth,norfromNorthtoEast.BenetsofTheorem3Ourtheoremisasecond-orderstatement.Itholdsforalldenitionsoftheroutingfunctionandtheswitchingpolicyprovidedthatthesedenitionssatisfyproofobligations[PO-I]to[PO-IV].Thisenablesaconvenientwaytoformallyprovethataroutingfunctionisdeadlock-free.Onehas(1)togiveaconcretedenitionoftheroutingfunctionandtheswitchingpolicy,(2)thecorrespondinginstancesoftheproofobligationsareautomaticallygenerated,(3)todischargetheseproofobligationsfortheconcretedenitions,and(4)itfollowsbyfunctionalinstantiationthatthisconcretenetworkisdeadlock-free.[PO-III]iseasilyproven.Although[PO-IV]canbediculttoprove{dependingontheroutingalgorithm{onecanrstdeneastaticgraphwhichsatises[PO-I]and[PO-II]andthenperformasearchforacycle.Searchingforacycleinagraphcanbedoneinlineartime[5].RelatedWorkandExtensionsIncontrasttoDallyandSeitz,ourproofisfullyconstructive.Insteadofusingtheexistenceofatotalorderonthechannels,weusethewaitinggraphtoconstructawitnessdependencycyclefromalistofdeadlockedmessages.Duato[8]denesanecessaryandsucientconditionforadaptiveroutingfunctions.Theproofofhisconditionmakesuseofatotalorderonthechannels{inthesamewayasDallyandSeitz{toshowthatthereexistsnodeadlock-conguration.OurwaitinggraphissimilartothebuerwaitinggraphusedbySchwiebertandJayasimha[19].Inthatpaper,abuerwaitinggraphisusedtoshowanecessaryandsucientconditionforadaptiverouting.Theirtheoremholdsforallswitchingpoliciesthatrequireablockedpackettowaitforaspecicoutputbuer.Inthefuture,weexpecttogeneralizetheproofinthispapertoaformalizedproofofanecessaryandsucientconditionforadaptiverouting.Sinceadaptiveroutingallowsmultiplenexthopspermessage,adeadlock-congurationhasallthesenexthopslledforeachmessage.Thus,inordertoprovesuciencyadependencycycleisnotenough,sinceitmighthaveanescapeline.Asaturatedsetisenough,sincethissetcontainsallitsneighbors.Thedicultyliesinprovingthatadeadlock-congurationnecessarilycontainsasaturatedsetinthedependencygraph.8ACL2FormalizationInthissectionweprovidesomedetailsontheACL2formalization.WepresentourformalizationofTheorem2,andprovidesomedetailsontheproof.Lastlywepresentanapplicationofthiswork:weshowhowtheACL2formalizationcanbeusedtoprovedeadlock-freedomofNetworks-on-Chips. 148.1FormalizationofTheorem2Theorem2rangesovermemorylessroutingfunctionsandoverallpossiblecongurations.Itcontainsbothasecond-orderuniversalquantierandarst-orderexistentialquantier.Thesecond-orderquanticationcanbeelegantlyformalizedusingtheencapsulateconstructofACL2.Functionroutesisintroducedusinganencapsulateevent.Itreturnsasetofroutesfromasourcetoadestination.E.g.thefollowingconstraintsareaddedtotheencapsulateconstructtoenforceadeterministicroutingfunction:(defthmconsp-routes(implies(reachablecurrdest)(consp(routescurrdest))))(defthmdeterministic(implies(reachablecurrdest)(endp(cdr(routescurrdest)))))Constraintsconsp-routesanddeterministicstatethatforeachnodecurrandeachreachabledestina-tiondestthereisexactlyoneroute.Intotalthereare14constraintsontheroutingfunction.Formoredetailswereferto[18].Thestandardwayofformalizingtherst-orderexistentialquanticationinTheorem2iswitharecursivefunctionwhichsearchesthroughallpossiblecongurations.Deningsuchafunctionwouldbeverytediousasitwouldrequireafunctionenumeratingallreachablecongurations.Toovercomethisproblem,weusedthedefun-skconstructofACL2whichintroducesaskolemizedfunction[16].Givenarst-orderexistentialformula,adefun-skeventintroducesanon-executablefunctionwhichreturnstifandonlyifthereexistsawitnessthatsatisestheformula.Thisconstructallowsustoelegantlydenetherst-orderexistentialquanticationinTheorem2:(defun-skE-deadlock(resourceset)(exists(trlstntkstate)(and(uptodatentkstatetrlst)(realdeadlocktrlstntkstate)(trlstptrlstresourceset)(valid-tailstrlst)(trlst-has-reachable-routestrlst)(consptrlst))))Giventhesetofresourcesinthenetwork,functionE-deadlockreturnstifandonlyifthereisacon-guration,i.e.alistoftravelsandastatethatsatisesallpropertiesofadeadlock.Firstly,itmustbeacongurationasdenedinSection5.1.Second,functionrealdeadlockmustreturnt.Thisfunctionisassumedtobelogicallyequivalenttoafunctionstatingthatalltravelsarestuck(theswitchingmethodmustbenext-hop-based).Thelistoftravelsmustbesyntacticallywell-formed.Thisalsoincludesthattheroutesassociatedtothetravelsarevalidpathsinthenetworkleadingfromthecurrentlocationtothedestination.Thetailsmustbevalid(seeDenition15)andalltravelsmusthavereachabledestinations.Lastly,theremustbeatleastonetravelinthenetwork.Similarly,functionE-dep-cycleisdenedwhichreturnstifandonlyifthereisacycleinthede-pendencygraph.OurformalizationofTheorem2isnoweasilydened.Underassumptionthatwehaveavalidsetofresources,thereisadeadlockifandonlyifthereisacycleinthedependencygraph.(defthmdeadlock-.05;ॐdep-cycle(implies(resourcesetpresourceset))(iff(E-deadlockresourceset)(E-dep-cycleresourceset))))8.2ACL2ProofOurproofisbasedontwodierentgraphs.Eachgraphrequiresitsowndenitionsandtheoremsoncorrectness.E.g.itmustbeproventhattheneighborfunctionofthewaiting(dependency)graphalwaysreturnsvalidwaiting(dependency)vertices.Wehaveprovensometheoremsonagenericgraph.Thefact 15thatacyclicsubgraphimpliesacyclicsupergraphisprovengenericly.Inourproof,weusefunctionalinstantiationtoobtainthistheoremforthewaitinggraphandthedependencygraph.Althoughthissimpliedtheproofeort,functionalinstantiationdoesresultinarelativelylargenumberoftheoremsasboththegenerictheoremsandtheinstantiatedtheoremsmustbedened.Toprovetheexistentialquantierswecreatedafunctionthatbuildsadeadlockwitness.Provingthatthisfunctioncomputesacorrectdeadlockcongurationwitness,i.e.acongurationthatsatisesallnecessaryproperties,requiredmanytheorems.8.3ApplicationsOurworkiscloselyrelatedtothedenitionofaformaltheoryofnetworkarchitectures.Inthiscontext,Schmaltzetal.[18,1]proposedafunctionalformalizationofnetworks.Theydeneagenericfunction{namedGeNoC{representinganetworkwithanarbitraryroutingfunctionandswitchingpolicy.Theydeneproofobligationsonthesecomponentswhicharesucienttoproveglobalsafetypropertieslikemessagesreachtheirexpecteddestinationwithoutmodicationoftheircontent.OurACL2formalizationextendsthisworktosupporttheanalysisofdeadlock.Incombinationwithworkontheanalysisoflivelock[20]wewereabletoprovetheoremslikeallinjectedmessageseventuallyreachtheirdestinationandleavethenetworkforaspecicationofaNetwork-on-Chip[21].9ConclusionThispaperpresentedaformaldenitionofthenecessaryandsucientconditionfordeadlock-freeroutingininterconnectionnetworksproposedintheseminalpaperofDallyandSeitz.OurformalconditionhasbeenmechanicallyprovedusingtheACL2theoremprovingsystem.Ourconditionanditsproofslightlydiersfromtheoriginalone.Theformalizedtheoremismoregeneralasitdirectlyappliestopacketandwormholeswitchingpolicies.Ourtheoremalsoismoredetailed.Theroutingfunctionsandswitchingpoliciesaredenedatthelevelofportsinsteadofabstractprocessingnodes.Ourapproachisgenericinthesensethatourconditionisdenedforallroutingfunctionsandnext-hop-basedswitchingpoliciesthatsatisfyaxedsetofconstraintsorproofobligations.Thismeansthatprovingdeadlock-freedomisreducedto(1)deningastaticdependencygraphfortheroutingalgorithmand(2)dischargingaxedsetofproofobligationsonthisgraph.Wehaveshownthatthetwomostcommonlyusedswitchingpolicies,i.e.packetandwormholeswitching,arenext-hop-based.AcknowledgementsWewouldliketothankFreekWiedijkforsuggestingimprovementstoanearlierversionofthispaper.Wewouldliketothanktheanonymousreviewersfortheirapposite,constructiveanddetailedcomments.InparticularthecounterexampletoDallyandSeitz'originaltheoremwasprovidedtousbyoneofthereviewers.References1.D.Borrione,A.Helmy,L.Pierre,andJ.Schmaltz.Aformalapproachtothevericationofnetworksonchip.EURASIPJournalonEmbeddedSystems,2009(ArticleID548324):14pages,2009.doi:10.1155/2009/548324.2.R.S.BoyerandJStrotherMoore.Theadditionofboundedquanticationandpartialfunctionstoacompu-tationallogicanditstheoremprover.J.Autom.Reasoning,4(2):117{172,1988.3.R.S.BoyerandJStrotherMoore.AComputationLogicHandbook.AcademicPress,1988.4.R.C.Chen.Deadlockpreventioninmessageswitchednetworks.InACM74:Proceedingsofthe1974annualconference,pages306{310,NewYork,NY,USA,1974.ACM.5.T.H.Cormen,C.E.Leiserson,andR.L.Rivest.IntroductiontoAlgorithms.MITPressandMcGrawHill,1990.6.W.J.DallyandC.L.Seitz.Deadlock-freemessageroutinginmultiprocessorinterconnectionnetworks.IEEETransactionsonComputers,(36):547{553,May1987.7.W.J.DallyandB.Towles.PrinciplesandPracticesofInterconnectionNetworks.Morgan-KaufmannPublisher,2004.8.J.Duato.Anecessaryandsucientconditionfordeadlock-freeadaptiveroutinginwormholenetworks.IEEETransactionsonParallelandDistributedSystems,6(10):1055{1067,101995.9.J.Duato,S.Yalamanchili,andL.Ni.InterconnectionNetworks:AnEngineeringApproach.IEEEComputerSocietyPress,LosAlamitos,CA,USA,1997. 1610.E.FleuryandP.Fraigniaud.Ageneraltheoryfordeadlockavoidanceinwormhole-routednetworks.IEEETransactionsonParallelandDistributedSystems,9(7):626{638,1998.11.M.Kaufmann,P.Manolios,andJStrotherMoore.ACL2Computer-AidedReasoning:AnApproach,2000.12.M.KaufmannandJStrotherMoore.AnIndustrialStrenghTheoremProverofaLogicBasedonCommonLisp.IEEETransactionsonSoftwareEngineering,23(4):203{213,April1997.13.M.KaufmannandJStrotherMoore.StructuredTheoryDevelopmentforaMechanizedLogic.J.Autom.Reasoning,26(2):161{203,1997.14.P.ManoliosandJStrotherMoore.PartialfunctionsinACL2.J.Autom.Reasoning,31(2):107{127,2003.15.L.M.NiandP.K.Mckinley.Asurveyofwormholeroutingtechniquesindirectnetworks.IEEEComputer,26:62{76,Februari1993.16.S.Ray.QuanticationinTail-recursiveFunctionDenitions.InP.ManoliosandM.Wilding,editors,Pro-ceedingsofthe6thInternationalWorkshopontheACL2TheoremProverandItsApplications(ACL22006),volume205ofACMInternationalConferenceSeries,pages95{98,Seattle,WA,August2006.ACM.17.J.SchmaltzandD.Borrione.TowardsaFormalTheoryofOnChipCommunicationsintheACL2Logic.InProceedingsoftheSixthInternationalWorkshopontheACL2TheoremProveranditsApplications,partofFloC'06,Seattle,Washington,USA,August14-152006.ACM.18.J.SchmaltzandD.Borrione.Afunctionalformalizationofonchipcommunications.FormalAspectsofComputing,20:241{258,2008.19.L.SchwiebertandD.N.Jayasimha.Auniversalprooftechniquefordeadlock-freeroutingininterconnectionnetworks.InIn7thAnnualACMSymposiumonParallelAlgorithmsandArchitectures,pages175{184,1995.20.F.VerbeekandJ.Schmaltz.Formalvalidationofdeadlockpreventioninnetworks-on-chips.InS.RayandD.Russino,editors,EighthInternationalWorkshopontheACL2TheoremProverandItsApplication,pages135{145,NortheasternUniversity,BostonMA,USA,May11{122009.ACM.21.F.VerbeekandJ.Schmaltz.Formalspecicationofnetworks-on-chip:deadlock,livelock,andevacuation.InProceedingsofDesign,Automation&TestinEurope2010(DATE'10),march2010.