The list of all pattern variables used by the guard condition. Each element of this list is a list of variables used by one guard clause. In the example shown above, this will be List(List('y, 'z))
because all other conditions are moved out of the guard.
The conjunction of all the clauses of the guard that are independent of pattern variables. This closure can be called in order to determine whether the reaction should even be considered to start, regardless of the presence of molecules. In this example, the value of staticGuard
will be Some(() => n > 1)
.
A list of values of type CrossMoleculeGuard, each representing one cross-molecule clauses of the guard. The partial function Any => Unit
should be called with the arguments representing the tuples of pattern variables from each molecule used by the cross guard.
In the present example, the value of crossGuards
will be
indices = Array(1, 2), List((List('y, 'z), { case List(y: Int, z: Int) if y > z => () }))
A list of values of type CrossMoleculeGuard, each representing one cross-molecule clauses of the guard.
A list of values of type CrossMoleculeGuard, each representing one cross-molecule clauses of the guard. The partial function Any => Unit
should be called with the arguments representing the tuples of pattern variables from each molecule used by the cross guard.
In the present example, the value of crossGuards
will be
indices = Array(1, 2), List((List('y, 'z), { case List(y: Int, z: Int) if y > z => () }))
Checks whether the reaction has no cross-molecule guard conditions.
Checks whether the reaction has no cross-molecule guard conditions.
For example, go { case a(x) + b(y) if x > y => }
has a cross-molecule guard condition,
whereas go { case a(x) + b(y) if x == 1 && y == 2 => }
has no cross-molecule guard conditions because its guard condition
can be split into a conjunction of guard conditions that each constrain the value of a single molecule.
true
if the reaction has no guard condition, or if it has guard conditions that can be split between molecules;
false
if the reaction has a cross-molecule guard condition.
The conjunction of all the clauses of the guard that are independent of pattern variables.
The conjunction of all the clauses of the guard that are independent of pattern variables. This closure can be called in order to determine whether the reaction should even be considered to start, regardless of the presence of molecules. In this example, the value of staticGuard
will be Some(() => n > 1)
.
Checks whether the reaction should not start because its static guard is present and returns false
.
Checks whether the reaction should not start because its static guard is present and returns false
.
true
if the reaction's static guard returns false
.
false
if the reaction has no static guard, or if the static guard returns true
.
The list of all pattern variables used by the guard condition.
The list of all pattern variables used by the guard condition. Each element of this list is a list of variables used by one guard clause. In the example shown above, this will be List(List('y, 'z))
because all other conditions are moved out of the guard.
Indicates whether guard conditions are required for this reaction to start.
The guard is parsed into a flat conjunction of guard clauses, which are then analyzed for cross-dependencies between molecules.
For example, consider the reaction
Here
n
is an integer constant defined outside the reaction. The conditions for starting this reaction is thata(x)
has valuex
such thatx > n
; thatb(y)
has valuey
such thaty > 0
; thatc(z)
has valuez
such thaty > z
; and finally thatn > 1
, independently of any molecule values. The conditionn > 1
is a static guard. The conditionx > n
restricts only the moleculea(x)
and therefore can be moved out of the guard into the per-molecule conditional inside InputMoleculeInfo for that molecule. Similarly, the conditiony > 0
can be moved out of the guard. However, the conditiony > z
relates two different molecule values; it is a cross-molecule guard.Any guard condition given by the reaction code will be converted to the Conjunctive Normal Form, and split into a static guard, a set of per-molecule conditionals, and a set of cross-molecule guards.
The list of all pattern variables used by the guard condition. Each element of this list is a list of variables used by one guard clause. In the example shown above, this will be
List(List('y, 'z))
because all other conditions are moved out of the guard.The conjunction of all the clauses of the guard that are independent of pattern variables. This closure can be called in order to determine whether the reaction should even be considered to start, regardless of the presence of molecules. In this example, the value of
staticGuard
will beSome(() => n > 1)
.A list of values of type CrossMoleculeGuard, each representing one cross-molecule clauses of the guard. The partial function
Any => Unit
should be called with the arguments representing the tuples of pattern variables from each molecule used by the cross guard. In the present example, the value ofcrossGuards
will be