mirror of
https://github.com/Z3Prover/z3
synced 2025-05-11 09:44:43 +00:00
Add get_sort(expr * n) function that does not depend on ast_manager. Move power_of_two to rational class. Add arith_recognizers and bv_recognizers classes. The two new classes contain the 'read-only' methods from arith_util and bv_util.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
4f0d5a5756
commit
cec328cfdc
17 changed files with 314 additions and 282 deletions
|
@ -573,18 +573,7 @@ expr * arith_decl_plugin::get_some_value(sort * s) {
|
|||
return mk_numeral(rational(0), s == m_int_decl);
|
||||
}
|
||||
|
||||
arith_util::arith_util(ast_manager & m):
|
||||
m_manager(m),
|
||||
m_afid(m.get_family_id("arith")),
|
||||
m_plugin(0) {
|
||||
}
|
||||
|
||||
void arith_util::init_plugin() {
|
||||
SASSERT(m_plugin == 0);
|
||||
m_plugin = static_cast<arith_decl_plugin*>(m_manager.get_plugin(m_afid));
|
||||
}
|
||||
|
||||
bool arith_util::is_numeral(expr const * n, rational & val, bool & is_int) const {
|
||||
bool arith_recognizers::is_numeral(expr const * n, rational & val, bool & is_int) const {
|
||||
if (!is_app_of(n, m_afid, OP_NUM))
|
||||
return false;
|
||||
func_decl * decl = to_app(n)->get_decl();
|
||||
|
@ -593,6 +582,17 @@ bool arith_util::is_numeral(expr const * n, rational & val, bool & is_int) const
|
|||
return true;
|
||||
}
|
||||
|
||||
arith_util::arith_util(ast_manager & m):
|
||||
arith_recognizers(m.get_family_id("arith")),
|
||||
m_manager(m),
|
||||
m_plugin(0) {
|
||||
}
|
||||
|
||||
void arith_util::init_plugin() {
|
||||
SASSERT(m_plugin == 0);
|
||||
m_plugin = static_cast<arith_decl_plugin*>(m_manager.get_plugin(m_afid));
|
||||
}
|
||||
|
||||
bool arith_util::is_irrational_algebraic_numeral(expr const * n, algebraic_numbers::anum & val) {
|
||||
if (!is_app_of(n, m_afid, OP_IRRATIONAL_ALGEBRAIC_NUM))
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue