Expand description
The library of basic functions that operates on circuits provided by gatesim. This library provide set of functions that doing some operations on circuits. Routines provided to make following operations:
- translate circuits inputs and circuit outputs.
- fill outputs defined in output map.
- generate circuits that have assigned values to original inputs.
- generate optimized circuits that have assigned values to original inputs.
- generate optimized and deduplicated circuits that have assigned values to original inputs.
- optimize clause circuit.
- deduplicate circuit or clause circuit.
- optimize and deduplicate clause circuit.
- generate circuit with negated inputs.
- generate join of two circuits sequentially.
- generate join of many circuits sequentially.
- calculate minimal and maximal depth of circuit.
- calculate minimal and maximal depth and depths for any gate of circuit.
- generate pipelined circuit.
- join input or output maps.
Some WARNINGS about using some routines. A optimization and deduplication routines are not completely tested and they can get wrong results in some specific input. They shouldn’t be used in deployed software.
Re-exports§
pub use gatesim;
Enums§
- Output
Entry - Output entry to store assignment of value (for output and input).
Functions§
- assign_
to_ circuit - Assigns inputs to circuit.
- assign_
to_ circuit_ and_ optimize - Assigns inputs to circuit and optimize circuit.
- assign_
to_ circuit_ optimize_ and_ dedup - Assigns inputs to circuit, deduplicate and optimize circuit.
- deduplicate
- Deduplicates gates in circuit. It finds duplicates by comparing gate and its inputs.
- deduplicate_
clause_ circuit - Deduplicate clauses and clause literals.
- fill_
outputs - Fill circuit outputs by zero or one wire based on output map given by assign_to_circuit.
- join_
circuits_ seq - Join multiple circuits sequentially.
- join_
input_ entry_ and_ input_ map - Joins input/output maps from previous and next operation and returns joined input/output map.
- join_
input_ map - Joins input/output maps from previous and next operation and returns joined input/output map.
- join_
output_ entry_ map - Joins input/output maps from previous and next operation and returns joined input/output map.
- join_
two_ circuits - Join two circuits sequentially.
- min_
and_ max_ depth - Calculates minimal and maximal depth of circuit and depth for all circuit wires.
- min_
and_ max_ depth_ list - Calculates minimal and maximal depth of circuit and depth for all circuit wires.
- negate_
inputs - Generates circuit with negated original circuit inputs from original circuit.
- optimize_
and_ dedup_ clause_ circuit - Optimize and deduplicate clause circuit.
- optimize_
clause_ circuit - Optimize clause circuit.
- reverse_
trans - Reverses translation table.
- simple_
pipeliner - Generates pipelined version of circuit.
- translate_
inputs - Translates circuit inputs using translation table.
- translate_
inputs_ rev - Translates circuit inputs using reversed translation table.
- translate_
outputs - Translates circuit outputs using translation table.
- translate_
outputs_ rev - Translates circuit outputs using reversed translation table.