mirror of
https://github.com/Z3Prover/z3
synced 2025-08-23 03:27:52 +00:00
mbp (#4741)
* adding dt-solver Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * dt Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * move mbp to self-contained module Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * files Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * Create CMakeLists.txt * dt Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * rename to bool_var2expr to indicate type class * mbp * na * add projection * na * na * na * na * na Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * deps Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> * testing arith/q * na * newline for model printing Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e5cc613bf1
commit
72d407a49f
51 changed files with 903 additions and 618 deletions
|
@ -35,18 +35,43 @@ namespace mbp {
|
|||
def(const expr_ref& v, expr_ref& t): var(v), term(t) {}
|
||||
};
|
||||
|
||||
class project_plugin {
|
||||
ast_manager& m;
|
||||
expr_mark m_visited;
|
||||
expr_mark m_bool_visited;
|
||||
/***
|
||||
* An EUF inverter provides two services:
|
||||
* 1. It inverts an uninterpreted function application f(s1,s2) with 'value' to a ground term evaluating to the same
|
||||
* 2. It adds constraints for arguments to s_i with 'value' to be within the bounds of the model value.
|
||||
*/
|
||||
class euf_inverter {
|
||||
public:
|
||||
virtual expr* invert_app(app* t, expr* value) = 0;
|
||||
virtual expr* invert_arg(app* t, unsigned i, expr* value) = 0;
|
||||
};
|
||||
|
||||
class project_plugin {
|
||||
ast_manager& m;
|
||||
expr_mark m_visited;
|
||||
ptr_vector<expr> m_to_visit;
|
||||
expr_mark m_bool_visited;
|
||||
expr_mark m_non_ground;
|
||||
expr_ref_vector m_cache, m_args, m_pure_eqs;
|
||||
|
||||
void extract_bools(model_evaluator& eval, expr_ref_vector& fmls, unsigned i, expr* fml, bool is_true);
|
||||
void visit_app(expr* e);
|
||||
bool visit_ite(model_evaluator& eval, expr* e, expr_ref_vector& fmls);
|
||||
bool visit_bool(model_evaluator& eval, expr* e, expr_ref_vector& fmls);
|
||||
bool is_true(model_evaluator& eval, expr* e);
|
||||
|
||||
bool extract_bools(model_evaluator& eval, expr_ref_vector& fmls, expr* fml);
|
||||
// over-approximation
|
||||
bool contains_uninterpreted(expr* v) { return true; }
|
||||
|
||||
void push_back(expr_ref_vector& lits, expr* lit);
|
||||
|
||||
void mark_non_ground(expr* e);
|
||||
|
||||
expr* purify(euf_inverter& inv, model_evaluator& eval, expr* e, expr_ref_vector& lits);
|
||||
void purify_app(euf_inverter& inv, model_evaluator& eval, app* t, expr_ref_vector& lits);
|
||||
|
||||
public:
|
||||
project_plugin(ast_manager& m) :m(m) {}
|
||||
project_plugin(ast_manager& m) :m(m), m_cache(m), m_args(m), m_pure_eqs(m) {}
|
||||
virtual ~project_plugin() {}
|
||||
virtual bool operator()(model& model, app* var, app_ref_vector& vars, expr_ref_vector& lits) { return false; }
|
||||
/**
|
||||
|
@ -81,7 +106,8 @@ namespace mbp {
|
|||
/*
|
||||
* Purify literals into linear inequalities or constraints without arithmetic variables.
|
||||
*/
|
||||
void purify(model& model, app_ref_vector const& vars, expr_ref_vector& fmls);
|
||||
|
||||
void purify(euf_inverter& inv, model& model, app_ref_vector const& vars, expr_ref_vector& fmls);
|
||||
|
||||
static expr_ref pick_equality(ast_manager& m, model& model, expr* t);
|
||||
static void erase(expr_ref_vector& lits, unsigned& i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue