twaalgos: Improve data storage in SAT-minimization

* spot/misc/satsolver.hh: Make solver return vector<bool> instead of
vector<int>.
* spot/misc/satsolver.cc: Update code.
* spot/priv/Makefile.am: Add satcommon.*
* spot/priv/satcommon.hh: Declare helper class and factorize some
duplicate code of dt*asat.cc
* spot/priv/satcommon.cc: Implement helper class and factorize some
duplicate code of dt*asat.cc
* spot/twaalgos/dtbasat.cc: Declare helper, implement some functions
in dict struct and update code.
* spot/twaalgos/dtwasat.cc: Declare helper, implement some functions
in dict struct and update code.
* tests/core/readsat.cc: Update tests.
* tests/core/satmin.test: Typo.
* tests/core/satmin2.test: Update an expected result.
This commit is contained in:
Alexandre GBAGUIDI AISSE 2016-10-25 16:29:29 +02:00
parent 79f4c8e0d7
commit 9acd7370b2
10 changed files with 1282 additions and 1004 deletions

View file

@ -114,7 +114,7 @@ namespace spot
template<typename T, typename... Args>
void comment(T first, Args... args);
typedef std::vector<int> solution;
typedef std::vector<bool> solution;
typedef std::pair<int, solution> solution_pair;
/// \brief Return std::vector<solving_return_code, solution>.
@ -130,7 +130,11 @@ namespace spot
/// \brief Extract the solution of Picosat output.
/// Must be called only if SPOT_SATSOLVER env variable is not set.
satsolver::solution
picosat_get_solution(int res);
picosat_get_sol(int res);
/// \brief Extract the solution of a SAT solver output.
satsolver::solution
satsolver_get_sol(const char* filename);
private: // variables
/// \brief A satsolver_command. Check if SPOT_SATSOLVER is given.
@ -148,9 +152,8 @@ namespace spot
};
/// \brief Extract the solution of a SAT solver output.
SPOT_API satsolver::solution
SPOT_API std::vector<int>
satsolver_get_solution(const char* filename);
}
namespace spot