A Tracking Semantics for CSP

Size: px
Start display at page:

Download "A Tracking Semantics for CSP"

Transcription

1 A Trcking Semntics for CSP Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit Universidd Politécnic de Vlenci, Cmino de Ver S/N, E Vlenci, Spin Abstrct. CSP is powerful lnguge for specifying complex concurrent systems. Due to the non-deterministic execution order of processes nd to synchroniztions, mny nlyses such s dedlock nlysis, relibility nlysis, nd progrm slicing try to predict properties of the specifiction which cn gurntee the qulity of the finl system. These nlyses often rely on the use of CSP s trces. In this work, we introduce the theoreticl bsis for trcking concurrent nd explicitly synchronized computtions in process lgebrs such s CSP. Trcking computtions is difficult tsk due to the subtleties of the underlying opertionl semntics which combines concurrency, non-determinism nd non-termintion. We define n instrumented opertionl semntics tht genertes s side-effect n pproprite dt structure ( trck) which cn be used to trck computtions. Forml definition of trcking semntics improves the understnding of the trcking process, but lso, it llows to formlly prove the correctness of the computed trcks. Key words: Concurrent Progrmming, CSP, Semntics, Trcking. 1 Introduction One of the most importnt techniques for progrm understnding nd debugging is trcing [3]. A trce gives the user ccess to otherwise invisible informtion bout computtion. In the context of concurrent lnguges, computtions re prticulrly complex due to the non-deterministic execution order of processes nd to the restrictions imposed on this order by synchroniztions; nd thus, trcer is powerful tool to explore, understnd nd debug concurrent computtions. One of the most widespred concurrent specifiction lnguges is the Communicting Sequentil Processes (CSP) [7, 17] whose opertionl semntics llows the combintion of prllel, non-deterministic nd non-terminting processes. This work hs been prtilly supported by the Spnish Ministerio de Cienci e Innovción under grnt TIN C03-02, by the Generlitt Vlencin under grnt ACOMP/2009/017, nd by the Universidd Politécnic de Vlenci (Progrms PAID nd PAID-06-08). Slvdor Tmrit ws prtilly supported by the Spnish MICINN under FPI grnt BES

2 2 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit The study nd trnsformtion of CSP specifictions often uses different nlyses such s dedlock nlysis [10], relibility nlysis [8] nd progrm slicing [19] which re bsed on dt structure ble to represent computtions. In CSP trce is sequence of events. Concretely, the opertionl semntics of CSP is n event-bsed semntics in which the occurrence of events fires the rules of the semntics. Hence, the finl trce of the computtion is the sequence of events occurred (see Chpter 8 of [17] for detiled study of this kind of trces). In this work we introduce n essentilly different notion of trce [3] clled trck. In our setting, trck is dt structure which represents the sequence of expressions tht hve been evluted during the computtion, nd moreover, this dt structure is lbelled with the loction of these expressions in the specifiction. Therefore, CSP trck is much more informtive thn CSP trce since the former not only contins lot of informtion bout originl progrm structures but lso explicitly reltes the sequence of events with the prts of the specifiction tht cused these events. Exmple 1. Consider the following CSP specifiction: 1 MAIN = CASINO GAMBLING CASINO = (PLAYER ROULETTE) {betred,red,blck,prize} CROUPIER PLAYER = betred (prize STOP noprize STOP) ROULETTE = red STOP blck STOP CROUPIER = (betred red prize STOP) (betred blck prize STOP) (betblck blck prize STOP) (betblck red getmoney STOP) GAMBLING = Complex Composite Processes This specifiction models severl gmbling ctivities running in prllel nd modelled by process GAMBLING. One of the gmes is the csino. A CASINO is modelled s the interction of three prllel processes, nmely PLAYER, ROULETTE, nd CROUPIER. The plyer bets for red, nd she cn win prize or not. The roulette simply tkes color (either red or blck); nd the croupier checks the bet nd the color of the roulette in order to give prize to the plyer or just get the bet money. This specifiction contins n error, becuse it llows the trce of events t = betred, blck, prize where the plyer bets for red nd she wins prize even though the roulette tkes blck. 1 We refer those reders non fmilir with CSP syntx to Section 2 where we provide brief introduction to CSP.

3 A Trcking Semntics for CSP 3 MAIN CASINO CROUPIER PLAYER ROULETTE betred betred blck blck prize STOP prize STOP STOP Fig. 1. Trck of the progrm in Exmple 1 Now ssume tht we execute the specifiction nd discover the error fter executing trce t. A trck cn be very useful to understnd why the error ws cused, nd wht prt of the specifiction ws involved in the wrong execution. For instnce, if we look t the trck of Fig. 1, we cn esily see tht the three processes run in prllel, nd tht the prize is given becuse there is synchroniztion (dshed edges represent synchroniztions) between CROUPIER nd PLAYER tht should never hppen. Observe tht the trck is intuitive enough s to be powerful progrm comprehension tool tht provides much more informtion thn the trce. Moreover, observe tht the trck contins explicit informtion bout the specifiction expressions tht were involved in the execution. Therefore, it cn be used for progrm slicing (see [18] for n explntion of the technique nd [14] for n dpttion of progrm slicing to CSP). In prticulr, in this exmple, we cn use the trck to extrct the prt of the progrm tht ws involved in the execution note tht this is the only prt tht could cuse the error. This prt hs been underscored in the exmple. With quick look, one cn see tht the underscored prt of process CROUPIER produced the wrong behvior. Event prize should be replced by getmoney. Another interesting ppliction of trcks is relted to component extrction nd reuse. If we re interested in prticulr trce, nd we wnt to extrct the prt of the specifiction tht models this trce to be used in nother model, we

4 4 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit cn simply produce slice, nd slightly ugment the code to mke it syntcticlly correct (see [14] for n exmple nd n explntion of this trnsformtion). In our exmple, even though the system is very big due to the process GAMBLING, the trck is ble to extrct the only informtion relted to the trce. We hve implemented tool [13] ble to produce trcks nd to utomticlly color prts of the code relted to some point in the specifiction. This tool is integrted in the lst version of ProB [11, 12] which is the most extended IDE for CSP. In lnguges such s Hskell, the trcks (see, e.g., [3 5, 1]) re the bsis of mny nlysis methods nd tools. However, computing CSP trcks is complex tsk due to the non-deterministic execution of processes, due to dedlocks, due to non-terminting processes nd minly due to synchroniztions. This is probbly the reson why no correctness result exists which formlly reltes the trck of specifiction to its execution. This semntics is needed becuse it would llow us to prove importnt properties (such s correctness nd completeness) of the techniques nd tools bsed on trcking. To the best of our knowledge, there is only one ttempt to define nd build trcks for CSP [2]. Their notion of trck is bsed on the stndrd progrm dependence grph [6]; therefore it is useful for progrm slicing but it is insufficient for other nlyses tht need context-sensitive grph [9] (i.e., ech different process cll hs different representtion). Moreover, their notion of trck does not include synchroniztions. Our trcks re ble to represent synchroniztions, nd they re context-sensitive. The min contributions of this work re the forml definition of trcks, the definition of the first trcking semntics for CSP nd the proof tht the trce of computtion cn be extrcted from the trck of this computtion. Concretely, we instrument the stndrd opertionl semntics of CSP in such wy tht the execution of the semntics produces s side-effect the trck of the computtion. It should be cler tht the trck of n infinite computtion is lso infinite. However, we design the semntics in such wy tht the trck is produced incrementlly step by step. Therefore, if the execution is stopped (e.g., by the user becuse it is non-terminting or becuse limit in the size of the trck ws specified), then the semntics produces the trck of the computtion performed so fr. This semntics cn serve s theoreticl foundtion for trcking CSP computtions becuse it formlly reltes the computtions of the stndrd semntics with the trcks of these computtions. The rest of the pper hs been orgnized s follows. Firstly, in Section 2 we recll the syntx nd semntics of CSP. In Section 3 we define the concept of trck for CSP. Then, in Section 4, we instrument the CSP semntics in such wy tht its execution produces s side-effect the trck ssocited with the performed computtion. In Section 5, we present the min results of the pper proving tht the instrumented semntics presented is conservtive extension of the stndrd semntics, its computed trcks re correct nd the corresponding trce cn be extrcted from the trck. Finlly, Section 6 concludes.

5 2 The Syntx nd Semntics of CSP A Trcking Semntics for CSP 5 In order to mke the pper self-contined, we recll in this section the syntx nd semntics of CSP. Figure 2 summrizes the syntx constructions used in CSP specifictions. A specifiction is viewed s finite set of process definitions. The left-hnd side of ech definition is the nme of process, which is defined in the right-hnd side (bbrev. rhs) by mens of n expression tht cn be cll to nother process or combintion of the following opertors: Prefixing It specifies tht event must hppen before process P. Internl choice The system chooses non-deterministiclly to execute one of the two processes P or Q. Externl choice It is identicl to internl choice but the choice comes from outside the system (e.g., the user). Sequentil composition It specifies sequence of two processes. When the first (successfully) finishes, the second strts. Synchronized prllelism Both processes re executed in prllel with set X of synchronized events. In bsence of synchroniztions both processes cn execute in ny order. Whenever synchronized event X hppens in one of the processes it must lso hppen in the other t the sme time. Whenever the set of synchronized events is not specified, it is ssumed tht processes re synchronized in ll common events. A prticulr cse of prllel execution is interleving where no synchroniztions exist (i.e., X = ). Skip It successfully finishes the current process. It llows us to continue the next sequentil process. Stop Synonymous with dedlock: It finishes the current process nd it does not llow the next sequentil process to continue. S ::= {D 1,..., D m } (Entire specifiction) Domins M, N... N (Process nmes) P, Q... P (Processes), b... Σ (Events) D ::= N = P (Process definition) P ::= M (Process cll) P (Prefixing) P Q (Internl choice) P Q (Externl choice) P ; Q (Sequentil composition) P X Q (Synchronized prllelism) where X Σ SKIP (Skip) ST OP (Stop) Fig. 2. Syntx of CSP specifictions

6 6 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit We now recll the stndrd opertionl semntics of CSP s defined by Roscoe [17]. It is presented in Fig. 3 s logicl inference system. A stte of the semntics is process to be evluted clled the control. The system strts with n initil stte, nd the rules of the semntics re used to infer how this stte evolves. When no rules cn be pplied to the current stte, the computtion finishes. The rules of the semntics chnge the sttes of the computtion due to the occurrence of events. The set of possible events is Σ {, }. Events in Σ = {, b, c...} re visible from the externl environment, nd cn only hppen with its co-opertion (e.g., ctions of the user). The specil event cnnot be observed from outside the system nd it is n internl event tht hppens utomticlly s defined by the semntics. is specil event representing the successful termintion of process. We use the specil symbol Ω to denote ny process tht successfully terminted. In order to perform computtions, we construct n initil stte (e.g., MAIN) nd (non-deterministiclly) pply the rules of Fig. 3. The intuitive mening of ech rule is the following: (Process Cll) The cll is unfolded nd the right-hnd side of process nmed N is dded to the control. (Prefixing) When event occurs, process P is dded to the control. (SKIP) After SKIP, the only possible event is, which denotes the successful termintion of the (sub)computtion with the specil symbol Ω. There is no rule for Ω (neither for STOP), hence, this (sub)computtion hs finished. (Internl Choice 1 nd 2) The system, with the occurrence of the internl event, (non-deterministiclly) selects one of the two processes P or Q which is dded to the control. (Externl Choice 1, 2, 3 nd 4) The occurrence of develops one of the brnches. The occurrence of n event is used to select one of the two processes P or Q nd the control chnges ccording to the event. (Sequentil Composition 1) In P ; Q, P cn evolve to P with ny event except. Hence, the control becomes P ; Q. (Sequentil Composition 2) When P successfully finishes (with event ), Q strts. Note tht is hidden from outside the whole process becoming. (Synchronized Prllelism 1 nd 2) When event X or events or hppen, one of the two processes P or Q evolves ccordingly, but only is visible from outside the prllelism opertor. (Synchronized Prllelism 3) When event X hppens, it is required tht both processes synchronize, P nd Q re executed t the sme time nd the control becomes P X Q. (Synchronized Prllelism 4) When both processes hve successfully terminted the control becomes Ω, performing the event.

7 A Trcking Semntics for CSP 7 (Process Cll) (Prefixing) (SKIP) N rhs(n) ( P ) P SKIP Ω (Internl Choice 1) (Internl Choice 2) (P Q) P (P Q) Q (Externl Choice 1) (Externl Choice 2) P P (P Q) (P Q) Q Q (P Q) (P Q ) (Externl Choice 3) (Externl Choice 4) P e P e Q Q (P Q) e P (P Q) e e Σ { } Q (Sequentil Composition 1) (Sequentil Composition 2) P e P (P ; Q) e (P ; Q) e Σ {} P Ω (P ; Q) Q (Synchronized Prllelism 1) (Synchronized Prllelism 2) P e P (P Q) e (P Q) X X Q e Q (P Q) e (P Q ) X X (Synchronized Prllelism 3) (Synchronized Prllelism 4) P P Q Q (P Q) (P Q ) X (Ω Ω) Ω X X X (e = e = X) (e = e {, }) Fig. 3. CSP s opertionl semntics We illustrte the semntics with the following exmple. Exmple 2. Consider the next CSP specifiction: MAIN = ( STOP) (P ( STOP)) {} P = b SKIP If we use MAIN s the initil stte to execute the semntics, we get the computtion shown in Fig. 4 where the finl stte is (( STOP) Ω). This computtion {} corresponds to the execution of the left brnch of the choice (i.e., P) nd thus only event b occurs. Ech rewriting step is lbelled with the pplied rule, nd the exmple should be red from top to bottom.

8 8 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit (Process Cll) MAIN (( STOP) (P ( STOP))) {} (Synchronized Prllelism 2) (Process Cll) P (b SKIP) (Externl Choice 1) (P ( STOP)) ((b SKIP) ( STOP)) (( STOP) (P ( STOP))) Stte 1 {} where Stte 1 =(( STOP) {} ((b SKIP) ( STOP))) (Synchronized Prllelism 2) (Synchronized Prllelism 2) (Prefixing) b (b SKIP) SKIP (Externl Choice 3) b ((b SKIP) ( STOP)) SKIP Stte 1 (( STOP) {} b (( STOP) SKIP) {} (SKIP) SKIP Ω SKIP) (( STOP) {} Ω) Fig. 4. A computtion with the opertionl semntics in Fig. 3 3 Trcking Computtions In this section we define the notion of trck. Firstly, we introduce some nottion tht will be used throughout the pper. A trck is formed by the sequence of expressions tht re evluted during n execution. These expressions re conveniently connected to form grph. However, severl progrm nlysis techniques such s progrm slicing mke use of the loctions of progrm expressions, nd thus, this notion of trck is insufficient for them. Therefore, we wnt our trcks to lso store the loction of ech literl (i.e., events, opertors nd process nmes) in the specifiction so tht the trck cn be used to know wht portions of the source code hve been executed nd in wht order. The inclusion of source positions in the trck implies n dditionl level of complexity in the semntics, but the benefits of providing our trcks with this dditionl informtion re cler nd, for some pplictions, essentil. Therefore, we use lbels (tht we cll specifiction positions) to uniquely identify ech literl in specifiction which roughly corresponds to nodes in the CSP specifiction s bstrct syntx tree. We define function Pos to obtin the specifiction position of n element of CSP specifiction nd it is defined over nodes of n bstrct syntx tree for CSP specifiction. Formlly, Definition 1. (Specifiction position) A specifiction position is pir (N, w) where N N nd w is sequence of nturl numbers (we use Λ to denote the empty sequence). We let Pos(o) denote the specifiction position of n expression o. Ech process definition N = P of CSP specifiction is lbelled with specifiction positions. The specifiction position of its left-hnd side is Pos(N) = (N, 0). The right-hnd side is lbelled with the cll AddSpPos(P, (N, Λ)); where function

9 A Trcking Semntics for CSP 9 AddSpPos is defined s follows: AddSpPos(P, (N, w)) = ST OP (N,w) P (N,w) SKIP (N,w) (N,w.1) (N,w) AddSpPos(Q, (N, w.2)) if P N if P = ST OP if P = SKIP if P = Q AddSpPos(Q, (N, w.1)) op (N,w) AddSpPos(R, (N, w.2)) if P = Q op R op {,,, ; } Exmple 3. Consider gin the CSP specifiction in Exmple 2 where literls re lbelled with their ssocited specifiction positions (they re underlined) so tht lbels re unique: MAIN (MAIN,0) = ( (MAIN,1.1) (MAIN,1) STOP (MAIN,1.2) ) (MAIN,Λ) {} (P (MAIN,2.1) (MAIN,2) ( (MAIN,2.2.1) (MAIN,2.2) STOP (MAIN,2.2.2) )) P (P,0) = b (P,1) (P,Λ) SKIP (P,2) In the following, specifiction positions will be represented with greek letters (α, β,...) nd we will often use indistinguishbly n expression nd its ssocited specifiction position when it is cler from the context (e.g., in Exmple 3 we will refer to (P, 1) s b). In order to introduce the forml definition of trck, we need first to define the concept of control-flow, which refers to the order in which the individul literls of CSP specifiction re executed. Intuitively, the control cn pss from specifiction position α to specifiction position β iff n execution exists where α is executed before β. This notion of control-flow is similr to the control-flow used in the control-flow grphs (CFG) [18] of impertive progrmming. We hve dpted the sme ide to CSP where choices nd prllel composition pper; nd in similr wy to the CFG, we use this definition to drw control rcs in our trcks. Formlly, Definition 2. (Sttic control-flow) Given CSP specifiction S nd two specifiction positions α, β in S, we sy tht the control cn pss from α to β, denoted by α β, iff one of the following conditions holds: i) α = N β = first((n, Λ)) with N = rhs(n) S ii) α {,, } β {first(α.1), first(α.2)} iii) α {, ; } β = first(α.2) iv) α = β.1 β = v) α lst(β.1) β = ;

10 10 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit where first(α) is the specifiction position of the subprocess denoted by α which must be executed first: α.1 if α = first(α) = first(α.1) if α = ; α otherwise nd lst(α) is the set of ll possible termintion points of the subprocess denoted by α: {α} if α = SKIP if α = STOP (α { } (lst(α.1) = lst(α.2) = )) lst(α) = lst(α.1) lst(α.2) if α {, } (α { } lst(α.1) lst(α.2) ) lst(α.2) if α {, ; } lst((n, Λ)) if α = N For instnce, in Exmple 3, we cn see how the control cn pss from specifiction position to nother one, e.g., we hve (MAIN, 2) (MAIN, 2.1) nd (MAIN, 2) (MAIN, 2.2.1) due to rule ii). And (MAIN, 2.2.1) (MAIN, 2.2) due to rule iv); (MAIN, 2.2) (MAIN, 2.2.2) due to rule iii) nd (MAIN, 2.1) (P, 1) due to rule i). We lso need to define the notions of rewriting step nd derivtion. Definition 3. (Rewriting Step, Derivtion) Given CSP process P, rewriting step for P, denoted by P Θ P, is the trnsformtion of P into P by using rule of the CSP semntics. Therefore, P Θ P Θ iff rule of the form P e P is pplicble, where e Σ {, } nd Θ is (possibly empty) set of rewriting Θ steps. Given CSP process P 0, we sy tht the sequence P 0 Θ 0... n Pn+1, Θ n 0, is derivtion of P 0 iff i, 0 i n, P i i Pi+1 is rewriting step. We sy tht the derivtion is complete iff there is no possible rewriting step for P n+1. We sy tht the derivtion hs successfully finished iff P n+1 is Ω. For instnce, in Fig. 5(), one (possible) complete derivtion of Exmple 3 is shown (for the time being, the reder cn ignore the underlined prt). The rules pplied in ech rewriting step (ignoring subderivtions) re (Process Cll) nd (Synchronized Prllelism 3) (bbrev. (PC) nd (SP3), respectively). Function lst of Definition 2 cn be used to determine the lst specifiction position in derivtion. However, this function computes ll possible finl specifiction positions, nd derivtion only reches (non-deterministiclly) set of them. Therefore, we will use in the following modified version of lst clled lst whose behviour is exctly the sme s lst except in the cse of choices where only one of the brnches is selected: For ech derivtion (P P Θ P ) or (P P Θ 0... Θ n P, n 0 such tht P Θ 0... Θ m P, m 0), lst (P P ) = lst (P P ) = lst (P ).

11 A Trcking Semntics for CSP 11 Note tht, while lst is sttic, lst is dynmic; it is defined in the context of prticulr derivtion which implies one prticulr wy of resolving ny nondeterminism. The sme hppens with the definition of control-flow. Control-flow is defined stticlly nd sys whether the control cn pss from α to β in some derivtion. However, the trck is dynmic structure produced for prticulr derivtion. Therefore, we produce dynmic version of the definition of controlflow which is defined for prticulr derivtion. Definition 4. (Dynmic control-flow) Let S be CSP specifiction nd D derivtion in S. Given two specifiction positions α, β in S, we sy tht the control cn dynmiclly pss from α to β, denoted by α β, iff the control cn pss from α to β (α β) in derivtion D. For ech P Θ P D nd for ll rewriting steps in Θ, we hve tht: 1. if P is prefixing ( Q) or sequentil composition (Q; R), then Pos() Pos() or p lst (Q), Pos(p) Pos(; ) respectively, 2. if P first(p Θ ) where P P Θ, then Pos(P ) Pos(first(P )), 3. if P first(p ), then Pos(P ) Pos(first(P )). Cluses 1, 2 nd 3 define the cses in which the control psses between two specifiction positions in given derivtion. In cluse 1, if we hve prefixing in the control then Θ is empty nd the rewriting step pplied is of the form. In this cse, cluse 1 gurntees tht the control cn dynmiclly pss from to ; nd cluse 3 gurntees tht the control cn dynmiclly ( P ) P pss from to P. However, in generl, Θ is not empty, nd the rewriting step is of the form P P P P. Here, cluse 2 ensures tht the control cn dynmiclly pss from P to P ; nd cluse 3 ensures tht the control cn dynmiclly pss from P to P nd from P to P. For instnce, it is possible tht we hve rewriting step to evlute the process P P. Clerly, the control cn pss from to both P nd P ( P nd P ), but in the rewriting step the control will only pss to one of them ( P or P ). In this cse, cluses 2 nd 3 re used. We re now in position to formlly define the concept of trck of derivtion. Definition 5. (Trck) Given CSP specifiction S, nd derivtion D in S, the trck of D is grph G = (N, E c, E s ) where N is set of nodes uniquely identified with nturl number nd tht re lbelled with specifiction positions (l(n) refers to the lbel of node n), nd edges re divided into two groups: control-flow edges (E c ) re set of one-wy edges (denoted with ) representing the control-flow between two nodes, nd synchroniztion edges (E s ) re set of two-wy edges (denoted with ) representing the synchroniztion of two (event) nodes; nd

12 12 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 1. E c contins control-flow edge iff with respect to D, nd 2. E s contins synchroniztion edge for ech synchroniztion occurring in D where nd re the nodes of the synchronized events. The only nodes in N re the nodes induced by E c nd E s. 0 MAIN MAIN,0 1 MAIN,Λ MAIN ( STOP) (P ( STOP)) (PC) {} STOP STOP (SP3) {} (SP1) {} (SP2) {} STOP () Derivtion MAIN,1.1 MAIN,1 STOP MAIN,1.2 MAIN,2 (b) Trck 5 MAIN,2.2.1 MAIN,2.2 STOP MAIN, Fig. 5. Derivtion nd trck ssocited with the specifiction of Exmple 3 Exmple 4. Consider gin the specifiction of Exmple 3. We show in Fig. 5() one possible derivtion (ignoring subderivtions) of this specifiction (for the time being, the underlined prt should be ignored). Its ssocited trck is shown in Fig. 5(b). In the exmple, we see tht the trck is connected nd directed grph. Aprt from the control-flow edges, there is one synchroniztion edge between nodes (MAIN, 1.1) nd (MAIN, 2.2.1) representing the synchroniztion of event. To illustrte the inclusion of edges in Definition 5, we see tht the edge between nodes 2 nd 3 is introduced ccording to cluse 1 of Definition 4; the edge between nodes 5 nd 6 is introduced ccording to cluse 2 of Definition 4 becuse, in the subderivtions of (SP3), there is rewriting step (Externl ( STOP) (STOP) nd first( STOP) = ; (Prefixing) Choice 4) (P ( STOP)) (STOP) the edge between nodes 7 nd 8 is introduced ccording to cluse 3 of Definition 4 becuse there is lso rewriting step (Prefixing) ( STOP) (STOP) nd first(stop) = STOP; nd the synchroniztion edge between nodes 2 nd 6 is introduced ccording to cluse 2 of Definition 5. The trce ssocited with the derivtion in Fig. 5() is. Therefore, note tht the trck is much more informtive: it shows the exct processes tht hve

13 A Trcking Semntics for CSP 13 been evluted with n explicit cuslity reltion; nd, in ddition, it shows the specifiction positions tht hve been evluted nd in wht order. 4 Instrumenting the Semntics for Trcking The genertion of trcks in CSP introduces new chllenges such s non-deterministic execution of processes, dedlocks, non-terminting processes nd synchroniztions. In this work, we design solution tht overcomes these difficulties. Firstly, we generte trcks with n ugmented semntics which is conservtive with respect to the stndrd opertionl semntics. Therefore, the execution order is the stndrd order, thus non-determinism nd synchroniztions re solved by the semntics. Moreover, the semntics genertes the trck incrementlly, step by step. Therefore, infinite computtions cn be trcked until they re stopped. Hence, it is not needed to ctully finish computtion to get the trck of the subcomputtions performed. Exmple 5. In the following CSP specifiction two non-terminting processes run in prllel nd synchronize infinitely. MAIN (MAIN,0) P (P,0) = P (MAIN,1) (MAIN,Λ)P (MAIN,2) {} = (P,1) (P,Λ) P (P,2) Becuse the computtion is infinite, the trck (shown in Fig. 6) is lso infinite. 0 MAIN MAIN,0 1 MAIN,Λ 2 P MAIN,1 P MAIN,2 3 4 P,1 P,1 5 6 P,Λ P,Λ 8 7 P P,2 P P, P,1 P, P,Λ P,Λ P P,2 P P, Fig. 6. Trck of the progrm in Exmple 5

14 14 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit In order to solve the problem of dedlocks (tht stop the computtion), nd hve representtion for them in the trcks; when dedlock hppens, the semntics performs some dditionl steps to be ble to generte prt of the trck tht represents the dedlock. These dditionl steps do not influence the other rules of the semntics, thus it remins conservtive. This section introduces n instrumented opertionl semntics of CSP which genertes s side-effect the trcks ssocited with the computtions performed with the semntics. The trcking semntics is shown in Fig. 7, where we ssume tht every literl in the progrm hs been lbelled with its specifiction position (denoted by subscript, e.g., P α ). In this semntics, stte is tuple (P, G, m, ), where P is the process to be evluted (the control), G is directed grph (i.e., the trck built so fr), m is numeric reference to the current node in G, nd is set of references to nodes tht my be synchronized. Concretely, m references the node in G where the specifiction position of the control P must be stored. Reference m is fresh 2 reference generted to dd new nodes to G. The bsic ide of the grph construction is to record the current control with the current reference in every step by connecting it to its prent. We use the nottion G[m α] to introduce node in G. For instnce, if we re dding n node to G this new node hs reference m, it is lbelled with specifiction position α, nd its successor is n ( fresh reference). Successor rrows re denoted by m which mens tht node n is the successor of node m. Every time n n event in Σ hppens during the computtion, this event is stored in the set of the current stte. Therefore, when synchronized prllelism is evluted, ll the events tht must be synchronized re in. We use the specil symbol to denote ny process tht is dedlocked. In order to perform computtions, we construct n initil stte (e.g., (MAIN,, 0, )) nd (non-deterministiclly) pply the rules of Fig. 7. When the execution hs finished or hs been interrupted, the semntics hs produced the trck of the computtion performed so fr. An explntion for ech rule of the semntics follows: (Process Cll) The clled process N is unfolded, node m is dded to the grph with specifiction position α nd successor n ( fresh reference). The new process in the control is rhs(n). The set of events to be synchronized is put to. (Prefixing) This rule dds nodes m (the prefix) nd n (the prefixing opertor) to the grph. In the new stte, n becomes the prent reference nd the fresh reference p represents the current reference. The new control is P. The set is {m} to indicte tht event hs occurred nd it must be synchronized when required by (Synchronized Prllelism 3). (SKIP nd STOP) Whenever one of these rules is pplied, the subcomputtion finishes becuse Ω (for rule SKIP) nd (for rule STOP) re put in the control, nd these specil symbols hve no ssocited rule. A node with the SKIP (respectively STOP) specifiction position is dded to the grph. 2 We ssume tht fresh references re numeric nd generted incrementlly.

15 A Trcking Semntics for CSP 15 (Process Cll) (Prefixing) (N α, G, m, ) (rhs(n), G[m α], n, ) n ( α β P, G, m, ) (P, G[m α, n β], p, {m}) n p (SKIP) (STOP) (Internl Choice 1) (Internl Choice 2) (SKIP α, G, m, ) (Ω, G[m α], n, ) n (STOP α, G, m, ) (, G[m α], n, ) n (P α Q, G, m, ) (P, G[m α], n, ) n (P α Q, G, m, ) (Q, G[m α], n, ) n (Externl Choice 1) (Externl Choice 2) (P 1, G, n, ) (P, G, n, ) (P 1 (α,n1,n 2 )P 2, G, m, ) (P (α,n,n2 ) P 2, G, m, ) where (G, n ) = FirstEvl(G, n 1, m, α) (P 2, G, n, ) (P, G, n, ) (P 1 (α,n1,n 2 )P 2, G, m, ) (P 1 (α,n1,n ) P, G, m, ) where (G, n ) = FirstEvl(G, n 2, m, α) (Externl Choice 3) (Externl Choice 4) (P 1, G, n, ) e (P, G, n, ) (P 1 (α,n1,n 2 )P 2, G, m, ) e (P, G, n, ) where (G, n ) = FirstEvl(G, n 1, m, α) (P 2, G, n, ) e (P, G, n, ) (P 1 (α,n1,n 2 )P 2, G, m, ) e (P, G, n, ) where (G, n ) = FirstEvl(G, n 2, m, α) e Σ { } e Σ { } (Sequentil Composition 1) (P, G, m, ) e (P, G, m, ) (P ; Q, G, m, ) e (P ; Q, G, m, ) e Σ {} (Sequentil Composition 2) (P, G, m, ) (Ω, G, n, ) (P ; α Q, G, m, ) (Q, G [n α], p, ) p Fig. 7. An instrumented opertionl semntics to generte CSP trcks (Internl Choice 1 nd 2) The choice opertor is dded to the grph, nd the (non-deterministiclly) selected brnch is put into the control with the fresh reference n s the successor of the choice opertor. (Externl Choice 1, 2, 3 nd 4) Externl choices cn develop both brnches while events hppen (rules 1 nd 2), until n event in Σ { } occurs (rules 3 nd 4). This mens tht the semntics cn dd nodes to both brnches of the trck lterntively, nd thus, it needs to store the next reference to use in every brnch of the choice. This is done by lbelling choice opertors with

16 16 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit (Synchronized Prllelism 1) (Synchronized Prllelism 2) (P 1, G, n, ) e (P, G, n, ) (P 1 X (α,n 1,n 2 ) P 2, G, m, ) e (P X (α,n,n 2 ) P 2, G, m, ) where (G, n ) = FirstEvl(G, n 1, m, α) (P 2, G, n, ) e (P, G, n, ) (P 1 X (α,n 1,n 2 ) P 2, G, m, ) e (P 1 X (α,n 1,n ) P, G, m, ) where (G, n ) = FirstEvl(G, n 2, m, α) (e = e = X) (e = e {, }) (e = e = X) (e = e {, }) (Synchronized Prllelism 3) RewritingStep 1 RewritingStep 2 (P 1 X (α,n 1,n 2 ) P 2, G, m, ) (P 1 X (α,n 1,n 2 )P 2, G, m, 1 2 ) where G = G 1 G 2 {s 1 s 2 s 1 1 s 2 2 } RewritingStep 1 = (P 1, G 1, n 1, ) (P 1, G 1, n 1, 1) (G 1, n 1 ) = FirstEvl(G, n 1, m, α) X RewritingStep 2 = (P 2, G 2, n 2, ) (P 2, G 2, n 2, 2) (G 2, n 2 ) = FirstEvl(G, n2, m, α) (Synchronized Prllelism 4) (Ω X (α,n 1,n 2 ) Ω, G, m, ) (Ω, G, r, ) where G = G[{p r p q G where q {n 1, n 2}}] Fig. 7. An instrumented opertionl semntics to generte CSP trcks (cont.) tuple of the form (α, n 1, n 2 ) where α is the specifiction position of the choice opertor; nd n 1 nd n 2 re respectively the references to be used in the left nd right brnches of the choice, nd they re initilized to, symbol used to express tht the brnch hs not been evluted yet. Therefore, the first time brnch is evluted, we generte new reference for this brnch. For this purpose, function FirstEvl is used: FirstEvl(G, n, m, α) = { (G[m p α], p) if n = (G, n) otherwise This function checks whether this is the first time tht the brnch is evluted (this only hppens when the reference of this brnch is empty, i.e., n = ). In this cse, the choice opertor is dded to G. For instnce, consider the rewriting step (EC4) of Fig. 8. The choice opertor in the rewriting step R is lbelled with ((MAIN, Λ),, ). Therefore, it is evluted for the first time, nd thus, in the left-hnd side stte of the upper rewriting step, node 5 6 (MAIN, 2), which refers to the choice opertor, is dded to G. (Sequentil Composition 1 nd 2) Sequentil Composition 1 is used to evolve process P until it is finished. P is evolved to P which is put into the control. When P successfully finishes (it becomes Ω), hppens. Then, Sequentil Composition 2 is used nd Q is put into the control. The sequentil compo-

17 A Trcking Semntics for CSP 17 sition opertor ; is dded to the grph with successor p tht is the reference to be used in the first node dded in the subderivtion ssocited with Q. (Synchronized Prllelism 1 nd 2) In synchronized prllel composition, both prllel processes cn be intertwiningly executed until synchronized event is found. Therefore, nodes from both processes cn be dded interwoven to the grph. Hence, ech prllelism opertor is lbelled with tuple of the form (α, n 1, n 2 ) s it hppens with externl choices. These rules develop the brnches of the prllelism until they re finished or until they must synchronize. In order to introduce the prllelism opertor into the grph, function FirstEvl is used, s it hppens in the externl choice rules. For instnce, consider the rewriting step (Synchronized Prllelism 3) of Fig. 8. The prllelism opertor in the rewriting step Stte 1 is lbelled with ((MAIN, Λ),, ). Therefore, it is evluted for the first time, nd thus, in the left-hnd side stte of the rewriting step L, node 1 (MAIN, Λ), which 2 refers to the prllelism opertor, is dded to G. (Synchronized Prllelism 3) This rule is used to synchronize the prllel processes. In this cse, both brnches must perform rewriting step with the sme visible (nd synchronized) event. Ech brnch derivtion hs nonempty set of events ( 1, 2 ) to be synchronized (note tht this is set becuse mny prllelisms could be nested). Then, ll references in the sets 1 nd 2 re mutully linked with synchroniztion edges. Both sets re joined to form the new set of synchronized events. (Synchronized Prllelism 4) It is used when none of the prllel processes cn proceed becuse they lredy successfully finished. In this cse, the control becomes Ω indicting the successful termintion of the synchronized prllelism. In the new stte, the new (fresh) reference is r. This rule lso dds to the grph the rcs from ll the prents of the lst references of ech brnch (n 1 nd n 2 ) to r. Here, we use the nottion p to dd n edge from p r to r. Note tht the fct of generting the next reference in ech rule llows (Synchronized Prllelism 4) to connect the finl node of both brnches to the next node. This simplifies other rules such s (Sequentil Composition) tht lredy hs the reference of the node redy. We illustrte this semntics with simple exmple. 3 Exmple 6. Consider gin the specifiction in Exmple 3. Figure 5() shows one possible derivtion (excluding subderivtions) for this exmple. Note tht the underlined prt corresponds to the dditionl rewriting steps performed by the trcking semntics. This derivtion corresponds to the execution of the instrumented semntics with the initil stte (MAIN,, 0, ) shown in Fig. 8. Here, for clrity, ech computtion step is lbelled with the pplied rule; in ech stte, G denotes the current grph. This computtion corresponds to the execution of the right brnch of the choice (i.e., STOP). The finl stte is ( ((MAIN,Λ),9,10), G, 1, ). The finl trck G computed for this execution {} 3 We refer the reder to [16] where nother exmple is discussed.

18 18 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit is depicted in Fig. 5(b) where we cn see tht nodes re numbered with the references generted by the instrumented semntics. Note tht nodes 9 nd 10 were prepred by the semntics (edges to them were produced) but never used becuse the subcomputtions were stopped in STOP. Note lso tht the trck contins ll the prts of the specifiction executed by the semntics. This mens tht if the left brnch of the choice hd been developed (i.e., unfolding the cll to P, thus using rule (Externl Choice 3)), this brnch would lso belong to the trck. (Process Cll) where (MAIN,, 0, ) Stte 1 Stte 1 = (( STOP) {} ((MAIN,Λ),, )(P ( STOP)), G[0 1 (MAIN, 0)], 1, ) (Synchronized Prllelism 3) L R Stte 1 Stte 2 where L = (Prefixing) ( STOP, G[1 2 (MAIN, Λ)], 2, ) (STOP, G[2 3 (MAIN, 1.1), 3 4 (MAIN, 1)], 4, {2}) R = (EC 4) (Prefixing) ( STOP, G[5 6 (MAIN, 2)], 6, ) ((P ((MAIN,Λ),, ) ( STOP)), G[1 5 (MAIN, Λ)], 5, ) (STOP, G[6 7 (MAIN, 2.2.1), 7 8 (MAIN, 2.2)], 8, {6}) (STOP, G, 5, {6}) nd Stte 2 = ((STOP {} ((MAIN,Λ),4,8)STOP), G {2 6}, 1, {2, 6}) (Synchronized Prllelism 1) (STOP) (STOP, G, 4, {2, 6}) (, G[4 9 (MAIN, 1.2)], 9, ) Stte 2 Stte 3 where Stte 3 = ( {} ((MAIN,Λ),9,8)STOP, G, 1, ) (Synchronized Prllelism 2) (STOP) (STOP, G, 8, ) (, G[8 10 (MAIN, 2.2.2)], 10, ) Stte 3 Stte 4 where Stte 4 = ( {} ((MAIN,Λ),9,10), G, 1, ) Fig. 8. An exmple of computtion with the trcking semntics in Fig. 7

19 A Trcking Semntics for CSP 19 5 Correctness In this section we prove the correctness of the trcking semntics (in Fig. 7) by showing tht (i) the computtions performed by the trcking semntics re equivlent to the computtions performed by the stndrd semntics; nd (ii) the grph produced by the trcking semntics is the trck of the derivtion. We lso prove tht the trce of derivtion cn be utomticlly extrcted from the trck of this derivtion. The first theorem shows tht the computtions performed with the trcking semntics re ll nd only the computtions performed with the stndrd semntics. The only difference between them from n opertionl point of view is tht the trcking semntics needs to perform one step when STOP is evluted (to dd its specifiction position to the trck) nd then finishes, while the stndrd semntics finishes without performing ny dditionl step. Theorem 1 (Conservtiveness). Let S be CSP specifiction, P process in S, nd D nd D the derivtions of P performed with the stndrd semntics of CSP nd with the trcking semntics, respectively. Then, the sequence of rules pplied in D nd D is exctly the sme except tht D performs one rewriting step more thn D for ech (sub)computtion tht finishes with STOP. Proof. Firstly, rule (STOP) of the trcking semntics is the only rule tht is not present in the stndrd semntics. When (STOP) is reched in derivtion, the stndrd semntics stops the (sub)computtion becuse no rule is pplicble. In the trcking semntics, when STOP is reched in derivtion, the only rule pplicble is (STOP) which performs nd puts in the control: (STOP α, G, m, ) (, G[m n α], n, ) Then, the (sub)computtion is stopped becuse no rule is pplicble for. Therefore, when the control in the derivtion is STOP, the trcking semntics performs one dditionl rewriting step with rule (STOP). The clim follows from the fct tht both semntics hve exctly the sme number of rules except for rule (STOP), nd these rules hve the sme control in ll the sttes of the rules (thus the trcking semntics is conservtive extension of the stndrd semntics). Therefore, ll derivtions in both semntics hve exctly the sme number of steps nd they re composed of the sme sequences of rewriting steps except for (sub)derivtions finishing with STOP tht perform one rewriting step more (pplying rule (STOP)). The second theorem sttes the correctness of the trcking semntics by ensuring tht the grph produced is the trck of the computtion. To prove this theorem, the following lemms (proven in [16]) re used. Lemm 1. Let S be CSP specifiction, D complete derivtion of S performed with the trcking semntics, nd G the grph produced by D. Then, for ech prefixing ( P ) in the control of the left stte of rewriting step in D, we hve tht Pos() nd Pos() re nodes of G nd Pos() is the successor of Pos().

20 20 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit Lemm 2. Let S be CSP specifiction, D complete derivtion of S performed with the trcking semntics, nd G the grph produced by D. Then, for ech sequentil composition (P ; Q) in the control of the left stte of rewriting step in D, we hve tht lst (P ) nd Pos(; ) re nodes of G nd Pos(; ) is the successor of ll the elements of the set lst (P ) whenever P hs successfully finished. Lemm 3. Let S be CSP specifiction, D complete derivtion of S performed with the trcking semntics, nd G the grph produced by D. Then, for Θ ech rewriting step in D of the form R i i Ri+1 we hve tht: 1. E c contins n edge Pos(R i ) Pos(first(R )) where R Θ R Θ i nd R i first(r ), nd 2. if R i first(r i+1 ) then E c contins n edge Pos(R i ) Pos(first(R i+1 )). Lemm 4. Let S be CSP specifiction, D derivtion of S performed with the trcking semntics, nd G the grph produced by D. Then, there exists synchroniztion edge ( ) in G for ech synchroniztion in D where nd re the nodes of the synchronized events. Theorem 2 (Semntics correctness). Let S be CSP specifiction, D derivtion of S performed with the trcking semntics, nd G the grph produced by D. Then, G is the trck ssocited with D. Proof. In order to prove tht G = (N, E c, E s ) is trck, we need to prove tht it stisfies the properties of Definition 5. For ech R Θ R D nd for ll rewriting steps in Θ we hve 1. E c contins control-flow edge iff with respect to D. This is ensured by the three cluses of Definition 4: by Lemm 1, if R is prefixing ( P ), then E c contins n edge Pos() Pos(); by Lemm 2, if R is sequentil composition (Q; P ), then E c contins n edge p lst (Q), Pos(p) Pos(; ); by Lemm 3, if R first(r Θ ) where R R Θ, then E c contins n edge Pos(R) Pos(first(R )); nd if R first(r ) then E c contins n edge Pos(R) Pos(first(R )); nd 2. by Lemm 4, E s contins synchroniztion edge for ech synchroniztion occurring in the rewriting step where nd re the synchronized events. Moreover, we know tht the only nodes in N re the nodes induced by E c nd E s becuse ll the nodes inserted in G re inserted by connecting the new node to the lst inserted node (i.e., if the current reference is m nd the new fresh reference is n, then the new node is lwys inserted s G[m α]). Hence, ll n nodes re relted by control or synchroniztion edges nd thus the clim holds.

21 A Trcking Semntics for CSP 21 Our lst result sttes tht the trce of derivtion cn be extrcted from its ssocited trck. To prove it, we define first n order on the event nodes of trck tht corresponds to the order in which they were generted by the trcking semntics. Definition 6. (Event node order) Given trck G = (N, E c, E s ) nd nodes m, n N such tht l(m), l(n) Σ, m is smller thn n, represented by m n iff m < n where (m, m ), (n, n ) E c. Intuitively, n event node m is smller thn n event node n if nd only if the successor of m hs reference smller thn the reference of the successor of n. The following lemm is lso necessry to prove tht the order in which events occur in derivtion is directly relted with the order of Definition 6. In the following we consider n ugmented version of derivtion D which includes the event fired by the ppliction of the rule. So, we cn represent derivtion D s P 1 Θ 1 e1... Θj ej P j+1. Θ Lemm 5. Given derivtion D = P 1 1 e1... Θj P j+1 of the trcking semntics, ej nd the trck G = (N, E c, E s ) produced by D, then e i Σ, 1 i j, n N such tht l(n) = e i, nd (n, n ) E c such tht n = n + 1. Therefore, Lemm 5 (proven in [16]) ensures tht the order of Definition 6 corresponds to the order in which the semntics genertes the nodes, becuse ech event is dded to the grph together with new fresh reference for the prefixing opertor. Since references re generted incrementlly, the occurrence of n event e will generte reference which is less thn the reference generted with posterior event e. With this order, we cn esily define trnsformtion to extrct trce from trck bsed on the following proposition: Proposition 1. Given trck G = (N, E c, E s ), the trce induced by G is the sequence of events T = e 1,..., e m tht lbels the ssocited sequence of nodes T = n 1,..., n m (i.e., e i T, n i T, 1 i m, l(n i ) = e i nd e i Σ) where: 1. n i T, 0 < i < m, n i n i+1 2. n N such tht l(n) Σ, if ( n N (n, n ) E s ), then n T 3. n N such tht l(n) Σ, if ( n N (n, n ) E s n n), then n T The proof of this proposition cn be found in [16]. Theorem 3 (Trck correctness). Let S be CSP specifiction, D derivtion of S produced by the sequence of events (i.e., the trce) T = e 1,..., e m, nd G the trck ssocited with D. Then, there exists function f tht extrcts the trce T from the trck G, i.e., f(g) = T.

22 22 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit Proof. Proposition 1 llows to trivilly define function f such tht f(g) = T being G the trck of derivtion D, nd being T the trce of the sme derivtion. For trck G = (N, E c, E s ) we hve tht { {f((ns), Ec, E f((n : ns), E c, E s ) = s )} if ( n N (n, n ) E s n n ) (l(n) : f((ns), E c, E s )) otherwise where list (n : ns) corresponds to the set {n N l(n) Σ} ordered with respect to order of Definition 6. 6 Conclusions This work introduces the first semntics of CSP instrumented for trcking. Therefore, it is n interesting result becuse it cn serve s reference mrk to define nd prove properties such s completeness of sttic nlyses which re bsed on trcks [13 15]. The execution of the trcking semntics produces grph s side effect which is the trck of the computtion. This trck is produced step by step by the semntics, nd thus, it cn be lso used to produce trck of n infinite computtion until it is stopped. The generted trck cn be useful not only for trcking computtions but for debugging nd progrm comprehension. This is due to the fct tht our generted trck lso includes the specifiction positions ssocited with the expressions ppering in the trck. Therefore, trcks could be used to nlyse wht prts of the progrm re executed (nd in wht order) in prticulr computtion. Also, this informtion llows trck viewer tool to highlight the prts of the code tht re executed in ech step. Notble nlyses tht use trcks re [3 5, 1, 13 15]. The introduction of this semntics llows us to dpt these nlyses to CSP. On the prcticl side, we hve implemented tool clled SOC [13] which is ble to utomticlly generte trcks of CSP specifiction. These trcks re lter used for debugging. SOC hs been integrted into the most extended CSP nimtor nd modelchecker ProB [11, 12], tht shows the mturity nd usefulness of this tool nd of trcks. The implementtion, source code nd severl exmples re publicly vilble t: Acknowledgements We wnt to thnk the nonymous referees for mny vluble comments nd useful suggestions. References 1. Brssel, B., Hnus, M., Huch, F., Vidl, G.: A Semntics for Trcing Declrtive Multi-prdigm Progrms. In: Moggi, E., Wrren, D.S. (eds.) 6th ACM SIGPLAN Int l Conf. on Principles nd Prctice of Declrtive Progrmming (PPDP 04), pp ACM, New York, NY, USA (2004)

23 A Trcking Semntics for CSP Brückner, I., Wehrheim, H.: Slicing n Integrted Forml Method for Verifiction. In: Lu, K.K., Bnch, R. (eds.) ICFEM LNCS, vol. 3785, pp Springer, Heidelberg (2005) 3. Chitil, O.: A Semntics for Trcing. In: Arts, T., Mohnen, M. (eds.) 13th Int l Workshop on Implementtion of Functionl Lnguges (IFL 01), pp Ericsson CSL (2001) 4. Chitil, O., Runcimn, C., Wllce, M.: Trnsforming Hskell for Trcing. In: Peñ, R., Arts, T. (eds.) IFL 2002, Revised Selected Ppers. LNCS, vol. 2670, pp Springer, Heidelberg (2003) 5. Chitil, O., Lou, Y.: Structure nd Properties of Trces for Functionl Progrms. Electronic Notes in Theoreticl Computer Science (ENTCS). 176(1), (2007) 6. Ferrnte, J., Ottenstein, K.J., Wrren, J.D.: The Progrm Dependence Grph nd its Use in Optimiztion. ACM Trnsctions on Progrmming Lnguges nd Systems. 9(3), (1987) 7. Hore, C.A.R.: Communicting Sequentil Processes. Prentice-Hll, Upper Sddle River, NJ, USA (1985) 8. Kvi, K.M., Sheldon, F.T., Shirzi, B., Hurson, A.R.: Relibility nlysis of CSP specifictions using Petri nets nd Mrkov processes. In: 28th Annul Hwii Int l Conf. on System Sciences (HICSS 95), vol. 2 (Softwre Technology), pp IEEE Computer Society, Wshington, DC, USA (1995) 9. Krinke, J.: Context-Sensitive Slicing of Concurrent Progrms. ACM SIGSOFT Softwre Engineering Notes. 28(5) (2003) 10. Ldkin, P., Simons, B.: Sttic Dedlock Anlysis for CSP-Type Communictions. Responsive Computer Systems (Chpter 5), Kluwer Acdemic Publishers (1995) 11. Leuschel, M., Butler, M.: ProB: n utomted nlysis toolset for the B method. Journl of Softwre Tools for Technology Trnsfer. 10(2), (2008) 12. Leuschel, M., Fontine, M.: Probing the depths of CSP-M: A new FDR-complint vlidtion tool. In: Liu, S., Mibum, T., Arki, K. (eds.) ICFEM LNCS, vol. 5256, pp Springer, Heildeberg (2008) 13. Leuschel, M., Llorens, M., Oliver, J., Silv, J., Tmrit, S.: SOC: Slicer for CSP Specifictions. In: Puebl, G., Vidl, G. (eds.) 2009 ACM SIGPLAN Symposium on Prtil Evlution nd Semntics-bsed Progrm Mnipultion (PEPM 09), pp ACM, New York, NY, USA (2009) 14. Leuschel, M., Llorens, M., Oliver, J., Silv, J., Tmrit, S.: The MEB nd CEB Sttic Anlysis for CSP Specifictions. In: Hnus, M. (ed.) LOPSTR 2008, Revised Selected Ppers. LNCS, vol. 5438, pp Springer, Heildeberg (2009) 15. Llorens, M., Oliver, J., Silv, J., Tmrit, S.: An Algorithm to Generte the Context-sensitive Synchronized Control Flow Grph. In: 25th ACM Symposium on Applied Computing (SAC 2010) (to pper). ACM, New York, NY, USA (2010) 16. Llorens, M., Oliver, J., Silv, J., Tmrit, S.: A Trcking Semntics for CSP (Extended Version). Technicl report, DSIC-II/03/10, Universidd Politécnic de Vlenci (Mrch 2010) 17. Roscoe, A.W.: The Theory nd Prctice of Concurrency. Prentice Hll, Upper Sddle River, NJ, USA (2005) 18. Tip, F.: A survey of progrm slicing techniques. Journl of Progrmming Lnguges. 3, (1995) 19. Weiser, M.D.: Progrm Slicing. IEEE Trnsctions on Softwre Engineering. 10(4), (1984)

Informe Técnico / Technical Report

Informe Técnico / Technical Report DEPARTAMENTO DE SISTEMAS INFORMÁTICOS Y COMPUTACIÓN UNIVERSIDAD POLITÉCNICA DE VALENCIA P.O. Box: 22012 E-46071 Vlenci (SPAIN) Informe Técnico / Technicl Report Ref. No.: DSIC-II/03/10 Pges: 30 Title:

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

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

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

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

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

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

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

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

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

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

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

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

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

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

Infinite Geometric Series

Infinite Geometric Series Infinite Geometric Series Finite Geometric Series ( finite SUM) Let 0 < r < 1, nd let n be positive integer. Consider the finite sum It turns out there is simple lgebric expression tht is equivlent to

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

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

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

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

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

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

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

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

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes Jim Lmbers MAT 169 Fll Semester 2009-10 Lecture 4 Notes These notes correspond to Section 8.2 in the text. Series Wht is Series? An infinte series, usully referred to simply s series, is n sum of ll of

More information

SYDE 112, LECTURES 3 & 4: The Fundamental Theorem of Calculus

SYDE 112, LECTURES 3 & 4: The Fundamental Theorem of Calculus SYDE 112, LECTURES & 4: The Fundmentl Theorem of Clculus So fr we hve introduced two new concepts in this course: ntidifferentition nd Riemnn sums. It turns out tht these quntities re relted, but it is

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

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

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

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

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or

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

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

Section 6.1 INTRO to LAPLACE TRANSFORMS

Section 6.1 INTRO to LAPLACE TRANSFORMS Section 6. INTRO to LAPLACE TRANSFORMS Key terms: Improper Integrl; diverge, converge A A f(t)dt lim f(t)dt Piecewise Continuous Function; jump discontinuity Function of Exponentil Order Lplce Trnsform

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

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

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

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

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

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

4.4 Areas, Integrals and Antiderivatives

4.4 Areas, Integrals and Antiderivatives . res, integrls nd ntiderivtives 333. Ares, Integrls nd Antiderivtives This section explores properties of functions defined s res nd exmines some connections mong res, integrls nd ntiderivtives. In order

More information

Review of basic calculus

Review of basic calculus Review of bsic clculus This brief review reclls some of the most importnt concepts, definitions, nd theorems from bsic clculus. It is not intended to tech bsic clculus from scrtch. If ny of the items below

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

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

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

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

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

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

and that at t = 0 the object is at position 5. Find the position of the object at t = 2.

and that at t = 0 the object is at position 5. Find the position of the object at t = 2. 7.2 The Fundmentl Theorem of Clculus 49 re mny, mny problems tht pper much different on the surfce but tht turn out to be the sme s these problems, in the sense tht when we try to pproimte solutions we

More information

1.9 C 2 inner variations

1.9 C 2 inner variations 46 CHAPTER 1. INDIRECT METHODS 1.9 C 2 inner vritions So fr, we hve restricted ttention to liner vritions. These re vritions of the form vx; ǫ = ux + ǫφx where φ is in some liner perturbtion clss P, for

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

Week 10: Line Integrals

Week 10: Line Integrals Week 10: Line Integrls Introduction In this finl week we return to prmetrised curves nd consider integrtion long such curves. We lredy sw this in Week 2 when we integrted long curve to find its length.

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

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

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite Unit #8 : The Integrl Gols: Determine how to clculte the re described by function. Define the definite integrl. Eplore the reltionship between the definite integrl nd re. Eplore wys to estimte the definite

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

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

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

Theoretical foundations of Gaussian quadrature

Theoretical foundations of Gaussian quadrature Theoreticl foundtions of Gussin qudrture 1 Inner product vector spce Definition 1. A vector spce (or liner spce) is set V = {u, v, w,...} in which the following two opertions re defined: (A) Addition of

More information

Math 1B, lecture 4: Error bounds for numerical methods

Math 1B, lecture 4: Error bounds for numerical methods Mth B, lecture 4: Error bounds for numericl methods Nthn Pflueger 4 September 0 Introduction The five numericl methods descried in the previous lecture ll operte by the sme principle: they pproximte the

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

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

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

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems Centrum voor Wiskunde en Informtic REPORTRAPPORT Supervisory control for nondeterministic systems A. Overkmp Deprtment of Opertions Reserch, Sttistics, nd System Theory BS-R9411 1994 Supervisory Control

More information

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 7

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 7 CS 188 Introduction to Artificil Intelligence Fll 2018 Note 7 These lecture notes re hevily bsed on notes originlly written by Nikhil Shrm. Decision Networks In the third note, we lerned bout gme trees

More information

Numerical integration

Numerical integration 2 Numericl integrtion This is pge i Printer: Opque this 2. Introduction Numericl integrtion is problem tht is prt of mny problems in the economics nd econometrics literture. The orgniztion of this chpter

More information

Recitation 3: More Applications of the Derivative

Recitation 3: More Applications of the Derivative Mth 1c TA: Pdric Brtlett Recittion 3: More Applictions of the Derivtive Week 3 Cltech 2012 1 Rndom Question Question 1 A grph consists of the following: A set V of vertices. A set E of edges where ech

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

Math& 152 Section Integration by Parts

Math& 152 Section Integration by Parts Mth& 5 Section 7. - Integrtion by Prts Integrtion by prts is rule tht trnsforms the integrl of the product of two functions into other (idelly simpler) integrls. Recll from Clculus I tht given two differentible

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

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

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

Chapter 14. Matrix Representations of Linear Transformations

Chapter 14. Matrix Representations of Linear Transformations Chpter 4 Mtrix Representtions of Liner Trnsformtions When considering the Het Stte Evolution, we found tht we could describe this process using multipliction by mtrix. This ws nice becuse computers cn

More information

Notes on specifying systems in EST

Notes on specifying systems in EST Robert Meolic, Ttjn Kpus: Notes on specifying systems in EST 1 Notes on specifying systems in EST Robert Meolic, Ttjn Kpus Fculty of EE & CS University of Mribor Robert Meolic, Ttjn Kpus: Notes on specifying

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

Math 8 Winter 2015 Applications of Integration

Math 8 Winter 2015 Applications of Integration Mth 8 Winter 205 Applictions of Integrtion Here re few importnt pplictions of integrtion. The pplictions you my see on n exm in this course include only the Net Chnge Theorem (which is relly just the Fundmentl

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

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

Process Algebra CSP A Technique to Model Concurrent Programs

Process Algebra CSP A Technique to Model Concurrent Programs Process Algebr CSP A Technique to Model Concurrent Progrms Jnury 15, 2002 Hui Shi 1 Contents CSP-Processes Opertionl Semntics Trnsition systems nd stte mchines Bisimultion Firing rules for CSP Model-Checker

More information

Chapter 0. What is the Lebesgue integral about?

Chapter 0. What is the Lebesgue integral about? Chpter 0. Wht is the Lebesgue integrl bout? The pln is to hve tutoril sheet ech week, most often on Fridy, (to be done during the clss) where you will try to get used to the ides introduced in the previous

More information

The practical version

The practical version Roerto s Notes on Integrl Clculus Chpter 4: Definite integrls nd the FTC Section 7 The Fundmentl Theorem of Clculus: The prcticl version Wht you need to know lredy: The theoreticl version of the FTC. Wht

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

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

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

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

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

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

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

Administrivia CSE 190: Reinforcement Learning: An Introduction

Administrivia CSE 190: Reinforcement Learning: An Introduction Administrivi CSE 190: Reinforcement Lerning: An Introduction Any emil sent to me bout the course should hve CSE 190 in the subject line! Chpter 4: Dynmic Progrmming Acknowledgment: A good number of these

More information

5.5 The Substitution Rule

5.5 The Substitution Rule 5.5 The Substitution Rule Given the usefulness of the Fundmentl Theorem, we wnt some helpful methods for finding ntiderivtives. At the moment, if n nti-derivtive is not esily recognizble, then we re in

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

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

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

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

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

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

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

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