cana.io.bnet module

BoolNet / PyBoolNet *.bnet (targets,factors) import and export.

cana.io.bnet.parse_bnet_update_rule(line)[source]

Parse one target, named_expression line, or None if not a rule.

Skips blanks, comments, and the targets,factors header.

Parameters:

line (str)

Return type:

Tuple[str, str] | None

cana.io.bnet.parse_bnet(text)[source]

Parse BoolNet / PyBoolNet *.bnet into a node list.

Parameters:

text (str)

Return type:

List[BooleanNode]

cana.io.bnet.nodes_to_bnet(nodes, *, warn=True)[source]

Export a node list to BoolNet targets,factors text.

Prefers stored expression, then one-symbol schemata, then LUT DNF. Soft-warns when verification flags are not True (never blocks).

Parameters:
Return type:

str