Solutions to all three questions of the examination dated 1 June 2015. The cover permits answers to two questions.[ref]
Throughout, is the visible CSP event alphabet, is a CSP internal action, and has no transitions. There is no successful termination event. Write when implementation refines specification in model : the implementation's recorded behaviours are contained in the specification's. We use , and for the CSP traces model, CSP stable-failures model and CSP failures-divergences model.
The unique fixed point principle says that a suitably guarded recursion has a unique solution in the chosen CSP semantic model. In particular, for a guarded process expression ,
The same principle applies to a mutually recursive system: two tuples satisfying the same guarded equations are componentwise equal. Thus an algebraic proof may show that a candidate satisfies the defining equations, instead of comparing arbitrarily long executions individually.
A guarded recursion must make visible progress before re-entering its recursive dependency. For an equation built from CSP prefixing and CSP choice, the usual sufficient condition is that every recursive occurrence lies behind a visible CSP prefixing operation. For mutually recursive equations, every dependency cycle must pass such a guard. The guard must survive enclosing operators: an event subsequently removed by CSP hiding does not provide visible progress. Equivalently, in the usual semantic formulation the recursion functional must be contractive in observable depth. Merely seeing an arrow somewhere before the variable is insufficient.
Take a fresh CSP event and define
The apparent guard is removed by CSP hiding. Each unfolding can perform a CSP internal action and return to the same situation without any visible CSP event. Operationally this is an infinite internal loop, a CSP divergence, so the equation is not a guarded recursion. This is precisely why a syntactic test that counts every occurrence of would be wrong.
Let . In this CSP alphabetized parallel composition, require both participants, belongs only to the left participant and only to the right participant. Expand the reachable states using CSP prefixing and CSP external choice:
For example, after the synchronized , the left participant is back at but the right participant is at . The left participant's proposed is blocked until the right participant has performed . Similarly, after , only the synchronized is possible. Thus there is no extra interleaving to include.
Eliminating gives the guarded equation
Consequently choose the sequential CSP process
The unique fixed point principle first establishes .
Now let . The CSP exception operator follows its left operand until that operand performs , includes this in the visible behaviour, and then switches to its right operand. Applying its CSP step law to the four-state expansion yields
The switch occurs exactly where the ordinary execution already returns to . Therefore . The answer uses neither a CSP exception operator nor a CSP parallel composition operator, and the argument gives equality in all three standard CSP semantic models.
Use a chain of identical storage cells, each retaining the first value it sees and passing later values to the next cell. On the return journey it passes the next cell's reversed output before emitting its own retained value. This turns the chain into a distributed LIFO stack.
Here is one cell template. Its ports carry incoming values towards the tail; carry returning values towards the front. Each port carries values in , with the sentinel value outside :
An input such as abbreviates an indexed CSP external choice over the corresponding CSP events. An output is the CSP prefixing action . There is no extra controller process.
For , take copies of this same template. Introduce channels for and apply port CSP event renaming to copy , for , as follows:
At the front put and . Adjacent cells synchronize on every shared or CSP event. The two tail channels are sentinel-only: and are local tail CSP events, with no other participant required. Disable all for . Formally, use a partial relational CSP event renaming for the last copy, omitting the pairs for its with ; an unmapped transition is blocked. This explicitly prevents a fictitious tail from generating data.
Let be the resulting port-renamed cell and its visible alphabet. With consisting of the internal link CSP events, including the two tail CSP events, the answer is
Here the indexed operator is CSP alphabetized parallel composition: each CSP event is synchronized by all cells whose alphabets contain it. There are exactly storage-cell processes; port wiring and the sentinel-only tail adapt their interfaces, without adding a helper process. The local tail CSP events are hidden, as are all inter-cell communications.
To see correctness, after inputs have propagated, cell retains . The input sentinel value propagates to the tail. The last cell performs its two local tail CSP events, then returns . Inductively, if the suffix after cell returns , cell relays those values, replaces the final sentinel value by , and stops. Hence the external output is
and starts only after . Shared links provide synchronization rather than an assumption that all cells take steps simultaneously. For the degenerate known-empty input, no storage is needed: the interface is simply .
In the displayed network, the first cells retain values and cell is still in its initial state. It accepts only a value in , so it cannot accept the incoming sentinel value. For the first cell blocks the external sentinel value; for a stored cell blocks while trying to pass it to an empty neighbour. Thus
To handle shorter inputs, add an empty-cell branch to the initial state. An empty cell then terminates the downward scan and immediately returns an empty sequence. Earlier occupied cells append their retained values exactly as before; later cells need not participate. This works for every , because the occupied prefix of the chain alone produces the required output. For , the original sentinel-only tail still supplies the empty suffix. Every cell receives the same modification.
The obstruction is that the property is about where a transition originates, whereas the three standard CSP semantic models identify processes that can disagree about this fact. Take fresh and compare
In , the only transition leaves a CSP stable state, so the property holds. Initially has both an transition to and a CSP internal action to . Its initial state is therefore not a CSP stable state, and its direct transition violates the property.
Nevertheless both have exactly the CSP traces and . Initially their possible stable observations offer exactly , so their initial CSP stable failures are precisely with . After , both can refuse every CSP event. Neither has a CSP divergence: the hidden can occur at most once. Therefore
No CSP refinement test in one of these models can separate semantically equal operands. This also rules out placing the operand in a fixed context of ordinary CSP operators before the test, since those operators respect the model's equality. A model recording more about the interleaving of stability and acceptance, or an additional operator that explicitly observes stability, would be needed.
For a finite CSP trace , let be its sequence of values on and its sequence of values on , with channel names removed. Restrict the external alphabet to these two channels. The behavioural CSP trace specification for an unbounded FIFO buffer is
where means prefix of a list, not merely subsequence. Outputs must therefore occur in input order, cannot duplicate or invent values, and cannot precede their inputs. Applying the condition to every CSP trace also checks every execution prefix.
For a legal , write , so is the pending FIFO queue content. Define the events that must remain available by
In addition to the CSP trace condition, require the behavioural CSP stable failure condition
Thus an unbounded FIFO buffer cannot stably refuse any new input, and a nonempty FIFO buffer cannot stably refuse its oldest pending output. An empty FIFO buffer can refuse every output. Readiness of an input and readiness of an output are required together; the environment may choose either. These conditions do not require an output while the environment refuses to accept it. In a CSP failures-divergences model specification, also exclude CSP divergence; the stable-readiness condition alone does not rule out an implementation that loops internally forever without reaching a CSP stable state.
First define the ordinary unbounded FIFO buffer:
Now use CSP internal choice to permit an immediate stop:
An execution choosing the first branch can perform every legal CSP trace satisfying the prefix of a list condition in part (a). Conversely that condition excludes all other CSP traces, so no process satisfying it can have more CSP traces. The second branch adds no new CSP trace, since the empty CSP trace is already present.
The second branch does add the CSP stable failure for any . This violates mandatory input readiness. Therefore the process has the maximum possible CSP trace set and fails the CSP stable failure specification. The qualification is , as is implicit for a useful FIFO buffer; with an empty value type there is no input-readiness event to violate. Maximizing the number of CSP traces does not pick a unique process in the finer models: other processes with the same complete legal CSP trace set and extra refusals also qualify.
If is injective, the equation is true:
For a CSP event , the original CSP parallel composition permits exactly when both operands can perform . After CSP event renaming, the corresponding rule requires the same image in both operands. Injectivity ensures that matching images came from the same event, and that an event outside cannot acquire the image of one inside . Independent transitions remain independent, and CSP internal actions are unchanged. Matching these transition rules gives a strong bisimulation, hence equality in all three standard CSP semantic models.
For a non-injective , the equation need not hold. Let
On the left, both events require synchronization but the other operand offers the wrong event, so . On the right, both renamed operands offer , which can synchronize:
The failure is already visible in the CSP traces model. A particular non-injective CSP event renaming may still preserve a particular composition; it is the unrestricted equivalence that fails.
Write . The following five CSP operational semantics rules suffice, with always visible:
Thus a CSP internal action of either operand preserves the wrapper. A visible action outside by the left operand also preserves it, whereas such an action by the right operand performs an ordinary CSP interrupt and discards the left operand. An action in requires both operands and advances both without discarding either. If both can perform the same event outside , there are two transitions with the same visible label and potentially different derivatives; neither should be deleted. The paper excludes successful termination, so no extra termination rules are needed.
Suppose the operands are initially stable and written in CSP external choice normal form,
The CSP step law is
An empty indexed CSP external choice denotes . A label appearing in both of the first two lines must retain both continuations: after that common label the result is the CSP internal choice between the continuations. A label in appears only in the third line and only if both operands offer it. These are exactly the three visible-transition rules from part (d); the two CSP internal action rules handle operands that are not initially stable.
As a check, for the paper's example the initial shared leads to . Its expansion is
which recovers the displayed example after prefixing by .
Use fresh event tags to tell apart an action by and an interrupting action by . Put and introduce a disjoint copy . Let fix and map each to , and put . Define a process that always accepts an event from by
and an ordinary CSP interrupt handler by
Finally let fix every original event and send back to . A simulation containing no occurrence of the new operator is
Here is the ordinary CSP interrupt, and the CSP event renaming is applied after the CSP parallel composition. It is non-injective, so part (c) explains why moving it inside would be unsafe.
Before the interrupt, 's events in synchronize with on the same events. Its events outside are unprimed and do not synchronize with . Meanwhile 's events outside are primed; they synchronize with and thereby interrupt and discard . After the first such event, the left operand is , so it imposes no further restriction on ; final CSP event renaming then yields exactly the remaining behaviour of .
For a formal strong bisimulation, relate a pre-interrupt state to
and an already-interrupted state to
The three visible cases match the rules in part (d), including both transitions when both operands offer the same event outside . A CSP internal action of never activates , while a CSP internal action of remains possible exactly until the interrupt. The controller adds no CSP internal actions. Thus transitions match in both directions and related derivatives remain related.
Consequently this simulation is stronger than merely CSP trace equivalent:
It preserves CSP stable states, their enabled-event sets and their CSP stable failures, and matches every possible infinite run of CSP internal actions. In particular, it introduces neither a premature commitment nor a new CSP divergence. A different simulation that guesses an interrupt with a hidden handshake would need a separate refusal analysis; the visible tagging construction above needs no hidden handshake.
Use the intended nontrivial ring network, with , and let . A CSP event is one synchronized transfer from the predecessor to receiver , rather than a separate enqueue and dequeue. Let be the Boolean saying whether node is active. For , define
Initially the node is active:
The CSP external choice in always offers both possible incoming message values as well as the permitted status change. Thus a decision to change status cannot internally withdraw readiness to receive a message. When the first message arrives, an active node forces its forwarded bit to false; an idle node preserves the bit. The status is retained until the second-round message has been forwarded. Neither the forwarding prefix nor offers status-change events, enforcing the protocol's freeze. On a false second-round message the node resumes its previous status; on a true one it forwards the bit before announcing shutdown.
The coordinator has the following states:
Thus
The coordinator starts a round only while idle and sends true to node . After the first returning message it sends exactly the received bit on the second round, without modifying it. The second return is required before its own shutdown; if the attempt failed it remains idle and may try again or become active. It offers no status-change event between starting and finishing the protocol. The two round states are essential: the first means that the first survey succeeded, whereas the next one acknowledges the circulating decision.
As in part (a), the choices between observable events are expressed using CSP external choice. Execution is nondeterministic, but there is no hidden irrevocable decision to become active while refusing a message. This keeps the readiness required by the question.
For each node let
The required CSP alphabetized parallel composition is
Each message CSP event belongs to exactly the sender's and receiver's alphabets and synchronizes those two processes. A status signal belongs only to its own node. Using the common set of all message events as an all-node synchronization alphabet would be incorrect: unrelated nodes would then have to participate in each point-to-point transfer. The initial definitions in parts (a) and (b) make every node active. Keep the message CSP events visible here; later checks can apply CSP hiding as needed.
This is a safety property: a bad shutdown or a later reactivation has a finite bad CSP trace. Use the CSP traces model. Let , let track active nodes, and let track nodes that have announced shutdown. Let contain every message CSP event. Define the following specification over the status-signal alphabet:
Use the CSP refinement check
The specification offers a shutdown only if the active set is empty, and offers no activation once is nonempty. A trace violating either requirement is therefore absent from the specification. Recording also prevents duplicate shutdowns and any status change by an already shut-down node. CSP hiding removes message details irrelevant to this finite bad-prefix check; a CSP traces model check alone does not assert eventual progress.
The system satisfies the check. After the first message has passed nodes , its bit is the Boolean conjunction of their being idle when sampled. Every sampled node is then frozen until it forwards the second-round decision. A true bit returning to node therefore means that every non-coordinator is idle and still frozen; the coordinator has itself remained idle. A true decision consequently reaches only idle nodes, each of which proceeds to shutdown rather than returning to . No node can subsequently become active. A false decision permits no shutdown at all.
The trigger is specifically the first-round reception . A CSP trace restriction cannot by itself guarantee progress after this event, because a finite prefix is compatible with both completion and an indefinitely delayed completion. We need to exclude both a stable refusal to continue and CSP divergence, so use the CSP failures-divergences model.
Here is an explicit conditional check that imposes no progress requirement before the trigger. Build the reachable labelled transition system of and observe coordinator rounds with a two-phase monitor: it starts in the first-return phase and toggles on each . Collect the set of system derivatives immediately after a true return in the first-return phase. This distinguishes the survey's return from the decision's return, without changing any system transitions. For fixed finite , the set is finite. Define
Here denotes CSP internal choice. Perform the single CSP refinement check
Equivalently, check each post-trigger derivative individually against after the displayed CSP hiding. If the trigger is unreachable, the conditional property is vacuously true and there is no post-trigger check to perform.
The CSP internal choice in deliberately permits any next shutdown, including an implementation that offers only one of the remaining shutdowns. It forbids a stable refusal of all remaining shutdowns, has no CSP divergence, and permits at most distinct shutdowns before . A CSP external choice over all remaining nodes would instead demand simultaneous readiness for every remaining shutdown and would unnecessarily reject the protocol's sequential delivery.
After hiding all other actions, endless internal work becomes a CSP divergence and a blocked unfinished state becomes a forbidden CSP stable failure. Since there are only possible shutdown actions and duplicates are excluded by CSP traces, every maximal progressing execution must complete all . As usual for untimed CSP, this progress claim assumes the environment allows shutdown signals to occur; it supplies no wall-clock deadline. No fairness assumption requiring the coordinator eventually to initiate a survey has been smuggled into this conditional check.
For the defined system the check succeeds. Immediately after the trigger all statuses are idle and frozen. The only message work left is the second round: node sends the decision to node , nodes through forward it, and node receives it. These are exactly more message transfers. Each node then has its one shutdown action, and the message can advance even while an earlier node's shutdown is pending. Thus there are no remaining status changes, no message cycle, and no unfinished global state in which every action is blocked. The measure
starts at , is nonnegative, and decreases on every subsequent transition. This excludes any hidden infinite run; before all shutdowns finish there is either an enabled message transfer or an enabled shutdown signal. The operational argument proves the conditional claim for every ; finite state enumeration is only a supporting check.
For a general ring, no. Being idle at the instant the coordinator starts is not the same as remaining idle until sampled. A downstream node that has not yet received the first-round message is still in its state and may become active.
For a concrete example, first perform , so all nodes are idle. Then take this CSP trace:
At the first displayed event the coordinator has started and all nodes are idle. Node has received true and is frozen, but node can still activate before receiving the token. It forwards false, so the entire second round carries false and nobody shuts down. After the final , all nodes are idle again. The coordinator may then perform forever without starting another survey. This is an infinite execution with no shutdown and no assumption of fairness that would exclude it.
Figure 1.
A node can activate after the survey starts but before the token reaches it
. Details.
Therefore
This does not contradict part (e): its stronger trigger, the true first-round return, never occurs in the failed survey. For the special ring, starting by already samples and freezes the only non-coordinator. If both nodes are idle at that event, this particular counterexample is impossible and the successful-survey progress argument applies. The general claim in the question must cover larger rings, where the unsampled downstream node exists.

Articles by others on the same topic (0)

There are currently no matching articles.