mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
model refactor (#4723)
* refactor model fixing Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * missing cond macro Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * file Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * file Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * add macros dependency Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * deps and debug Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * add dependency to normal forms Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * build issues Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * compile Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * fix leal regression * complete model fixer Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * fold back private functionality to model_finder Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * avoid duplicate fixed callbacks Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
6cc52e04c3
commit
fa58a36b9f
42 changed files with 2060 additions and 1494 deletions
|
@ -54,7 +54,7 @@ namespace smt {
|
|||
obj_map<expr, expr *> m_value2expr;
|
||||
expr_ref_vector m_fresh_exprs;
|
||||
|
||||
friend class instantiation_set;
|
||||
friend class model_instantiation_set;
|
||||
|
||||
void init_aux_context();
|
||||
void init_value2expr();
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -47,9 +47,12 @@ Revision History:
|
|||
|
||||
#include "ast/ast.h"
|
||||
#include "ast/func_decl_dependencies.h"
|
||||
#include "model/model_macro_solver.h"
|
||||
#include "smt/proto_model/proto_model.h"
|
||||
#include "tactic/tactic_exception.h"
|
||||
|
||||
class model_instantiation_set;
|
||||
|
||||
namespace smt {
|
||||
class context;
|
||||
|
||||
|
@ -59,17 +62,14 @@ namespace smt {
|
|||
class auf_solver;
|
||||
class simple_macro_solver;
|
||||
class hint_solver;
|
||||
class non_auf_macro_solver;
|
||||
class non_auf_macro_solver;
|
||||
class instantiation_set;
|
||||
};
|
||||
|
||||
class model_finder {
|
||||
class model_finder : public quantifier2macro_infos {
|
||||
typedef mf::quantifier_analyzer quantifier_analyzer;
|
||||
typedef mf::quantifier_info quantifier_info;
|
||||
typedef mf::auf_solver auf_solver;
|
||||
typedef mf::simple_macro_solver simple_macro_solver;
|
||||
typedef mf::hint_solver hint_solver;
|
||||
typedef mf::non_auf_macro_solver non_auf_macro_solver;
|
||||
typedef mf::instantiation_set instantiation_set;
|
||||
|
||||
ast_manager & m;
|
||||
|
@ -79,9 +79,6 @@ namespace smt {
|
|||
obj_map<quantifier, quantifier_info *> m_q2info;
|
||||
ptr_vector<quantifier> m_quantifiers;
|
||||
func_decl_dependencies m_dependencies;
|
||||
scoped_ptr<simple_macro_solver> m_sm_solver;
|
||||
scoped_ptr<hint_solver> m_hint_solver;
|
||||
scoped_ptr<non_auf_macro_solver> m_nm_solver;
|
||||
|
||||
struct scope {
|
||||
unsigned m_quantifiers_lim;
|
||||
|
@ -105,7 +102,7 @@ namespace smt {
|
|||
|
||||
public:
|
||||
model_finder(ast_manager & m);
|
||||
~model_finder();
|
||||
~model_finder() override;
|
||||
void set_context(context * ctx);
|
||||
|
||||
void register_quantifier(quantifier * q);
|
||||
|
@ -122,6 +119,9 @@ namespace smt {
|
|||
void restart_eh();
|
||||
|
||||
void checkpoint(char const* component);
|
||||
|
||||
quantifier_macro_info* operator()(quantifier* q);
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ namespace smt {
|
|||
m_conversions.insert(e, res);
|
||||
m.inc_ref(e);
|
||||
m.inc_ref(res);
|
||||
m_trail_stack.push(fpa2bv_conversion_trail_elem<theory_fpa>(m, m_conversions, e));
|
||||
m_trail_stack.push(insert_ref2_map<theory_fpa, ast_manager, expr, expr>(m, m_conversions, e, res.get()));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -78,6 +78,10 @@ void user_propagator::new_fixed_eh(theory_var v, expr* value, unsigned num_lits,
|
|||
if (!m_fixed_eh)
|
||||
return;
|
||||
force_push();
|
||||
if (m_fixed.contains(v))
|
||||
return;
|
||||
m_fixed.insert(v);
|
||||
ctx.push_trail(insert_map<context, uint_set, unsigned>(m_fixed, v));
|
||||
m_id2justification.setx(v, literal_vector(num_lits, jlits), literal_vector());
|
||||
m_fixed_eh(m_user_context, this, v, value);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ Notes:
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "util/uint_set.h"
|
||||
#include "smt/smt_theory.h"
|
||||
#include "solver/solver.h"
|
||||
|
||||
|
@ -57,6 +58,7 @@ namespace smt {
|
|||
solver::eq_eh_t m_diseq_eh;
|
||||
solver::context_obj* m_api_context { nullptr };
|
||||
unsigned m_qhead { 0 };
|
||||
uint_set m_fixed;
|
||||
vector<prop_info> m_prop;
|
||||
unsigned_vector m_prop_lim;
|
||||
vector<literal_vector> m_id2justification;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue