mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 09:20:22 +00:00
Merge branch 'master' of https://github.com/Z3Prover/z3 into gh570-att-2
This commit is contained in:
commit
dcf643f711
7 changed files with 75 additions and 48 deletions
|
@ -237,22 +237,8 @@ VS_RUNTIME_PATS = [re.compile('vcomp.*\.dll'),
|
||||||
re.compile('msvcp.*\.dll'),
|
re.compile('msvcp.*\.dll'),
|
||||||
re.compile('msvcr.*\.dll')]
|
re.compile('msvcr.*\.dll')]
|
||||||
|
|
||||||
VS_RUNTIME_FILES = []
|
|
||||||
|
|
||||||
def cp_vs_runtime_visitor(pattern, dir, files):
|
|
||||||
global VS_RUNTIME_FILES
|
|
||||||
for filename in files:
|
|
||||||
for pat in VS_RUNTIME_PATS:
|
|
||||||
if pat.match(filename):
|
|
||||||
if fnmatch(filename, pattern):
|
|
||||||
fname = os.path.join(dir, filename)
|
|
||||||
if not os.path.isdir(fname):
|
|
||||||
VS_RUNTIME_FILES.append(fname)
|
|
||||||
break
|
|
||||||
|
|
||||||
# Copy Visual Studio Runtime libraries
|
# Copy Visual Studio Runtime libraries
|
||||||
def cp_vs_runtime_core(x64):
|
def cp_vs_runtime_core(x64):
|
||||||
global VS_RUNTIME_FILES
|
|
||||||
if x64:
|
if x64:
|
||||||
platform = "x64"
|
platform = "x64"
|
||||||
|
|
||||||
|
@ -261,7 +247,15 @@ def cp_vs_runtime_core(x64):
|
||||||
vcdir = os.environ['VCINSTALLDIR']
|
vcdir = os.environ['VCINSTALLDIR']
|
||||||
path = '%sredist\\%s' % (vcdir, platform)
|
path = '%sredist\\%s' % (vcdir, platform)
|
||||||
VS_RUNTIME_FILES = []
|
VS_RUNTIME_FILES = []
|
||||||
os.walk(path, cp_vs_runtime_visitor, '*.dll')
|
for root, dirs, files in os.walk(path):
|
||||||
|
for filename in files:
|
||||||
|
if fnmatch(filename, '*.dll'):
|
||||||
|
for pat in VS_RUNTIME_PATS:
|
||||||
|
if pat.match(filename):
|
||||||
|
fname = os.path.join(root, filename)
|
||||||
|
if not os.path.isdir(fname):
|
||||||
|
VS_RUNTIME_FILES.append(fname)
|
||||||
|
|
||||||
bin_dist_path = os.path.join(DIST_DIR, get_dist_path(x64), 'bin')
|
bin_dist_path = os.path.join(DIST_DIR, get_dist_path(x64), 'bin')
|
||||||
for f in VS_RUNTIME_FILES:
|
for f in VS_RUNTIME_FILES:
|
||||||
shutil.copy(f, bin_dist_path)
|
shutil.copy(f, bin_dist_path)
|
||||||
|
|
|
@ -73,6 +73,8 @@ public:
|
||||||
unsigned arity, sort * const * domain, sort * range);
|
unsigned arity, sort * const * domain, sort * range);
|
||||||
virtual void get_op_names(svector<builtin_name> & op_names, symbol const & logic);
|
virtual void get_op_names(svector<builtin_name> & op_names, symbol const & logic);
|
||||||
|
|
||||||
|
virtual bool is_considered_uninterpreted(func_decl * f) { return false; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1760,6 +1760,7 @@ namespace pdr {
|
||||||
smt::kernel solver(m, get_fparams());
|
smt::kernel solver(m, get_fparams());
|
||||||
solver.assert_expr(tmp);
|
solver.assert_expr(tmp);
|
||||||
lbool res = solver.check();
|
lbool res = solver.check();
|
||||||
|
TRACE("pdr", tout << tmp << " " << res << "\n";);
|
||||||
if (res != l_false) {
|
if (res != l_false) {
|
||||||
msg << "rule validation failed when checking: " << mk_pp(tmp, m);
|
msg << "rule validation failed when checking: " << mk_pp(tmp, m);
|
||||||
IF_VERBOSE(0, verbose_stream() << msg.str() << "\n";);
|
IF_VERBOSE(0, verbose_stream() << msg.str() << "\n";);
|
||||||
|
|
|
@ -25,6 +25,7 @@ Notes:
|
||||||
#include "uint_set.h"
|
#include "uint_set.h"
|
||||||
#include "opt_context.h"
|
#include "opt_context.h"
|
||||||
#include "theory_wmaxsat.h"
|
#include "theory_wmaxsat.h"
|
||||||
|
#include "theory_pb.h"
|
||||||
#include "ast_util.h"
|
#include "ast_util.h"
|
||||||
#include "pb_decl_plugin.h"
|
#include "pb_decl_plugin.h"
|
||||||
|
|
||||||
|
@ -124,6 +125,13 @@ namespace opt {
|
||||||
wth = alloc(smt::theory_wmaxsat, m, m_c.fm());
|
wth = alloc(smt::theory_wmaxsat, m, m_c.fm());
|
||||||
m_c.smt_context().register_plugin(wth);
|
m_c.smt_context().register_plugin(wth);
|
||||||
}
|
}
|
||||||
|
smt::theory_id th_pb = m.get_family_id("pb");
|
||||||
|
smt::theory_pb* pb = dynamic_cast<smt::theory_pb*>(m_c.smt_context().get_theory(th_pb));
|
||||||
|
if (!pb) {
|
||||||
|
theory_pb_params params;
|
||||||
|
pb = alloc(smt::theory_pb, m, params);
|
||||||
|
m_c.smt_context().register_plugin(pb);
|
||||||
|
}
|
||||||
return wth;
|
return wth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -334,6 +334,7 @@ namespace smt {
|
||||||
TRACE("t_fpa_detail", tout << "term: " << mk_ismt2_pp(e, get_manager()) << std::endl;
|
TRACE("t_fpa_detail", tout << "term: " << mk_ismt2_pp(e, get_manager()) << std::endl;
|
||||||
tout << "converted term: " << mk_ismt2_pp(e_conv, get_manager()) << std::endl;);
|
tout << "converted term: " << mk_ismt2_pp(e_conv, get_manager()) << std::endl;);
|
||||||
|
|
||||||
|
try {
|
||||||
if (m_fpa_util.is_rm(e)) {
|
if (m_fpa_util.is_rm(e)) {
|
||||||
SASSERT(m_fpa_util.is_bv2rm(e_conv));
|
SASSERT(m_fpa_util.is_bv2rm(e_conv));
|
||||||
expr_ref bv_rm(m);
|
expr_ref bv_rm(m);
|
||||||
|
@ -351,6 +352,12 @@ namespace smt {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
}
|
||||||
|
catch (rewriter_exception &)
|
||||||
|
{
|
||||||
|
m_th_rw.reset();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -743,8 +750,15 @@ namespace smt {
|
||||||
// These are the conversion functions fp.to_* */
|
// These are the conversion functions fp.to_* */
|
||||||
SASSERT(!m_fpa_util.is_float(n) && !m_fpa_util.is_rm(n));
|
SASSERT(!m_fpa_util.is_float(n) && !m_fpa_util.is_rm(n));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
UNREACHABLE();
|
/* Theory variables can be merged when (= bv-term (bvwrap fp-term)),
|
||||||
|
in which case context::relevant_eh may call theory_fpa::relevant_eh
|
||||||
|
after theory_bv::relevant_eh, regardless of whether theory_fpa is
|
||||||
|
interested in this term. But, this can only happen because of
|
||||||
|
(bvwrap ...) terms, i.e., `n' must be a bit-vector expression,
|
||||||
|
which we can safely ignore. */
|
||||||
|
SASSERT(m_bv_util.is_bv(n));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void theory_fpa::reset_eh() {
|
void theory_fpa::reset_eh() {
|
||||||
|
|
|
@ -316,6 +316,7 @@ namespace smt {
|
||||||
virtual void collect_statistics(::statistics & st) const;
|
virtual void collect_statistics(::statistics & st) const;
|
||||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||||
virtual void init_model(model_generator & m);
|
virtual void init_model(model_generator & m);
|
||||||
|
virtual bool include_func_interp(func_decl* f) { return false; }
|
||||||
|
|
||||||
static literal assert_ge(context& ctx, unsigned k, unsigned n, literal const* xs);
|
static literal assert_ge(context& ctx, unsigned k, unsigned n, literal const* xs);
|
||||||
};
|
};
|
||||||
|
|
|
@ -3259,14 +3259,17 @@ bool theory_seq::get_length(expr* e, rational& val) const {
|
||||||
|
|
||||||
let e = extract(s, i, l)
|
let e = extract(s, i, l)
|
||||||
|
|
||||||
0 <= i <= len(s) -> prefix(xe,s)
|
0 <= i <= |s| -> prefix(xe,s)
|
||||||
0 <= i <= len(s) -> len(x) = i
|
0 <= i <= |s| -> len(x) = i
|
||||||
0 <= i <= len(s) & 0 <= l <= len(s) - i -> len(e) = l
|
0 <= i <= |s| & 0 <= l <= |s| - i -> |e| = l
|
||||||
0 <= i <= len(s) & len(s) < l + i -> len(e) = len(s) - i
|
0 <= i <= |s| & |s| < l + i -> |e| = |s| - i
|
||||||
0 <= i <= len(s) & l < 0 -> len(e) = 0
|
0 <= i <= |s| & l < 0 -> |e| = 0
|
||||||
* i < 0 -> e = empty
|
i >= |s| => |e| = 0
|
||||||
* i > len(s) -> e = empty
|
i < 0 => |e| = 0
|
||||||
|
l <= 0 => |e| = 0
|
||||||
|
|
||||||
|
It follows that:
|
||||||
|
|e| = min(l, |s| - i) for 0 <= i < |s| and 0 < |l|
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -3301,16 +3304,20 @@ void theory_seq::add_extract_axiom(expr* e) {
|
||||||
expr_ref zero(m_autil.mk_int(0), m);
|
expr_ref zero(m_autil.mk_int(0), m);
|
||||||
|
|
||||||
literal i_ge_0 = mk_literal(m_autil.mk_ge(i, zero));
|
literal i_ge_0 = mk_literal(m_autil.mk_ge(i, zero));
|
||||||
literal i_le_ls = mk_literal(m_autil.mk_le(mk_sub(i, ls), zero));
|
literal ls_le_i = mk_literal(m_autil.mk_le(mk_sub(i, ls), zero));
|
||||||
literal li_ge_ls = mk_literal(m_autil.mk_ge(ls_minus_i_l, zero));
|
literal li_ge_ls = mk_literal(m_autil.mk_ge(ls_minus_i_l, zero));
|
||||||
literal l_ge_zero = mk_literal(m_autil.mk_ge(l, zero));
|
literal l_ge_zero = mk_literal(m_autil.mk_ge(l, zero));
|
||||||
|
literal ls_le_0 = mk_literal(m_autil.mk_le(ls, zero));
|
||||||
|
|
||||||
// add_axiom(~i_ge_0, ~i_le_ls, mk_literal(m_util.str.mk_prefix(xe, s)));
|
// add_axiom(~i_ge_0, ~ls_le_i, mk_literal(m_util.str.mk_prefix(xe, s)));
|
||||||
add_axiom(~i_ge_0, ~i_le_ls, mk_seq_eq(xey, s));
|
add_axiom(~i_ge_0, ~ls_le_i, mk_seq_eq(xey, s));
|
||||||
add_axiom(~i_ge_0, ~i_le_ls, mk_eq(lx, i, false));
|
add_axiom(~i_ge_0, ~ls_le_i, mk_eq(lx, i, false));
|
||||||
add_axiom(~i_ge_0, ~i_le_ls, ~l_ge_zero, ~li_ge_ls, mk_eq(le, l, false));
|
add_axiom(~i_ge_0, ~ls_le_i, ~l_ge_zero, ~li_ge_ls, mk_eq(le, l, false));
|
||||||
add_axiom(~i_ge_0, ~i_le_ls, li_ge_ls, mk_eq(le, mk_sub(ls, i), false));
|
add_axiom(~i_ge_0, ~ls_le_i, li_ge_ls, mk_eq(le, mk_sub(ls, i), false));
|
||||||
add_axiom(~i_ge_0, ~i_le_ls, l_ge_zero, mk_eq(le, zero, false));
|
add_axiom(~i_ge_0, ~ls_le_i, l_ge_zero, mk_eq(le, zero, false));
|
||||||
|
add_axiom(i_ge_0, mk_eq(le, zero, false));
|
||||||
|
add_axiom(ls_le_i, mk_eq(le, zero, false));
|
||||||
|
add_axiom(~ls_le_0, mk_eq(le, zero, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void theory_seq::add_tail_axiom(expr* e, expr* s) {
|
void theory_seq::add_tail_axiom(expr* e, expr* s) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue