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

add stubs for converting assertions, consolidate filter_model_converter

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-11-17 14:51:13 -08:00
parent 53e36c9cf9
commit 0d15b6abb7
76 changed files with 244 additions and 356 deletions

View file

@ -21,7 +21,7 @@ Notes:
#include "solver/solver_na2as.h"
#include "tactic/tactic.h"
#include "ast/rewriter/pb2bv_rewriter.h"
#include "tactic/filter_model_converter.h"
#include "tactic/generic_model_converter.h"
#include "tactic/extension_model_converter.h"
#include "ast/ast_pp.h"
#include "model/model_smt2_pp.h"
@ -86,7 +86,7 @@ public:
return result;
}
virtual void assert_expr(expr * t) {
virtual void assert_expr_core(expr * t) {
unsigned i = m_assertions.size();
m_assertions.push_back(t);
while (i < m_assertions.size()) {
@ -209,10 +209,8 @@ private:
if (m_bv_fns.empty()) {
return;
}
filter_model_converter filter(m);
for (unsigned i = 0; i < m_bv_fns.size(); ++i) {
filter.insert(m_bv_fns[i].get());
}
generic_model_converter filter(m);
for (func_decl* f : m_bv_fns) filter.hide(f);
filter(mdl, 0);
}

View file

@ -26,7 +26,7 @@ Notes:
#include "model/model_smt2_pp.h"
#include "tactic/tactic.h"
#include "tactic/extension_model_converter.h"
#include "tactic/filter_model_converter.h"
#include "tactic/generic_model_converter.h"
#include "tactic/portfolio/enum2bv_solver.h"
#include "solver/solver_na2as.h"
#include "ast/rewriter/enum2bv_rewriter.h"
@ -58,7 +58,7 @@ public:
return result;
}
virtual void assert_expr(expr * t) {
virtual void assert_expr_core(expr * t) {
expr_ref tmp(t, m);
expr_ref_vector bounds(m);
proof_ref tmp_proof(m);
@ -164,9 +164,9 @@ public:
}
void filter_model(model_ref& mdl) {
filter_model_converter filter(m);
generic_model_converter filter(m);
for (auto const& kv : m_rewriter.enum2bv()) {
filter.insert(kv.m_value);
filter.hide(kv.m_value);
}
filter(mdl, 0);
}

View file

@ -549,7 +549,7 @@ public:
expr_ref_vector clauses(m);
ptr_vector<expr> assumptions;
obj_map<expr, expr*> bool2dep;
ref<filter_model_converter> fmc;
ref<generic_model_converter> fmc;
extract_clauses_and_dependencies(g, clauses, assumptions, bool2dep, fmc);
for (expr * clause : clauses) {
s->assert_expr(clause);

View file

@ -21,7 +21,7 @@ Notes:
#include "tactic/tactic.h"
#include "ast/rewriter/pb2bv_rewriter.h"
#include "ast/rewriter/th_rewriter.h"
#include "tactic/filter_model_converter.h"
#include "tactic/generic_model_converter.h"
#include "ast/ast_pp.h"
#include "model/model_smt2_pp.h"
@ -57,7 +57,7 @@ public:
return result;
}
virtual void assert_expr(expr * t) {
virtual void assert_expr_core(expr * t) {
m_assertions.push_back(t);
}
@ -113,10 +113,10 @@ public:
if (m_rewriter.fresh_constants().empty()) {
return;
}
filter_model_converter filter(m);
generic_model_converter filter(m);
func_decl_ref_vector const& fns = m_rewriter.fresh_constants();
for (unsigned i = 0; i < fns.size(); ++i) {
filter.insert(fns[i]);
for (func_decl* f : fns) {
filter.hide(f);
}
filter(mdl, 0);
}
@ -138,8 +138,8 @@ private:
proof_ref proof(m);
expr_ref fml1(m), fml(m);
expr_ref_vector fmls(m);
for (unsigned i = 0; i < m_assertions.size(); ++i) {
m_th_rewriter(m_assertions[i].get(), fml1, proof);
for (expr* a : m_assertions) {
m_th_rewriter(a, fml1, proof);
m_rewriter(fml1, fml, proof);
m_solver->assert_expr(fml);
}