### Equivalence and conversion to other languages

In this section we compare the expressiveness of eSTG to 4 other families:

- 1.
maODE: Ordinary Differential Equations arising from mass-action kinetics.

- 2.
maCRN: Chemical Reaction Networks with mass-action kinetics.

- 3.
gCRN: Chemical Reaction Networks with general rate kinetics.

- 4.
U-gCRN: Unimolecular Chemical Reaction Networks with general rate kinetics.

An maCRN is a chemical reaction network where each reaction has an associated rate constant, and where the instantaneous rate of a reaction is determined by the product of the rate constant with the instantaneous concentrations of the reagents. It is known that an maCRN under that mass-action law produces a system of ODEs with a special structure, here called an maODE system. In an maODE system each right-hand-side of each differential equation for species *s* has the form of a polynomial over the set of species, where each monomial with a negative sign has *s* as a factor (raised to some non-zero power). Conversely each maODE determines a canonical maCRN that has that maODE as its kinetics. Therefore there are canonical translations back and forth between maODEs and maCRNs [46].

A gCRN is instead a Chemical Reaction Network where each reaction has an associated rate function from current or past system states to changes of concentrations. The instantaneous rate of a reaction is then given immediately by its rate function without further considerations; the class of ODEs that a gCRN may generate depends on the class of rate functions that are available.

A U-gCRN is a special case of a gCRN where all the reactions are unimolecular. For sufficiently powerful rate functions it is possible to have a (nominally) unimolecular reaction depend on the concentrations of other species, so that U-gCRN is in fact as expressive as gCRN. For example, an maCRN reaction
can be translated to the gCRN reaction
where [*A*] is the instantaneous concentration of *A*, and an maCRN reaction
can be translated to a gCRN reaction
or to two U-gCRN reactions
and
.

The family of population dynamics specifications that can be described using basic eSTG is equivalent to U-gCRN. A U-gCRN reaction
can be translated into an eSTG reaction
, and conversely an eSTG reaction
can be translated into a set of U-gCRN reactions
.

The U-gCRN form of eSTGs implies that one must make choices in modelling: the main species that are the focus of a model, and occur in the left-hand side of productions, will be reflected in the generated lineage trees, but auxiliary species that appear only in the rate laws will not, even when those would be considered as equal in a model based on bimolecular interactions.

### Operational semantics

We will start with basic definitions for the semantics of Lineage Trees. Paths in a tree are represented as finite sequences of natural numbers *π* = *n*
_{1}, …, *n*
_{
m
} ∈ ℕ* (star means finite sequence, with *nil* as the empty sequence, and ", " as sequence concatenation). Each number *n* in a path represents the *n*
^{
th
} child of a node, starting from the root. Nodes in a tree are labeled by an alphabet *S*
_{0} = *S* ∪ {0} consisting of species in *S* and a distinguished symbol 0 ∉ *S* (the "dead" leaf).

*Definition*: a *tree L* is a partial function in ℕ* → *S*
_{0}, from paths in ℕ* to label nodes in *S*
_{0}, whose domain is non-empty and prefix-closed (that is, L(*π*
_{1}, *π*
_{2}) defined ⇒ L(*π*
_{1}) defined).

*Definition:* A *leaf* in a tree *L* is a maximal path *π* - one such that *L*(*π*) is defined and there is no *π* ' ≠ *nil* where *L*(*π* , *π*') is defined. We also say that *π*, *B* is a (*B* -labeled) leaf in *L* if *π* is a leaf in *L* and *L*(*π*) = *B*.

*Definition*: A *lineage tree L* is a tree where each path *π* such that *L*(*π*) = 0 is a leaf.
is the set of such trees.

By these definitions, a tree is a non-empty set of paths and each node has a "unique label" which is the path *π* that leads to it. A root-only tree is a function from *nil* to some species *A*.

Next, we use the

*λ* -calculus notation for the definitions of lineage tree operators (if

*f* (

*x*) =

*b* then we write

*f* =

*λx. b*). We use the element

*undef* for partially defined functions:

- 1.
The lineage tree with just one dead leaf:

- 2.
The lineage tree with root

*A* ∈

*S* and children

*L*
_{
i
}, for

*A* ≠ 0 and

*n* > = 0:

where for

*n* = 0,

*A* =

*A*() is a "live" leaf.

- 3.
The

*leaf-extension* operator

*L*,

*π*,

*A* ⊲ (

*B*
_{1}, …

*B*
_{
n
}), which is defined if

*π* is an

*A* -labeled live leaf in

*L*(

*L*(

*π*) =

*A* ≠ 0), and

*n* > 0, and

*B*
_{1} …

*B*
_{
n
} ∈

*S*
_{0}:

For example, by the above definitions a tree with root *C* and with *n* children *B*
_{1}, …, *B*
_{
n
} which are all leaves can be written as the expression *C*(*B*
_{1}(), …, *B*
_{
n
}()), representing a function that given the sequence *nil* returns the label *C*, given the sequence *i*, *nil* returns the label *B*
_{
i
}, and is otherwise undefined. Similarly, the expression *C*(), *nil*, *C* ⊲ (*B*
_{1}, …, *B*
_{
n
}) represents the tree *C*() where the leaf *C* is extended into a node with children *B*
_{1}, …, *B*
_{
n
}; this is then the same as the tree *C*(*B*
_{1}(), …, *B*
_{
n
}()).

A collection of eSTG reactions describes a way of generating and transforming lineage trees. We now describe how each eSTG reaction transforms a lineage tree into new lineage trees. More precisely, since eSTG reactions are stochastic/probabilistic, how each reaction produces a *measure* of new lineage trees, where each new lineage tree is associated with its rate of occurrence.

*Definition*: A

*measure*
is a function from finite tuples of lineage trees to non-negative reals, with operators:

the singleton measure, which measures

as

*r* and everything else as 0;

the sum measure, with

*m* > 0;

the leaf-extension measure, where *π*, *B* is a leaf in *L*; this is a function in
. This is the measure such that any extended tree of the form *L*, *π*, *B* ⊲ (*L*
_{1,} …, *L*
_{
n
}) for some *L*
_{1}, …, *L*
_{
n
} receives the measure *M*(*L*
_{1}, …, *L*
_{
n
}).

For example, *C*(), *nil*, *C* ⊲ (*d*(*r*, (*D*(), *E*())) + *d*(*s*, *F*())) = *d*(*r*, *C*(*D*(), *E*())) + *d*(*s*, *C*(*F*())) because *C*(*D*(), *E*()) has the shape *C*(), *nil*, *C* ⊲ (*D*(), *E*()) and so it receives measure *r*, and *C*(*F*()) has shape *C*(), *nil*, *C* ⊲ (*F*()) and so it receives measure *s*.

We are now ready to define the effect of a set of eSTG reactions

S on lineage trees. This is given as a

*reduction* relation

R between lineage trees and measures. We write

*L* →

*M* (

*L reduces to M*) for (

*L*,

*M*) ∈

R, where

R is defined as the smallest relation satisfying the following rule:

This rule prescribes, for example, how to carry out a simulation of a set of eSTG reactions given an initial lineage tree: at each step apply the rule above to all applicable reactions and tree leaves, sum all the measures so obtained, and sample a new lineage tree according to the resulting measure.