next up previous
Next: Inference system interpretation Up: Partial constructions Previous: Compositional closure

   
State machine interpretation

A quadruple can be used to model a very common kind of state machine, that moves from state to state in response to inputs, at each step consuming one input, and emitting one output.

The operation of such a machine can be depicted as follows:


\begin{picture}(90,30)(0,5)
\put(0,10){\makebox(30,20){\begin{tabular}{l}\texti...
...t}\\
$c\;:\;C(a,b)$\end{tabular}}}
\put(60,20){\vector(1,0){30}}
\end{picture}
Note that it can happen that in some states, there are no legal inputs, so that the user is stymied, or deadlocked; also it can happen that there are inputs - effectively `stop' commands for which there is no legal response.

A morphism between quadruples, under the state-machine interpretation, is a simulation of one machine (the virtual machine) by another (the real machine). The state of the virtual machine is a function of the state of the real machine, and there are functions to translate between the inputs and outputs in the right way. The inputs to the real machine might be programs, if the real machine is the compositional closure of a basic instruction set; the outputs from the real machine are then traces of the execution of these programs.

\begin{displaymath}\providecommand{\ZZ}[1]{\underline{\mbox{\textit{ ...

In general such a machine need not be deterministic, in the sense that the response of the machine is not necessarily predictable from its present state and input. A deterministic machine is one for which the outputs can be predicted given the inputs and start state. So for a deterministic machine, C(a,b) is always either empty or a singleton.) For a deterministic user, B(a) is always either empty or a singleton, and the machine has all the choice.

The interpretation of the `star' operator is as follows.

The interpretation of the dual of the above construction is as follows.

I'm fond of this interpretation. Perhaps programming is after all only an application of the theory of ordinals? Ordinals are just the purest possible paradigms of well-founded structures, and here we have a broad class of well founded structures that serve as very apt modelling material when describing and designing clients and implementations of state machines. This is a very broad class of programs - a program that uses the services of an operating system or makes network calls to a remote resource is `just' such a client; the system which responds to those calls is just such an implementation. The client's primitive for invoking an action is essentially the $\ensuremath{\mathop{\mathit{Fork}}(\makebox[1em]{\_},\makebox[1em]{\_})} $constructor. On the server side, decoding a command and dispatching to give the appropriate response and next-state is essentially the $ \ensuremath{\mathop{\mathit{Krof}}(\makebox[1em]{\_},\makebox[1em]{\_})} $ constructor.


next up previous
Next: Inference system interpretation Up: Partial constructions Previous: Compositional closure
Peter Hancock
1998-04-08