spot: Implement dt*a_sat_minimize_assume(...) methods
* python/spot/__init__.py: Add 'assume' option. * spot/misc/satsolver.cc: Add function to handle assumptions. * spot/misc/satsolver.hh: Declare assumption function. * spot/twaalgos/dtbasat.cc: Implement dtba_sat_minimize_assume. * spot/twaalgos/dtbasat.hh: Declare it. * spot/twaalgos/dtwasat.cc: Implement dtwa_sat_minimize_assume and handle options. * spot/twaalgos/dtwasat.hh: Declare it. * spot/twaalgos/postproc.cc: Handle options. * spot/twaalgos/postproc.hh: Use param_ var for incr and assume. * tests/core/satmin.test: Add tests for the new function. * tests/core/satmin2.test: Add tests for the new function. * tests/python/satmin.py: Add tests for the new function.
This commit is contained in:
parent
ee17c2dee4
commit
9a204b770f
12 changed files with 1021 additions and 69 deletions
|
|
@ -79,6 +79,9 @@ namespace spot
|
|||
/// \brief Adjust the number of variables used in the cnf formula.
|
||||
void adjust_nvars(int nvars);
|
||||
|
||||
/// \brief Declare the number of vars reserved for assumptions.
|
||||
void set_nassumptions_vars(int nassumptions_vars);
|
||||
|
||||
/// \brief Add a list of lit. to the current clause.
|
||||
void add(std::initializer_list<int> values);
|
||||
|
||||
|
|
@ -114,6 +117,10 @@ namespace spot
|
|||
template<typename T, typename... Args>
|
||||
void comment(T first, Args... args);
|
||||
|
||||
/// \brief Assume a litteral value.
|
||||
/// Must only be used with distributed picolib.
|
||||
void assume(int lit);
|
||||
|
||||
typedef std::vector<bool> solution;
|
||||
typedef std::pair<int, solution> solution_pair;
|
||||
|
||||
|
|
@ -146,6 +153,11 @@ namespace spot
|
|||
std::ostream* cnf_stream_;
|
||||
int nclauses_;
|
||||
int nvars_;
|
||||
int nassumptions_vars_; // Surplus of vars (for 'assume' algorithm).
|
||||
|
||||
/// \brief Number of solutions to obtain from the satsolver
|
||||
/// (without assuming litterals).
|
||||
int nsols_;
|
||||
|
||||
/// \brief Picosat satsolver instance.
|
||||
PicoSAT* psat_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue