14.08.2013 Views

Reactive Systems: Modelling, Specification and Verification - Cs.ioc.ee

Reactive Systems: Modelling, Specification and Verification - Cs.ioc.ee

Reactive Systems: Modelling, Specification and Verification - Cs.ioc.ee

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.2. CCS, FORMALLY 21<br />

(the corresponding action ‘tea’ or ‘coff<strong>ee</strong>’ is executed) <strong>and</strong> the internal state of the<br />

machine changes accordingly to p1 or p2. Formally, this can be described by the<br />

transitions<br />

p tea<br />

→ p1 <strong>and</strong> p coff<strong>ee</strong><br />

→ p2 .<br />

The target state p1 records that the customer has requested tea, whereas p2 describes<br />

the situation in which coff<strong>ee</strong> has b<strong>ee</strong>n selected.<br />

Now the customer is asked to insert the corresponding amount of money, let us<br />

say one euro for a cup of tea <strong>and</strong> two euros for a cup of coff<strong>ee</strong>. This is reflected<br />

by corresponding changes in the control state of the vending machine. These state<br />

changes can be modelled by the transitions<br />

p1 1C=<br />

→ p3 <strong>and</strong> p2 2C=<br />

→ p3 ,<br />

whose target state p3 records that the machine has received payment for the chosen<br />

drink.<br />

Finally, the drink is collected <strong>and</strong> the machine returns to its initial state p, ready<br />

to accept the request of another customer. This corresponds to the transition<br />

p3 collect<br />

→ p .<br />

It is often convenient <strong>and</strong> suggestive to use a graphical representation for labelled<br />

transition systems. The following picture represents the tea/coff<strong>ee</strong> machine described<br />

above.<br />

p1<br />

p<br />

tea<br />

<br />

<br />

<br />

coff<strong>ee</strong><br />

<br />

<br />

<br />

<br />

<br />

<br />

1C= <br />

2C=<br />

<br />

<br />

<br />

<br />

collect<br />

p3<br />

Sometimes, when referring only to the process p, we do not have to give names to<br />

the other process states (in our example p1, p2 <strong>and</strong> p3) <strong>and</strong> it is sufficient to provide<br />

the following labelled transition system for the process p.<br />

p2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!