3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

add feature to display benchmark in format seen by SAT solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-09-21 18:32:46 -05:00
parent f5db69529a
commit cab4e4b461
9 changed files with 38 additions and 8 deletions

View file

@ -35,7 +35,7 @@ namespace sat {
m_glue("glue"),
m_glue_psm("glue_psm"),
m_psm_glue("psm_glue") {
m_num_parallel = 1;
m_num_parallel = 1;
updt_params(p);
}
@ -114,6 +114,7 @@ namespace sat {
m_core_minimize = p.core_minimize();
m_core_minimize_partial = p.core_minimize_partial();
m_dyn_sub_res = p.dyn_sub_res();
m_dimacs_display = p.dimacs_display();
}
void config::collect_param_descrs(param_descrs & r) {

View file

@ -74,6 +74,7 @@ namespace sat {
bool m_core_minimize;
bool m_core_minimize_partial;
bool m_dimacs_display;
symbol m_always_true;
symbol m_always_false;

View file

@ -23,4 +23,5 @@ def_module_params('sat',
('core.minimize', BOOL, False, 'minimize computed core'),
('core.minimize_partial', BOOL, False, 'apply partial (cheap) core minimization'),
('parallel_threads', UINT, 1, 'number of parallel threads to use'),
('dimacs.core', BOOL, False, 'extract core from DIMACS benchmarks')))
('dimacs.core', BOOL, False, 'extract core from DIMACS benchmarks'),
('dimacs.display', BOOL, False, 'display SAT instance in DIMACS format and return unknown instead of solving')))

View file

@ -724,6 +724,13 @@ namespace sat {
pop_to_base_level();
IF_VERBOSE(2, verbose_stream() << "(sat.sat-solver)\n";);
SASSERT(scope_lvl() == 0);
if (m_config.m_dimacs_display) {
display_dimacs(std::cout);
for (unsigned i = 0; i < num_lits; ++lits) {
std::cout << dimacs_lit(lits[i]) << " 0\n";
}
return l_undef;
}
if (m_config.m_num_parallel > 1 && !m_par) {
return check_par(num_lits, lits);
}

View file

@ -105,7 +105,6 @@ public:
virtual void set_progress_callback(progress_callback * callback) {}
void display_weighted(std::ostream& out, unsigned sz, expr * const * assumptions, unsigned const* weights) {
if (weights != 0) {
for (unsigned i = 0; i < sz; ++i) m_weights.push_back(weights[i]);