core package#

Subpackages#

Submodules#

core.BooleanFunction module#

class core.BooleanFunction.BooleanFunction(name: str | None = None)[source]#

Bases: BooleanFunctionInterface, ABC

An abstract class to represent a Boolean function.

abstract static get_file_extension() str[source]#
get_file_path() Path[source]#
get_name() str[source]#

Returns the name of this Boolean function. :return:

core.BooleanFunctionCollection module#

class core.BooleanFunctionCollection.BooleanFunctionCollection(boolean_functions: Set[BooleanFunction] | None = None)[source]#

Bases: BooleanFunctionInterface, Loggable

A class to represent a set of multi-output Boolean functions.

add(boolean_function: BooleanFunction)[source]#

Adds a multi-output Boolean function to this :param boolean_function: :return:

copy()[source]#
draw() Set[str][source]#
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.

get_log() Dict[str, Any][source]#
get_output_variables() Set[str][source]#

Returns the set of output variables of this multi-output Boolean function.

static read(file_path: Path) BooleanFunctionInterface[source]#
to_json() Dict[Any, Any][source]#
to_string() str[source]#
write(file_path: Path | None = None)[source]#

core.BooleanFunctionInterface module#

class core.BooleanFunctionInterface.BooleanFunctionInterface[source]#

Bases: ABC

An interface for a multi-output Boolean function.

abstract 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).

abstract get_auxiliary_variables() Set[str][source]#

Returns the set of auxiliary variables of this multi-output Boolean function.

abstract get_input_variables() Set[str][source]#

Returns the set of input variables of this multi-output Boolean function.

abstract get_output_variables() Set[str][source]#

Returns the set of output variables of this multi-output Boolean function.

core.DrawInterface module#

class core.DrawInterface.DrawInterface[source]#

Bases: ABC

abstract to_dot() str[source]#

core.IOInterface module#

class core.IOInterface.IOInterface[source]#

Bases: ABC

abstract static from_string(content: str) BooleanFunction[source]#
abstract static read(filepath: Path) BooleanFunction[source]#
abstract to_string() str[source]#
write(file_path: Path)[source]#

Module contents#