Specifications¶
In percy we use specification objects to tell synthesizers both what and
how to synthesize. Specifications are implemented by the
synth_spec class, which can be found under <percy/spec.hpp>.
We can specify the functions to synthesize, but we also control some optional
parameters such as conflict limits, and various symmetry breaking flags.
Symmetry breaking is used to rule out certain “symmetric” solutions. Often
we’re not interested a solution if it is symmetric to one we have already
found. [1] Ruling out such solutions makes the search space smaller and thus
speeds up synthesis. Note that the symmetry breaking flags should be
interpreted as hints and not as law: they may not be implemented in all
synthesizers. In fact, depending on the implementation, not all flags may apply
to some synthesizers’ synthesis process.
Note that synth_spec takes a template parameter. This parameter
specifies the type of functions to synthesize (i.e. static or dynamic kitty
truth tables).
- template <typename TT>
-
class percy
::synth_spec¶ Public Functions
-
percy::synth_spec
synth_spec()¶ Default constructor leaves default settings untouched.
-
percy::synth_spec
synth_spec(int nr_in, int nr_out)¶ Construct a spec with nr_in inputs and nr_out outputs.
-
void percy::synth_spec
set_nr_in(const int n)¶
-
void percy::synth_spec
set_nr_out(const int n)¶
-
int percy::synth_spec
get_nr_in() const¶
-
int percy::synth_spec
get_tt_size() const¶
-
int percy::synth_spec
get_nr_out() const¶
-
void percy::synth_spec
preprocess(void)¶ Normalizes outputs by converting them to normal functions. Also checks for trivial outputs, such as constant functions or projections. This determines which of the specifeid functions need to be synthesized. This function expects the following invariants to hold:
- The number of input variables has been set.
- The number of output variables has been set.
- The functions requested to be synthesized have been set.
Public Members
-
int percy::synth_spec
nr_steps¶ The number of Boolean operators to use.
-
int percy::synth_spec
verbosity= 0¶ Verbosity level for debugging purposes.
-
uint64_t percy::synth_spec
out_inv¶ Is 1 at index i if output i must be inverted.
-
uint64_t percy::synth_spec
triv_flag¶ Is 1 at index i if output i is constant zero or one or a projection.
-
int percy::synth_spec
nr_triv¶ Number of trivial output functions.
-
int percy::synth_spec
nr_nontriv¶ Number of non-trivial output functions.
-
int percy::synth_spec
nr_rand_tt_assigns¶ Number of truth table bits to assign randomly in CEGAR loop.
-
bool percy::synth_spec
add_nontriv_clauses= true¶ Symmetry break: do not allow trivial operators.
-
bool percy::synth_spec
add_alonce_clauses= true¶ Symmetry break: all steps must be used at least once.
-
bool percy::synth_spec
add_noreapply_clauses= true¶ Symmetry break: no re-application of operators.
-
bool percy::synth_spec
add_colex_clauses= true¶ Symmetry break: order step fanins co-lexicographically.
-
bool percy::synth_spec
add_lex_func_clauses= true¶ Symmetry break: order step operators co-lexicographically.
-
bool percy::synth_spec
add_symvar_clauses= true¶ Symmetry break: impose order on symmetric variables.
-
bool percy::synth_spec
add_lex_clauses= false¶ Symmetry break: order step fanins lexicographically.
-
template<>
const TT *percy::synth_spec<TT>functions[MAX_OUT]¶ The functions to synthesize.
-
template<>
int percy::synth_spec<TT>triv_functions[MAX_OUT]¶ Trivial outputs.
-
template<>
int percy::synth_spec<TT>synth_functions[MAX_OUT]¶ Nontrivial outputs.
-
int64_t percy::synth_spec
synth_time¶ A place for synthesizers to log elapsed synthesis time. Measured in microseconds.
-
int percy::synth_spec
conflict_limit= 0¶ Limit on the number of SAT conflicts. Zero means no limit.
Private Members
-
int percy::synth_spec
nr_in¶ The number of inputs to the function.
-
int percy::synth_spec
tt_size¶ The size of the truth table.
-
int percy::synth_spec
nr_out¶ The number of outputs to synthesize.
-
percy::synth_spec
| [1] | An example would be a solution in which we simply swap two inputs. |