core.benchmarks package#

Submodules#

core.benchmarks.Benchmark module#

class core.benchmarks.Benchmark.BLIFBenchmark(blif: Blif, file_path: Path | None = None, name: str | None = None)[source]#

Bases: Benchmark, Loggable

A class to represent a BLIF benchmark.

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

static from_string(content: str) BooleanFunction[source]#
get_auxiliary_variables() Set[str][source]#

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

static get_file_extension() str[source]#
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.

model_name() str[source]#

Returns the name of this BLIF benchmark. :return: The name of this BLIF benchmark.

static read(file_path: Path) BLIFBenchmark[source]#

Reads a BLIF benchmark from the file with the given file path. :param file_path: The path of the BLIF file. :return: A BLIF benchmark.

to_blif() BLIFBenchmark[source]#
to_data_flow_graph()[source]#

Returns a data flow graph of this BLIF benchmark. The leaf nodes are the primary input variables, and the root nodes are the output variables.

to_file_path(file_name: str)[source]#
to_pla() PLABenchmark[source]#
to_string() str[source]#
to_verilog() VerilogBenchmark[source]#
class core.benchmarks.Benchmark.Benchmark(file_path: Path | None = None, name: str | None = None)[source]#

Bases: BooleanFunction, Loggable, IOInterface, ABC

An abstract class to represent a benchmark. A benchmark is a multi-output Boolean function.

get_log() List[Dict[str, Any]] | Dict[str, Any][source]#
abstract to_blif() BLIFBenchmark[source]#
abstract to_pla() PLABenchmark[source]#
abstract to_verilog() VerilogBenchmark[source]#
class core.benchmarks.Benchmark.PLABenchmark(pla: PLA, file_path: Path | None = None, name: str | None = None)[source]#

Bases: Benchmark

A class to represent a PLA benchmark.

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

static from_string(content: str) BooleanFunction[source]#
get_auxiliary_variables() Set[str][source]#

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

get_file_extension() str[source]#
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) PLABenchmark[source]#
to_blif() BLIFBenchmark[source]#
to_pla() PLABenchmark[source]#
to_string() str[source]#
to_verilog() VerilogBenchmark[source]#
class core.benchmarks.Benchmark.VerilogBenchmark(verilog: VerilogModule, file_path: Path | None = None, name: str | None = None)[source]#

Bases: Benchmark

A class to represent a Verilog benchmark.

collapse() VerilogBenchmark[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).

fix(atom: str, positive: bool) VerilogBenchmark[source]#
static from_string(content: str) BooleanFunction[source]#
get_auxiliary_variables() Set[str][source]#

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

static get_file_extension() str[source]#
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.

negate() VerilogBenchmark[source]#

Returns the negation of this benchmark.

static read(file_path: Path) VerilogBenchmark[source]#
to_blif(collapse: bool = True) BLIFBenchmark[source]#
to_pla() PLABenchmark[source]#
to_string() str[source]#
to_verilog() VerilogBenchmark[source]#
to_z3() Dict[str, Bool][source]#

core.benchmarks.Formula module#

class core.benchmarks.Formula.Formula(verilog: VerilogFormula)[source]#

Bases: BooleanFunction

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.

static get_file_extension() str[source]#
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.

negate() Formula[source]#

Returns the negation of this formula.

class core.benchmarks.Formula.VerilogFormula[source]#

Bases: object

negate()[source]#

Module contents#