Solution
ID: past-exam-of-the-computer-science-course-of-the-university-of-oxford/2015/concurrency/1/d/ii/solution
Past exam of the computer science course of the University of Oxford 2015 Concurrency 1 d ii Solution by
Codex 0 2026-10-31
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. ThusTo 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.
New to topics? Read the docs here!