INFR10089/INFR11248 — 2024

Main page Lectures and handouts Homework
Piazza Notes HW Submissions

Homework 1, Tuesday 17-9-2024

(Due: 24-9-2024 at 10am; accepted without penalty until 25-9-2024 at 10am)
  1. A binary relation ~ on a set D is an equivalence relation if it is
    • reflexive: p ~ p for all processes p in D,
    • symmetric: if p ~ q then q ~ p,
    • and transitive: if p ~ q and q ~ r then p ~ r.
    1. Give an example of an equivalence relation on the domain of all people.
    2. For each of these three requirements, give an example of a relation on people that is not an equivalence relation, because it fails this one requirement but satisfies the other two requirements.
    3. If ~ is an equivalence relation on D, and p is in D, then [p]~ denotes the set of all processes in D that are equivalent to p. Such a set is called an equivalence class. Show (formally, by means of a mathematical proof) that the collection of all equivalence classes form a partitioning of D. This means that every p in D belongs to one and only one equivalence class.
    [None of this has been treated in class; (c) is a test of prior mathematical exposure to the notion of a mathematical proof. If this is hard, it is a good warm-up for bits of mathematical proof yet to come.]
  2. Consider a vending machine that accept pieces of 20 cents, 50 cents and 1 dollar, and that can dispense (multiple) chocolate and pretzels, each of which costs 1 dollar. Draw an LTS whose transitions are labelled with "20c", "50c" or "$\$$1", indicating the reception by the machine of a coin inserted by a user, and by the actions "chocolate" or "pretzel", indicating the opening of the glass door of the machine behind which chocolate or pretzels are stored. (We abstract from the closing of the door after extraction of the pretzel, which happens automatically, and the appearance of a new pretzel behind the glass door afterwards.) Assume that the machine does not give change, and that it accepts any amount of surplus money. Try to make the number of states in your LTS as small as possible.
  3. Consider the process graph depicted in Counterexample 17, on page 49 of this paper. In that paper, the initial state is the unique one without incoming transitions. Formalise this graph in two ways:
    1. As a triple $(S,I,\rightarrow)$ of states, initial state and transition relation, as in the notes.
    2. As a tuple $(S,I,T,\textit{source},\textit{target},\ell)$, discussed in class.

Homework 2, Thursday 19-9-2024

(Also due: 24-9-2024 at 10am; accepted without penalty until 25-9-2024 at 10am)
  1. Draw a process graph for the ACP expression a(bc+b(c+d)).
  2. [Harder; can be skipped by students that merely aim for a basic good grade.]
    Give a formal definition of the sequential composition operator of ACP (see
    notes), in the style of the notes.
  3. Give an example of two processes that have the same partial traces but different completed traces. Moreover, the completed traces of the one should not be a subset of the completed traces of the other.
  4. Give an example of a process that has no finite completed traces at all.
  5. [Harder; can be skipped by students that merely aim for a basic good grade.]
    Consider a more bureaucratic version of the relay race that was presented in class. This time runner 1 may only pass the stick to runner 2 in the presence of a bureaucrat, who is stationed halfway the start and finish. The bureaucrat will watch the transaction and subsequently make a note of it in his notebook, that will be kept for posterity. Consider a specification that mentions the start of the race (start), the delivery of the parcel (finish) and the making of the bureaucratic note (note). Describe the specification and the implementation in ACP.
Note: Whereas students of the third year course MCS-10 may skip both harder questions for a basic good grade, students of the fourth year course MCS (or MCS-11) ought to do at least one of them.

Homework 3, Tuesday 24-9-2024

(Due: 1-10-2024 at 10am; accepted without penalty until 2-10-2024 at 10am)
  1. Give an example of two processes without infinite traces that are weakly completed trace equivalent and also strongly partial trace equivalent but not strongly completed trace equivalent.
  2. Consider a process called "gatekeeper" that makes sure that of 2 other processes "1" and "2", at most one is in its critical section. Its action are "hear request of process i to enter critical section", or h(i) for short; "admit process i into critical section", or a(i); and "observe that process i exits the critical section", e(i). Here i can have the values 1 or 2. Keep in mind that each of the processes i may enter the critical section multiple times. The actions h(i), a(i) and e(i) all synchronise with corresponding actions h(i), a(i) and e(i) from the processes 1 and 2. Processes 1 and 2 have the form P(i)=h(i).a(i).e(i).P(i). The gatekeeper should be able to hear (and remember) a request in any state. Deadlock should be avoided.
    • Draw a process graph describing the correct behaviour of the gatekeeper.
    We do not ask you to calculate the parallel composition of the gatekeeper with the two client processes.

Homework 4, Thursday 26-9-2024

(Also due: 1-10-2024 at 10am; accepted without penalty until 2-10-2024 at 10am)
  1. Give an example of two strongly bisimilar process graphs, one with 5 reachable states, and one with 7.
  2. Show, for labelled transition systems without τ-transitions, and without termination predicate, that bisimulation equivalence is strictly finer than infinitary completed trace equivalence. This means that it makes strictly fewer identifications. This involves two things:
    • show that whenever two processes are bisimulation equivalent, they are surely also infinitary completed trace equivalent.
    • give an example of two processes that are infinitary completed trace equivalent but not bisimulation equivalent.
  3. Draw the process graph for a single Boolean variable $x$ kept in some memory system. The process should support the following actions:
    • $w_x(0)$: write the value 0 to the variable $x$.
    • $w_x(1)$: write the value 1 to the variable $x$.
    • $r_x(0)$: read $x$ and retrieve the value 0.
    • $r_x(1)$: read $x$ and retrieve the value 1.
    Let's assume the initial value of $x$ is 0.

Homework 5, Tuesday 1-10-2024

(Due: 8-10-2024 at 10am; accepted without penalty until 9-10-2024 at 10am)
    1. Out of the following processes, which pairs are weak bisimulation equivalent?
      a.(b+τ.c)+τ.a.d a.(b+τ.c)+τ.a.d+a.b a.(b+τ.c)+τ.a.d+a.c a.(b+τ.c)+τ.a.d+a.d
      Show the bisimulation or informally describe why there isn't any.
    2. Also tell which pairs are weak completed trace equivalent, and why or why not.
    3. And which pairs are strong completed trace equivalent, and why or why not.
    4. And which pairs are branching bisimulation equivalent, and why or why not.
  1. Given an example of two processes of which some of the states may be marked with the termination predicate ✔, such that the two are (strong) bisimulation equivalent when discarding the termination predicate (without changing the states and transitions in any way), yet with the termination predicate taken into account they are completed trace equivalent but not bisimulation equivalent.
  2. [Harder; can be skipped by students that merely aim for a basic good grade.]
    We write $Q \Longrightarrow Q$ if there are $Q_0$, $Q_1$, ... , $Q_n$ for some $n \geq 0$, such that $Q=Q_0$, $Q=Q_n$, and $Q_{i-1} \stackrel{\tau}\longrightarrow Q_i$ for all $i=1,...,n$.
    Here $Q$, $Q$ and the $Q_i$ are either processes or states in labelled transition systems. (In the next lecture we will drop the distinction between processes and states.) We write $P =_{BB} Q$ if there exists a branching bisimulation that relates the states $P$ and $Q$.

    1. Show that if $P =_{BB} Q$, $Q \Longrightarrow Q'$ and $P =_{BB} Q'$, then $P =_{BB} Q_i$ for any process $Q_i$ on the $\tau$-path from $Q$ to $Q'$.
    2. Does the same property also holds for weak bisimilarity $=_{WB}$? Give a proof or a counterexample.
    3. In class I defined a branching bisimulation $\mathcal{B}$ to satisfy the following transfer property:

      if $P \mathrel{\mathcal{B}} Q$ and $P \stackrel{\alpha}\longrightarrow P'$, then there are $Q_0$, $Q_1$, ... , $Q_n$ for some $n \geq 0$, and $Q'_0$, $Q'_1$, ... , $Q'_m$ for some $m \geq 0$
      such that $Q=Q_0 \stackrel{\tau}\longrightarrow Q_1 \stackrel{\tau}\longrightarrow \dots \stackrel{\tau}\longrightarrow Q_n \stackrel{(\alpha)}\longrightarrow Q'_0 \stackrel{\tau}\longrightarrow Q'_1 \stackrel{\tau}\longrightarrow \dots \stackrel{\tau}\longrightarrow Q'_m$,
      and moreover $P \mathrel{\mathcal{B}} Q_i$ for all $i=1,...,n$ and $P' \mathrel{\mathcal{B}} Q'_j$ for all $j=0,...,m$.

      The handout, on the other hand, requires the following transfer property:

      if $P \mathrel{\mathcal{B}} Q$ and $P \stackrel{\alpha}\longrightarrow P'$, then there are $Q_0$, $Q_1$, ... , $Q_n$ for some $n \geq 0$,
      such that $Q=Q_0 \stackrel{\tau}\longrightarrow Q_1 \stackrel{\tau}\longrightarrow \dots \stackrel{\tau}\longrightarrow Q_n \stackrel{(\alpha)}\longrightarrow Q'$,
      and moreover $P \mathrel{\mathcal{B}} Q_n$ and $P' \mathrel{\mathcal{B}} Q'$.

      Prove that these two definitions lead to the very same notion of branching bisimilarity.
      (As always, you may also answer the question by giving a counterexample showing that this is not the case.)

Homework 6, Thursday 3-10-2024

(Also due: 8-10-2024 at 10am; accepted without penalty until 9-10-2024 at 10am)
  1. Let P be the process given by the recursive equation X = a.(b.X + c.X)
    and Q be the process (c+e).a. Assume an ACP communication function γ given by γ(a,c)=γ(c,a)=d.
    1. Draw a process graph representation of P and Q.
    2. Draw a process graph representation of P||Q.
    3. Draw a process graph representation of {a,c}(P||Q).
    Answer
  2. Express the behaviour of the gatekeeper from Homework 3.2 by a system of recursive equations.
    Answer
  3. Describe the relay race in CCS in a similar way as the class notes describe it in ACP.
    Answer

Homework 7, Tuesday 8-10-2024

(Due: 15-10-2024 at 10am; accepted without penalty until 16-10-2024 at 10am)
  1. For which possible choices of Q and R are there transitions of the form
    a.(c+b) | ((c+a) | b) --τ--> Q --τ--> R
    in the labelled transition system of CCS? (In CCS expressions action prefixing binds strongest of all operators. Moreover, I leave out trailing 0s, so c+b means c.0+b.0 .) Give a proof tree of the formal derivation of one of those transitions from the structural operational rules of CCS.
    Answer
  2. [Fairly hard] An equivalence ~ is a congruence for a language L if P ~ Q implies that C[P] ~ C[Q] for every context C[ ]. Here a context C[ ] is an L-expression with a hole in it, and C[P] is the result of plugging in P for the hole.

    Consider a language L without recursion. A different definition of a congruence ~ requires for any $n$-ary operator $f$ of L that

    $P_i \sim Q_i$ for $i=1,...,n$ implies $f(P_1,...,P_n) \sim f(Q_1,...,Q_n)$.

    Show that this definition is equivalent to the one above.
  3. [Hard; can be skipped by students that merely aim for a basic good grade.]
    The congruence closure ~L of ~ is defined by

    P ~L Q if and only if C[P] ~ C[Q] for any L-context C[ ].

    Prove that ~L is the coarsest congruence finer than ~.

Homework 8, Thursday 10-10-2024

(Also due: 15-10-2024 at 10am; accepted without penalty until 16-10-2024 at 10am)
  1. Show that (strong, finitary) partial trace equivalence is a congruence for the CCS relabelling operator. This means that whenever P =PT Q and f: A -> A is a relabelling operator, it must be the case that P[f] =PT Q[f].
  2. Sequencing is a binary operation defined on process graphs without the state-label ✔; it starts with its second component as soon as its first component cannot do any further actions.
    Sequential composition, on the other hand, is defined on process graphs equipped with a state-labelling, where some states are marked with the symbol for successful termination, ✔. Here the second component starts only when the first one successfully terminates. This is the operator that occurs in ACP.

    In (c) and (d) below, work with a form of LTS in which any state (possibly with outgoing transitions) can have the label $\surd$. Moreover, the label $\surd$ can occur in a (partial or completed) trace, as explained in the notes.

    1. Give a definition of sequencing as an operator on process graphs.
    2. Give an example that shows the difference between these two operators.
    3. Is sequential composition (as used e.g. in ACP) compositional for partial trace equivalence? Give a counterexample, or show why.
    4. Is sequential composition compositional for completed trace equivalence? Give a counterexample, or show why.
    5. Is sequencing compositional for partial trace equivalence? Give a counterexample, or show why.
    6. Is sequencing compositional for (strong) completed trace equivalence? Give a counterexample, or show why.
    7. Is partial trace equivalence a congruence for sequencing? Show why your answer is correct.
    8. Is (strong) completed trace equivalence a congruence for sequencing? Show why your answer is correct.
  3. Use the axioms of CCS to proof by means of equational logic that $((a.(b+c.\bar{e})) \mid (e + \bar{b}.c))\backslash \{b,e\}$ is strongly bisimilar to $a.(c|\tau)$. Here the CCS constant $0$ is elided, meaning that we abbreviate $a.0$ to $a$. Moreover, $P\backslash\{b,e\}$ is the same as $P \backslash b \backslash e$. Which CCS law(s) for restriction do you need to show this?

Homework 9, Tuesday 15-10-2024

(Due: 22-10-2024 at 10am; accepted without penalty until 23-10-2024 at 10am)
  1. Consider the processes a.0 + b.0, τ.(a.0 + b.0), τ.a.0 + b.0, a.τ.0 + b.0 and τ.(a.0 + b.0) + a.0.
    1. Which of these processes are weak bisimulation equivalent to each other, and why (or why not)?
    2. Which of these processes are branching bisimulation equivalent to each other, and why (or why not)?
    3. Which of these processes are rooted weak bisimulation equivalent to each other, and why (or why not)?
    4. Which of these processes are rooted branching bisimulation equivalent to each other, and why (or why not)?
  2. Formally derive the axiom (B) for branching bisimilarity (see notes) from the axioms for weak bisimilarity for CCS.

Homework 10, Thursday 17-10-2024

(Also due: 22-10-2024 at 10am; accepted without penalty until 23-10-2024 at 10am)
  1. Give a CCS expression for the vending machine intended by Q2 of HW1. This involves declaring a recursive specification.
  2. Recall the specification and implementation of the relay race in CCS (HW 6, Q3):

    Specification:    start.finish.0

    Implementation:    (R1 | R2)\$\{$handover$\}$    where
    R1 = start.handover.0
    R2 = handover.finish.0

    Prove the rooted branching bisimulation equivalence between the specification and the implementation by means of equational logic, using the equational axiomatisation of CCS.
  3. Let the processes $X$, $Y$, $Z$ and $W$ be defined by the equations \[\begin{array}{lcl} X &=& b.Y + c.X \\ Y &=& d.(e.X+b.Y) \\ Z &=& b.d.W + c.(b.d.W + c.Z) \\ W &=& e.Z + b.d.W \end{array}\] Proof that $X=Z$, using the CCS axiomatisation of strong bisimilarity with RDP and RSP.

Rob van Glabbeek main MCS page notes Rob.van.Glabbeek@ed.ac.uk