pub fn optimize_clause_circuit<T>(
circuit: ClauseCircuit<T>,
) -> (ClauseCircuit<T>, Vec<Option<T>>, Vec<OutputEntry<T>>)Expand description
Optimize clause circuit.
WARNING: This function is not completely tested. It should be used enough carefully.
Returned circuit is optimized: reduce any clause that can be replaced by single wire and evaluate trees of clauses to single value including same outputs. It optimize circuit by joining clauses with same type and resolving duplicates of literals in clauses and resolving values from that clauses.
Function returns optimized circuit, list of mapping of original circuit inputs and
list of mapping original circuit outputs.
First list contains entries as options of index Option<T>. If entry is None then
original circuit input is not used, if entry is Some(...) then value is new circuit
input index. Second list contains OutputEntry
that it is NewIndex if circuit output is stored in new index or
have Value if circuit outputs are calculated to value.
An entry index from list is original index of circuit input or circuit output.