Introduction to LOTOS

# Introduction to LOTOS

## Introduction to LOTOS

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. Introduction to LOTOS • A LOTOS process is built up from events. • An event is • unstructured - just a (gate) name • e.g. g, a, send, open • structured - a name with a data offer • e.g. • g!1 - offer the value 1 at gate g • g?x:N - offer to accept any value of sort • N, bind it to variable x • g?y:N[y<10] - offer to accept any • number less than 10, bind it to • variable y

2. Behaviour expressions Prefix a; P - offer event a and then behave like process P. - n.b. a is an event, P is a process. Choice P1 [] P2 - behave like process P1 or process P2. Termination stop or exit(…) - stop is deadlock - exit is “graceful” termination: d;stop - exit may have data values associates Basic Operations

3. Process Definition process Buffer[in,out](k:Nat) := body endproc -Buffer is process name - […] is list of gates/events as formal parameters - (…) is list of data as formal parameters - body is behaviour expression Basic Operations

4. Semantics A LOTOS process/behaviour expression denotes a labelled transition system. The lts is defined by a set of axioms and inference rules. Axioms a; P a P g!n;P gn P g?x:Nat; P g1 P g2 P g3 P ...

5. More on Choice [] represents non-deterministic choice the environment resolves the non-determinisim. Does a; (b;stop [] c; stop) behave the same as a; b; stop [] a; c; stop ? This is a crucial question. View processes as trees. a a a b c b c When are two processes equivalent?

6. Bisimulation for LOTOS • An LTS consists of • States S • An initial state S0 • A set of labels L • A labelled transition relation -> on LxSxS E.g. g!n; P gn P Defn A strong bisimulation ~ is a binary relation on LTS’s. P and Q are strong bisimilar if P0 ~ Q0 , for all a in Act, where • if P a P’then there exists Q’ s.t. Q a Q’ and P’ ~ Q’. • if Q a Q’then there exists P’ s.t. P a P’ and P’ ~ Q’. a a a a a a b c b c b b b

7. Recursion A process can be recursive. E.g. Process P[a] :noexit := a;P a process Buffer[in,out] :noexit := in; out; Buffer[in,out] in out NB mutual recursion is allowed.

8. Parallelism Independent parallelism ||| Eg. P ||| Q. P a P’ ----------------------------------- and v.v. P ||| Q a P’ ||| Q e.g. Buffer[ain,aout] ||| Buffer[bin,bout] arbitrary interleaving of events.

9. Parallelism Dependent parallelism || Eg. P || Q. P a P’ Q a Q’ ----------------------------------- P || Q a P’ || Q’ complete dependence.

10. Example A[a,b,c,d] || B[a,b,c,d] when A is a; (b; stop [] c; stop) B is a; (c; stop [] b;stop) A is a; (b; stop [] c; stop) B is a; c; stop A is a; (b; stop [] c; stop) B is b; a;stop

11. Parallelism General parallelism |[…]| Eg. P |[g]| Q. P a P’ Q a Q’ ----------------------------------------- a e {g1,…,gn} P |[g1,…,gn]| Q a P’ | |[g1,…,gn]| | Q’ P a P’ ----------------------------------------- a e {g1,…,gn} P |[g1,…,gn]| Q a P’ | |[g1,…,gn]| | Q (and v.v.)

12. Example 2 one-slot buffers to make 1 two-slot buffer process Buffer2slot[in,out,mid] : noexit := Buffer1[in,mid] |[mid]| Buffer1[mid,out] endproc where process Buffer1[in1,out1]:noexit := in1?x:Nat; out1!x; Buffer1[in1,out1] endproc in Buffer1 Buffer1 out mid is an internal gate.

13. Example A[a,b,c,d] |[..]| B[a,b,c,d] when A is a; (b; stop [] c; stop) B is a; (c; stop [] b;stop) … is [a,b,c] … is [b,c] A is a; (b; stop [] c; stop) B is b; stop … is [a,b,c] … is [b,c] … is [c] … is [b]