Informe Técnico / Technical Report

Size: px
Start display at page:

Download "Informe Técnico / Technical Report"

Transcription

1 DEPARTAMENTO DE SISTEMAS INFORMÁTICOS Y COMPUTACIÓN UNIVERSIDAD POLITÉCNICA DE VALENCIA P.O. Box: E Vlenci (SPAIN) Informe Técnico / Technicl Report Ref. No.: DSIC-II/03/10 Pges: 30 Title: A Trcking Semntics for CSP (Extended Version) Author(s): M. Llorens, J. Oliver, J. Silv nd S. Tmrit Dte: Mrch, 2010 Keywords: Concurrency, CSP, Semntics, Trce V o B o Leder of reserch Group Author(s)

2

3 A Trcking Semntics for CSP (Extended Version) 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 the restrictions imposed on this order by 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 t n dequte level of bstrction. Given n execution, its trck is more informtive thn its 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. 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, 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

4 2 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 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, 16] whose opertionl semntics llows the combintion of prllel, non-deterministic nd non-terminting processes. The study nd trnsformtion of CSP specifictions often uses different nlyses such s dedlock nlysis [10], relibility nlysis [8] nd progrm slicing [18] 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 [16] 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 1 We refer those reders non fmilir with CSP syntx to Section 2 where we provide brief introduction to CSP.

5 A Trcking Semntics for CSP (Extended Version) 3 MAIN CASINO CROUPIER PLAYER ROULETTE betred betred blck blck prize STOP prize STOP STOP Fig. 1. Trck of the progrm in Exmple 1 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. 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 [17] 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

6 4 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 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 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

7 A Trcking Semntics for CSP (Extended Version) 5 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. 2 The Syntx nd Semntics of CSP 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. We now recll the stndrd opertionl semntics of CSP s defined by Roscoe [16]. 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

8 6 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 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 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 Q. X

9 A Trcking Semntics for CSP (Extended Version) 7 (Synchronized Prllelism 4) When both processes hve successfully terminted the control becomes Ω, performing the event. (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

10 8 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 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. (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

11 A Trcking Semntics for CSP (Extended Version) 9 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 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)

12 10 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 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) [17] 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) β = ; 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.

13 A Trcking Semntics for CSP (Extended Version) 11 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 ). 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

14 12 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit. 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 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. 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

15 A Trcking Semntics for CSP (Extended Version) 13 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 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 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.

16 14 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 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 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 2 We ssume tht fresh references re numeric nd generted incrementlly.

17 A Trcking Semntics for CSP (Extended Version) 15 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. (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 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

18 16 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit (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 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 composition 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.

19 A Trcking Semntics for CSP (Extended Version) 17 (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 (Synchronized Prllelism 4) RewritingStep 2 = (P 2, G 2, n 2, ) (P 2, G 2, n 2, 2) (G 2, n 2 ) = FirstEvl(G, n2, m, α) (Ω X (α,n 1,n 2 ) Ω, G, m, ) (Ω, G, r, ) where G = G[{p p G where q {n r q 1, n 2}}] Fig. 7. An instrumented opertionl semntics to generte CSP trcks (cont.) (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.

20 18 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit (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 r to dd n edge from p 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. 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 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. We show nother exmple whose execution finishes with dedlock nd where non-terminting process ppers. Exmple 7. Consider the following CSP specifiction where ech (sub)process hs been lbelled with its ssocited specifiction position (underlining). MAIN (MAIN,0) P (P,0) = (MAIN,1.1) (MAIN,1) (MAIN,1.2.1) (MAIN,1.2) STOP (MAIN,1.2.2) (MAIN,Λ)P (MAIN,2) {} = (P,1) (P,Λ) P (P,2) We use the initil stte (MAIN,, 0, ) to execute the semntics nd get the computtion of Fig. 10. The finl stte is ( ((MAIN,Λ),14,15)( P), G, 1, ). The {} finl trck G computed is the grph of Fig. 9.

21 A Trcking Semntics for CSP (Extended Version) 19 (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 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

22 20 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 0 MAIN MAIN,0 1 MAIN,Λ 4 MAIN,1.1 P MAIN,2 2 5 MAIN,1 P,1 3 6 MAIN,1.2.1 P,Λ 7 10 MAIN,1.2 P P, STOP MAIN,1.2.2 P,1 9 P,Λ 12 P P,2 13 Fig. 9. Trck of the progrm in Exmple 7 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

23 A Trcking Semntics for CSP (Extended Version) 21 (Process Cll) (MAIN,, 0, ) Stte 1 where Stte 1 = (( STOP ((MAIN,Λ),, )P), G[0 (MAIN, 0)], 1, ) {} 1 (Syncronized Prllelism 2) (Process Cll) (P, G[1 2 (MAIN, Λ)], 2, ) ( P, G[2 (MAIN, 2)], 3, ) 3 Stte 1 Stte 2 where Stte 2 = (( STOP ((MAIN,Λ),,3) P), G, 1, ) {} L R (Synchronized Prllelism 3) Stte 2 Stte 3 where L =(Pref) ( STOP, G[1 4 (MAIN, Λ)], 4, ) ( STOP, G[4 (MAIN, 1.1), 5 (MAIN, 1)], 6, {4}) 5 6 R = (Pref) ( P, G, 3, ) (P, G[3 7 (P, 1), 7 8 (P, Λ)], 8, {3}) nd Stte 3 = ( STOP ((MAIN,Λ),6,8)P, G {4 3}, 1, {4, 3}) {} (Syncronized Prllelism 2) (Process Cll) (P, G, 8, {4, 3}) (( P), G[8 (P, 2)], 9, ) 9 Stte 3 Stte 4 where Stte 4 = (( STOP) ((MAIN,Λ),6,9)( P), G, 1, ) {} L R (Synchronized Prllelism 3) Stte 4 Stte 5 where L = (Pref) ( STOP, G, 6, ) (STOP, G[6 10 (MAIN, 1.2.1), (MAIN, 1.2)], 11, {6}) R = (Pref) ( P, G, 9, ) P, G[9 12 (P, 1), (P, Λ)], 13, {9}) nd Stte 5 = (STOP ((MAIN,Λ),11,13)P, G {9 6}, 1, {6, 9}) {} (Syncronized Prllelism 1) (Syncronized Prllelism 2) (STOP) (STOP, G, 11, {6, 9}) (, G[11 (MAIN, 1.2.2)], 14, ) 14 Stte 5 Stte 6 where Stte 6 = ( ((MAIN,Λ),14,13)P), G, 1, ) {} (Process Cll) (P, G, 13, ) (( P), G[13 (P, 2)], 15, ) 15 Stte 6 Stte 7 where Stte 7 = ( ((MAIN,Λ),14,15)( P), G, 1, ) {} Fig. 10. Computtion of Exmple 7 with the trcking semntics in Fig. 7

24 22 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit 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 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(). Proof. If prefixing P is in the control of the left stte of rewriting step, following the trcking semntics, only the rule (Prefixing) cn be pplied. By definition of this rule, m is the reference of the current node in G. The rule (Prefixing) dds two new nodes to the grph: n nd p. The node m is lbelled with the specifiction position of event nd hs successor n. The node n is lbelled with the specifiction position of opertor nd hs prent m nd successor p ( fresh reference). Therefore, we hve tht Pos() nd Pos( ) re nodes of G nd Pos( ) is the successor of Pos(). Auxiliry Lemm 1. Given derivtion D, for ech rewriting step R Θ R in D with R Ω nd R, lst (R) = lst (R ). Proof. We prove this lemm by induction on the length of Θ. In the bse cse, Θ is empty, nd thus only the rules (Process Cll), (Prefixing), (Internl Choice 1 nd 2) nd (Synchronized Prllelism 4) cn be pplied. In ll cses, the lemm holds trivilly by the definition of lst. We ssume s the induction hypothesis tht the lemm holds for non-empty Θ i with i > 0 rewriting steps; nd prove tht the lemm lso holds for Θ i+1 with i + 1 rewriting steps. We cn ssume tht Θ i+1 = R Θ R, thus, we hve to prove tht the lemm holds for ny possible R nd R. The possible cses re the following: (Externl Choice 1 nd 2) This cse is trivil becuse the specifiction positions of R nd R re the sme. Hence, lst (R) = lst (R ). (Externl Choice 3 nd 4) Both cses re similr. Thus, we only discuss (Externl Choice 3). In the cse of (Externl Choice 3), lst (P 1 P 2 ) = lst (P 1 ). This rule puts P in the control, nd we know by the induction hypothesis tht lst (P 1 ) = lst (P ) nd, thus, the lemm holds. (Sequentil Composition 1) This cse is nlogous to (Externl Choice 1 nd 2). (Sequentil Composition 2) lst (P ; Q) = lst (Q). Therefore the lemm holds trivilly by the definition of lst. (Synchronized Prllelism 1, 2 nd 3) It is the sme cse s (Externl Choice 1 nd 2).

25 A Trcking Semntics for CSP (Extended Version) 23 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. Proof. If sequentil composition (P ; Q) is in the left stte of the control of rewriting step, following the trcking semntics, only the rules (Sequentil Composition 1) nd (Sequentil Composition 2) cn be pplied. (Sequentil Composition 1) is only used to evolve process P until it is finished. The ppliction of this rule is only possible with ny event except, remining the sequentil composition opertor in the control. (Sequentil Composition 2) cn only be used when hppens nd thus Ω is left in the control. Therefore, when P hs successfully finished evolving to Ω nd with m s the new reference, (Sequentil Composition 2) is pplied. This rule dds to the grph new node n lbelled with the specifiction position of ; tht hs successor p ( fresh reference). Therefore, we hve tht Pos(; ) is node of G nd Pos(; ) is the successor of the node m. Then, we hve to prove tht lst (P ) is set of nodes of the grph dded before P successfully finished with reference m nd its successor is n. We prove this clim by induction on the length of the derivtion P Θ0... Θn Ω, n 0. The bse cse hppens when the lst rewriting step of the derivtion is done leving Ω in the control. Only these rules cn be used: (SKIP) In this cse, m SKIP is dded to G nd n is the new reference. Becuse n lst (SKIP) = {SKIP}, therefore, the clim follows. (Externl Choice 3) Here, lst (P 1 P 2 ) = lst (P 1 ). This rule puts P in the control which is Ω by the conditions of the lemm. Therefore, there must be SKIP, which is lst (P ), t the top of Θ becuse we know tht the derivtion successfully finishes nd thus Θ is finite. (Externl Choice 4) It is nlogous to the previous cse, but here lst (P 1 P 2 ) = lst (P 2 ). (Synchronized Prllelism 4) lst (P 1 P 2 ) = lst (P 1 ) lst (P 2 ). The prents of the lst nodes of P 1 nd P 2 re connected to the new reference r. Therefore the clim follows. The induction hypothesis sttes tht for ll rewriting step R Θ R, R Ω in the derivtion Q Θ0... Θn Ω, n 0 where P Θ Q D, lst (P ) is put in the control of further rewriting step of the derivtion together with its reference. Θ Then, we prove tht this lso holds for the previous rewriting step R 0 R. Only rules tht do not perform could be pplied (becuse puts Ω in the control of the right stte nd now, we re not considering the finl rewriting step). (STOP) This rule could not be pplied becuse it puts in the control. There is no rule for thus, if pplied, P could not successfully finished.

26 24 Mris Llorens, Jvier Oliver, Josep Silv, nd Slvdor Tmrit (Process Cll), (Prefixing) nd (Internl Choice 1 nd 2) In these rules R is put in the control of the finl stte together with its reference. We know by Auxiliry Lemm 1 tht lst (R 0 ) = lst (R) thus, the clim follows by the induction hypothesis. (Externl Choice 1 nd 2) Both rules keep the process in the control nd the sme references, thus the clim follows by the induction hypothesis. (Externl Choice 3 nd 4) In this cse, lst (P 1 P 2 ) = lst (P 1 ). This rule puts P in the control, nd we know by Auxiliry Lemm 1 tht lst (P 1 ) = lst (P ), thus the lemm holds by the induction hypothesis. (Sequentil Composition 1 nd 2) We know tht P successfully finished, thus (Sequentil Composition 1) is pplied number of times before (Sequentil Composition 2), tht puts Q in the control. We know tht lst (P ; Q) = lst (Q) thus, the clim holds by the induction hypothesis. (Synchronized Prllelism 4) lst (P 1 P 2 ) = lst (P 1 ) lst (P 2 ). The prents of the lst nodes of P 1 nd P 2 re connected to the new reference r. Therefore the clim follows. In the following lemm, we need to extend the notion of rewriting step by including the grph reference to ech expression. Therefore, we will use extended rewriting step denoted with (R, m) Θ (R, m ). Auxiliry 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 extended rewriting step in D of the form (R, m) Θ (R, m ) which is not ssocited with (Synchronized Prllelism 4) we hve tht node for f irst(r) is dded to G with reference m. Proof. We prove the lemm for ech rule: (SKIP), (STOP), (Prefixing), (Process Cll), nd (Internl Choice 1 nd 2) A node for first(r) (in these rules α) is dded to G with reference m. (Externl Choice 1, 2, 3 nd 4) nd (Synchronized Prllelism 1, 2 nd 3) In these rules, the node ssocited with first(r) (it is α here) could be included or not, depending on whether it hs been included by previous rewriting step. If it is lredy included, it is due to the specifiction position of the previous expression in the control is the sme s R, nd its ssocited rewriting step or previous one hs dded it. If other cse, function FirstEvl is clled nd it includes the node for R with reference m, since the corresponding n 1 nd n 2 re equl to. (Sequentil Composition 1 nd 2) In both rules, the node for first(r) (in this cse first(p )) is included by rewriting step in Θ. All possible rewriting steps must pply one of these previous rules, nd thus, the clim recursively follows. 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:

A Tracking Semantics for CSP

A Tracking Semantics for CSP 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-46022 Vlenci, Spin {mllorens,fjoliver,jsilv,stmrit}@dsic.upv.es Abstrct.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 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

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

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

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

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

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

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

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

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

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

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

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 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir CSCI 2400 Models of Computtion, Section 3 Solutions to Homework 4 Problem 1. ll the solutions below refer to the Pumping Lemm of Theorem 4.8, pge 119. () L = f n b l k : k n + lg Let's ssume for contrdiction

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

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

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

DIRECT CURRENT CIRCUITS

DIRECT CURRENT CIRCUITS DRECT CURRENT CUTS ELECTRC POWER Consider the circuit shown in the Figure where bttery is connected to resistor R. A positive chrge dq will gin potentil energy s it moves from point to point b through

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

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

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

3 Regular expressions

3 Regular expressions 3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

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

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1 Non-Deterministic Finite Automt Fll 2018 Costs Busch - RPI 1 Nondeterministic Finite Automton (NFA) Alphbet ={} q q2 1 q 0 q 3 Fll 2018 Costs Busch - RPI 2 Nondeterministic Finite Automton (NFA) Alphbet

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

4 7x =250; 5 3x =500; Read section 3.3, 3.4 Announcements: Bell Ringer: Use your calculator to solve

4 7x =250; 5 3x =500; Read section 3.3, 3.4 Announcements: Bell Ringer: Use your calculator to solve Dte: 3/14/13 Objective: SWBAT pply properties of exponentil functions nd will pply properties of rithms. Bell Ringer: Use your clcultor to solve 4 7x =250; 5 3x =500; HW Requests: Properties of Log Equtions

More information

Harvard University Computer Science 121 Midterm October 23, 2012

Harvard University Computer Science 121 Midterm October 23, 2012 Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is

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

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

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

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

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

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 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

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

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

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

Read section 3.3, 3.4 Announcements:

Read section 3.3, 3.4 Announcements: Dte: 3/1/13 Objective: SWBAT pply properties of exponentil functions nd will pply properties of rithms. Bell Ringer: 1. f x = 3x 6, find the inverse, f 1 x., Using your grphing clcultor, Grph 1. f x,f

More information

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer Divisibility In this note we introduce the notion of divisibility for two integers nd b then we discuss the division lgorithm. First we give forml definition nd note some properties of the division opertion.

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

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

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