core.decision_diagrams package#
Submodules#
core.decision_diagrams.BDD module#
- class core.decision_diagrams.BDD.BDD(graph: DiGraph, variable_order: List[str], name: str | None = None)[source]#
Bases:
DD
A class to represent a binary decision diagram (BDD). A BDD can either be a ROBDD or SBDD, and is defined by its directed acyclic graph (DAG).
- FALSE = '0'#
- TRUE = '1'#
- eval(instance: Dict[str, bool]) Dict[str, bool] [source]#
Evaluates this BDD by traversing the DAG from root nodes to leaf nodes (positive and/or negative terminal node). :param instance: A dictionary mapping the input variables to a Boolean truth value (true/false). :return: A dictionary mapping the output variables to a Boolean truth value (true/false).
- get_auxiliary_variables() Set[str] [source]#
Returns the set of auxiliary variables of this multi-output Boolean function.
- get_input_variables() Set[str] [source]#
Returns the input variables from this BDD. :return: A set of the input variables of this BDD.
- get_output_variables() Set[str] [source]#
Returns the output variables from this BDD. :return: A set of the output variables of this BDD.
- get_variable_order() List[str] [source]#
Returns the variable order of the input variables of this BDD. :return: A list of the input variables such that they are in variable order.
- prune() BDD [source]#
Prunes this BDD. Pruning entails the removal of the negative terminal node. :return: A BDD without the negative terminal node of this BDD.
core.decision_diagrams.BDDCollection module#
- class core.decision_diagrams.BDDCollection.BDDCollection(bdds: Set[BDD] | None = None)[source]#
Bases:
DDCollection
- get_auxiliary_variables() Set[str] [source]#
Returns the set of auxiliary variables of this multi-output Boolean function.
- get_input_variables() Set[str] [source]#
Returns the set of input variables of this multi-output Boolean function.
- get_output_variables() Set[str] [source]#
Returns the set of output variables of this multi-output Boolean function.
- static read(file_path: Path) BDDCollection [source]#
core.decision_diagrams.BDDTopology module#
- class core.decision_diagrams.BDDTopology.BDDTopology(topology: DiGraph, bdds: Dict[str, BDD])[source]#
Bases:
BooleanFunctionCollection
,DrawInterface
- eval(instance: Dict[str, bool]) Dict[str, bool] [source]#
Given the instance, this function returns an evaluation of this multi-output Boolean function. An evaluation is an assignment for each variable to a Boolean truth value (true/false). :param instance: A dictionary mapping the input variables (str) to the Boolean truth values true and false (bool). :return: A dictionary mapping the output variables (str) to the Boolean truth values true and false (bool).
- get_auxiliary_variables() Set[str] [source]#
Returns the set of auxiliary variables of this multi-output Boolean function.
- get_boolean_functions() Set[BooleanFunction] [source]#
- get_input_variables() Set[str] [source]#
Returns the set of input variables of this multi-output Boolean function.
core.decision_diagrams.DD module#
- class core.decision_diagrams.DD.DD(graph: DiGraph, name: str | None = None)[source]#
Bases:
BooleanFunction
,IOInterface
,DrawInterface
,ABC
core.decision_diagrams.DDCollection module#
- class core.decision_diagrams.DDCollection.DDCollection(dds: Set[DD] | None = None)[source]#
Bases:
BooleanFunctionCollection
- get_auxiliary_variables() Set[str] [source]#
Returns the set of auxiliary variables of this multi-output Boolean function.
- get_input_variables() Set[str] [source]#
Returns the set of input variables of this multi-output Boolean function.
- get_output_variables() Set[str] [source]#
Returns the set of output variables of this multi-output Boolean function.
- prune() DDCollection [source]#
- static read(file_path: Path) BooleanFunctionCollection [source]#