Verifying Concurrent Message-Passing C Programs with Recursive Calls

Size: px
Start display at page:

Download "Verifying Concurrent Message-Passing C Programs with Recursive Calls"

Transcription

1 Verifying Concurrent Messge-Pssing C Progrms with Recursive Clls Sgr Chki Edmund Clrke Crnegie Mellon University Pittsburgh USA Nichols Kidd Thoms Reps University of Wisconsin Mdison USA Tyssir Touili LIAFA CNRS & University of Pris 7 Pris Frnce Abstrct We consider the model-checking problem for C progrms with (1) dt rnging over very lrge domins (2) (recursive) procedure clls nd (3) concurrent prllel components tht communicte vi synchronizing ctions. We model such progrms using communicting pushdown systems nd reduce the rechbility problem for this model to deciding the emptiness of the intersection of two context-free lnguges L 1 nd L 2. We tckle this undecidble problem using CounterExmple Guided Abstrction Refinement (CEGAR) scheme bsed on (1) computing over-pproximtions A 1 nd A 2 of L 1 nd L 2 (2) checking if the intersection of A 1 nd A 2 is non-empty nd if the non-empty intersection represents n infesible trce (3) refining these over-pproximtions A 1 nd A 2. Furthermore we present new fully utomtic predictebstrction refinement techniques to obtin communicting pushdown systems from C source code. We hve implemented our techniques in the model-checker MAGIC. We report our experimentl results on some non-trivil benchmrks. 1. Introduction Anlysis of concurrent softwre represents mjor chllenge in the model-checking community. Indeed concurrent progrms include vrious complex fetures such s: (1) the mnipultion of dt rnging over unbounded domins such s integers nd rels (or very lrge domins such s 32-bit ints nd flots) (2) the presence of recursive procedure clls which cn led to n unbounded number of clls (3) concurrency nd the existence of synchroniztion sttements. Unfortuntely checking whether given control point is rechble is undecidble even if the progrm includes only recursive procedures nd synchronistion sttements [Rm00]. Consequently ny method for solving the rechbility problem for these systems is incomplete nd ll we cn hope for is either n pproxi- This reserch ws sponsored by the Office of Nvl Reserch (ONR) nd the Nvl Reserch Lbortory (NRL) under contrct no. N The views nd conclusions contined in this document re those of the uthors nd should not be interpreted s representing the officil policies either expressed or implied of ONR NRL the U.S. Government or ny other entity. [copyright notice will pper here] mte technique or semi-decision procedure whose termintion is not gurnteed. During the lst few yers severl uthors hve ddressed this issue. Pushown systems hve been proposed s n dequte formlism to describe pure sequentil recursive progrms [EK99 ES01]. This llows to represent the potentilly infinite configurtions of recursive progrms in symbolic mnner using regulr lnguges [BEM97 FWW97]. Recently compositions of pushown systems clled communicting pushown systems hve been used to model concurrent recursive progrms [BET03 BET03b]. However in these cses ll dt were ssumed to hve smll finite domin. On the other hnd bstrct-interprettion techniques [CC77] hve been used to del with dt rnging over unbounded (or very lrge) domins. More recently utomted predicte-bstrction techniques [GS97] hve been proposed to del with this issue. The ide of predicte bstrction is to bstrct the infinite dt domin into finite one defined by given set of predictes. The precision of the bstrction nd the model-checking lgorithm depend on the number nd the form of the predictes becuse the size of the model increses with the number of predictes. The centrl problem in predicte bstrction is then the discovery of smll set of predictes sufficient to prove the desired property. To do so CounterExmple Guided Abstction Refinement (CEGAR) techniques [Kur94 CGJ + 00] hve been used to find such smll set. The ide is to (1) strt with n empty set of predictes (2) perform the verifiction procedure on the obtined model. If the property is stisfied by the model we conclude tht it is lso stisfied by the rel progrm becuse the progrm hs fewer behviors thn the model. Otherwise we obtin counterexmple. (3) If the counterexmple corresponds to n execution of the progrm we conclude tht the progrm does not stisfy the property. (4) Otherwise we compute new set of predictes tht eliminte future explortion of the spurious trce nd go bck to step (2). This schem hs been successfully pplied to hndle both pure non-concurrent (sequentil) recursive progrms in the tool SLAM [BR01] nd concurrent nonrecursive progrms in the tools BLAST [HJMS02] nd MAGIC [CCG + 03]. In this work we go one step further nd combine CEGAR predicte-bstrction techniques with pushdown-system modeling to hndle concurrency recursion nd very lrge dt domins t the sme time. Our pproch consists of using communicting pushdown systems (CPDSs) to model concurrent progrms. To do this we (1) define CEGAR predicte-bstrction techniques to obtin successively more precise CPDSs from the C source code of prllel progrm nd (2) define model-checking lgorithms for CPDSs. The min contributions of this pper re: 1. Defining new utomtic CEGAR predicte-bstrction techniques tht cn crete CPDS from the C source code of concurrent (recursive) C progrm tht mnipultes vribles tht /7/19

2 rnge over very lrge domins nd tht cn refine CPDS bstrctions to eliminte given counterexmple. Our techniques re defined component-wise which mkes them compositionl nd sclble to lrge progrms. 2. Defining new model-checking techniques for CPDSs. We restrict ourselves in this work to solving rechbility queries. We reduce the rechbility problem for CPDSs to the undecidble problem of checking the emptiness of the intersection of two context-free lnguges L 1 nd L 2. To tckle this problem we pply second CEGAR scheme tht consists of (1) computing over-pproximtions A 1 nd A 2 of L 1 nd L 2. (2) If A 1 A 2 = we conclude tht L 1 L 2 =. (3) Otherwise we check whether the intersection A 1 A 2 is spurious. In this cse we refine the over-pproximtions A 1 nd A 2 nd return to step (2). This semi-decision procedure is gurnteed to terminte if the intersection L 1 L 2 is not empty. 3. Implementing our technique in the model-checker MAGIC nd crrying out number of non-trivil experiments. Our implementtion ws ble to hndle non-trivil exmple ( Bluetooth driver in Windows NT) tht could not be hndled with the previous version of MAGIC. Moreover the implementtion provides improved performnce for non-recursive exmples tht the previous version of MAGIC ws ble to hndle only vi inlining. This shows tht our technique represents n dvnce for recursive s well s non-recursive concurrent progrms. One of the novel fetures of this work is tht it pplies the CEGAR scheme t two levels: (1) t the predicte-bstrction level to del with unbounded domin vribles nd (2) t the modelchecking level to solve rechbility queries in CPDSs: the CPDS model checker uses second CEGAR scheme in its semi-decision procedure for testing emptiness of the intersection of two contextfree lnguges. As fr s we know this is the first time tht CEGAR is used in the model-checker itself. Indeed it is usully used to compute successively more precise bstrctions of system. Relted Work. In [BET03 BET03b] the rechbility problem for CPDSs hs lso been reduced to computing over-pproximtions of context-free lnguges. However no CEGAR techniques were presented there. More precisely those works compute overpproximtions A 1 nd A 2 of two given context-free lnguges L 1 nd L 2 nd if A 1 A 2 = one concludes tht L 1 L 2 =. However with the pproch of [BET03 BET03b] no conclusion cn be mde utomticlly if A 1 A 2. In prticulr using [BET03 BET03b] one cn never conclude tht L 1 L 2. In contrst our CEGAR-bsed semi-decision procedure is gurnteed to terminte in this cse with the correct nswer. CEGAR-bsed predicte-bstrction techniques re used in severl C-progrms model-checking tools such s SLAM [BR01] BLAST [HJMS02] ZING [QRR04] nd KISS [QW04]. However s mentioned previously SLAM cnnot del with concurrency BLAST cnnot hndle recursion nd KISS cnnot discover errors tht pper fter number of interlevings between the prllel components greter thn three. ZING is n extension of SLAM to concurrent progrms. SLAM nd ZING re bsed on procedure summriztion; hence ZING might not terminte in cses where our technique will. Indeed in the concurrent cse one needs to keep trck of the clling stck which cn be unbounded in the presence of recursive clls. The contents of the stck re explicitely represented in ZING. In contrst in our frmework they re symboliclly represented with regulr lnguges becuse we use pushdown system modeling. On the other hnd SLAM nd ZING use predicte-bstrction techniques to extrct Boolen progrm from C progrm with recursion. Schwoon [Sch02] hs implemented in his pushdown-systems-nlysis tool MOPED trnsltion from Boolen progrms to pushdown systems. However MOPED cnnot hndle concurrent progrms. Our CPDS predicte-bstrctionrefinement techniques re done component-wise nd mount to performing successive sequentil PDS predicte-bstrctions nd refinements. One cn rgue tht these successive steps cn be done using SLAM nd then MOPED. However in this pper we propose predicte-bstrction techniques tht produce directly nd more efficently pushdown system from C source code of sequentil component without going through Boolen progrm. We give in Section 3.4 more detils bout the difference between our predicte-bstrction techniques nd the ones used in SLAM nd ZING. Reders who re lredy fmilir with those techniques nd who wish to skip our pproch to trnslting C code to PDSs should concentrte on Sections 2 4 nd 6 which focus on the concurrency-relted spects of our work. Finlly the new techniques presented in [KIG05 QR05] lso use multiple pushdown systems to model concurrent recursive progrms. However [KIG05] is restricted to progrms tht communicte vi finite number of locks nd ssumes certin nesting condition on the locks. As for [QR05] it uses shred-vribles for communiction between threds wheres we use synchronizing ctions (these two models cn simulte ech other). The technique presented in [QR05] sidesteps the undecidbility of rechbility of multiple pushdown systems by putting bound k on the number of interlevings between the different threds wheres we hndle this undecidble problem by computing bstrctions of context-free lnguges (without bounding the number of interlevings between the different threds). In certin cses our technique cn be more powerful thn the one presented in [QR05]. Indeed if the trget configurtions re rechble our technique is gurnteed to terminte with the correct nswer. The sme cn be sid of the technique of [QR05] if we pply it by incrementing utomticlly the bound k until the trget configurtions re found to be rechble. However in certin circumstnces (when we find A 1 A 2 = ) we cn infer tht the trget configurtions re not rechble wheres the technique of [QR05] cn never estblish such property. Finlly the technique of [QR05] hs not been implemented nd no utomtic techniques to trnslte C code to pushdown systems re provided there. In contrst our method hs been implemented nd pplied to severl non-trivil exmples. This effort is reported in Section 6. The reminder of the pper is orgnized s follows: In Section 2 we define the CPDS model. Section 3 describes the wy we generte CPDS from C progrm using predicte bstrction. In Section 4 we give our semi-decision procedure for model-checking CPDS. Section 5 presents our predicte-bstrction refinement techniques. Section 6 reports our experimentl results. 2. Preliminry definitions A pushdown system (PDS) is four-tuple P = (Q Act Γ ) where P is finite set of sttes Act is finite set of ctions Γ is finite stck lphbet nd is finite set of trnsition rules of the form p γ p w where p p P Act γ Γ nd w Γ. We ssume without loss of generlity tht ll the rules of re such tht w 2. This is not restrictive becuse ny PDS cn be trnsformed into PDS of this form [Sch02]. Moreover s we will see in the next subsection the trnsition rules obtined from progrms re lwys of this form. A configurtion of P is pir p w where p P is stte nd w Γ is the content of the stck. A set C of configurtions is regulr if for every p P the lnguge {w Γ p w C} is regulr. For every Act we define trnsition reltion between the configurtions of P s follows: q γ q w then q γv q wv for every v Γ /7/19

3 For 1 n Act the reltion 1 n is defined in the obvious wy. Let C be set of configurtions. P ost (C) is the set of successors of C defined s follows: P ost (C) = {c c C 1 n Act c 1 n c } A communicting pushdown system (CPDS) [BET03b] is tuple CP = (P 1... P n) of pushdown systems over the sme set of ctions Act such tht Act = Lb {} where Lb is the set of synchroniztion ctions nd represents internl ctions. is such tht for every Lb = =. As we will see lter we need this to reduce the rechbility problem for CPDSs to checking the emptiness of the intersection of two context-free lnguges. A globl configurtion of CP is tuple g = (c 1... c n) of configurtions of P 1... P n. The reltion is extended to globl configurtions s follows: (c 1... c n) (c 1... c n) if there is n index 1 i n such tht c i c i nd c j = c j for every j i; (c 1... c n) (c 1... c n) if there re two distinct indices i j such tht c i c i c j c j nd c k = c k for every i k j. Given set G of globl configurtions we define the successors of G P ost (G) s before. 3. Component-wise Predicte Abstrction We model concurrent recursive progrms using CPDSs. In this section we show how to use predicte bstrction to extrct CPDS from prllel progrm. Suppose tht we re given n concurrent recursive C components. We extrct PDS from ech recursive component. The prllel composition of these components is then represented by the CPDS corresponding to the tuple of these PDSs. In wht follows we show how to extrct PDS from sequentil component using predicte bstrction. To do this we extend the pproch originlly used in MAGIC [CCG + 03] which utomticlly extrcts finitestte utomton from C code to extrct PDS. Without loss of generlity we ssume tht there re only six kinds of sttements in progrms: ssignments procedure clls if-then-else brnches gotos synchroniztion sttements nd returns. In MAGIC we use the CIL tool [NMW + 01] to trnsform rbitrry C progrms into the bove formt. Ech PDS is defined in terms of current set of seed predictes. Initilly the set of seed predictes is empty. The predicte set is ugmented using our refinement techniques (see Section 5). Ech predicte represents set of ssignments of the vribles of the progrm. Let p be predicte over the sets of vribles X nd Y where X (resp. Y ) is set of locl (resp. globl) vribles. Then p loc (resp. p glob ) is the projection of p over the locl vribles X (resp. globl vribles Y ). For exmple let p = (x > 0 & y < 8) be predicte tht represents the set of vlues {x > 0 y < 8}. If x is locl vrible nd y is globl one; p loc denotes the predicte (x > 0); nd p glob the predicte (y < 8). We extend these nottions to sets of predictes in the obvious mnner. We first describe how given set of seed predictes we generte lrger set of predictes useful to compute n bstrction of the progrm (this process is clled predicte inference) nd then describe how to use this new set of predictes to obtin PDS from sequentil C component. As explined bove the CPDS tht corresponds to prllel progrm is the tuple of ll the PDSs of its different sequentil components. 3.1 Predicte inference The wekest precondition of set of predictes p is defined s follows. Let s be n ssignment of the form v = e. Then the wekest precondition of p with respect to s (denoted by W s(p)) is obtined from p by replcing every occurrence of v in p by e. Assignments through pointers i.e. sttements of the form p = e re hndled by the pproch of Morris [Mor82]. Let C be set of seed predictes. In MAGIC we require tht the seed set C is lwys subset of the conditions in the progrm s if sttements 1. To crete PDS tht is n bstrction of sequentil component reltive to the predictes in seed set C we repetedly compute wekest preconditions. Tht is for every control point n we compute set of predictes P[C] n s follows: Initilly P[C] n = for every point n. We repet the following until for every n P[C] n is no longer modified. Let s n be the sttement tht corresponds to control point n: 1. if s n is n ssignment tht hs n s successor then dd W sn`p[c]n to P[C]n. 2. if s n is n if sttement nd n is its then or else successor then dd P[C] n to P[C] n. Moreover if c is the corresponding condition of s n such tht c C then dd c to P[C] n. 3. if s n is goto or synchronistion sttement tht hs n s successor then dd P[C] n to P[C] n. 4. if s n is cll to procedure π where s n hs n s successor nd if e π is the initil control point of procedure π then dd P[C] loc n nd P[C]glob e π to P[C] n. Note tht this procedure might not terminte in the presence of loops nd recursive procedure clls. In this cse we impose termintion by bounding the number of predictes in P[C] n for every control point n. Let us explin the intuition behind the items bove. P[C] n is ment to be the set of predictes needed to chrcterize the vlues of the vribles when point n is ctive (with respect to the predictes in C). Let s n be n ssignment tht hs n s successor. The first item dds W sn`p[c]n to P[C]n. This is becuse if ϕ is true t n then W sn (ϕ) is true t n. Thus if we know tht ϕ holds t n then to void loss of precision we need to know tht W sn (ϕ) holds t n. Now consider the fourth item (the others re esy to understnd). Let π be the procedure tht contins control point n. Becuse procedure π is clled t n the globl vribles hve the sme in P[C] n. Moreover when the procedure π termintes nd control goes bck to point n in procedure π the vlues of the locl vribles of the procedure π in n re the sme s those t point n (since these vlues did not chnge during the cll to π). This is why vlues t n nd e π. This motivtes the inclusion of P[C] glob e π we dd P[C] loc n to P[C]n. Note tht in our procedure we reson in bckwrd mnner to compute the P[C] n s. An equivlent pproch would hve been to use forwrd resoning. In this cse we would need to compute strongest postconditions insted of wekest preconditions. Finlly let P[C] = P[C] n where the union is tken over ll the control points n of the sequentil component be the set of ll the generted predictes. 3.2 Predicte vlution Recll tht our gol is to compute PDS bstrction of sequentil component. As described in the next section the sttes of this PDS correspond to the different vlutions of the globl predictes nd symbol of its stck will be pir tht consists of control point 1 A query q t given point p cn be emulted by introducing n if sttement t p whose brnch condition is q /7/19

4 n nd vlution of the locl predictes t point n. We ssocite with ech loction n two sets of formuls V[C] glob n nd V[C] loc n respectively clled globl nd locl vlutions s follows: For x in {glob loc} V[C] x n is the set of formuls {(p x 1 = v 1) (p x k x = v kx ) P[C] x n = {p x 1... p x k x } v i {trueflse} i = 1... k x}. Moreover if P[C] x n = then V[C] x n = {empty}. Let V be vlution of the form (p 1 = v 1) (p k = v k ). We denote by Γ(V ) its corresponding predicte p 1 p k where p i = p i if v i = true nd p i = p i if v i = flse. Moreover we let Γ(empty) = {true}. 3.3 Creting PDS tht corresponds to sequentil component We re now redy to describe how to crete PDS tht corresponds to sequentil component. Let C be given set of seed predictes. We ssign to sequentil (possibly recursive) component the PDS P = (Q Act Γ ) defined s follows. Q is the set of vlutions where the union is tken over ll the control points n of the sequentil component. Act contins the ction s well s the other synchroniztion ctions of the progrm. Γ is the set of ll pirs (n v) where n is control point of the sequentil component nd v is tht correspond to the globl vribles i.e. Q = V[C] glob n vlution in V[C] loc n tht corresponds to set of vlutions of the locl vribles t loction n. To define the rules of we need one more notion. Consider goto sttement from point to. Intuitively we would like to represent this sttement with rules of the form glob ( loc) glob ( loc ) where glob V[C] glob glob V[C] glob loc V[C] loc loc V[C] loc nd the formuls `Γ(glob) Γ(glob ) nd `Γ(loc) Γ(loc ) re stisfible. This mens tht if the progrm is t point nd its vribles stisfy the globl nd locl vlutions glob nd loc then fter performing the goto sttement it goes to point nd its vribles cn stisfy ll the vlutions glob V[C] glob nd loc V[C] loc such tht `Γ(glob) Γ(glob ) nd `Γ(loc) Γ(loc ) re stisfible. This condition ensures tht the PDS we re creting hs more behviors thn the concrete progrm. However determining whether (p 1 p 2) is stisfible is in generl undecidble when p 1 nd p 2 re first-order formuls over the integers. To sidestep this problem we use sound vlidity checker [Nel80] tht lwys termintes nd nswers TRUE FALSE or UN- KOWN to the question whether given formul (p 1 p 2) is vlid. We use A(p 1 p 2) to denote tht the nswer provided by the vlidity checker to the question Is (p 1 p 2) vlid? is FALSE or UNKOWN. Then to ensure tht the PDS we re creting is sfe bstrction we dd the PDS-trnsition bove if A(p 1 p 2) holds. We re now redy to define the set of rules s follows: Let s be sttement nd be its corresponding control point: If s is goto sttement it is represented by rules of the form: glob ( loc) glob ( loc ) where is the unique successor of glob V[C] glob glob V[C] glob loc V[C] loc loc V[C] loc A`Γ(glob) Γ(glob ) nd A`Γ(loc) Γ(loc ). If s is synchronizing sttement lbeled with ction it is represented by rules of the form: glob ( loc) glob ( loc ) where is the unique successor of glob V[C] glob glob V[C] glob loc V[C] loc loc V[C] loc A`Γ(glob) Γ(glob ) nd A`Γ(loc) Γ(loc ). If s is n ssignment then it is trnslted into set of rules of the form glob ( loc) glob ( loc ). where is the unique successor of glob V[C] glob glob V[C] glob loc V[C] loc loc V[C] loc A W s`γ(glob ) Γ(glob) nd A W s`γ(loc ) Γ(loc). In other words glob nd glob (loc nd loc ) re vlutions tht correspond to the vlues of the globl (locl) vribles before nd fter the ssignment. For exmple if we hve P[C] n1 = {(y = 7) (x > 2)} nd P[C] n2 = {(y = 7) (x > 1)} where y is globl vrible nd x is locl one; if s is the ssignment x := x + 3; then we hve the following rule where T stnds for true: `(y = 7) = T n `(x 1 > 2) = T `(y = 7) = T n `(x 2 > 1) = T. If s is n if sttement it is represented by rules of the form: glob ( loc) glob ( loc ). where is the control point of the corresponding then (resp. else) sttement if glob nd loc stisfy the if condition (resp. do not stisfy the if condition); nd where glob V[C] glob glob V[C] glob loc V[C] loc loc V[C] loc A`Γ(glob) Γ(glob ) nd A`Γ(loc) Γ(loc ). If s is cll to procedure π then it is represented by rules of the form: glob ( loc) glob (e π loc ) ( loc ) where is the unique successor of e π is the initil control point of the procedure π glob V[C] glob loc V[C] loc glob V[C] glob e π loc V[C] loc e π loc V[C] loc A`Γ(glob) Γ(glob ) nd A`Γ(loc) Γ(loc ). We need to hve A`Γ(loc) Γ(loc ) becuse the role of loc is to sve the vlues of the locl vribles of the cller procedure. Finlly return sttement is trnslted into rules of the following form where glob V[C] glob nd loc V[C] loc : glob ( loc) glob ε REMARK 3.1. Note tht the predicte bstrction techniques described bove re sound only for progrms in which there re no ssignments through pointers tht cn hold ddresses of locl vribles of cllers. It would not be difficult to extend these techniques with n interprocedurl modifiction-nlysis lgorithm [CK88] to detect nd ccount for such cses. NOTE 3.1. Observe tht ll the internl ctions re represented by. This is needed to reduce the rechbility problem for CPDSs to computing bstrctions of pth lnguges for pushdown systems s will be discussed in Section Comprision with the predicte-bstrction technique of SLAM As mentioned in Sectio the SLAM tool uses predictebstrction techniques to extrct Boolen progrm from C source code. Then one cn use Schwoon s trnsltion [Sch02] to obtin /7/19

5 PDS from Boolen progrm. Compred with the techniques used in SLAM the techniques described in Section 3.3 exhibit two min differences: 1. Our trnsltion is more efficient becuse it produces directly in one step PDS from C code without going through n intermedite Boolen progrm. 2. Techniclly the pproch described in Section 3.3 is different from SLAM s pproch. In our method we close given set of seed predictes C by computing wekest preconditions long the different possible pths of the progrm nd thus obtin lrger set of predictes tht we use to compute the bstrct model. In contrst SLAM uses the seed set of predictes C s is without computing its closure by wekest precondition. Insted it computes lrgest disjunctions of predictes in C tht imply the wekest preconditions. Consequently the bstrct model we obtin is more precise thn SLAM s becuse it uses more predictes. 3.5 Exmple Consider the following two sequentil components D 1 nd D 2 running in prllel where is synchroniztion ction: D 1: min() { n 0: int x=10; : proc(); : return;} void proc(){ n 3: if (x < 10) n 4: {;} n 5: else {proc();} n 6: return;} D 2: min(){ m 0: ; m 1: return;} Cse #1: The set of seed predictes C is empty: Let us model first the component D 1 by PDS P 1. There re no locl vribles so the stck lphbet is the set of the control points. Moreover becuse the set of seed predictes C is empty let p be the unique stte of P 1 (p corresponds to the vlution empty). P 1 contins the following rules: r 1 : p n 0 p ; r 2 : p p n 3 ; r 3 : p p ɛ ; r 4 : p n 3 p n 4 ; r 5 : p n 3 p n 5 ; r 6 : p n 4 p n 6 ; r 7 : p n 5 p n 3n 6 ; r 8 : p n 6 p ɛ. Similrly we represent the second component by PDS P 2 tht hs unique stte q nd the following rules: r 1 : q m 0 q m 1 ; nd r 2 : q m 1 q ɛ. Cse #2: We hve C = {(x < 10)}: We model the component D 1 by the following PDS P 1. We hve: P n1 = P n3 = P n5 = {x < 10} nd P n = for the other points (while computing P n0 we find the predicte 10 < 10. Becuse we ignore predictes tht re trivilly true or flse we keep P n0 = ). The sttes of P 1 re: p 1 : (x < 10) = flse p 2 : (x < 10) = true nd p 3 : empty. P 1 contins the following rules: p 3 n 0 p 1 ; p 1 p 1 n 3 ; p 3 p 3 ɛ ; p 2 n 3 p 3 n 4 ; p 1 n 3 p 1 n 5 ; p 3 n 4 p 3 n 6 ; p 1 n 5 p 1 n 3n 6 ; p 3 n 6 p 3 ɛ. 4. Rechbility Anlysis of CPDSs Suppose tht the progrm consists of n sequentil components. In MAGIC we usully sk the following query: Suppose tht the system strts from configurtion where ech component i is t its initil control point n i 0 for i = 1... n; cn one component rech n error point? We show in this section how to tckle the rechbility nlysis of these systems. In the reminder of this pper we restrict ourselves to systems tht consist of two prllel sequentil components. The technique cn be extended in strightforwrd mnner to the generl cse (see [BET03b] for more detils); the implementtion reported in Section 6 supports n rbitrry number of components. We reduce the rechbility problem for CPDSs to deciding the emptiness question for the intersection of two context-free lnguges s follows: Let (P 1 P 2) be CPDS nd let C 1 C 2 nd C 1 C 2 be two sets of globl configurtions of the system. Becuse ll the internl ctions re represented by (which is neutrl element for conctention) C 1 C 2 is rechble from C 1 C 2 if nd only if there exists t lest one sequence of synchroniztion ctions tht simultneously leds P 1 from configurtion in C 1 to configurtion in C 1 nd P 2 from configurtion in C 2 to configurtion in C 2. This holds iff L(C 1 C 1) L(C 2 C 2) where L(C i C i) is the context-free lnguge consisting of ll the sequences of ctions (or equivlently of synchroniztion ctions becuse the internl ctions re represented by ) tht led P i from C i to C i. Becuse deciding the emptiness of two context-free lnguges is undecidble we propose semi-decision procedure tht in cse of termintion nswers exctly whether the intersection is empty or not. Moreover if L(C 1 C 1) L(C 2 C 2) the semi-decision procedure is gurnteed to terminte nd return sequence in the intersection. The semi-decision procedure is bsed on CounterExmple Guided Abstrction Refinement (CEGAR) scheme s follows: 1. Abstrction: We compute n over-pproximtion A i of the pth lnguge L(C i C i). 2. Verifiction: We check if A 1 A 2 = nd if so we conclude tht L(C 1 C 1) L(C 2 C 2) = i.e. tht C 1 C 2 is unrechble from C 1 C 2. Otherwise we compute the counterexmple I = A 1 A Counterexmple Vlidtion: We check whether I contins sequence x tht is in L(C 1 C 1) L(C 2 C 2). In this cse I is not spurious nd we conclude tht L(C 1 C 1) L(C 2 C 2) i.e. tht C 1 C 2 is rechble from C 1 C 2. Otherwise we proceed to the next step. 4. Refinement: If I is spurious we refine the over-pproximtions A 1 nd A 2 i.e. we compute other over-pproximtions A 1 nd A 2 such tht L(C i C i) A i A i. We then continue from step 2. In the reminder of this section we discuss these steps in detil. We fix two sets of globl configurtions C 1 C 2 nd C 1 C 2. For the ske of simplicity we denote L(C 1 C 1) by L 1 nd L(C 2 C 2) by L Computing over-pproximtions of pth lnguges To compute over-pproximtions of pushdown-system pth lnguges our technique is bsed on the pproch presented in [BET03b]. We summrize this pproch in wht follows. Consider n bstrct lttice (D ) ssocited with n idempotent semiring (D 0 1) such tht = is n ssocitive commuttive nd idempotent ( = ) opertion; is n ssocitive opertion; 0 = ; 0 nd 1 re neutrl elements for /7/19

6 nd respectively; 0 is n nnihiltor for ( 0 = 0 = 0); nd distributes over. Finlly is such tht x x. D is relted to the concrete domi Lb s follows: It contins n element v for every letter Lb It is ssocited with n bstrction function α : 2 Lb D nd concretiztion function γ : D 2 Lb defined s follows: α(l) = M v 1 v n 1 n L nd γ(x) = { 1 n Lb v 1 v n x} It is esy to see tht for every lnguge L Lb ; α(l) D nd γ`α(l) L. In other words γ`α(l) is n overpproximtion of L tht is finitely represented in the bstrct domin D by the element α(l). Intuitively the bstrct opertions nd correspond to conctention nd union respectively; nd correspond to inclusion nd intersection respectively; nd the bstrct elements 0 nd 1 correspond to the empty lnguge nd {ɛ} respectively. Therefore to compute the over-pproximtions γ`α(l i) we need to compute its representtive α(l i) in the bstrct domin D. Let finite-chin bstrction be n bstrction such tht D does not contin n infinite scending chin nd let h be the mximl height of chin in D. Then we hve: THEOREM 4.1. [BET03b RSJ03] Let P = (Q Act Γ ) be PDS nd C C be two regulr sets of configurtions of P nd let α be finite-chin bstrction defined on the bstrct domin D. Then α`l(c C ) cn be effectively computed in D in O(h Q 2 ) time. There re two different lgorithms tht provide the bsis of this theorem one described in [BET03 BET03b] nd one described in [RSJ03 RSJM]. The ltter hs been implemented in tool clled WPDS++ [KRML]. We use this tool to compute bstrctions of pth lnguges. To check the emptiness of the intersection of the overpproximtions γ`α(l 1) nd γ`α(l 2) it suffices to check whether α(l 1) α(l 2) =. Indeed using the fct tht α( ) = nd γ( ) = we cn show tht L 1 L 2 Lb α(l 1) α(l 2) = γ`α(l 1) γ`α(l 2) = 4.2 Defining refinble finite-chin bstrctions To be ble to pply our CEGAR scheme we need to define refinble finite-chin bstrctions i.e. series (α i) i 1 such tht α i is more precise thn α j if i > j; i.e. for every lnguge L Lb if i > j then L γ i`αi(l) γ j`αj(l) For this we define the i th -prefix bstrction s follows: Let W i be the set of words of Lb of length less thn or equl to i. The bstrct lttice D i is equl to 2 W i ; for every Lb v = ; = ; = ; U V = {(uv) i u U v V } where (w) i is the prefix of w of length i; 0 = ; 1 = {ɛ}; =. Let α i nd γ i be the bstrction nd the concretiztion functions ssocited with this domin. It is esy to see tht α i(l) is the set of words of L of length less thn i union the set of prefixes of length i of L i.e. α i(l) = {w w < i nd w L or w = i nd v Lb s.t. wv L}. Therefore γ i`αi(l) = {w α i(l) w < i} {wv w α i(l) w = i v Lb }. Observe tht it is possible to decide whether α i(l 1) α i(l 2) = becuse for every L Lb α i(l) is finite set of words. It is esy to see tht if i > j then α i is more precise thn α j. Indeed we hve L γ i`αi(l) γ j`αj(l). We hve thus defined series of refinble finite-chin bstrctions α 1 α 2 α REMARK 4.1. The i th -prefix bstrction is only one bstrction tht cn be used to instntite the frmework. Others re possible such s the i th -suffix or the i th -subword bstrctions (defined in n nlogous wy). 4.3 Checking whether the counterexmple is spurious It remins to check whether I = γ i`αi`l1) γ i`αi(l 2) contins n element x such tht x L 1 L 2. This mounts to deciding whether I L 1 L 2 =. Unfortuntely this problem is undecidble becuse I is regulr lnguge (becuse for L Lb γ i`αi(l) is regulr). To sidestep this problem we check insted whether L 1 nd L 2 hve common word of length t most i. This mounts to checking whether `αi(l 1) L 1 `αi(l 2) L 2 = This is decidble becuse α i(l) is finite set. 4.4 The semi-decision procedure Summrizing the previous discussion we obtin the following semi-decision procedure: 1. Initilly i = 1; 2. Compute the common words of length less thn i nd the common prefixes of length i of L(C 1 C 1) nd L(C 2 C 2): I = α i`l(c1 C 1) α i`l(c2 C 2). 3. If I = conclude tht L(C 1 C 1) L(C 2 C 2) = nd tht C 1 C 2 is unrechble from C 1 C 2. Otherwise determine whether or not I is spurious: Check whether I L(C 1 C 1) L(C 2 C 2). If this holds conclude tht L(C 1 C 1) nd L(C 2 C 2) hve common word of length less thn or equl to i nd therefore tht L(C 1 C 1) L(C 2 C 2) nd C 1 C 2 is rechble from C 1 C Otherwise increment i nd proceed from step 2. It is esy to see tht: THEOREM 4.2. If L(C 1 C 1) L(C 2 C 2) then the bove semi-decision procedure termintes with the exct solution. Proof: Let x L(C 1 C 1) L(C 2 C 2) nd let k be the length of x. Then x α k`l(c1 C 1) α k`l(c2 C 2). REMARK 4.2. It follows from Theorem 4.1 tht t ech step i computing α i(l) necessittes O(2 Lb i Q 2 ) time since there re t most Lb i words of length i nd therefore t most 2 Lb i elements in D i. This is the worst cse complexity of our lgorithm. However in prctice our tool behves well s described in Section /7/19

7 4.5 Exmple Let P 1 be the PDS hving the following rules: r 1 : p n 0 p ; r 2 : p p n 0 ; r 3 : b b p p ɛ ; r 4 : p n 0 p ɛ. And let P 2 be the PDS hving the following rules: r 1 : q m 0 q m 1 ; r 2 b : q m 1 q m 2 ; r 3 : q m 2 q m 0m 3 ; r 4 b : q m 3 q ɛ ; nd r 5 : d q m 0 q ɛ. It is esy to see tht in P 1 L 1 = L` p n 0 p ɛ = { k bb k k 0}; nd tht in P 2 L 2 = L` q m 0 q ɛ = {(b) k db k k 0} nd therefore tht L 1 L 2 =. We use this strightforwrd exmple to illustrte our pproch: α 1(L 1) α 1(L 2) = {} ; / L 1 therefore we refine the bstrction nd go to α 2; α 2(L 1) α 2(L 2) = {b} ; b / L 2 therefore we refine the bstrction nd go to α 3; α 3(L 1) α 3(L 2) =. Therefore we infer tht L 1 L 2 =. 5. Component-wise Refinement The construction of the CPDS model from the C progrm involves predicte bstrction. It is prmetrized by set of predictes. The min issue in predicte bstrction is to find smll set of predictes tht llows to prove property of interest. In our cse the property in question is whether the system cn rech n error from the initil configurtion where component i (where e.g. i = 1 2) is in glob i 0 (n i 0 loc i 0) such tht n i 0 is the initil control point of the component i nd glob i 0 loc i 0 re initil vlutions of the globl nd locl vribles respectively. Similrly n error is configurtion where t lest one component i is in configurtion of the form glob (n i e loc) where n i e correponds to n error point nd glob nd loc re rbitrry vlutions of the vribles. MAGIC finds this miniml set of predictes by pplying CEGAR pproch s follows: We strt with model involving n empty set of seed predictes nd perform the model-checking step described in Section 4. If the model checker nswers tht the error stte is unrechble in the CPDS model we re sure tht this is lso the cse for the concrete progrm becuse the progrm hs fewer behviors thn the model. Otherwise if the model checker finds tht the CPDS cn rech n error stte by performing sequence of synchroniztion ctions 1 n ( 1 n I L(C 1 C 1) L(C 2 C 2)) we need to verify whether this behvior corresponds to ny rel executions of the progrm (in which cse we hve shown tht the progrm is not correct) or whether the erroneous-looking behvior hs been introduced by bstrction. If this is the cse we need to refine the CPDS model. More precisely the model checker returns two sequences of rules r rm 1 1 nd r rm 2 2 such tht the CPDS (P 1 P 2) reches the error stte if P i performs the sequence r1 i... rm i i (in this cse 1 n is the sequence of synchroniztion ctions corresponding to these sequences of rules). We sy tht the sequence r1 i... rm i i is counterexmple for component i. To check whether this counterexmple is spurious we need to check whether component i cn perform the sequence of sttements tht correspond to the sequence of rules r1 i... rm i i. If either component fils to perform its corresponding sequence we refine its corresponding PDS to eliminte the spurious sequence of rules. Observe tht ll these steps re done component-wise which mkes the technique compositionl nd sclble to lrge progrms. In this section we first show how to check whether sequence of rules returned by the model checker is spurious. We show then how to dd new seed predictes to crete more precise CPDS model tht elimintes spurious trce. 5.1 Counterexmple vlidtion We present in this subsection n lgorithm tht tkes s input counterexmple given by sequence of rules r 1... r n of PDS tht models sequentil component nd nswers whether it is spurious. Let s 1... s n be the sequence of sttements tht correspond to r 1... r n. Intuitively the lgorithm simultes the different steps to determine whether the concrete component could possibly perform them. The lgorithm strts from the initil point n 0 nd the vlutions glob 0 nd loc 0 of the vribles. Then it pplies successively the different sttements s i i = 1... n updtes the vlues of the vribles nd checks whether the if-thenelse conditions re stisfied in this sequence of instructions. More precisely the lgorithm works s follows: Initilly ϕ = glob 0 loc 0 For i = 1 to n do if s i is n ssignment compute the strongest postcondition of ϕ with respect to s i. For exmple if s i is the ssignment x := x + 5 nd ϕ is the vlution (1 < x < 4) = true; the updted vlution ϕ is (6 < x < 9) = true. if s i is n if sttement with condition c then if s i+1 corresponds to its then successor ϕ := ϕ c. Otherwise if s i+1 corresponds to its else successor ϕ := ϕ c. If ϕ is stisfible then the progrm cn execute the sequence of sttements nd the counterexmple is vlid; otherwise the counterexmple is spurious. 5.2 Eliminting the counterexmple If the counterexmple is spurious for component i we need to refine the PDS model P i corresponding to this component by dding new seed predictes. The predictes tht we dd re subsets of the set of conditions of the if-then-else brnches of the progrm. Intuitively it works s follows: In most cses the counterexmple is spurious becuse in the bstrct model we hve not modeled n if condition with sufficient precision nd we hve llowed both of its brnches to be followed (t some moment during n bstrct execution) wheres in ny concrete execution run only one brnch cn be followed; the counterexmple corresponds to trce tht tkes the wrong brnch. So to eliminte this trce we need to dd the condition c of this if sttement s seed predicte. More precisely let X = {c 1... c k } be the set of conditions of the if sttements of the progrm nd let C be the current set of seed predictes i.e. such tht P i is computed s described in Section 3 using the set of predictes P[C]. We proceed s follows: 1. i := 1 2. if c i C then increment i nd go to step 2 3. C := C {c i} 4. Crete the PDS P i tht corresponds to the predictes P[C ] s described in Section 3.3. If the new model elimintes the counterexmple then let the new seed set be C := C. Otherwise increment i nd go to step 2. If none of the predictes c 1... c k succeeds in eliminting the counterexmple we try to dd two predictes t ech step. If we try ll the possibilities nd the counterexmple is still not eliminted we try to dd three predictes t ech step etc. 5.3 Exmple Let us consider the prllel progrm given in Section 3.5. Consider this query: Cn D 2 rech the point m 1 if the system strts /7/19

8 from (n 0 m 0)? Obviously this is not the cse becuse the second component cn go to m 1 only if it synchronizes with D 1 using the ction wheres the first component cn never perform becuse t n 3 we do not hve x < 10. If we model the concurrent progrm using no seed predictes i.e. if we consider the model (P 1 P 2) described in Section 3.5 the model checker nswers tht (n 6 m 1) is rechble with the following sequences: r 1r 2r 4r 6 for P 1 nd r 1 for P 2. Using our method we cn check tht r 1r 2r 4r 6 is spurious becuse ϕ = (x = 10) (x < 10) is not stisfible. Therefore we refine PDS P 1. If we consider C = (x < 10) we obtin the PDS P 1 described in Section 3.5. Then it is esy to see tht in the CPDS (P 1 P 2) P 2 cnnot rech m Experimentl Results We implemented the method described in the pper in ComFoRT [CISW05] model checker built on top of MAGIC [CCG + 03] nd experimented with set of non-trivil benchmrks. Our implementtion supports two kinds of bstrctions described in Section 4.2: the i th -prefix nd the i th -suffix bstrctions. 6.1 Appliction to concurrent recursive progrms: Windows NT Bluetooth driver We pplied our technique to nontrivil recursive concurrent progrm tht could not be hndled with the originl (non-recursive) version of MAGIC: Windows NT Bluetooth driver. Our tool found bug in this progrm (tht ws reported in [QW04]). The bug could be detected with the i th -prefix s well s the i th -suffix bstrctions. Our experiments were performed on Linux SMP P Ghz mchine with 2 GB memory. The results re summrized in Figure 1. Abstrction Execution time(seconds) Memory used (MB) i th -prefix i th -suffix Figure 1. Results for the Bluetooth driver Note tht the suffix bstrction is more efficient in this cse. This is due to the fct tht in this exmple there re less possible bckwrd pths from the erroneous configurtions thn forwrd pths from the initil configurtions. We describe in wht follows the progrm (the source code cn be found in [QW04]) its corresponding CPDS model nd we show how to pply our technique to find the error. The driver consists of certin number of processes running in prllel: process STOP-D process COUNTER process STOPPING-FLAG process STOPPING-EVENT nd n rbitrry number of processes REQUEST (one per ech request for the driver). The role of the process COUNTER is to count the number of requests tht the driver receives. This number is set to 1 initilly is incremented when the driver receives new request nd is decremented when request exits the driver. The process STOP-D my issue request to stop the driver t ny time. It then hs to wit until ll the other requests hve finished their work before stopping the driver. The process STOPPING-FLAG hs two control points: F- S-F (FALSE-STOP-FLAG) nd T-S-F (TRUE-STOP-FLAG) depending on whether the process STOP-D is trying to stop the driver or not. It is initilly in stte F-S-F nd moves to stte T-S-F if it receives messge from STOP-D. No new thred cn enter the driver if this process is in T-S-F. The process STOPPING-EVENT lso hs two control points: F-S-E (FALSE-STOP-EVENT) nd T-S-E (TRUE-STOP-EVENT). It enters stte T-S-E if the driver stops i.e. when the number of running REQUESTs reches 0. Finlly when new REQUEST enters the driver it hs to increment the number stored in COUNTER perform the work sked by the request nd then decrement the number stored in COUNTER before exiting the driver. This is done by two functions: Increment nd Decrement. Ech of these processes cn be modeled by PDS s described below (ll the techniques described here were utomticlly performed by our tool). The process COUNTER: It hs no globl vribles so let p 0 be its unique stte. The number of threds is represented in stck. The stck lphbet is {0 1}. Initilly the stck contins the word 10 mening tht the number of requests is zero. It cn then contin ny word i 0. The number of 1 s in the stck corresponds to the number of running requests minus 1. The increment nd decrement opertions re invoked by incr nd decr messges from the REQUEST processes. COUNTER is represented by the following PDS rules: p 0 1 p incr 0 11 nd p 0 0 p incr These rules increment the counter. p 0 1 p decr 0 ɛ. This rule decrements the counter. p 0 1 p not zero 0 1 nd p 0 0 p is zero 0 0. These rules test whether the counter is 0. The process STOPPING-FLAG: let p 1 be its unique stte. It hs no globl vribles so p 1 F-S-F stop p 1 T-S-F : The process receives stop request from STOP-D. p 1 T-S-F p stop 1 T-S-F : The process communictes with REQUEST process vi stop messge. p 1 F-S-F p non stop 1 F-S-F : It sends non-stop request to the incoming REQUESTs. The process STOPPING-EVENT: As with the two previous processes this process hs lso no globl vribles so let p 2 be its unique stte. p 2 F-S-E p stop driver 2 T-S-E nd p 2 T-S-E p is stopped 2 T-S-E : The process uses the messges is-stopped nd stop-driver to indicte tht the driver is stopped. p 2 F-S-E non stopped p 2 F-S-E : It sends nonstopped messge to indicte tht the driver is still running. The process STOP-D: Agin this process hs no globl vribles so let p 3 be its unique stte. p 3 n 0 stop p 3 e Decrement : STOP-D sends stop request to STOPPING-FLAG nd clls Decrement. p 3 is stopped p 3 RELEASE. If the driver is stopped the llocted resources re relesed. This process hs copy of the function Decrement tht will be described below. The process REQUEST: This process hs globl vrible g tht cn be 0 1 or -1. It is set initilly to 1. Let g 0 g 1 nd g 1 be the globl sttes of the PDS tht correspond to the cses where g is equl to 0 1 nd -1 respectively. The process REQUEST does the following: 1. It strts by clling function Increment. This function will set g to -1 if the STOPPING-FLAG is set to TRUE otherwise it will increment the counter nd set g to /7/19

9 2. If Increment returns 0 REQUEST performs the work it hs to do nd then sserts tht STOPPING-EVENT is in stte F-S-E (i.e. tht the driver is still running). 3. Afterwrds it clls function Decrement tht decrements the counter. If this counter hs reched 0 it sends messge to inform STOPPING-EVENT tht the driver is stopped becuse there re no more requests running. The process REQUEST cn be modeled by the following PDS rules where x {1 0 1}: g x e g x e Inc n. First Increment is clled; g 0 n g 0 n W ork. If Increment returns 0 REQUEST performs some work. g 0 n W ork g 0 n End W ork. The work ends. g 0 n End W ork non stopped g 0 e Decrement. After the work is finished we hve to mke sure tht the driver is still running i.e. tht STOPPING-EVENT is in F-S-E. g 0 n End W ork is stopped g 0 ABORT. If this is not the cse we hve reched n error nd the progrm ABORTs. g x n g x e Decrement. After Decrement is clled. The function Increment is represented s follows: g x e Inc g stop 1 ɛ. If STOPPING-FLAG is in T-S-F the function returns -1; g x e Inc g non stop x n. Otherwise it increments the counter nd returns: g x n g incr 0 ɛ The function Decrement is represented s follows where g {g x p 3} (this function is shred by REQUEST nd STOP-D): g e Decrement dec g n. The counter is decremented. g n g not zero ɛ. If it hs not reched 0 the function termintes; g n g is zero n. Otherwise it communictes with STOPPING-EVENT using messge stop-driver: g n g stop driver ɛ The erroneous trce: The error rises even if we hve only one running request i.e. if we hve the processes STOP-D COUNTER STOPPING-FLAG STOPPING-EVENT nd n instnce of REQUEST running in prllel. We show tht the progrm cn rech the bd point ABORT. A configurtion will be represented by 5-tuple ( ) where nd 5 represent the configurtions of the processes STOP-D COUNTER STOPPING-FLAG STOPPING-EVENT nd RE- QUEST respectively. The initil configurtion is p 0 10 p 1 F-S-F p 2 F-S-E p 3 n 0 g 1 e With ction this configurtion cn move to: p 0 10 p 1 F-S-F p 2 F-S-E p 3 n 0 g 1 e Inc n nd then by exchnging non-stop messge between REQUEST nd STOPPING-FLAG to: p 0 10 p 1 F-S-F p 2 F-S-E p 3 n 0 g 1 n n Now STOP-D cn send stop request to STOPPING-FLAG: p 0 10 p 1 T-S-F p 2 F-S-E p 3 e Decrement g 1 n n The counter is decremented: p 0 0 p 1 T-S-F p 2 F-S-E p 3 n g 1 n n The counter is tested s to whether it is 0 by exchnging the messge is-zero: p 0 0 p 1 T-S-F p 2 F-S-E p 3 n g 1 n n Therefore Decrements confirms tht the driver is stopped by sending the messge stop-driver: p 0 0 p 1 T-S-F p 2 T-S-E p 3 g 1 n n Now the resources re relesed: p 0 0 p 1 T-S-F p 2 T-S-E p 3 RELEASE g 1 n n At this point the REQUEST t point n decides to resume its execution nd it increments the counter: p 0 10 p 1 T-S-F p 2 T-S-E p 3 RELEASE g 0 n Now the request executes its work: p 0 10 p 1 T-S-F p 2 T-S-E p 3 RELEASE g 0 n W ork The work finishes: p 0 10 p 1 T-S-F p 2 T-S-E p 3 RELEASE g 0 n End W ork Now REQUEST relises tht the driver ws stopped by communicting with STOPPING-EVENT using the messge isstoppednd it borts! p 0 10 p 1 T-S-F p 2 T-S-E p 3 RELEASE g 0 ABORT It is esy to see tht this trce will be found by our technique when using prefixes of length 8 (α 8) becuse it contins 8 synchronistion ctions. The sme cn be chieved using the suffix bstrction. 6.2 Appliction to non-recursive exmples We lso pplied our implementtion to severl exmples without recursion to which MAGIC hd lredy been pplied. The previous version of MAGIC hndles non-recursive procedure clls by in-line expnsion. The gol of these experiments ws to determine whether the method described in the pper would improve MAGIC s performnce. Indeed inlining produces huge finite-stte models. Consider for exmple procedure hving k control points nd m clls to procedure hving n control points. This system cn be modeled using finite utomton with O(k + mn) sttes or PDS tht hs only O(k + n) sttes. As described next our results re encourging nd we believe tht they cn be improved even further vi more efficient implementtion. This shows tht in ddition to its utility in the verifiction of concurrent recursive progrms our technique represents n dvnce for recursive s well s non-recursive concurrent progrms. The experiments were crried out on dul-athlon-xp mchine with 3 GB of RAM running RedHt 9.0. We used the i th - prefix bstrction for those experiments. The results re summrized in Figure 2. The columns re explined below the tble. Ech row corresponds to different benchmrk. More precisely the srvr series is single OpenSSL server (1444 lines of code); the clnt series is single OpenSSL client (1386 lines of code); ssl series is server nd client tht execute concurrently (2830 lines of code). Ech element of series corresponds to different property being verified on the sme source code. The ucos benchmrk (6263 lines /7/19

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below. Dulity #. Second itertion for HW problem Recll our LP emple problem we hve been working on, in equlity form, is given below.,,,, 8 m F which, when written in slightly different form, is 8 F Recll tht we

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

More information

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS. THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS RADON ROSBOROUGH https://intuitiveexplntionscom/picrd-lindelof-theorem/ This document is proof of the existence-uniqueness theorem

More information

Chapter 2 Finite Automata

Chapter 2 Finite Automata Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

A Generic Approach to the Static Analysis of Concurrent Programs with Procedures

A Generic Approach to the Static Analysis of Concurrent Programs with Procedures A Generic Approch to the Sttic Anlysis of Concurrent Progrms with Procedures Ahmed Boujjni Jvier Esprz Tyssir Touili ABSTRACT We present generic proch to the sttic nlysis of concurrent progrms with procedures.

More information

1.4 Nonregular Languages

1.4 Nonregular Languages 74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!) CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All

More information

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation Strong Bisimultion Overview Actions Lbeled trnsition system Trnsition semntics Simultion Bisimultion References Robin Milner, Communiction nd Concurrency Robin Milner, Communicting nd Mobil Systems 32

More information

KNOWLEDGE-BASED AGENTS INFERENCE

KNOWLEDGE-BASED AGENTS INFERENCE AGENTS THAT REASON LOGICALLY KNOWLEDGE-BASED AGENTS Two components: knowledge bse, nd n inference engine. Declrtive pproch to building n gent. We tell it wht it needs to know, nd It cn sk itself wht to

More information

7.2 The Definite Integral

7.2 The Definite Integral 7.2 The Definite Integrl the definite integrl In the previous section, it ws found tht if function f is continuous nd nonnegtive, then the re under the grph of f on [, b] is given by F (b) F (), where

More information

This lecture covers Chapter 8 of HMU: Properties of CFLs

This lecture covers Chapter 8 of HMU: Properties of CFLs This lecture covers Chpter 8 of HMU: Properties of CFLs Turing Mchine Extensions of Turing Mchines Restrictions of Turing Mchines Additionl Reding: Chpter 8 of HMU. Turing Mchine: Informl Definition B

More information

Handout: Natural deduction for first order logic

Handout: Natural deduction for first order logic MATH 457 Introduction to Mthemticl Logic Spring 2016 Dr Json Rute Hndout: Nturl deduction for first order logic We will extend our nturl deduction rules for sententil logic to first order logic These notes

More information

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan CS 267: Automted Verifiction Lecture 8: Automt Theoretic Model Checking Instructor: Tevfik Bultn LTL Properties Büchi utomt [Vrdi nd Wolper LICS 86] Büchi utomt: Finite stte utomt tht ccept infinite strings

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility)

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility) CS5371 Theory of Computtion Lecture 20: Complexity V (Polynomil-Time Reducibility) Objectives Polynomil Time Reducibility Prove Cook-Levin Theorem Polynomil Time Reducibility Previously, we lernt tht if

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

19 Optimal behavior: Game theory

19 Optimal behavior: Game theory Intro. to Artificil Intelligence: Dle Schuurmns, Relu Ptrscu 1 19 Optiml behvior: Gme theory Adversril stte dynmics hve to ccount for worst cse Compute policy π : S A tht mximizes minimum rewrd Let S (,

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

The Regulated and Riemann Integrals

The Regulated and Riemann Integrals Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh Finite Automt Informtics 2A: Lecture 3 Mry Cryn School of Informtics University of Edinburgh mcryn@inf.ed.c.uk 21 September 2018 1 / 30 Lnguges nd Automt Wht is lnguge? Finite utomt: recp Some forml definitions

More information

Refined interfaces for compositional verification

Refined interfaces for compositional verification Refined interfces for compositionl verifiction Frédéric Lng INRI Rhône-lpes http://www.inrilpes.fr/vsy Motivtion Enumertive verifiction of concurrent systems Prllel composition of synchronous processes

More information

Lecture 9: LTL and Büchi Automata

Lecture 9: LTL and Büchi Automata Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled

More information

New Expansion and Infinite Series

New Expansion and Infinite Series Interntionl Mthemticl Forum, Vol. 9, 204, no. 22, 06-073 HIKARI Ltd, www.m-hikri.com http://dx.doi.org/0.2988/imf.204.4502 New Expnsion nd Infinite Series Diyun Zhng College of Computer Nnjing University

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) Anton Setzer (Bsed on book drft by J. V. Tucker nd K. Stephenson)

More information

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power CS411-2015S-12 Turing Mchine Modifictions 1 12-0: Extending Turing Mchines When we dded stck to NFA to get PDA, we incresed computtionl power Cn we do the sme thing for Turing Mchines? Tht is, cn we dd

More information

Designing finite automata II

Designing finite automata II Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of

More information

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn

More information

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives Block #6: Properties of Integrls, Indefinite Integrls Gols: Definition of the Definite Integrl Integrl Clcultions using Antiderivtives Properties of Integrls The Indefinite Integrl 1 Riemnn Sums - 1 Riemnn

More information

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies Stte spce systems nlysis (continued) Stbility A. Definitions A system is sid to be Asymptoticlly Stble (AS) when it stisfies ut () = 0, t > 0 lim xt () 0. t A system is AS if nd only if the impulse response

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

Frobenius numbers of generalized Fibonacci semigroups

Frobenius numbers of generalized Fibonacci semigroups Frobenius numbers of generlized Fiboncci semigroups Gretchen L. Mtthews 1 Deprtment of Mthemticl Sciences, Clemson University, Clemson, SC 29634-0975, USA gmtthe@clemson.edu Received:, Accepted:, Published:

More information

How to simulate Turing machines by invertible one-dimensional cellular automata

How to simulate Turing machines by invertible one-dimensional cellular automata How to simulte Turing mchines by invertible one-dimensionl cellulr utomt Jen-Christophe Dubcq Déprtement de Mthémtiques et d Informtique, École Normle Supérieure de Lyon, 46, llée d Itlie, 69364 Lyon Cedex

More information

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1 Exm, Mthemtics 471, Section ETY6 6:5 pm 7:4 pm, Mrch 1, 16, IH-115 Instructor: Attil Máté 1 17 copies 1. ) Stte the usul sufficient condition for the fixed-point itertion to converge when solving the eqution

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 2013 Outline 1 Riemnn Sums 2 Riemnn Integrls 3 Properties

More information

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

SUMMER KNOWHOW STUDY AND LEARNING CENTRE SUMMER KNOWHOW STUDY AND LEARNING CENTRE Indices & Logrithms 2 Contents Indices.2 Frctionl Indices.4 Logrithms 6 Exponentil equtions. Simplifying Surds 13 Opertions on Surds..16 Scientific Nottion..18

More information

A BRIEF INTRODUCTION TO UNIFORM CONVERGENCE. In the study of Fourier series, several questions arise naturally, such as: c n e int

A BRIEF INTRODUCTION TO UNIFORM CONVERGENCE. In the study of Fourier series, several questions arise naturally, such as: c n e int A BRIEF INTRODUCTION TO UNIFORM CONVERGENCE HANS RINGSTRÖM. Questions nd exmples In the study of Fourier series, severl questions rise nturlly, such s: () (2) re there conditions on c n, n Z, which ensure

More information

1 Online Learning and Regret Minimization

1 Online Learning and Regret Minimization 2.997 Decision-Mking in Lrge-Scle Systems My 10 MIT, Spring 2004 Hndout #29 Lecture Note 24 1 Online Lerning nd Regret Minimiztion In this lecture, we consider the problem of sequentil decision mking in

More information

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3 UNIFORM CONVERGENCE Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3 Suppose f n : Ω R or f n : Ω C is sequence of rel or complex functions, nd f n f s n in some sense. Furthermore,

More information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

New data structures to reduce data size and search time

New data structures to reduce data size and search time New dt structures to reduce dt size nd serch time Tsuneo Kuwbr Deprtment of Informtion Sciences, Fculty of Science, Kngw University, Hirtsuk-shi, Jpn FIT2018 1D-1, No2, pp1-4 Copyright (c)2018 by The Institute

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 203 Outline Riemnn Sums Riemnn Integrls Properties Abstrct

More information

Formal languages, automata, and theory of computation

Formal languages, automata, and theory of computation Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

More information

Here we study square linear systems and properties of their coefficient matrices as they relate to the solution set of the linear system.

Here we study square linear systems and properties of their coefficient matrices as they relate to the solution set of the linear system. Section 24 Nonsingulr Liner Systems Here we study squre liner systems nd properties of their coefficient mtrices s they relte to the solution set of the liner system Let A be n n Then we know from previous

More information

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004 Advnced Clculus: MATH 410 Notes on Integrls nd Integrbility Professor Dvid Levermore 17 October 2004 1. Definite Integrls In this section we revisit the definite integrl tht you were introduced to when

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q

More information

Bernoulli Numbers Jeff Morton

Bernoulli Numbers Jeff Morton Bernoulli Numbers Jeff Morton. We re interested in the opertor e t k d k t k, which is to sy k tk. Applying this to some function f E to get e t f d k k tk d k f f + d k k tk dk f, we note tht since f

More information

Review of Calculus, cont d

Review of Calculus, cont d Jim Lmbers MAT 460 Fll Semester 2009-10 Lecture 3 Notes These notes correspond to Section 1.1 in the text. Review of Clculus, cont d Riemnn Sums nd the Definite Integrl There re mny cses in which some

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

Acceptance Sampling by Attributes

Acceptance Sampling by Attributes Introduction Acceptnce Smpling by Attributes Acceptnce smpling is concerned with inspection nd decision mking regrding products. Three spects of smpling re importnt: o Involves rndom smpling of n entire

More information

CSC 473 Automata, Grammars & Languages 11/9/10

CSC 473 Automata, Grammars & Languages 11/9/10 CSC 473 utomt, Grmmrs & Lnguges 11/9/10 utomt, Grmmrs nd Lnguges Discourse 06 Decidbility nd Undecidbility Decidble Problems for Regulr Lnguges Theorem 4.1: (embership/cceptnce Prob. for DFs) = {, w is

More information

More on automata. Michael George. March 24 April 7, 2014

More on automata. Michael George. March 24 April 7, 2014 More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose

More information

20 MATHEMATICS POLYNOMIALS

20 MATHEMATICS POLYNOMIALS 0 MATHEMATICS POLYNOMIALS.1 Introduction In Clss IX, you hve studied polynomils in one vrible nd their degrees. Recll tht if p(x) is polynomil in x, the highest power of x in p(x) is clled the degree of

More information

Supervisory Control (4CM30)

Supervisory Control (4CM30) Supervisory Control (4CM30) Verifiction in mcrl2 Michel Reniers M.A.Reniers@tue.nl 2016-2017 Verifiction in mcrl2 M CIF = φ CIF iff M mcrl2 = φ mcrl2 1. Adpt CIF model 2. Formulte property in modl µ-clculus

More information

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science CSCI 340: Computtionl Models Kleene s Theorem Chpter 7 Deprtment of Computer Science Unifiction In 1954, Kleene presented (nd proved) theorem which (in our version) sttes tht if lnguge cn e defined y ny

More information

1 From NFA to regular expression

1 From NFA to regular expression Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

C. C^mpenu, K. Slom, S. Yu upper boun of mn. So our result is tight only for incomplete DF's. For restricte vlues of m n n we present exmples of DF's

C. C^mpenu, K. Slom, S. Yu upper boun of mn. So our result is tight only for incomplete DF's. For restricte vlues of m n n we present exmples of DF's Journl of utomt, Lnguges n Combintorics u (v) w, x{y c OttovonGuerickeUniversitt Mgeburg Tight lower boun for the stte complexity of shue of regulr lnguges Cezr C^mpenu, Ki Slom Computing n Informtion

More information

Homework Solution - Set 5 Due: Friday 10/03/08

Homework Solution - Set 5 Due: Friday 10/03/08 CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.

More information

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics SCHOOL OF ENGINEERING & BUIL ENVIRONMEN Mthemtics An Introduction to Mtrices Definition of Mtri Size of Mtri Rows nd Columns of Mtri Mtri Addition Sclr Multipliction of Mtri Mtri Multipliction 7 rnspose

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2 CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Kleene Theorems for Free Choice Nets Labelled with Distributed Alphabets

Kleene Theorems for Free Choice Nets Labelled with Distributed Alphabets Kleene Theorems for Free Choice Nets Lbelled with Distributed Alphbets Rmchndr Phwde Indin Institute of Technology Dhrwd, Dhrwd 580011, Indi Emil: prb@iitdh.c.in Abstrct. We provided [15] expressions for

More information

Theory of Computation Regular Languages

Theory of Computation Regular Languages Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

More information

Global Session Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems

Global Session Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems Globl Session Types for Dynmic Checking of Protocol Conformnce of Multi-Agent Systems (Extended Abstrct) Dvide Ancon, Mtteo Brbieri, nd Vivin Mscrdi DIBRIS, University of Genov, Itly emil: dvide@disi.unige.it,

More information

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar) Lecture 3 (5.3.2018) (trnslted nd slightly dpted from lecture notes by Mrtin Klzr) Riemnn integrl Now we define precisely the concept of the re, in prticulr, the re of figure U(, b, f) under the grph of

More information

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation 9/6/28 Stereotypicl computer CISC 49 Theory of Computtion Finite stte mchines & Regulr lnguges Professor Dniel Leeds dleeds@fordhm.edu JMH 332 Centrl processing unit (CPU) performs ll the instructions

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic

More information

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a).

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a). The Fundmentl Theorems of Clculus Mth 4, Section 0, Spring 009 We now know enough bout definite integrls to give precise formultions of the Fundmentl Theorems of Clculus. We will lso look t some bsic emples

More information

Math Lecture 23

Math Lecture 23 Mth 8 - Lecture 3 Dyln Zwick Fll 3 In our lst lecture we delt with solutions to the system: x = Ax where A is n n n mtrix with n distinct eigenvlues. As promised, tody we will del with the question of

More information

1.3 Regular Expressions

1.3 Regular Expressions 56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,

More information

Bisimulation. R.J. van Glabbeek

Bisimulation. R.J. van Glabbeek Bisimultion R.J. vn Glbbeek NICTA, Sydney, Austrli. School of Computer Science nd Engineering, The University of New South Wles, Sydney, Austrli. Computer Science Deprtment, Stnford University, CA 94305-9045,

More information

1 Probability Density Functions

1 Probability Density Functions Lis Yn CS 9 Continuous Distributions Lecture Notes #9 July 6, 28 Bsed on chpter by Chris Piech So fr, ll rndom vribles we hve seen hve been discrete. In ll the cses we hve seen in CS 9, this ment tht our

More information

Improper Integrals, and Differential Equations

Improper Integrals, and Differential Equations Improper Integrls, nd Differentil Equtions October 22, 204 5.3 Improper Integrls Previously, we discussed how integrls correspond to res. More specificlly, we sid tht for function f(x), the region creted

More information

RELATIONAL MODEL.

RELATIONAL MODEL. RELATIONAL MODEL Structure of Reltionl Dtbses Reltionl Algebr Tuple Reltionl Clculus Domin Reltionl Clculus Extended Reltionl-Algebr- Opertions Modifiction of the Dtbse Views EXAMPLE OF A RELATION BASIC

More information

Riemann is the Mann! (But Lebesgue may besgue to differ.)

Riemann is the Mann! (But Lebesgue may besgue to differ.) Riemnn is the Mnn! (But Lebesgue my besgue to differ.) Leo Livshits My 2, 2008 1 For finite intervls in R We hve seen in clss tht every continuous function f : [, b] R hs the property tht for every ɛ >

More information

MAA 4212 Improper Integrals

MAA 4212 Improper Integrals Notes by Dvid Groisser, Copyright c 1995; revised 2002, 2009, 2014 MAA 4212 Improper Integrls The Riemnn integrl, while perfectly well-defined, is too restrictive for mny purposes; there re functions which

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb. CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

N 0 completions on partial matrices

N 0 completions on partial matrices N 0 completions on prtil mtrices C. Jordán C. Mendes Arújo Jun R. Torregros Instituto de Mtemátic Multidisciplinr / Centro de Mtemátic Universidd Politécnic de Vlenci / Universidde do Minho Cmino de Ver

More information

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams Chpter 4 Contrvrince, Covrince, nd Spcetime Digrms 4. The Components of Vector in Skewed Coordintes We hve seen in Chpter 3; figure 3.9, tht in order to show inertil motion tht is consistent with the Lorentz

More information

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by. NUMERICAL INTEGRATION 1 Introduction The inverse process to differentition in clculus is integrtion. Mthemticlly, integrtion is represented by f(x) dx which stnds for the integrl of the function f(x) with

More information

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus Unit #9 : Definite Integrl Properties; Fundmentl Theorem of Clculus Gols: Identify properties of definite integrls Define odd nd even functions, nd reltionship to integrl vlues Introduce the Fundmentl

More information

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature CMDA 4604: Intermedite Topics in Mthemticl Modeling Lecture 19: Interpoltion nd Qudrture In this lecture we mke brief diversion into the res of interpoltion nd qudrture. Given function f C[, b], we sy

More information

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tble of Contents: Week 1: Preliminries (set lgebr, reltions, functions) (red Chpters 1-4) Weeks

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!!

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!! Nme: Algebr II Honors Pre-Chpter Homework Before we cn begin Ch on Rdicls, we need to be fmilir with perfect squres, cubes, etc Try nd do s mny s you cn without clcultor!!! n The nth root of n n Be ble

More information

Concepts of Concurrent Computation Spring 2015 Lecture 9: Petri Nets

Concepts of Concurrent Computation Spring 2015 Lecture 9: Petri Nets Concepts of Concurrent Computtion Spring 205 Lecture 9: Petri Nets Sebstin Nnz Chris Poskitt Chir of Softwre Engineering Petri nets Petri nets re mthemticl models for describing systems with concurrency

More information

Foundations for Timed Systems

Foundations for Timed Systems Foundtions for Timed Systems Ptrici Bouyer LSV CNRS UMR 8643 & ENS de Cchn 6, venue du Président Wilson 9423 Cchn Frnce emil: bouyer@lsv.ens-cchn.fr Introduction Explicit timing constrints re nturlly present

More information

Vyacheslav Telnin. Search for New Numbers.

Vyacheslav Telnin. Search for New Numbers. Vycheslv Telnin Serch for New Numbers. 1 CHAPTER I 2 I.1 Introduction. In 1984, in the first issue for tht yer of the Science nd Life mgzine, I red the rticle "Non-Stndrd Anlysis" by V. Uspensky, in which

More information

Global Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems

Global Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems Globl Types for Dynmic Checking of Protocol Conformnce of Multi-Agent Systems (Extended Abstrct) Dvide Ancon, Mtteo Brbieri, nd Vivin Mscrdi DIBRIS, University of Genov, Itly emil: dvide@disi.unige.it,

More information

Tutorial Automata and formal Languages

Tutorial Automata and formal Languages Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we

More information

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS CST.2011.2.1 COMPUTER SCIENCE TRIPOS Prt IA Tuesdy 7 June 2011 1.30 to 4.30 COMPUTER SCIENCE Pper 2 Answer one question from ech of Sections A, B nd C, nd two questions from Section D. Submit the nswers

More information

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year 1/1/21. Fill in the circles in the picture t right with the digits 1-8, one digit in ech circle with no digit repeted, so tht no two circles tht re connected by line segment contin consecutive digits.

More information

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018 CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA

More information

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac REVIEW OF ALGEBRA Here we review the bsic rules nd procedures of lgebr tht you need to know in order to be successful in clculus. ARITHMETIC OPERATIONS The rel numbers hve the following properties: b b

More information