Similar documents

PROGRAM OF STUDIES FORM MASTERS OF SCIENCE IN EDUCATION Concentration: Curriculum and Instruction and Secondary English licensure combined

DATABASE DESIGN. - Developing database and information systems is performed using a development lifecycle, which consists of a series of steps.

Environmental Compliance Reporting Mastering a Moving Target

MIDDLEWARE AUTOMATION

Why should our fitness center administer fitness tests?

LICENSURE ONLY PROGRAM REQUIREMENTS FORM Elementary Education UNDERGRADUATE ROUTE

Institutional Research Database Study

HEALTH INSURANCE CERTIFICATION GUIDE FOR FALL 2015

American Women Artists National Show, R.S. Hanna Gallery, Fredericksburg, TX. American Impressionist Society National Show, M. Gallery, Charleston, SC

Is it Possible to Live Without Having Real Estate?

HEALTH INSURANCE CERTIFICATION GUIDE FOR SPRING 2016

When printed the document is for reference only and is considered uncontrolled - refer to the Document Control System for the most current version

Opportunities for cooperation with South Med region

Logo. International Symposium Security Dimensions in Europe Today 2004/12/20

Inthispaper,weareinterestedinrandomgraphswithaxeddegree

Agenda. Overview. Federation Requirements. Panlab IST Teagle for Partners

COMMUTATIVE RINGS. Definition: A domain is a commutative ring R that satisfies the cancellation law for multiplication:

sqlcmd -S.\SQLEXPRESS -Q "select name from sys.databases"

Adjustment Manual Performance Test

Data to Advance Economic Access and Justice for Tribes: Patterns of Consumer Credit Use in Tribal Communities

Procedure for Nominating Renewable Energy Credit Offsets

MOOCs and the Opening Up of Higher Education

Digital signature and e-government: legal framework and opportunities. Raúl Rubio Baker & McKenzie

MOOCs - a European university perspective

Vulnerability assessment of ecosystem services for climate change impacts and adaptation (VACCIA)

Fig. 1 Southwest Credit s Continuous Improvement Strategy

Information Session for Peking University Fall 2013 Overseas Admissions

Optimizing Cost and Performance for Content Multihoming

A.) Using the pulley system B.) Lifting it straight up C.) Both using the pulley system or lifting it straight up require the same effort (force)

EVALUATION OF WELL TESTS USING RADIAL COMPOSITE MODEL AND DIETZ SHAPE FACTOR FOR IRREGULAR DRAINAGE AREA. Hana Baarová 1

Ash content [%] Sulphur content [%]

Session 5. Mixing and matching Public, Private and Hybrid Clouds for maximum benefits

Goulds Water Technology


solutionsintheareaofdistributedtransactionsystemsandreplicated disseminationwithinsuchaserviceinadynamiclooselycoupledenvironment. databases.

FIRE Project. Open communications day Brussels, Feb., the 7th, 2013

ID: FDA-2015-N :

managedip Trunking TDS Table of Contents Essentials Special Calling Features


Norstar Plus Programming and Feature Card - Automation

Configuring the SST DeviceNet OPC Server

Fixed Point Theorems in Topology and Geometry

Quality Procedure ISO 9001: 2008 Control of Documents

North Star Heating & Air Conditioning Fenchurch Rd. West Jordan, UT (801)

The Process Below are the steps for creating and presenting digital short courses:

Mechanics 1: Vectors

Maine State Innovation Model Risk and Issue Mitigation Plan and Process

STAMPIN UP! Customer Manager and Mailing Selector Users Guide

E L E C T R O N I C V E H I C L E R E G I S T R A T I O N S Y S T E M. data management

Policy for Promotion of Agro-Processing and Agri-Business, Government of Rajasthan

S.GRAF C.LOISEAUX Keywords:abstractinterpretation,simulation,propertypreservation,model-checking. 1.Introduction

State of the Storage Virtualization Market 2008

Case: BKT11 Doc#:67 Filed:10/09/14 Entered:10/09/14 15:14:42 Document Page 1 of 7

Nonlinear Systems and Control Lecture # 15 Positive Real Transfer Functions & Connection with Lyapunov Stability. p. 1/?

Fact Sheet: Building the First Link to the Force of the Future

! Page!1!/!10! Figure'1.'DE+miniTED'participants'

The Perfect Number Theorem

Do Containers fully 'contain' security issues? A closer look at Docker and Warden. By Farshad Abasi,

How To Use Payables Automation

HILLENBRAND A GLOBAL DIVERSIFIED INDUSTRIAL COMPANY

Changes to New York State Publication Requirements for Non-Corporate Entities

Securing public cloud

INDUSTRIAL SERVICES PRESSURE EQUIPMENT CERTIFICATION (PED) Pressure equipment certification. Your key to market access in Europe.

Dynamic Trust Management for the Internet of Things Applications

Red Three Consulting

Module 8: QUALITY CONTROL SYSTEM (QCS) and RESIDENT MANAGEMENT SYSTEM (RMS) Submodule 1: Introduction and Overview

( F O R M E R LY M Y A C C O U N T ) Quick Reference Guide - Updated Sept 21, 2015

National Insurance Numbers and Immigration figures for Eastern Europeans

Peak load reduction for distributed backup scheduling

Spring 2011 Conference Sandanski, May 13th 15th 2011 Oracle SOA Suite 11g Rapid service integration and process automation with a no-coding approach

Identity opens the participation age. Dr. Rainer Eschrich. Program Manager Identity Management Sun Microsystems GmbH

Interreg CENTRAL EUROPE 1 st Call for proposals

AGILE SOFTWARE TESTING

Independent Contractors: Utah

ALPHA SAMPLE FUND, L.P. ACCOUNT STATEMENT FOR THE QUARTER AND YEAR ENDED 12/31/07

Bridge Development and Operations for faster delivery of applications

A-B: Mrs. Marshall C-G: Mrs. Lassiter H-Ma: Mrs. Wilson Mb-R: Mrs. Green S-Z: Mrs. Smith. Class of 2016

Application Security Testing as a Foundation for Secure DevOps

FWT-8848 GSM (GATEWAY) USER S MANUAL

Data Quality. Tips for getting it, keeping it, proving it! Central Coast Ambient Monitoring Program

Network Drive Access Policy

A Review ISO 9001:2015 Draft

[ SHERRYANNE MEYER. SAP CRM at Applied Materials. Session Al Linke Director, IT Sales & Marketing [ STEVE RUGGIERO [ ED HUDAK

OA S. ITEC - State University of New York. Our Banner Customers. Presentation Outcomes

Efficient Similarity Search over Encrypted Data

Welcome to the Center for International Studies Ohio University

Qualysoft Group Company Presentation 2015

ETICS - A Clean Approach to Open Source Cloud Software

How Service Manager 7 Licensing works

GE Medical Systems The Basic Structure of DICOM Charles Parisot, GE Medical Systems SSRPM Course Neuchâtel June 2003

Vendor Code Request Procedures

Online Application Procedure Guide. Feb. 2015

European Approach for Quality Assurance of Joint Programmes

Developing Joint Masters Programmes for Europe: lessons from the EUA Joint Masters Project

ROYAL REHAB COLLEGE AND THE ENTOURAGE EDUCATION GROUP. UPDATED SCHEDULE OF VET UNITS OF STUDY AND VET TUITION FEES Course Aug 1/2015

Unit Testing with FlexUnit. by John Mason

The Rise in Mobile Phone Internet Usage by Media Partners

Beyond the Software Life Cycle

P R E F E I T U R A M U N I C I P A L D E J A R D I M

Transcription:

Averiedmodelcheckerforthemodal -calculusincoq SwissFederalInstituteofTechnology,Lausanne,Switzerland ComputerNetworkingLaboratory, sprenger@di.epfl.ch ChristophSprenger Abstract.Wereportontheformalisationandcorrectnessproofofa ory.usingcoq'sextractionmechanismweobtainanexecutablecaml modelcheckerforthemodal-calculusincoq'sconstructivetypethe- 1Introduction exampleillustratesitsapplicationincombinationwithdeduction. program,whichisaddedasasafedecisionproceduretothesystem.an techniquesforthevericationofreactivesystems.theexpressivenessofthetheoremprover's(oftenhigher-order)logiccanbeusedtoaccommodateavarietyof designscanbeveried.however,usingatheoremproverisnottransparentand Thereisanobviousadvantageincombiningtheoremprovingandmodelchecking programmodellingandvericationparadigms,soinnitestateandparametrised whenusedinisolation. thetwotechniquescanthereforealleviatetheproblemsinherenttoeachofthem plicationisthuslimitedtosystemswithsmallstatespaces.acombinationof transparent,butexponentialinthenumberofconcurrentcomponents.itsap- mayrequireafairamountofexpertise.ontheotherhand,modelcheckingis areabstractinterpretation[4,11,7]andinductivereasoningattheprocesslevel smallenoughtobeamenabletomodelchecking.examplesofsuchtechniques ductiontechniqueswhichtransforminnitestateorparametrisedsystemsinto nitestateones,whilepreservingthepropertiesofinterest.theseareoften Suchanintegrationpaysoevenmore,whenusedincombinationwithre- [23,10]. environments[20,14,8].commontoallthesecasesisthatthemodelcheckerisan posed.inthispaper,wetakethepositionthatthisisanimportantquestion, aretrusted.thequestionofthecorrectnessofthemodelcheckeritselfisrarely externalprogramthatisinvokedasneededand,mostimportantly,whoseresults Variousmodelcheckershavealreadybeenintegratedintheoremproving whenevertheproofenvironmentweuseshouldbehighlyreliable.thisquestion gainsevenmoreimportanceinthecontextofproversbasedonintuitionistic (i.e.-terms)areconstructedduringtheproof.theseproofobjectsarethen typetheorysuchascoq[3],alf[1]andlego[12],whereexplicitproofobjects veriedbyaninferenceengineimplementingthebasicproofrules.sincethere

areonlyafewrulesandthecorrectnessofanyproofdependsonlyonthecorrect implementationoftheserules,thesesystemscanberegardedasveryreliable. necessaryproofobjectandadditasatactictothesystemor(2)weprovethe procedure.inbothapproachestheproofsystemforthetemporalormodallogic modelcheckeritselfformallycorrectandthenconsideritasatrusteddecision aframework:(1)weimplementitasanexternalprogramthatgeneratesthe Weseetwopossibilitiesfortheintegrationofamodelcheckerintosuch isimplementedintheproverandisthereforeavailablefordeductiveproofs. proofobjectsgrowslinearlywiththenumberofapplicationsofproofrules.this isclosesttoours.theyhaveimplementedamodelcheckerforthemodalcalculusforlegointhisway.whileintegratingverysmoothlyintotheprover, TherstapproachhasbeenfollowedbyYuandLuo[24],theworkwhich thisapproachhastheproblemofbeinginecient.thesizeofthegenerated ismoreecient,butintegratessomewhatlesssmoothlyintotheproofenvironment,astheresultsproducedbythemodelcheckerhavetobeintroducedas generateslargeproofobjectsevenforquitesmallexamples.thesecondapproach (safe)axiomsintotheprover. translatedintoanexecutablecamlprogram.moreover,wealsohavethepossibilitytodirectlyrunthe(proofofthe)modelcheckerincoqitselfandgenerate Ourapproachisacompromisebetweenthetwo.Wehaveformalisedthe modal-calculus,aspecicationofthemodelcheckerin[22]andprovedit correctincoq.usingcoq'sprogramextractionmechanismourproofisthen calculuscanbeusedtoprovepropertiesof(possiblyinnite)transitionsystems. istherstformallyveriedmodelchecker.secondly,theformalisationoftheablycorrectsequential(functional)programs.tothebestofourknowledge,this correctnessproofofthemodelcheckerprovidesacasestudyindevelopingprov- aproofobject.weseeourcontributionastwo-fold.firstly,thespecicationand Fornitestatesystems,themodelcheckerprovidesausefuldecisionprocedure whichrelievestheuserfromtediousdetailsofaproof.reductiontechniquescan beusedtoreduceinnitestatesystemstonitestate,whichcanthenbeproved -calculus,theproofsystemunderlyingthemodelcheckerandthecorrectness anoverviewofthecoqsystem.section3recallsthesyntaxandsemanticsof themodal-calculus.insection4wedescribeourformalisationofthemodal automaticallywiththemodelchecker.weillustratethisusewithanexample. proofofthealgorithm.section5reportsonanexampleillustratingthecombinationofdeductiveproofandautomaticproofusingthemodelchecker. Theoutlineoftherestofthepaperisasfollows.Thenextsectiongives 2OverviewofCoq Coq[3]isaninteractiveproofdevelopmentsystemimplementingtheCalculusof structions[6]isthemostpowerfulsysteminbarendregt's-cube[2].itcombines provideapowerfulandnaturalmechanismforthedenitionofdatatypes,spec- InductiveConstructions(CIC)[18,21].TheunderlyingpureCalculusofCon- polymorphic,higherorderanddependenttypes.theadditionalinductivetypes

toderivejudgementsoftheform `t:tmeaningthatincontext,termt CICisatypedlambdacalculus.Itsnaturaldeductionstyleproofrulesareused hastypet.sinceprovingtincontext involvestheexplicitconstructionofa -termtinhabitingt,thecurry-howardcorrespondenceallowsustoidentify icationsandpredicatesaswellasforproofsbystructuralinduction.formally, 2.1Thepurecalculus InCoqthefollowingnotationforthebasictermandtypeconstructionsisused: proofswithprogramsandtypeswithspecications. associatestotheleftandproductstotheright.inthispaper,wewritethe specialcaseoftheproductwhenxdoesnotoccurfreeinb.functionapplication [x:a]mistheabstractionofx:afromm(usuallynotedx:a:m),(mn) dependentproductas8x:a:minordertoimprovereadability. B(oftennoted8x:A:Morx:A:M).ThefunctionspaceA!Bisthe denotesapplicationofmtonand(x:a)bthedependentproductofaand fprop;set;typeg,axiomsa=fprop:type;set:typegandrulesr=ss. Thepurecalculuscanbespeciedasthepuretypesystem[2]withsortsS= Moreover,therearethethreeconstantsProp,SetandType,calledsorts. arityisofsorts.alongwitheachinductivetypeastructuralinductionprinciple arityisatypeoftheform8x1:a1:::8xn:an:s,wheresisasort.wesaythe 2.2Inductivetypesandrecursion isautomaticallygenerated.forourpurpose,thedenitionofinductivetypesis bestexplainedwithacoupleofexamples. Apositiveinductivetypeisspeciedbyanarity,andasetofconstructors.An Example1.(Naturalnumbers)The(data)typeofnaturalnumbersisspecied bythefollowinginductivedenition: ThistypehasaritySetandtwoconstructorsO:natandS:nat!nat.Inthis case,theinductionprincipleisatermnatindofthefamiliartype: Inductivenat:Set:=O:natjS:nat!nat: instance,additiononnaturalnumberscanbedenedbyprimitiverecursion: combinedwiththefixpointconstructtodeneprimitiverecursivefunctions.for TheconstructCases:::of:::enddenesafunctionbycaseanalysis;itmaybe 8P:nat!Prop:(PO)!(8n:nat:(Pn)!(P(Sn)))!8n:nat:(Pn) Fixpointadd[n:nat]:nat!nat:= teeingitstermination. verifythatitbecomesstructurallysmallerineachrecursivecall,thusguaran- Notethatbyemphasisingtherstargument(namedn),thesystemisableto [m:nat]casesnofo)mj(sp))(s(addpm))end:

Example2.(Predicates)Thepredicateonnaturalnumbersisdenedby: Inductivele[n:nat]:nat!Prop:= tobegreaterorequalton. Infact,thisdenesthefamilyofinductivepredicates\n:",indexedbyn:nat, jles:8m:nat:(lenm)!(len(sm)): len:(lenn) quantication: tionprincipleprovidestheeliminationrule.asanexample,wetakeexistential Example3.Logicalconnectivescanbedenedasnon-recursiveinductivetypes. Thetypesoftheconstructorstaketheroleofintroductionrules,whiletheinduc- naturaldeduction: Theassociatedinductionprincipleremindsofthe9-eliminationruleknownfrom Inductiveex[A:Set;P:A!Prop]:Prop:= exintro:8x:a:(px)!(exap): 2.3Programdevelopmentandextraction exind:8a:set:8p:a!prop:8q:prop: (8x:A:(Px)!Q)!(exAP)!Q Pandinput-outputrelationQ. AccordingtoHeyting'sconstructiveinterpretationofpropositions[9],aproofof theformula8x:a:(px)!9y:b:(qxy)isafunctiontakingavalueianda acomputationalpointofview,weareonlyinterestedintheinputandoutput proofof(pi)andconstructsvalueoalongwithaproofthat(qio).so,this valuesandnotintheproofsofpandq,whichareofpurelylogicalcontent.the formulacanbeunderstoodasthespecicationofaprogramwithprecondition content,respectively.theextractionmechanismstripso(sub-)termswhose twosortssetandpropareusedtomarktermsofcomputationalandoflogical Anyproofofthisspecicationisavalidimplementation.However,from functionalsoforgetsaboutdependenciesoftypesonterms.itscodomainis specicationlanguageforfind typeareofsortprop,whilekeepingthosewithtypesofsortset.theextraction executablecamlprograms1. thesubsystemofcicwithoutdependenttypes,calledfind replacesexinspecications.(sigap)iswrittenasfx:aj(px)g.extraction InCoq,thereisatypesigisomorphictoexbutwhosearityisofsortSet.It!programs.Thesemaythenbetranslatedinto!.CICisusedas proofofthespecication8x:a:(px)!fy:bj(qxy)gextractstoafunction f:a!b.thecorrectnessoftheextractumisjustiedbytherealisability A!(sig0A).Thistypecanbesimpliedtotheisomorphictype[A:Set]A.So,a yieldstheinductivetypesig0ofarityset!setwithitsonlyconstructoroftype 1providedtheyaretypableinCaml,whichisthecaseformostpracticalapplications

interpretation[16,17],ensuringinthiscasethatfsatises8x:a:(ix)! (Qx(fx)). arityofsortset)givenby: Decisionproceduresarespeciedbyavariantoflogicaldisjunction(with Inductivesumbool[A:Prop;B:Prop]:Set:= tothetypeofbooleans.forexample,8x;y:nat:fx=yg+f:x=ygspeciesa Thenotationfor(sumboolAB)isfAg+fBg.Itsextractionisisomorphic left:a!(sumboolab)jright:b!(sumboolab) decisionprocedureforequalityonthenaturalnumbers. arguments.moresophisticatedpatternmatchingrequiresstatingandproving specialisedinductionprinciples,whicharethenappliedtoobtainthedesired Proofmethods.Therearetwopossibilitiestoproveaprogramspecication. controlstructure[19]. TherstoneistousetheusualtacticsandtacticalsprovidedbyCoq.Primitiverecursivefunctionsareconstructedbystructuralinductionononeoftheir systemrightfromthebeginningandthenapplyaspecialprogramtacticwhich triestosynthesisethecomputationalpartsoftheproofandgeneratesthelogical lemmasnecessarytocompletetheproof.thisistheinversetotheextraction process.however,asextractionisnotinvertible,therawfind Theideaofthesecondmethodisroughlytogivethedesiredprogramtothe andthelanguageofrealizersiscalledreal. programwithspecications[15].suchannotatedprogramsarecalledrealizers sucientandthetacticneedssomehintswhicharegivenbyannotatingthe!programisnot Themodal-calculussubsumesinexpressivepowermanymodalandtemporal logicssuchasltlandctl.itisinterpretedoverlabelledtransitionsystems 3Thepropositionalmodal-calculus states,actisasetofactionsand!stactstisthetransitionrelation. anenvironmentwhichassignstoeachvariableandatomicpropositionasetof APofatomicpropositions.Amodelisapair(T;)consistingofaLTSTand Wewritesa!tfor(s;a;t)2!.AssumeacountablesetsVarofvariablesand (LTS),whicharestructuresoftheformT=(St;Act;!),whereStisasetof states.theabstractsyntaxofthemodal-calculusisnowdenedby anaction.thexedpointoperatorsandaretaggedwithanitesetuof wherex2varisavariable,a2apisanatomicpropositionand2actis ::=XjAj:Aj_j^jhij[]jXfUg:jXfUg: states.wewritewheneverwemeaneitherofor.thesemanticsisthen

inductivelydenedasfollows: kxk=(x) k0^1k=k0k\k1k k0_1k=k0k[k1k k:ak=stnkak kak=(a) kxfug:k=s:( khik=fs2sj9s02s:s!s0^s02kkg k[]k=fs2sj8s02s:s!s0)s02kkg thefalse(f)andtrue(t)propositionsaredenableasx:xandx:x,respectively.thispresentationofthecalculus,wherenegationoccursonlyinfront (S)) (S)=kk[S=X].TheusualX:isdenedasXf?g:.Notethat kxfug:k=s:(u[ (S)nU) 4Implementationofthemodelchecker ofatomicpropositioniscalledpositivenormalform. mentationandcorrectnessproofofthemodelcheckerdescribedin[22]. 4.1Fixedpoints Thissectiondescribestheformalisationofthe-calculusinCoqandtheimple- AssumeanarbitrarytypeU.Then(EnsembleU)isthetypeofsetsoverU (whichareimplementedaspredicatesu!prop).weabbreviatethistypeto inclusionordering.wedenethefollowingtwooperatorsmuandnu: EnsU.SupposefurtherthatF:EnsU!EnsUisamonotonefunctionw.r.t.the Denitionmu:(EnsU!EnsU)!EnsU:= Denitionnu:(EnsU!EnsU)!EnsU:= [F:EnsU!EnsU][s:U]8X:EnsU:(Included(FX)X)!(InXs): Winskel'sreductionlemma,whichformsthebasisforthemodelchecker: AccordingtoTarski'stheorem,thesetwooperatorsdenetheleastandgreatest xedpointsoff,respectively,asiseasilyprovedincoq.thenextingredientis [F:EnsU!EnsU][s:U]9X:EnsU:(IncludedX(FX))^(InXs): ItstatesthatasetPiscontainedinthegreatestxedpointofamonotone TheoremReductionlemma: functionexactlyifitiscontainedinacertainkindofunfoldingofthatxed (IncludedP(F(nu[S:EnsU]UnionP(FS)))): (IncludedP(nuF))$ point,wherepisaddedtofunderthexedpointoperator.

4.2-calculussyntaxandsemantics s.thisisexpressedinthefollowinglines: functionwhich,foranystatesandactiona,computesalistofa-successorsof sitionsystem.weassumethatthesetofstatesisniteandthatwehavea Ourdevelopmentofthemodelcheckerwillbeparametrisedbyalabelledtran- ParameterAct;St:Set: ParameterTrans:St!Act!St!Prop. Theinductivetypedeningthesyntaxisthendenedby: Axiompostspec: Axiomfinitestate:(Finite(FullsetSt)): InductiveMuForm:Set:= 8s:St:8a:Act:fl:(listSt)j8t:St:(Elemtl)$(Transsat)g: jor: jand:muform!muform!muform jlit:(st!bool)!muform Var:nat!MuForm jnu: jmu: jdia:act!muform!muform jbox:act!muform!muform (listst)!muform!muform. predicatesoftypest!bool.sincethistypeisclosedundernegationwecan ofatomicpropositionsisdirectlycodedintothesyntaxintheformofcomputable dropnegationaltogetherfromthesyntax.thexedpointoperatorsaretagged withalistofstates. VariablesareencodedinthestandardwayusingdeBruijnindices.Thevaluation aninnitelistsofsetsofstates.weintroduceanoperationenvcons:ensst! functionrecursivelycomputingthesemanticsofaformulawithrespectto environmentisdenedby: Env!Envwith(envconsR)returningRforOand(j)forj+1.The ThetypeEnvofenvironmentsisdenedasnat!EnsSt,whichcanbeseenas FixpointSem[:MuForm]:Env!EnsSt:= [:Env]Casesof j(litp) (Vari) )(i) j(diaa))(diasema(sem)) j(boxa))(boxsema(sem)) j(or12))(unionst(sem1)(sem2)) j(and12))(intersectionst(sem1)(sem2)) )(cf2ensstp) end: j(mul) j(nul) )(MuSeml[R:EnsSt](Sem(envconsR))) )(NuSeml[R:EnsSt](Sem(envconsR)))

Thefunction(cf2ensSt)transformsapredicateoftypeSt!boolintothe setofstates(oftypeensst)verifyingthepredicate.boxsem,diasemarethe freevariablesbyone,accountingfortheincreasedabstractiondepthunderthese pointoperator.here,envconshastheeectofshiftingtheinterpretationof debruijnversionofs:kk[s=x]whenxisthevariableboundtothexed ofthexedpointoperators,thesecondargumenttomusemandnusemisthe predicatetransformersdeningthesemanticsofthemodalities.inthecases operators.forillustration,wegivethedenitionsofdiasemandnusem. InductiveDiaSem[a:Act;R:EnsSt]:EnsSt:= DenitionNuSem:(listSt)!(EnsSt!EnsSt)!EnsSt:= diaintro:8s;t:st:(transsat)!(instrt)!(inst(diasemar)s): [P:(listSt)][:EnsSt!EnsSt] typenat!muformassigningeachvariablea-calculusformula.substitutionis Substitution.WedenethetypeofsubstitutionsSubsttobethefunctionsof (nust[r:ensst](unionst(list2ensstp)(r))): ducessomenotationwhichisusefulinthecontextofdebruijn-codedvariables: thusafunctionsubst:muform!subst!muform.thefollowingtableintro- notationdenition 0 id " [i:nat](vari) [i:nat](var(si)) name *() [i:nat]casesiofo)j(sk))(k)end\cons" [i:nat](subst(i)0) O(") \lift" \shift" \composition" \identity" of(subst).insubst,thecasesofthexedpointoperatorsuse'lift'to pushsubstitutioninside,i.e.wehave(l Inordertoimprovereadability,wewillusetheusualnotation[]instead Lemma4.(0)=*()(0): operatorisusefulinunfoldingxedpointformulas: totheunfoldingof(nul ).Withthesedenitions,wecanprove: )[]=(l( [(Nul[*()])).The'cons' )id]corresponds stitutionandenvironment.itisprovedisbystructuralinductionon. Thenextlemmaestablishesastandardsemanticalcorrespondencebetweensub- LemmaSubstitutionlemma: 4.3Correctnessassertions 8:MuForm:8:Env:8:Subst: (Sem[])=(Sem[i:nat](Sem(i))): Thesatisfactionrelationsatonstatesandformulasisdenedas:

Wecalltheproposition(sats)acorrectnessassertionandwriteitassj=. InCoq,wecanprovethefollowinglemma: Inductivesat[s:St;:MuForm]:Prop:= satintro:(8:env:(inst(sem)s))!(sats): Lemma5.For';'0;'1and(l 1.sj=(And01)$sj=0^sj=1 2.sj=(Or01)$sj=0_sj=1 3.sj=(Diaa)$9s0:St:(Transsas0)^s0j= )closedformulas,wehave 4.sj=(Boxa)$8s0:St:(Transsas0)!s0j= Proof.Items(1)-(5)followdirectlyfromthesemanticdenition.For(6),weneed 6.if:(Elemsl)thenfor2fMu;Nug: 5.if(Elemsl)then(a):(sj=(Mul sj=(l )$sj=[((conssl))),and(b)sj=(nul )id] ) thereductionandsubstitutionlemmas.inthecaseoftheleastxedpoint,a ertiesofarbitrary(possiblyinnitestate)transitionsystemsdeductively. dualversionofthereductionlemmaisused. Theseequivalences,whencastintoproofrules,canbeusedtoestablishprop- ut 4.4Thealgorithm themassimplicationrules(ingoingfromlefttoright). correctnessassertionsbyexploringtheneighbourhoodofthestateofinterest. Inthissection,wedescribethespecicationandcorrectnessproofofWinskel's TheideaistoexploittheequivalencesofthepreviousLemma5byconsidering localmodelcheckingalgorithm[22]incoq.itdecidesthetruthorfalsityof oritnot.thisleadsustothefollowingcoqspecication: transitionsystem,themodelcheckerissupposedtodecidewhetherssatises Specication.Givenaclosedformulaofthe-calculusandastatesofthe (booleancombinationsof)simplerones.thexedpointoperatorsaredealtwith byunfoldingthemwhileaddingthecurrentstatetothetag,wheneveritisnot WeapplyLemma5inordertograduallytransformthedecisionprobleminto MuChk:8:MuForm:(Closed)!8s:St:fsj=g+f:(sj=)g: openorclosed.thisleadstothefollowinggeneralisedspecicationmuchkplus, proofalsorequiresthatweextendourspecicationtoarbitraryformulas,bethey thatthecorrectnessproofwillproceedbywell-foundedinduction.however,the alreadythere.incases1-4thereisastructuralreductioningoingfromleftto right.case5providesthebase.incase6thereductionislessobvious.thismeans usingtheauxiliarypredicatesqandq+.

DenitionQ+:MuForm!Set:= DenitionQ:MuForm!Set:= [:MuForm]8:Subst: [:MuForm]8s:St:fsj=g+f:(sj=)g: MuChkplus:8:MuForm:(Q+) 8i:nat:(Elemi(fv))!(Closed(i))! 8i:nat:(Elemi(fv))!(Q(i))!(Q[]): TherstconditioninthedenitionofQ+meansthatthesubstitute(i)for isequivalenttoqinthiscase.withthesedenitionstheoriginalspecication eachfreevariableiofisaclosedformula.thesecondconditionexpresses substitutes.sinceaclosedformulatriviallysatisesbothoftheseconditions,q+ MuChkreads8:MuForm:(Closed)!(Q). theassumptionthatweknowhowtodecidethesatisfactionproblemforthese partofthecoqlibrary.itisstatedinthefollowing. well-foundedinduction.thewell-foundedinductionprinciple(wfi)isatheorem Correctnessproof.WeprovethegeneralisedspecicationMuChkplusby wellfoundedinduction: 8A:Set:8R:A!A!Prop:(wellfoundedAR)! P)!P)!A!P.Note,however,thatbytherecursiverealisabilityinterpretation[19]anyprogramextractedfromaproofbywell-foundedinductionis guaranteedtoterminateonargumentssatisfyingthespeciedpreconditions. tryheretopointouttheapplicationoftheproofmethodprovidedbyrealizers ProofofmaintheoremMuChkplus.Aswefollowbasicallytheproofin[22],we obtainedbyextractionisageneralrecursor.itstypeis8a;p:set:(a!(a! Thecomputationalcontentoftheproofofthewell-foundedinductionprinciple 8P:A!Set:(8x:A: 8y:A:(Ryx)!(Py))!(Px)!8a:A:(Pa) formulas.thenrelationr:muform!muform!propisdenedby: andtheprogramtactic. Denition6.Letbetheproperone-step2subformularelationon-calculus isnite.bythewell-foundedinductionprinciple,muchkplusfollowsfrom: Well-foundednessofRfollowsfromtheassumptionthatthesetofstatesSt [;0:MuForm] 0_9s:St:9l:(listSt):9 (:(Elemsl)^((conssl))^0(l :MuForm: )) Theproofproceedsbycaseanalysisontheformof,whichgenerateseight subgoals,oneforeachconstructorofmuform.wepickoutthecaseofthegreatest xedpointwhichwestateasthelemma: 8:MuForm:(8 :MuForm:(R )!(Q+ ))!(Q+): (1) 2i.e.if0thenthereisno00s.t.000

AfterunfoldingthedenitionsofQ+andQ,introducingthehypothesisintothe LemmachkNuplus: contextandpushingsubstitutioninsidenu,weobtainthesequent: 8l:(listSt):8:MuForm: (8:MuForm:(R(Nul))!(Q+))!(Q+(Nul)): h:8 80:Subst: :MuForm:(R (8j:nat:(Elemj(fv(Nul)))!(Closed(0j)))! (8j:nat:(Elemj(fv(Nul))!(Q(0j)))!(Q (Nul))! h1:8i0:nat:(elemi0(fv(nul))!(q(i0)) s:st :Subst h0:8i0:nat:(elemi0(fv(nul)))!(closed(i0)) [0]) Therealizerforthisgoaldependsontwolemmaswhichareprovedinthecontext above.therstoneis: ============================ fsj=(nul([*()]))g+f:(sj=(nul([*()])))g righthandsideoflemma5(6): ItisautomaticallyprovedbyProgramall.Thesecondonecorrespondstothe LemmaQNucons::(Elemsl)!(Q(Nu(conssl))[]) Realizer(h(Nu(conssl)h1)): UsingLemma4,werstrewritethisto(Q[(Nu(conssl)([*()]))]).Now, sincebylemmaqnuconsweknowhowtodecide(nu(conssl)([*()])) LemmaQNuunfold: :(Elemsl)! Q([*()])(Nu(conssl)([*()]))id thefollowingrealizer howtodosoforeach(i),wecanusetheinductionhypothesishtoconstruct (whichisconvertiblewith(nu(conssl))[])andbyhypothesish1weknow ApplyingthetacticProgramallleavesuswithtwosubgoalswhichareeasily solved.now,withlemma5(5b)and(6)inmind,wearereadytogivetherealizer Realizer h(nu(conssl)([*()])) [i:nat]casesiofo)qnuconsj(sj))(h1j)end forthegoalofouroriginalsequent: and5(6). subgoalsgeneratedbyprogramallarealleasilyprovedusinglemmas5(5b) whereiselemspec:8s:st:8l:(listst):f(elemsl)g+f:(elemsl)g.the Realizerif(iselemspecsl)thentrueelse(QNuunfolds):

realizerformuchkplus: (applicationofthewfiandcaseanalysis)canbereplacedbythefollowing ArealizerforthecontrolstructureThestepstakeninthebeginningoftheproof Realizer<Q+>recmuchkplus::::fRg [:MuForm]Casesof j(constrargs))(chkconstrplusargsmuchkplus) j(litp) j::: (Vari) )(chklitplusp) )(chkvarplusi) hypothesisandm:p,issyntacticsugarfor(wellfoundedinductionap[a: Thenotation<P>rech::::fRg[a:A]M,wherehisthenameoftheinduction end: A][h:A!P]M).Theidentierschkconstrplus,whereconstristhenameof 5Application insubgoal(1). arecursiveconstructorofmuform,denotelemmasprovingthedierentcasesfor CCSandthespecicationpreorder.Werecallthebasicdenitions.For ematicalnotationforbrevity. AllthenotionsinthissectionhavebeenformalisedinCoq.WeuseusualmathplementsA=fljl2AgandthesetoflabelsL=A[A.Wesetl=l.fDene moredetail,wereferthereaderto[13,5].letabeasetofnames,theircom- thesetofactionsbyact=l[fg,wherewiththeinvisible/silentaction.f isarelabellingfunctioniff(l)=f(l)andf()=.supposeasetkofprocess constants.thesetpofprocessesisdenedbytheabstractsyntax: bytherules: wherea2act,farelabellingfunction,llanda2k.lettbethe transitionsystem(p;act;!),whosetransitionrelation!isinductivelydened p::=nilj?ja:pjp0+p1jp0jp1jp[f]jpnlja a:pa!p pa!p0;a;a62l)pnla!p0nl pa!p0;adef pa!p0)p+qa!p0;q+pa!p0; =p)aa!p0 pjqa!p0;qjpa!p0;pffgf(a)!p0ffg Thepartialitypredicate"isthecomplementof#whichisdenedby:(i)nil# ;a:p#,(ii)p#;q#)p+q#;pjq#,(iii)p#)pnl#;p[f]#,(iv) Adef =p;p#)a#.intuitively,"denotestheunderdenedprocesses.

Denition7.Letl2Landa2Act.Dene 1.l)=!l!!and)= p+(p+a)isthecomplementsofp*(p*a).wesaythataprocesspistotally 3.p*aip*_9p0:(p")p0^p0*) 2.p*i9p0:p")p0^p"! s.t.p+awehave: Denition8.Denethespecicationpreorderasthegreatestxedpointof thefunctionfonrelationsoverpdenedby(p;q)2f(r)iforalla2act denedifforallp0reachablefromp:p+.otherwise,itispartiallydened. Letdenoteweakbisimulationequivalence[13]. 3.ifqa!q0then9p0:pa)p0^(p0;q0)2R. 1.q+a, 2.ifpa!p0then9q0:qa)q0^(p0;q0)2R, Lemma9.Ifpqandpistotallydened,thenqistotallydenedandpq. Theorem10.([5])Thepreorderisaprecongruencew.r.t.parallelcomposition,restrictionandrelabelling,i.e.ifpqthenpjrqjr;pffgqffgand Vericationofusingthemodelchecker.Weintroducethetransition systemt+=(pp;act]act;!+),where!+isdenedby: pnlqnl. thetransitionsystemt+: Next,wedenesomeleftandrightmodalitiesforthe-calculusinterpretedover pa!p0)(p;q)0(a)!+(p0;q);(q;p)1(a)!+(q;p0) Ofallthesewedene\right"versions,butwithhair=h1(a)i.Wealso hh`iil=hilh`ilhil(`2l) hail=h0(a)i hhiil=hil hil=x:_hilx(x62fv()) Similarly,\right"versionsaredenedusing"r=P".Now,supposingtheset introduceleft/rightversionsofthepartialitypredicates: Actisnite,thefunctionFfromdenition8canbeexpressedasthe-calculus formula:~f(x)=^ "l="p *l=hhiil"l *l(a)=*l_hhaiil*l Wedene=X:~F(X).Thenwehavethefollowingresult: a2act:*l(a)_ *r(a)^[a]lhhaiirx^[a]rhhaiilx

Lemma11.ForActnite:pq,(p;q)j=. Asimpleprotocol.AsimpleprotocolPniscomposedofasenderSsynchronouslytransmittingsignalsoverabuerBnofsizentoareceiverR.With XkYdef =(X[out=z]jY[in=z])nfzg,thedenitionis: Bdef =in:out:b Bndef =kni=1b Sdef =send:in:ack:s Rdef =out:recv:ack:r Edef =(SjR)nfackg Pndef =(EjBn)nfin;outg WedeneaspecicationoftheprotocolbySpecdef =send:recv:spec.wewantto showthatthebehaviouroftheprotocolisindependentofthesizeofthebuer. Theorem12.Foralln1:SpecPn. Proof.Theproofisdecomposedintothefollowingtwosteps: 1.ndanetworkinvariantJsuchthatforalln1:JBn 2.verifythatSpec(EjJ)nfin;outg TheresultthenfollowsfromTheorem10andLemma9,afactwhichisproved bydeductionincoq.wedenejdef =in:j0andj0def =out:j+in:?. Step(1)isprovedbyanimplicitinductiononn:(a)JB(basecase)(b) JBkJ(inductivestep).Boththesestepscanbeprovedwiththemodel checker,byusingthecharacteristicformula.that(a)and(b)imply(1)is proved\byhand"incoq.step(2)canbedelegatedtothemodelcheckeras well. ut Asanyproperty,expressedinaversionofthemodal-calculuswithweak modalitiesonly,ispreservedbyweakbisimulationequivalence,wecanverifyit onthespecicationspecandconcludethatitalsoholdsforeachofthepn. References 1.L.Augustsson,T.Coquand,andB.Nordstrom.Ashortdescriptionofanother logicalframework.ing.huetandp.g.,editors,preliminaryproceedingsoflogical Frameworks,1990. 2.H.P.Barendregt.Lambdacalculiwithtypes.InS.Abramsky,D.M.Gabbay, andt.s.e.maibaum,editors,handbookoflogicincomputerscience,volume2: Background:ComputationalStructures,pages118{309.OxfordUniversityPress, 1992. 3.B.Barras,S.Boutin,C.Cornes,J.Courant,j.-C.Fili^atre,E.Gimenez,H.Herbelin, G.Huet,andal.TheCoqProofAssistantReferenceManual,Version6.1.Projet Coq,INRIARocquencourt,CNRS-ENSLyon,Dec.1996. 4.E.M.Clarke,O.Grumberg,andD.E.Long.Modelcheckingandabstraction. ACMTransactionsonProgrammingLanguagesandSystems,16(5):1512{1542, Sept.1994.

5.R.CleavelandandB.Steen.Apreorderforpartialprocessspecications.In CONCUR'90,volume458ofLectureNotesinComputerScience.Springer-Verlag, 1990. 6.T.CoquandandG.Huet.Thecalculusofconstructions.InformationandComputation,76:95{120,1988. 7.D.Dams,O.Grumberg,andR.Gerth.Abstractinterpretationofreactivesystems. ACMTransactionsonProgrammingLanguagesandSystems,19(2):253{291,1997. 8.J.DingelandT.Filkorn.Modelcheckingforinnitestatesystemsusingdata abstraction,assumption-commitmentstylereasoningandtheoremproving.incav '95,volume939ofLectureNotesinComputerScience.Springer-Verlag,1995. 9.J.-Y.Girard,Y.Lafont,andP.Taylor.ProofsandTypes,volume7ofCambrdge TractsinTheoreticalComputerScience.CambridgeUniversityPress,1989. 10.R.P.KurshanandK.McMillan.Astructuralinductiontheoremforprocesses. In8thACMSymposiumonPrinciplesofDistributedComputing,pages239{248, 1989. 11.C.Loiseaux,S.Graf,J.Sifakis,A.Bouajjani,andB.S.Propertypreserving abstractionsforthevericationofconcurrentsystems.formalmethodsinsystem Design,6:11{44,1995. 12.Z.LuoandR.Pollack.Legoproofdevelopmentsystem:User'smanual.TechnicalReportECS-LFCS-92-211,DepartmentofComputerScience,Universityof Edinburgh,1992. 13.R.Milner.CommunicationandConcurrency.PrenticeHallInternationalSeriesin ComputerScience.PrenticeHall,1989. 14.O.MullerandT.Nipkow.CombiningmodelcheckinganddeductionforI/Oautomata.InTACAS95,volume1019ofLectureNotesinComputerScience, pages1{16.springer-verlag,1995. 15.C.Parent.SynthesedepreuvesdeprogrammesdansleCalculdesConstructions Inductives.PhDthesis,EcoleNormaleSuperieuredeLyon,Jan.1995. 16.C.Paulin-Mohring.ExtractingF!programsfromproofsintheCalculusofConstructions.InSixteenthAnnualACMSymposiumonthePriciplesofProgramming Languages,Austin,Texas,Jan.1989. 17.C.Paulin-Mohring.ExtractiondeprogrammesdansleCalculdesConstructions. PhDthesis,UniversitedeParisVII,Jan.1989. 18.C.Paulin-Mohring.InductivedenitionsinthesystemCoq{rulesandproperties. TechnicalReport92-49,Laboratoiredel'InformatiqueduParallelisme,ENSLyon, France,Dec.1992. 19.C.Paulin-MohringandB.Werner.SynthesisofMLprogramsinthesystemcoq. JournalofSymbolicComputation,11:1{34,1993. 20.S.Rajan,N.Shankar,andM.K.Srivas.Anintegrationofmodelcheckingwith automatedproofchecking.incav'95,volume939oflecturenotesincomputer Science,pages84{97.Springer-Verlag,1995. 21.B.Werner.UneTheoriedesConstructionsInductives.PhDthesis,Universitede Paris7,France,1994. 22.G.Winskel.Anoteonmodelcheckingthemodal-calculus.TheoreticalComputer Science,83:157{167,1991. 23.P.WolperandV.Lovinfosse.Verifyingpropertiesoflargesetsofprocesseswith networkinvariants.inj.sifakis,editor,internationalworkshoponautomatic VericationMethodsforFiniteStateSystems,volume407ofLectureNotesin ComputerScience,pages68{80.Springer-Verlag,1989. 24.S.YuandZ.Luo.ImplementingamodelcheckerforLEGO.InFormalMethods Europe,1997.