molfoundry.FlowSolutionCertificate#

class molfoundry.FlowSolutionCertificate(solution, firing_order)#

A witness that a FlowSolution is realizable: one concrete order in which the reactions fire so that, starting from the inflow marking, no reaction consumes a species before enough of it exists. It holds the FlowSolution it realizes (its solution), which supplies the derivation graph and the initial marking.

The certificate is the firing sequence itself, so it iterates as its hyperedges in firing order (a reaction that fires n times appears n times):

for step, edge in enumerate(certificate, 1):
    ...

print() / svg() unroll it into a causal DAG — each firing its own reaction node, each molecule token its own species node.

Parameters:
property solution: FlowSolution#

The flow solution this certificate realizes.

property dg: DG#
property edges: List[HyperEdge]#

The reactions in firing order (a reaction fired n times appears n times).

trajectoryTable()#

Return the marking trajectory as a fixed-width text table: one row per species, one column per time step. Column 0 is the initial (inflow) marking; column i + 1 is the marking after the i-th reaction of the firing order fires. Each cell is how many copies of that species exist at that step.

Return type:

str

svg() → str#
svg(printer: DGPrinter | None = None) → str

Render the certificate as a causal DAG and return the SVG string.

Without a printer the layered (dot) layout is used, since the unrolled firing is a directed acyclic graph that reads best top-to-bottom.

Parameters:

printer (DGPrinter | None)

Return type:

str

print() → None#
print(printer: DGPrinter | None = None) → None

Emit the causal-DAG drawing (see svg()) as a summary card.

Parameters:

printer (DGPrinter | None)

Return type:

None