mirror of
https://github.com/Z3Prover/z3
synced 2025-06-22 05:43:39 +00:00
Added is_considered_uninterpreted() to decl_plugins.
This commit is contained in:
parent
3d37c25bcc
commit
7ddd2856c8
4 changed files with 38 additions and 17 deletions
|
@ -211,6 +211,25 @@ public:
|
||||||
|
|
||||||
virtual expr * get_some_value(sort * s);
|
virtual expr * get_some_value(sort * s);
|
||||||
|
|
||||||
|
virtual bool is_considered_uninterpreted(func_decl * f) {
|
||||||
|
if (f->get_family_id() != get_family_id())
|
||||||
|
return false;
|
||||||
|
switch (f->get_decl_kind())
|
||||||
|
{
|
||||||
|
case OP_0_PW_0_INT:
|
||||||
|
case OP_0_PW_0_REAL:
|
||||||
|
case OP_NEG_ROOT:
|
||||||
|
case OP_DIV_0:
|
||||||
|
case OP_IDIV_0:
|
||||||
|
case OP_MOD_0:
|
||||||
|
case OP_U_ASIN:
|
||||||
|
case OP_U_ACOS:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -992,6 +992,8 @@ public:
|
||||||
// Event handlers for deleting/translating PARAM_EXTERNAL
|
// Event handlers for deleting/translating PARAM_EXTERNAL
|
||||||
virtual void del(parameter const & p) {}
|
virtual void del(parameter const & p) {}
|
||||||
virtual parameter translate(parameter const & p, decl_plugin & target) { UNREACHABLE(); return p; }
|
virtual parameter translate(parameter const & p, decl_plugin & target) { UNREACHABLE(); return p; }
|
||||||
|
|
||||||
|
virtual bool is_considered_uninterpreted(func_decl * f) { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
|
|
@ -266,6 +266,22 @@ public:
|
||||||
virtual bool are_distinct(app* a, app* b) const;
|
virtual bool are_distinct(app* a, app* b) const;
|
||||||
|
|
||||||
virtual expr * get_some_value(sort * s);
|
virtual expr * get_some_value(sort * s);
|
||||||
|
|
||||||
|
virtual bool is_considered_uninterpreted(func_decl * f) {
|
||||||
|
if (f->get_family_id() != get_family_id())
|
||||||
|
return false;
|
||||||
|
switch (f->get_decl_kind()) {
|
||||||
|
case OP_BSDIV0:
|
||||||
|
case OP_BUDIV0:
|
||||||
|
case OP_BSREM0:
|
||||||
|
case OP_BUREM0:
|
||||||
|
case OP_BSMOD0:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class bv_recognizers {
|
class bv_recognizers {
|
||||||
|
@ -353,22 +369,6 @@ public:
|
||||||
rational norm(rational const & val, unsigned bv_size) const { return norm(val, bv_size, false); }
|
rational norm(rational const & val, unsigned bv_size) const { return norm(val, bv_size, false); }
|
||||||
bool has_sign_bit(rational const & n, unsigned bv_size) const;
|
bool has_sign_bit(rational const & n, unsigned bv_size) const;
|
||||||
bool mult_inverse(rational const & n, unsigned bv_size, rational & result);
|
bool mult_inverse(rational const & n, unsigned bv_size, rational & result);
|
||||||
|
|
||||||
bool is_considered_uninterpreted(func_decl * f) {
|
|
||||||
if (f->get_family_id() != get_family_id())
|
|
||||||
return false;
|
|
||||||
switch (f->get_decl_kind()) {
|
|
||||||
case OP_BSDIV0:
|
|
||||||
case OP_BUDIV0:
|
|
||||||
case OP_BSREM0:
|
|
||||||
case OP_BUREM0:
|
|
||||||
case OP_BSMOD0:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class bv_util : public bv_recognizers {
|
class bv_util : public bv_recognizers {
|
||||||
|
|
|
@ -202,7 +202,7 @@ struct evaluator_cfg : public default_rewriter_cfg {
|
||||||
|
|
||||||
if (m_model_completion &&
|
if (m_model_completion &&
|
||||||
(f->get_family_id() == null_family_id ||
|
(f->get_family_id() == null_family_id ||
|
||||||
m_bv_rw.get_util().is_considered_uninterpreted(f)))
|
m().get_plugin(f->get_family_id())->is_considered_uninterpreted(f)))
|
||||||
{
|
{
|
||||||
sort * s = f->get_range();
|
sort * s = f->get_range();
|
||||||
expr * val = m_model.get_some_value(s);
|
expr * val = m_model.get_some_value(s);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue