The schema has one object and one arrow (no equations). A -instance is a set of states with a function next: a discrete dynamical system — a deterministic machine which, in each state, moves to a uniquely determined next state.
Sources: 7 Sketches §3.4.1 (Eq. 3.65–3.66), Exercise 3.67; Example 3.46 (idempotent variant); DaoFP Chapter 13 (coalgebras as state machines); CTfS Example 3.5.2.9, Application 3.5.2.10, Exercises 3.5.2.12–3.5.2.13, 4.5.1.7, 4.5.1.22, Example 4.2.3.3, Example 5.3.4.3
Eq. (3.65). States with : states , , and the 2-cycle .
CTfS’s example (Example 3.5.2.9): states with = A↦B, B↦C, C↦C, D↦B, E↦C, F↦G, G↦H, H↦G — two “basins”: everything in flows to the fixed point , and falls into the 2-cycle . This particular instance satisfies the path equation , which cuts the infinitely many paths of the schema down to four classes (CTfS Exercise 3.5.2.12). More interpretations: a “quantum-time universe” with one row per state of the universe (Application 3.5.2.10); a chess program choosing a move in every position, where the game-ending positions are fixed points (CTfS Exercise 3.5.2.13); a management hierarchy with .
Products and sums (CTfS Exercises 4.5.1.7, 4.5.1.22): the product of two DDSs runs both systems in lockstep on pairs of states, ; the coproduct runs them side by side. Variants: replacing by the topological monoid and by gives a continuous dynamical system (a flow, CTfS Example 4.2.3.3); letting return a probability distribution gives a Markov Chain (a Kleisli instance for the Distribution Monad).
Migration to a graph. The functor sending both , , gives the pullback : a graph with one vertex and one arrow per state, arrow going from to — “what I do next is determined by what I am now”. With swapping the roles of source and target, the arrows point backwards (7S Exercise 3.67). Conversely turn any graph into a DDS.
Categorically, a DDS is an algebra and coalgebra of the identity functor, a -set (a functor from the one-object category of Example 3.13 to ), and a -valued non-representable functor in general.
Docs: FinCats · Data migration · ACSets API · Graphs · Theories & presentations
using Catlab
@present SchDDS(FreeSchema) begin State::Ob; next::Hom(State, State) end
@acset_type DDS(SchDDS)
I = @acset DDS begin State = 7; next = [4, 4, 5, 5, 5, 7, 6] end
# pull back along F : Gr → DDS to get a graph
F = FinFunctor(Dict(:V => :State, :E => :State), Dict(:src => id(SchDDS[:State]), :tgt => :next),
FinCat(SchGraph), FinCat(SchDDS))
G = migrate(Graph, I, DeltaMigration(F)) # Δ_F(I): the graph of Eq. (3.66)
src(G), tgt(G) # ([1..7], [4,4,5,5,5,7,6])data DDS s = DDS { states :: [s], next :: s -> s }
-- Δ_F: the graph with an arrow s -> next s for each state
toGraph :: DDS s -> Graph s s
toGraph (DDS ss n) = Graph ss ss id n