Mealy machines as contexts in categorical systems theory [lcc-001B]
Mealy machines as contexts in categorical systems theory [lcc-001B]
(Inspired by a conversation with Dylan Braithwaite, Matteo Capucci, Toby Smythe)
A "context" is "something you can plug a system into, producing a closed system. Recall that, given a (monoidal) theory of dynamical systems, a closed system is a system with interface I. So we may say that, when A is an interface, a context of type A should give a functor \mathsf {Sys}(A) \to \mathsf {Sys}(I).
Given a Mealy machine TS \otimes A \to I (see Moore and Mealy machines in CST), plugging into it thus gives a context of type A. Moreover, given a morphism of Mealy machines S \to S', we find a natural transformation between the induced functors---thus, we have a functor \mathsf {Mealy}(A) \to [\mathsf {Sys}(A),\mathsf {Sys}(I)].
On the other hand, this functor is not in general full. To see this, suppose we're working with the theory \mathcal {C} = \mathsf {Set}, \mathcal {A}(X) = \mathsf {Set}_{/X}, T(X) = X \times X \to X, i.e of simple discrete-time discrete-space systems. For an interface \binom {B}{A}, let \operatorname {Stream}(\binom {B}{A}) be the terminal coalgebra of the functor S \mapsto \sum _{a \in A} S^{B_a}---the set of "input-output streams". Let TS \otimes \binom {B}{A} \to I, TS' \otimes \binom {B}{A} \to I be two Mealy machines. Let f_w: S \to S' be a family of morphisms between them indexed by w \in \operatorname {Stream}(\binom {B}{A}). Given a dynamical system TX \to \binom {B}{A}, consider the mapping X \times S \to X \times S' which carries (x,s) to (x,f_w(s)) where w is the behaviour of x. It's not hard to see that this is a mapping between the two closed systems, and since any map of dynamical systems X \to X' must preserve the behaviour of points, this construction is a natural transformation. But clearly unless all the f_x are constant, this does not come from a map of Mealy machines.
It should be possible to build this into a full subcategory of [\mathsf {Sys}(A),\mathsf {Sys}(I)] given by families of Mealy machines indexed by the set of streams. Since every Moore machine (dynamical system) is a quotient of a coproduct of systems that are "free on a point with a specific behaviour", it seems likely that this full subcategory consists exactly of the cocontinuous functors (all this is specific to the particular case of sets, discrete-time and discrete space). This is vaguely analogous to the way the cocontinuous functors R-\mathsf {Mod} \to S-\mathsf {Mod} are classified by S-R bimodules.