Skip to content

Commit

Permalink
Slight API change
Browse files Browse the repository at this point in the history
Encoders may depend on underlying SAT backend, not the other way around.
  • Loading branch information
whaaswijk committed May 7, 2018
1 parent 4924961 commit dd600fd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
19 changes: 14 additions & 5 deletions include/percy/percy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,21 +418,30 @@ namespace percy
The following are constructor functions that allocate new synthesizer
objects. This is the preferred way of instantiating new synthesizers.
***************************************************************************/
template<int FI=2, typename E=knuth_encoder<FI>, typename S=sat_solver*>
template<
int FI=2,
typename S=sat_solver*,
typename E=knuth_encoder<FI, S>>
auto
new_std_synth()
{
return std::make_unique<std_synthesizer<FI, E, S>>();
}

template<int FI=2, typename E=fence_encoder<FI>, typename S=sat_solver*>
template<
int FI=2,
typename S=sat_solver*,
typename E=fence_encoder<FI, S>>
auto
new_fence_synth()
{
return std::make_unique<fence_synthesizer<FI, E, S>>();
}

template<int FI=2, typename E=dag_encoder<dag<FI>>, typename S=sat_solver*>
template<
int FI=2,
typename S=sat_solver*,
typename E=dag_encoder<dag<FI>,S>>
auto
new_dag_synth()
{
Expand All @@ -441,8 +450,8 @@ namespace percy

template<
int FI=2,
typename E=floating_dag_encoder<FI>,
typename S=sat_solver*>
typename S=sat_solver*,
typename E=floating_dag_encoder<FI, S>>
auto
new_floating_dag_synth()
{
Expand Down
3 changes: 1 addition & 2 deletions test/cms_equivalence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ void check_std_equivalence(bool full_coverage)
synth_spec<static_truth_table<NrIn>> spec(NrIn, 1);

auto synth1 = new_std_synth();
auto synth2 = new_std_synth<2,
knuth_encoder<2, CMSat::SATSolver*>, CMSat::SATSolver*>();
auto synth2 = new_std_synth<2, CMSat::SATSolver*>();

spec.verbosity = 0;

Expand Down
3 changes: 1 addition & 2 deletions test/glucose_equivalence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ void check_std_equivalence(bool full_coverage)
synth_spec<static_truth_table<NrIn>> spec(NrIn, 1);

auto synth1 = new_std_synth();
auto synth2 = new_std_synth<2,
knuth_encoder<2, Glucose::Solver*>, Glucose::Solver*>();
auto synth2 = new_std_synth<2, Glucose::Solver*>();

spec.verbosity = 0;

Expand Down
2 changes: 2 additions & 0 deletions test/synth_equivalence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ int main(int argc, char **argv)
4,
3>(full_coverage);
//check_equivalence<STD,DAG, 4, 3>(full_coverage);
//
auto synth = new_std_synth<3, Glucose::MultiSolvers*>();

return 0;
}
Expand Down
3 changes: 1 addition & 2 deletions test/syrup_equivalence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ void check_std_equivalence(bool full_coverage)
synth_spec<static_truth_table<NrIn>> spec(NrIn, 1);

auto synth1 = new_std_synth();
auto synth2 = new_std_synth<2,
knuth_encoder<2, Glucose::MultiSolvers*>, Glucose::MultiSolvers*>();
auto synth2 = new_std_synth<2, Glucose::MultiSolvers*>();

spec.verbosity = 0;

Expand Down

0 comments on commit dd600fd

Please sign in to comment.