
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Reading. Read §4 of RS:MSV.
You may work singly or in pairs on it. If you work with someone else, turn in a single assignment with both names on it.
Exercise 1 (24 points). Consider the following process definitions:
A def = a.A′^ B def = c.B′^ A′^ def = c.A B′^ def = b.B
Give formal derivations for each of the following transitions:
(a) (A′^ + B′)[b/c] b → A[b/c]
(b) (A|B) { c }[c/a] → τ (A′|B) { c }[c/a]
(c) b.a. 0 + (B|A′) { c } → τ (B′|A) { c }
(Recall that [x/y] is shorthand for the substitution function f = { y 7 → x }.)
Exercise 2 (6 points). IMCCS, page 26, Exercise 4.6. Draw at least 5 states of the process, and label each node of the graph with the correspond- ing process term. You need not answer the finite-automaton question. (Note: CWB seems to get the wrong answer for this problem.) Also, recall that f (^1 )^ = f and f (k+^1 )^ = f ◦ f (k)^ = f ◦ · · · ◦ f ︸ ︷︷ ︸ (k + 1 )-many f ’s
Exercise 3 (15 points). IMCCS, page 27, Exercise 4.7 (parts 1 and 2 only). You need not answer the “Would the behavior change” question. If you want, you may use CWB for these questions.
Exercise 4 (15 points). Use CWB to implement the process FMutex from Part 3 of Exercise 4.7 (see previous question), using exactly the actions and format given in the statement of the exercise. Generate the text-mode transition graph of FMutex using the CWB command graph.
Exercise 5 (30 points). A particular driver is so enamored of his new car that he is content to drive (and drive and drive and drive, possibly forever), unless he sees the flashing lights (flash) of a railroad crossing. At that point, the driver makes a conscious decision between:
Option 1: The driver will stop, wait for the gate to go down (gateDown) and then back up (gateUp), resume driving, cross the tracks, and then begin the entire driving scenario all over again.
Option 2: The driver will speedUp. If the driver happens to be lucky, he will manage to cross the tracks, and then see (via his rearview mir- ror) the gate go down (gateDown) and back up (gateUp) again; he then begins the entire driving scenario all over again. (Sadly, he won’t necessarily learn from this experience.) On the other hand, if the driver happens to be unlucky, the gate will go down (gateDown), and the driver will crash, putting an immedi- ate end to the driving excursion.
N.B. The driver has no control over whether he’s lucky or unlucky: only fate (actually, FATE—see below) makes that determination. Use CWB to implement and analyze the preceding scenario, as follows.
(a) Implement a CCS process DRIVER to describe the driver’s behavior, using the actions: drive, flash, stop, speedUp, gateDown, gateUp, resume, cross, lucky, unlucky, crash, plus τ (as warranted).
(b) Implement a CCS process FATE, whose sole purpose is to make re- peated choices between lucky and unlucky circumstances.
(c) Define CROSSING def = flash.gateDown.train.gateUp.CROSSING and generate the transition graph (using either graph or the daVinci ap- plication) of:
(DRIVER|(FATE|CROSSING)) { flash, gateUp, gateDown, lucky, unlucky }