mirror of
https://github.com/Z3Prover/z3
synced 2025-04-16 05:48:44 +00:00
added stubs for get_lower/get_upper required by theory_seq
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
f2e878047d
commit
da44ad7e6f
|
@ -2611,6 +2611,16 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get_lower(enode* n, expr_ref& r) {
|
||||||
|
NOT_IMPLEMENTED_YET();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get_upper(enode* n, expr_ref& r) {
|
||||||
|
NOT_IMPLEMENTED_YET();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const {
|
bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const {
|
||||||
SASSERT(v1 != null_theory_var);
|
SASSERT(v1 != null_theory_var);
|
||||||
SASSERT(v2 != null_theory_var);
|
SASSERT(v2 != null_theory_var);
|
||||||
|
@ -2980,6 +2990,13 @@ model_value_proc * theory_lra::mk_value(enode * n, model_generator & mg) {
|
||||||
bool theory_lra::get_value(enode* n, expr_ref& r) {
|
bool theory_lra::get_value(enode* n, expr_ref& r) {
|
||||||
return m_imp->get_value(n, r);
|
return m_imp->get_value(n, r);
|
||||||
}
|
}
|
||||||
|
bool theory_lra::get_lower(enode* n, expr_ref& r) {
|
||||||
|
return m_imp->get_lower(n, r);
|
||||||
|
}
|
||||||
|
bool theory_lra::get_upper(enode* n, expr_ref& r) {
|
||||||
|
return m_imp->get_upper(n, r);
|
||||||
|
}
|
||||||
|
|
||||||
bool theory_lra::validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const {
|
bool theory_lra::validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const {
|
||||||
return m_imp->validate_eq_in_model(v1, v2, is_true);
|
return m_imp->validate_eq_in_model(v1, v2, is_true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,8 @@ namespace smt {
|
||||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||||
|
|
||||||
bool get_value(enode* n, expr_ref& r) override;
|
bool get_value(enode* n, expr_ref& r) override;
|
||||||
|
bool get_lower(enode* n, expr_ref& r);
|
||||||
|
bool get_upper(enode* n, expr_ref& r);
|
||||||
|
|
||||||
bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override;
|
bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override;
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ Revision History:
|
||||||
#include "smt/smt_model_generator.h"
|
#include "smt/smt_model_generator.h"
|
||||||
#include "smt/theory_seq.h"
|
#include "smt/theory_seq.h"
|
||||||
#include "smt/theory_arith.h"
|
#include "smt/theory_arith.h"
|
||||||
|
#include "smt/theory_lra.h"
|
||||||
#include "smt/smt_kernel.h"
|
#include "smt/smt_kernel.h"
|
||||||
|
|
||||||
using namespace smt;
|
using namespace smt;
|
||||||
|
@ -3506,6 +3507,8 @@ static bool get_arith_value(context& ctx, theory_id afid, expr* e, expr_ref& v)
|
||||||
if (tha) return tha->get_value(ctx.get_enode(e), v);
|
if (tha) return tha->get_value(ctx.get_enode(e), v);
|
||||||
theory_i_arith* thi = get_th_arith<theory_i_arith>(ctx, afid, e);
|
theory_i_arith* thi = get_th_arith<theory_i_arith>(ctx, afid, e);
|
||||||
if (thi) return thi->get_value(ctx.get_enode(e), v);
|
if (thi) return thi->get_value(ctx.get_enode(e), v);
|
||||||
|
theory_lra* thr = get_th_arith<theory_lra>(ctx, afid, e);
|
||||||
|
if (thr) return thr->get_value(ctx.get_enode(e), v);
|
||||||
TRACE("seq", tout << "no arithmetic theory\n";);
|
TRACE("seq", tout << "no arithmetic theory\n";);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -3531,25 +3534,37 @@ bool theory_seq::lower_bound(expr* _e, rational& lo) const {
|
||||||
context& ctx = get_context();
|
context& ctx = get_context();
|
||||||
expr_ref e(m_util.str.mk_length(_e), m);
|
expr_ref e(m_util.str.mk_length(_e), m);
|
||||||
expr_ref _lo(m);
|
expr_ref _lo(m);
|
||||||
theory_mi_arith* tha = get_th_arith<theory_mi_arith>(ctx, m_autil.get_family_id(), e);
|
family_id afid = m_autil.get_family_id();
|
||||||
if (tha && !tha->get_lower(ctx.get_enode(e), _lo)) return false;
|
do {
|
||||||
if (!tha) {
|
theory_mi_arith* tha = get_th_arith<theory_mi_arith>(ctx, afid, e);
|
||||||
theory_i_arith* thi = get_th_arith<theory_i_arith>(ctx, m_autil.get_family_id(), e);
|
if (tha && tha->get_lower(ctx.get_enode(e), _lo)) break;
|
||||||
if (!thi || !thi->get_lower(ctx.get_enode(e), _lo)) return false;
|
theory_i_arith* thi = get_th_arith<theory_i_arith>(ctx, afid, e);
|
||||||
|
if (thi && thi->get_lower(ctx.get_enode(e), _lo)) break;
|
||||||
|
theory_lra* thr = get_th_arith<theory_lra>(ctx, afid, e);
|
||||||
|
if (thr && thr->get_lower(ctx.get_enode(e), _lo)) break;
|
||||||
|
TRACE("seq", tout << "no lower bound " << mk_pp(_e, m) << "\n";);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
while (false);
|
||||||
return m_autil.is_numeral(_lo, lo) && lo.is_int();
|
return m_autil.is_numeral(_lo, lo) && lo.is_int();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool theory_seq::upper_bound(expr* _e, rational& hi) const {
|
bool theory_seq::upper_bound(expr* _e, rational& hi) const {
|
||||||
context& ctx = get_context();
|
context& ctx = get_context();
|
||||||
expr_ref e(m_util.str.mk_length(_e), m);
|
expr_ref e(m_util.str.mk_length(_e), m);
|
||||||
theory_mi_arith* tha = get_th_arith<theory_mi_arith>(ctx, m_autil.get_family_id(), e);
|
family_id afid = m_autil.get_family_id();
|
||||||
expr_ref _hi(m);
|
expr_ref _hi(m);
|
||||||
if (tha && !tha->get_upper(ctx.get_enode(e), _hi)) return false;
|
do {
|
||||||
if (!tha) {
|
theory_mi_arith* tha = get_th_arith<theory_mi_arith>(ctx, afid, e);
|
||||||
theory_i_arith* thi = get_th_arith<theory_i_arith>(ctx, m_autil.get_family_id(), e);
|
if (tha && tha->get_upper(ctx.get_enode(e), _hi)) break;
|
||||||
if (!thi || !thi->get_upper(ctx.get_enode(e), _hi)) return false;
|
theory_i_arith* thi = get_th_arith<theory_i_arith>(ctx, afid, e);
|
||||||
|
if (thi && thi->get_upper(ctx.get_enode(e), _hi)) break;
|
||||||
|
theory_lra* thr = get_th_arith<theory_lra>(ctx, afid, e);
|
||||||
|
if (thr && thr->get_upper(ctx.get_enode(e), _hi)) break;
|
||||||
|
TRACE("seq", tout << "no upper bound " << mk_pp(_e, m) << "\n";);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
while (false);
|
||||||
return m_autil.is_numeral(_hi, hi) && hi.is_int();
|
return m_autil.is_numeral(_hi, hi) && hi.is_int();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue