An important design goal of SBML rule semantics is to ensure that a
model's simulation and analysis results will not be dependent on when or
how often rules are evaluated. To achieve this, SBML needs to place two
restrictions on rule use. The first concerns algebraic loops in the system
of assignments in a model, and the second concerns overdetermined systems.
The combined set of InitialAssignment, AssignmentRule and KineticLaw
objects in a model constitute a set of assignment statements that should be
considered as a whole. (A KineticLaw object is counted as an assignment
because it assigns a value to the symbol contained in the "id" attribute of
the Reaction object in which it is defined.) This combined set of
assignment statements must not contain algebraic loops—dependency
chains between these statements must terminate. To put this more formally,
consider a directed graph in which nodes are assignment statements and
directed arcs exist for each occurrence of an SBML species, compartment or
parameter symbol in an assignment statement's "math" subelement. Let the
directed arcs point from the statement assigning the symbol to the
statements that contain the symbol in their "math" subelement expressions.
This graph must be acyclic.
SBML does not specify when or how often rules should be evaluated.
Eliminating algebraic loops ensures that assignment statements can be
evaluated any number of times without the result of those evaluations
changing. As an example, consider the set of equations x = x + 1,
y = z + 200 and z = y + 100. If this set of equations
were interpreted as a set of assignment statements, it would be invalid
because the rule for x refers to x (exhibiting one type
of loop), and the rule for y refers to z while the rule
for z refers back to y (exhibiting another type of loop).
Conversely, the following set of equations would constitute a valid set of
assignment statements: x = 10, y = z + 200, and z = x
+ 100.
An SBML model must not be overdetermined; that is, a model must not
define more equations than there are unknowns in a model. An SBML model
that does not contain AlgebraicRule structures cannot be overdetermined.
LibSBML implements the static analysis procedure described in
Appendix B of the SBML Level 3 Version 1 Core
specification for assessing whether a model is overdetermined.
(In summary, assessing whether a given continuous, deterministic,
mathematical model is overdetermined does not require dynamic analysis; it
can be done by analyzing the system of equations created from the model.
One approach is to construct a bipartite graph in which one set of vertices
represents the variables and the other the set of vertices represents the
equations. Place edges between vertices such that variables in the system
are linked to the equations that determine them. For algebraic equations,
there will be edges between the equation and each variable occurring in the
equation. For ordinary differential equations (such as those defined by
rate rules or implied by the reaction rate definitions), there will be a
single edge between the equation and the variable determined by that
differential equation. A mathematical model is overdetermined if the
maximal matchings of the bipartite graph contain disconnected vertexes
representing equations. If one maximal matching has this property, then
all the maximal matchings will have this property; i.e., it is only
necessary to find one maximal matching.)