Generating causal networks
If every element generated in the evolution of a generalized substitution system is assigned a unique number, then events can be represented for example by {4, 5} {11, 12, 13}—and from a list of such events a causal network can be built up using
With[{u = Map[First, list]}, MapIndexed[Function[{e, i}, First[i] Map[(If[# === {}, ∞, #〚1, 1〛] &)[Position[u, #]]) &, Last[e]]], list]]