void copy_metadata( const truth_table<T>& spec, circuit& circ ) { circ.set_inputs( spec.inputs() ); circ.set_outputs( spec.outputs() ); circ.set_constants( spec.constants() ); circ.set_garbage( spec.garbage() ); }
unsigned add_line_to_circuit( circuit& circ, const std::string& input, const std::string& output, const constant& c, bool g ) { std::vector<std::string> ins = circ.inputs(); std::vector<std::string> outs = circ.outputs(); std::vector<constant> cs = circ.constants(); std::vector<bool> gar = circ.garbage(); circ.set_lines( circ.lines() + 1u ); ins += input; circ.set_inputs( ins ); outs += output; circ.set_outputs( outs ); cs += c; circ.set_constants( cs ); gar += g; circ.set_garbage( gar ); return circ.lines() - 1u; }