mirror of
https://github.com/Z3Prover/z3
synced 2025-06-21 05:13:39 +00:00
Merge branch 'master' of https://github.com/Z3Prover/z3
This commit is contained in:
commit
fc1f37efc9
8 changed files with 528 additions and 485 deletions
|
@ -596,7 +596,7 @@ def display_help(exit_code):
|
||||||
else:
|
else:
|
||||||
print(" --parallel=num use cl option /MP with 'num' parallel processes")
|
print(" --parallel=num use cl option /MP with 'num' parallel processes")
|
||||||
print(" --pypkgdir=<dir> Force a particular Python package directory (default %s)" % PYTHON_PACKAGE_DIR)
|
print(" --pypkgdir=<dir> Force a particular Python package directory (default %s)" % PYTHON_PACKAGE_DIR)
|
||||||
print(" -b <sudir>, --build=<subdir> subdirectory where Z3 will be built (default: build).")
|
print(" -b <subdir>, --build=<subdir> subdirectory where Z3 will be built (default: %s)." % BUILD_DIR)
|
||||||
print(" --githash=hash include the given hash in the binaries.")
|
print(" --githash=hash include the given hash in the binaries.")
|
||||||
print(" -d, --debug compile Z3 in debug mode.")
|
print(" -d, --debug compile Z3 in debug mode.")
|
||||||
print(" -t, --trace enable tracing in release mode.")
|
print(" -t, --trace enable tracing in release mode.")
|
||||||
|
@ -742,7 +742,8 @@ def extract_c_includes(fname):
|
||||||
|
|
||||||
# Given a path dir1/subdir2/subdir3 returns ../../..
|
# Given a path dir1/subdir2/subdir3 returns ../../..
|
||||||
def reverse_path(p):
|
def reverse_path(p):
|
||||||
l = p.split(os.sep)
|
# Filter out empty components (e.g. will have one if path ends in a slash)
|
||||||
|
l = list(filter(lambda x: len(x) > 0, p.split(os.sep)))
|
||||||
n = len(l)
|
n = len(l)
|
||||||
r = '..'
|
r = '..'
|
||||||
for i in range(1, n):
|
for i in range(1, n):
|
||||||
|
|
|
@ -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,7 +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);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class bv_util : public bv_recognizers {
|
class bv_util : public bv_recognizers {
|
||||||
|
|
|
@ -694,7 +694,7 @@ br_status bv_rewriter::mk_bv_sdiv_core(expr * arg1, expr * arg2, bool hi_div0, e
|
||||||
if (r2.is_zero()) {
|
if (r2.is_zero()) {
|
||||||
if (!hi_div0) {
|
if (!hi_div0) {
|
||||||
result = m().mk_app(get_fid(), OP_BSDIV0, arg1);
|
result = m().mk_app(get_fid(), OP_BSDIV0, arg1);
|
||||||
return BR_DONE;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// The "hardware interpretation" for (bvsdiv x 0) is (ite (bvslt x #x0000) #x0001 #xffff)
|
// The "hardware interpretation" for (bvsdiv x 0) is (ite (bvslt x #x0000) #x0001 #xffff)
|
||||||
|
@ -745,7 +745,7 @@ br_status bv_rewriter::mk_bv_udiv_core(expr * arg1, expr * arg2, bool hi_div0, e
|
||||||
if (r2.is_zero()) {
|
if (r2.is_zero()) {
|
||||||
if (!hi_div0) {
|
if (!hi_div0) {
|
||||||
result = m().mk_app(get_fid(), OP_BUDIV0, arg1);
|
result = m().mk_app(get_fid(), OP_BUDIV0, arg1);
|
||||||
return BR_DONE;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// The "hardware interpretation" for (bvudiv x 0) is #xffff
|
// The "hardware interpretation" for (bvudiv x 0) is #xffff
|
||||||
|
@ -808,7 +808,7 @@ br_status bv_rewriter::mk_bv_srem_core(expr * arg1, expr * arg2, bool hi_div0, e
|
||||||
if (r2.is_zero()) {
|
if (r2.is_zero()) {
|
||||||
if (!hi_div0) {
|
if (!hi_div0) {
|
||||||
result = m().mk_app(get_fid(), OP_BSREM0, arg1);
|
result = m().mk_app(get_fid(), OP_BSREM0, arg1);
|
||||||
return BR_DONE;
|
return BR_REWRITE1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// The "hardware interpretation" for (bvsrem x 0) is x
|
// The "hardware interpretation" for (bvsrem x 0) is x
|
||||||
|
|
|
@ -174,6 +174,8 @@ public:
|
||||||
br_status mk_eq_core(expr * lhs, expr * rhs, expr_ref & result);
|
br_status mk_eq_core(expr * lhs, expr * rhs, expr_ref & result);
|
||||||
|
|
||||||
bool hi_div0() const { return m_hi_div0; }
|
bool hi_div0() const { return m_hi_div0; }
|
||||||
|
|
||||||
|
bv_util & get_util() { return m_util; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -181,6 +181,7 @@ struct evaluator_cfg : public default_rewriter_cfg {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_macro(func_decl * f, expr * & def, quantifier * & q, proof * & def_pr) {
|
bool get_macro(func_decl * f, expr * & def, quantifier * & q, proof * & def_pr) {
|
||||||
|
TRACE("model_evaluator", tout << "get_macro for " << f->get_name() << " (model completion: " << m_model_completion << ")\n";);
|
||||||
|
|
||||||
func_interp * fi = m_model.get_func_interp(f);
|
func_interp * fi = m_model.get_func_interp(f);
|
||||||
if (fi != 0) {
|
if (fi != 0) {
|
||||||
|
@ -199,7 +200,10 @@ struct evaluator_cfg : public default_rewriter_cfg {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f->get_family_id() == null_family_id && m_model_completion) {
|
if (m_model_completion &&
|
||||||
|
(f->get_family_id() == null_family_id ||
|
||||||
|
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);
|
||||||
func_interp * new_fi = alloc(func_interp, m(), f->get_arity());
|
func_interp * new_fi = alloc(func_interp, m(), f->get_arity());
|
||||||
|
|
|
@ -76,7 +76,7 @@ void invoke_gdb() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
std::cerr << "(C)ontinue, (A)bort, (S)top, (T)hrow exception, Invoke (G)DB\n";
|
std::cerr << "(C)ontinue, (A)bort, (S)top, (T)hrow exception, Invoke (G)DB\n";
|
||||||
char result;
|
char result;
|
||||||
bool ok = (std::cin >> result);
|
bool ok = bool(std::cin >> result);
|
||||||
if (!ok) exit(ERR_INTERNAL_FATAL); // happens if std::cin is eof or unattached.
|
if (!ok) exit(ERR_INTERNAL_FATAL); // happens if std::cin is eof or unattached.
|
||||||
switch(result) {
|
switch(result) {
|
||||||
case 'C':
|
case 'C':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue