mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
Merge remote-tracking branch 'upstream/master' into fix-length-testing
This commit is contained in:
commit
2ffffa9bed
90 changed files with 2192 additions and 1492 deletions
|
@ -75,7 +75,7 @@ z3_add_component(smt
|
|||
normal_forms
|
||||
parser_util
|
||||
pattern
|
||||
proof_checker
|
||||
proofs
|
||||
proto_model
|
||||
simplex
|
||||
substitution
|
||||
|
|
|
@ -101,14 +101,14 @@ void asserted_formulas::push_assertion(expr * e, proof * pr, vector<justified_ex
|
|||
else if (m.is_and(e)) {
|
||||
for (unsigned i = 0; i < to_app(e)->get_num_args(); ++i) {
|
||||
expr* arg = to_app(e)->get_arg(i);
|
||||
proof_ref _pr(m.mk_and_elim(pr, i), m);
|
||||
proof_ref _pr(m.proofs_enabled() ? m.mk_and_elim(pr, i) : 0, m);
|
||||
push_assertion(arg, _pr, result);
|
||||
}
|
||||
}
|
||||
else if (m.is_not(e, e1) && m.is_or(e1)) {
|
||||
for (unsigned i = 0; i < to_app(e1)->get_num_args(); ++i) {
|
||||
expr* arg = to_app(e1)->get_arg(i);
|
||||
proof_ref _pr(m.mk_not_or_elim(pr, i), m);
|
||||
proof_ref _pr(m.proofs_enabled() ? m.mk_not_or_elim(pr, i) : 0, m);
|
||||
expr_ref narg(mk_not(m, arg), m);
|
||||
push_assertion(narg, _pr, result);
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ void asserted_formulas::assert_expr(expr * e, proof * _in_pr) {
|
|||
}
|
||||
|
||||
void asserted_formulas::assert_expr(expr * e) {
|
||||
assert_expr(e, m.mk_asserted(e));
|
||||
assert_expr(e, m.proofs_enabled() ? m.mk_asserted(e) : nullptr);
|
||||
}
|
||||
|
||||
void asserted_formulas::get_assertions(ptr_vector<expr> & result) const {
|
||||
|
@ -365,7 +365,7 @@ void asserted_formulas::nnf_cnf() {
|
|||
CASSERT("well_sorted", is_well_sorted(m, n));
|
||||
apply_nnf(n, push_todo, push_todo_prs, r1, pr1);
|
||||
CASSERT("well_sorted",is_well_sorted(m, r1));
|
||||
pr = m.mk_modus_ponens(pr, pr1);
|
||||
pr = m.proofs_enabled() ? m.mk_modus_ponens(pr, pr1) : nullptr;
|
||||
push_todo.push_back(r1);
|
||||
push_todo_prs.push_back(pr);
|
||||
|
||||
|
@ -506,16 +506,16 @@ void asserted_formulas::update_substitution(expr* n, proof* pr) {
|
|||
}
|
||||
if (is_gt(rhs, lhs)) {
|
||||
TRACE("propagate_values", tout << "insert " << mk_pp(rhs, m) << " -> " << mk_pp(lhs, m) << "\n";);
|
||||
m_scoped_substitution.insert(rhs, lhs, m.mk_symmetry(pr));
|
||||
m_scoped_substitution.insert(rhs, lhs, m.proofs_enabled() ? m.mk_symmetry(pr) : nullptr);
|
||||
return;
|
||||
}
|
||||
TRACE("propagate_values", tout << "incompatible " << mk_pp(n, m) << "\n";);
|
||||
}
|
||||
if (m.is_not(n, n1)) {
|
||||
m_scoped_substitution.insert(n1, m.mk_false(), m.mk_iff_false(pr));
|
||||
m_scoped_substitution.insert(n1, m.mk_false(), m.proofs_enabled() ? m.mk_iff_false(pr) : nullptr);
|
||||
}
|
||||
else {
|
||||
m_scoped_substitution.insert(n, m.mk_true(), m.mk_iff_true(pr));
|
||||
m_scoped_substitution.insert(n, m.mk_true(), m.proofs_enabled() ? m.mk_iff_true(pr) : nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -810,8 +810,6 @@ namespace smt {
|
|||
m_new_proofs.push_back(pr);
|
||||
return pr;
|
||||
}
|
||||
if (m_manager.coarse_grain_proofs())
|
||||
return pr;
|
||||
TRACE("norm_eq_proof",
|
||||
tout << "#" << n1->get_owner_id() << " = #" << n2->get_owner_id() << "\n";
|
||||
tout << mk_ll_pp(pr, m_manager, true, false););
|
||||
|
@ -1217,7 +1215,7 @@ namespace smt {
|
|||
mk_proof(rhs, c, prs2);
|
||||
while (!prs2.empty()) {
|
||||
proof * pr = prs2.back();
|
||||
if (m_manager.fine_grain_proofs()) {
|
||||
if (m_manager.proofs_enabled()) {
|
||||
pr = m_manager.mk_symmetry(pr);
|
||||
m_new_proofs.push_back(pr);
|
||||
prs1.push_back(pr);
|
||||
|
|
|
@ -23,7 +23,7 @@ Revision History:
|
|||
#include "ast/ast_ll_pp.h"
|
||||
#include "util/warning.h"
|
||||
#include "smt/smt_quick_checker.h"
|
||||
#include "ast/proof_checker/proof_checker.h"
|
||||
#include "ast/proofs/proof_checker.h"
|
||||
#include "ast/ast_util.h"
|
||||
#include "smt/uses_theory.h"
|
||||
#include "model/model.h"
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace smt {
|
|||
|
||||
if (m_node1 != m_node1->get_root()) {
|
||||
proof * pr = cr.get_proof(m_node1, m_node1->get_root());
|
||||
if (pr && m.fine_grain_proofs())
|
||||
if (pr && m.proofs_enabled())
|
||||
pr = m.mk_symmetry(pr);
|
||||
prs.push_back(pr);
|
||||
if (!pr)
|
||||
|
|
|
@ -29,9 +29,8 @@ Notes:
|
|||
|
||||
namespace smt {
|
||||
|
||||
class solver : public solver_na2as {
|
||||
class smt_solver : public solver_na2as {
|
||||
smt_params m_smt_params;
|
||||
params_ref m_params;
|
||||
smt::kernel m_context;
|
||||
progress_callback * m_callback;
|
||||
symbol m_logic;
|
||||
|
@ -42,28 +41,24 @@ namespace smt {
|
|||
obj_map<expr, expr*> m_name2assertion;
|
||||
|
||||
public:
|
||||
solver(ast_manager & m, params_ref const & p, symbol const & l) :
|
||||
smt_solver(ast_manager & m, params_ref const & p, symbol const & l) :
|
||||
solver_na2as(m),
|
||||
m_smt_params(p),
|
||||
m_params(p),
|
||||
m_context(m, m_smt_params),
|
||||
m_minimizing_core(false),
|
||||
m_core_extend_patterns(false),
|
||||
m_core_extend_patterns_max_distance(UINT_MAX),
|
||||
m_core_extend_nonlocal_patterns(false) {
|
||||
m_core_extend_nonlocal_patterns(false) {
|
||||
m_logic = l;
|
||||
if (m_logic != symbol::null)
|
||||
m_context.set_logic(m_logic);
|
||||
smt_params_helper smth(p);
|
||||
m_core_extend_patterns = smth.core_extend_patterns();
|
||||
m_core_extend_patterns_max_distance = smth.core_extend_patterns_max_distance();
|
||||
m_core_extend_nonlocal_patterns = smth.core_extend_nonlocal_patterns();
|
||||
updt_params(p);
|
||||
}
|
||||
|
||||
virtual solver * translate(ast_manager & m, params_ref const & p) {
|
||||
ast_translation translator(get_manager(), m);
|
||||
|
||||
solver * result = alloc(solver, m, p, m_logic);
|
||||
smt_solver * result = alloc(smt_solver, m, p, m_logic);
|
||||
smt::kernel::copy(m_context, result->m_context);
|
||||
|
||||
for (auto & kv : m_name2assertion)
|
||||
|
@ -73,13 +68,13 @@ namespace smt {
|
|||
return result;
|
||||
}
|
||||
|
||||
virtual ~solver() {
|
||||
virtual ~smt_solver() {
|
||||
dec_ref_values(get_manager(), m_name2assertion);
|
||||
}
|
||||
|
||||
virtual void updt_params(params_ref const & p) {
|
||||
solver::updt_params(p);
|
||||
m_smt_params.updt_params(p);
|
||||
m_params.copy(p);
|
||||
m_context.updt_params(p);
|
||||
smt_params_helper smth(p);
|
||||
m_core_extend_patterns = smth.core_extend_patterns();
|
||||
|
@ -146,9 +141,9 @@ namespace smt {
|
|||
}
|
||||
|
||||
struct scoped_minimize_core {
|
||||
solver& s;
|
||||
smt_solver& s;
|
||||
expr_ref_vector m_assumptions;
|
||||
scoped_minimize_core(solver& s) : s(s), m_assumptions(s.m_assumptions) {
|
||||
scoped_minimize_core(smt_solver& s) : s(s), m_assumptions(s.m_assumptions) {
|
||||
s.m_minimizing_core = true;
|
||||
s.m_assumptions.reset();
|
||||
}
|
||||
|
@ -165,7 +160,7 @@ namespace smt {
|
|||
r.push_back(m_context.get_unsat_core_expr(i));
|
||||
}
|
||||
|
||||
if (m_minimizing_core && smt_params_helper(m_params).core_minimize()) {
|
||||
if (m_minimizing_core && smt_params_helper(get_params()).core_minimize()) {
|
||||
scoped_minimize_core scm(*this);
|
||||
mus mus(*this);
|
||||
mus.add_soft(r.size(), r.c_ptr());
|
||||
|
@ -346,22 +341,16 @@ namespace smt {
|
|||
|
||||
void add_nonlocal_pattern_literals_to_core(ptr_vector<expr> & core) {
|
||||
ast_manager & m = get_manager();
|
||||
|
||||
obj_map<expr, expr*>::iterator it = m_name2assertion.begin();
|
||||
obj_map<expr, expr*>::iterator end = m_name2assertion.end();
|
||||
for (unsigned i = 0; it != end; it++, i++) {
|
||||
expr_ref name(it->m_key, m);
|
||||
expr_ref assrtn(it->m_value, m);
|
||||
for (auto const& kv : m_name2assertion) {
|
||||
expr_ref name(kv.m_key, m);
|
||||
expr_ref assrtn(kv.m_value, m);
|
||||
|
||||
if (!core.contains(name)) {
|
||||
func_decl_set pattern_fds, body_fds;
|
||||
collect_pattern_fds(assrtn, pattern_fds);
|
||||
collect_body_func_decls(assrtn, body_fds);
|
||||
|
||||
func_decl_set::iterator pit = pattern_fds.begin();
|
||||
func_decl_set::iterator pend= pattern_fds.end();
|
||||
for (; pit != pend; pit++) {
|
||||
func_decl * fd = *pit;
|
||||
for (func_decl *fd : pattern_fds) {
|
||||
if (!body_fds.contains(fd)) {
|
||||
core.insert(name);
|
||||
break;
|
||||
|
@ -374,7 +363,7 @@ namespace smt {
|
|||
};
|
||||
|
||||
solver * mk_smt_solver(ast_manager & m, params_ref const & p, symbol const & logic) {
|
||||
return alloc(smt::solver, m, p, logic);
|
||||
return alloc(smt::smt_solver, m, p, logic);
|
||||
}
|
||||
|
||||
class smt_solver_factory : public solver_factory {
|
||||
|
|
|
@ -218,7 +218,6 @@ namespace smt {
|
|||
ast_manager & m = get_manager();
|
||||
ext_skolems = alloc(func_decl_ref_vector, m);
|
||||
for (unsigned i = 0; i < dimension; ++i) {
|
||||
sort * ext_sk_domain[2] = { s_array, s_array };
|
||||
func_decl * ext_sk_decl = util.mk_array_ext(s_array, i);
|
||||
ext_skolems->push_back(ext_sk_decl);
|
||||
}
|
||||
|
|
|
@ -190,13 +190,13 @@ namespace smt {
|
|||
|
||||
expr * theory_str::rewrite_implication(expr * premise, expr * conclusion) {
|
||||
ast_manager & m = get_manager();
|
||||
return m.mk_or(m.mk_not(premise), conclusion);
|
||||
return m.mk_or(mk_not(m, premise), conclusion);
|
||||
}
|
||||
|
||||
void theory_str::assert_implication(expr * premise, expr * conclusion) {
|
||||
ast_manager & m = get_manager();
|
||||
TRACE("str", tout << "asserting implication " << mk_ismt2_pp(premise, m) << " -> " << mk_ismt2_pp(conclusion, m) << std::endl;);
|
||||
expr_ref axiom(m.mk_or(m.mk_not(premise), conclusion), m);
|
||||
expr_ref axiom(m.mk_or(mk_not(m, premise), conclusion), m);
|
||||
assert_axiom(axiom);
|
||||
}
|
||||
|
||||
|
@ -545,7 +545,7 @@ namespace smt {
|
|||
context & ctx = get_context();
|
||||
ast_manager & m = get_manager();
|
||||
|
||||
expr_ref ax1(m.mk_not(ctx.mk_eq_atom(s, mk_string(""))), m);
|
||||
expr_ref ax1(mk_not(m, ctx.mk_eq_atom(s, mk_string(""))), m);
|
||||
assert_axiom(ax1);
|
||||
|
||||
{
|
||||
|
@ -557,7 +557,7 @@ namespace smt {
|
|||
SASSERT(zero);
|
||||
// build LHS > RHS and assert
|
||||
// we have to build !(LHS <= RHS) instead
|
||||
expr_ref lhs_gt_rhs(m.mk_not(m_autil.mk_le(len_str, zero)), m);
|
||||
expr_ref lhs_gt_rhs(mk_not(m, m_autil.mk_le(len_str, zero)), m);
|
||||
SASSERT(lhs_gt_rhs);
|
||||
assert_axiom(lhs_gt_rhs);
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ namespace smt {
|
|||
SASSERT(zero);
|
||||
// build LHS > RHS and assert
|
||||
// we have to build !(LHS <= RHS) instead
|
||||
expr_ref lhs_gt_rhs(m.mk_not(m_autil.mk_le(len_str, zero)), m);
|
||||
expr_ref lhs_gt_rhs(mk_not(m, m_autil.mk_le(len_str, zero)), m);
|
||||
SASSERT(lhs_gt_rhs);
|
||||
assert_axiom(lhs_gt_rhs);
|
||||
}
|
||||
|
@ -1089,7 +1089,7 @@ namespace smt {
|
|||
m_autil.mk_ge(expr->get_arg(1), mk_int(0)),
|
||||
// REWRITE for arithmetic theory:
|
||||
// m_autil.mk_lt(expr->get_arg(1), mk_strlen(expr->get_arg(0)))
|
||||
m.mk_not(m_autil.mk_ge(m_autil.mk_add(expr->get_arg(1), m_autil.mk_mul(mk_int(-1), mk_strlen(expr->get_arg(0)))), mk_int(0)))
|
||||
mk_not(m, m_autil.mk_ge(m_autil.mk_add(expr->get_arg(1), m_autil.mk_mul(mk_int(-1), mk_strlen(expr->get_arg(0)))), mk_int(0)))
|
||||
), m);
|
||||
|
||||
expr_ref_vector and_item(m);
|
||||
|
@ -1130,7 +1130,7 @@ namespace smt {
|
|||
expr_ref_vector innerItems(m);
|
||||
innerItems.push_back(ctx.mk_eq_atom(expr->get_arg(1), mk_concat(ts0, ts1)));
|
||||
innerItems.push_back(ctx.mk_eq_atom(mk_strlen(ts0), mk_strlen(expr->get_arg(0))));
|
||||
innerItems.push_back(m.mk_ite(ctx.mk_eq_atom(ts0, expr->get_arg(0)), expr, m.mk_not(expr)));
|
||||
innerItems.push_back(m.mk_ite(ctx.mk_eq_atom(ts0, expr->get_arg(0)), expr, mk_not(m, expr)));
|
||||
expr_ref then1(m.mk_and(innerItems.size(), innerItems.c_ptr()), m);
|
||||
SASSERT(then1);
|
||||
|
||||
|
@ -1143,7 +1143,7 @@ namespace smt {
|
|||
, m);
|
||||
SASSERT(topLevelCond);
|
||||
|
||||
expr_ref finalAxiom(m.mk_ite(topLevelCond, then1, m.mk_not(expr)), m);
|
||||
expr_ref finalAxiom(m.mk_ite(topLevelCond, then1, mk_not(m, expr)), m);
|
||||
SASSERT(finalAxiom);
|
||||
assert_axiom(finalAxiom);
|
||||
}
|
||||
|
@ -1167,7 +1167,7 @@ namespace smt {
|
|||
expr_ref_vector innerItems(m);
|
||||
innerItems.push_back(ctx.mk_eq_atom(expr->get_arg(1), mk_concat(ts0, ts1)));
|
||||
innerItems.push_back(ctx.mk_eq_atom(mk_strlen(ts1), mk_strlen(expr->get_arg(0))));
|
||||
innerItems.push_back(m.mk_ite(ctx.mk_eq_atom(ts1, expr->get_arg(0)), expr, m.mk_not(expr)));
|
||||
innerItems.push_back(m.mk_ite(ctx.mk_eq_atom(ts1, expr->get_arg(0)), expr, mk_not(m, expr)));
|
||||
expr_ref then1(m.mk_and(innerItems.size(), innerItems.c_ptr()), m);
|
||||
SASSERT(then1);
|
||||
|
||||
|
@ -1180,7 +1180,7 @@ namespace smt {
|
|||
, m);
|
||||
SASSERT(topLevelCond);
|
||||
|
||||
expr_ref finalAxiom(m.mk_ite(topLevelCond, then1, m.mk_not(expr)), m);
|
||||
expr_ref finalAxiom(m.mk_ite(topLevelCond, then1, mk_not(m, expr)), m);
|
||||
SASSERT(finalAxiom);
|
||||
assert_axiom(finalAxiom);
|
||||
}
|
||||
|
@ -1204,7 +1204,7 @@ namespace smt {
|
|||
if (haystackStr.contains(needleStr)) {
|
||||
assert_axiom(ex);
|
||||
} else {
|
||||
assert_axiom(m.mk_not(ex));
|
||||
assert_axiom(mk_not(m, ex));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1265,7 +1265,7 @@ namespace smt {
|
|||
SASSERT(tmpLen);
|
||||
thenItems.push_back(ctx.mk_eq_atom(expr->get_arg(0), mk_concat(x3, x4)));
|
||||
thenItems.push_back(ctx.mk_eq_atom(mk_strlen(x3), tmpLen));
|
||||
thenItems.push_back(m.mk_not(mk_contains(x3, expr->get_arg(1))));
|
||||
thenItems.push_back(mk_not(m, mk_contains(x3, expr->get_arg(1))));
|
||||
expr_ref thenBranch(m.mk_and(thenItems.size(), thenItems.c_ptr()), m);
|
||||
SASSERT(thenBranch);
|
||||
|
||||
|
@ -1341,7 +1341,7 @@ namespace smt {
|
|||
|
||||
expr_ref ite1(m.mk_ite(
|
||||
//m_autil.mk_lt(expr->get_arg(2), zeroAst),
|
||||
m.mk_not(m_autil.mk_ge(expr->get_arg(2), zeroAst)),
|
||||
mk_not(m, m_autil.mk_ge(expr->get_arg(2), zeroAst)),
|
||||
ctx.mk_eq_atom(resAst, mk_indexof(expr->get_arg(0), expr->get_arg(1))),
|
||||
ite2
|
||||
), m);
|
||||
|
@ -1384,7 +1384,7 @@ namespace smt {
|
|||
thenItems.push_back(m_autil.mk_ge(indexAst, mk_int(0)));
|
||||
// args[0] = x1 . args[1] . x2
|
||||
// x1 doesn't contain args[1]
|
||||
thenItems.push_back(m.mk_not(mk_contains(x2, expr->get_arg(1))));
|
||||
thenItems.push_back(mk_not(m, mk_contains(x2, expr->get_arg(1))));
|
||||
thenItems.push_back(ctx.mk_eq_atom(indexAst, mk_strlen(x1)));
|
||||
|
||||
bool canSkip = false;
|
||||
|
@ -1402,7 +1402,7 @@ namespace smt {
|
|||
expr_ref tmpLen(m_autil.mk_add(indexAst, mk_int(1)), m);
|
||||
thenItems.push_back(ctx.mk_eq_atom(expr->get_arg(0), mk_concat(x3, x4)));
|
||||
thenItems.push_back(ctx.mk_eq_atom(mk_strlen(x3), tmpLen));
|
||||
thenItems.push_back(m.mk_not(mk_contains(x4, expr->get_arg(1))));
|
||||
thenItems.push_back(mk_not(m, mk_contains(x4, expr->get_arg(1))));
|
||||
}
|
||||
//----------------------------
|
||||
// else branch
|
||||
|
@ -1452,7 +1452,7 @@ namespace smt {
|
|||
argumentsValid_terms.push_back(m_autil.mk_ge(substrPos, zero));
|
||||
// pos < strlen(base)
|
||||
// --> pos + -1*strlen(base) < 0
|
||||
argumentsValid_terms.push_back(m.mk_not(m_autil.mk_ge(
|
||||
argumentsValid_terms.push_back(mk_not(m, m_autil.mk_ge(
|
||||
m_autil.mk_add(substrPos, m_autil.mk_mul(minusOne, substrLen)),
|
||||
zero)));
|
||||
|
||||
|
@ -1473,7 +1473,7 @@ namespace smt {
|
|||
|
||||
// Case 1: pos < 0 or pos >= strlen(base) or len < 0
|
||||
// ==> (Substr ...) = ""
|
||||
expr_ref case1_premise(m.mk_not(argumentsValid), m);
|
||||
expr_ref case1_premise(mk_not(m, argumentsValid), m);
|
||||
SASSERT(case1_premise);
|
||||
ctx.internalize(case1_premise, false);
|
||||
expr_ref case1_conclusion(ctx.mk_eq_atom(expr, mk_string("")), m);
|
||||
|
@ -1505,7 +1505,7 @@ namespace smt {
|
|||
case3_conclusion_terms.push_back(ctx.mk_eq_atom(mk_strlen(t3), substrLen));
|
||||
case3_conclusion_terms.push_back(ctx.mk_eq_atom(expr, t3));
|
||||
expr_ref case3_conclusion(mk_and(case3_conclusion_terms), m);
|
||||
expr_ref case3(rewrite_implication(m.mk_and(argumentsValid, m.mk_not(lenOutOfBounds)), case3_conclusion), m);
|
||||
expr_ref case3(rewrite_implication(m.mk_and(argumentsValid, mk_not(m, lenOutOfBounds)), case3_conclusion), m);
|
||||
SASSERT(case3);
|
||||
|
||||
ctx.internalize(case1, false);
|
||||
|
@ -1548,7 +1548,7 @@ namespace smt {
|
|||
argumentsValid_terms.push_back(m_autil.mk_ge(substrPos, zero));
|
||||
// pos < strlen(base)
|
||||
// --> pos + -1*strlen(base) < 0
|
||||
argumentsValid_terms.push_back(m.mk_not(m_autil.mk_ge(
|
||||
argumentsValid_terms.push_back(mk_not(m, m_autil.mk_ge(
|
||||
m_autil.mk_add(substrPos, m_autil.mk_mul(minusOne, substrLen)),
|
||||
zero)));
|
||||
// len >= 0
|
||||
|
@ -1564,7 +1564,7 @@ namespace smt {
|
|||
|
||||
// Case 1: pos < 0 or pos >= strlen(base) or len < 0
|
||||
// ==> (Substr ...) = ""
|
||||
expr_ref case1_premise(m.mk_not(argumentsValid), m);
|
||||
expr_ref case1_premise(mk_not(m, argumentsValid), m);
|
||||
expr_ref case1_conclusion(ctx.mk_eq_atom(expr, mk_string("")), m);
|
||||
expr_ref case1(m.mk_implies(case1_premise, case1_conclusion), m);
|
||||
|
||||
|
@ -1589,7 +1589,7 @@ namespace smt {
|
|||
case3_conclusion_terms.push_back(ctx.mk_eq_atom(mk_strlen(t3), substrLen));
|
||||
case3_conclusion_terms.push_back(ctx.mk_eq_atom(expr, t3));
|
||||
expr_ref case3_conclusion(mk_and(case3_conclusion_terms), m);
|
||||
expr_ref case3(m.mk_implies(m.mk_and(argumentsValid, m.mk_not(lenOutOfBounds)), case3_conclusion), m);
|
||||
expr_ref case3(m.mk_implies(m.mk_and(argumentsValid, mk_not(m, lenOutOfBounds)), case3_conclusion), m);
|
||||
|
||||
assert_axiom(case1);
|
||||
assert_axiom(case2);
|
||||
|
@ -1630,7 +1630,7 @@ namespace smt {
|
|||
expr_ref tmpLen(m_autil.mk_add(i1, mk_strlen(expr->get_arg(1)), mk_int(-1)), m);
|
||||
thenItems.push_back(ctx.mk_eq_atom(expr->get_arg(0), mk_concat(x3, x4)));
|
||||
thenItems.push_back(ctx.mk_eq_atom(mk_strlen(x3), tmpLen));
|
||||
thenItems.push_back(m.mk_not(mk_contains(x3, expr->get_arg(1))));
|
||||
thenItems.push_back(mk_not(m, mk_contains(x3, expr->get_arg(1))));
|
||||
thenItems.push_back(ctx.mk_eq_atom(result, mk_concat(x1, mk_concat(expr->get_arg(2), x2))));
|
||||
// -----------------------
|
||||
// false branch
|
||||
|
@ -1684,7 +1684,7 @@ namespace smt {
|
|||
expr_ref tl(mk_str_var("tl"), m);
|
||||
expr_ref conclusion1(ctx.mk_eq_atom(S, mk_concat(hd, tl)), m);
|
||||
expr_ref conclusion2(ctx.mk_eq_atom(mk_strlen(hd), m_autil.mk_numeral(rational::one(), true)), m);
|
||||
expr_ref conclusion3(m.mk_not(ctx.mk_eq_atom(hd, mk_string("0"))), m);
|
||||
expr_ref conclusion3(mk_not(m, ctx.mk_eq_atom(hd, mk_string("0"))), m);
|
||||
expr_ref conclusion(m.mk_and(conclusion1, conclusion2, conclusion3), m);
|
||||
SASSERT(premise);
|
||||
SASSERT(conclusion);
|
||||
|
@ -1708,7 +1708,7 @@ namespace smt {
|
|||
// axiom 1: N < 0 <==> (str.from-int N) = ""
|
||||
expr * N = ex->get_arg(0);
|
||||
{
|
||||
expr_ref axiom1_lhs(m.mk_not(m_autil.mk_ge(N, m_autil.mk_numeral(rational::zero(), true))), m);
|
||||
expr_ref axiom1_lhs(mk_not(m, m_autil.mk_ge(N, m_autil.mk_numeral(rational::zero(), true))), m);
|
||||
expr_ref axiom1_rhs(ctx.mk_eq_atom(ex, mk_string("")), m);
|
||||
expr_ref axiom1(ctx.mk_eq_atom(axiom1_lhs, axiom1_rhs), m);
|
||||
SASSERT(axiom1);
|
||||
|
@ -1947,7 +1947,7 @@ namespace smt {
|
|||
// inconsistency check: value
|
||||
if (!can_two_nodes_eq(eqc_nn1, eqc_nn2)) {
|
||||
TRACE("str", tout << "inconsistency detected: " << mk_pp(eqc_nn1, m) << " cannot be equal to " << mk_pp(eqc_nn2, m) << std::endl;);
|
||||
expr_ref to_assert(m.mk_not(ctx.mk_eq_atom(eqc_nn1, eqc_nn2)), m);
|
||||
expr_ref to_assert(mk_not(m, ctx.mk_eq_atom(eqc_nn1, eqc_nn2)), m);
|
||||
assert_axiom(to_assert);
|
||||
// this shouldn't use the integer theory at all, so we don't allow the option of quick-return
|
||||
return false;
|
||||
|
@ -2160,7 +2160,7 @@ namespace smt {
|
|||
expr_ref implyR11(ctx.mk_eq_atom(mk_strlen(arg1), mk_int(makeUpLenArg1)), m);
|
||||
assert_implication(implyL11, implyR11);
|
||||
} else {
|
||||
expr_ref neg(m.mk_not(implyL11), m);
|
||||
expr_ref neg(mk_not(m, implyL11), m);
|
||||
assert_axiom(neg);
|
||||
}
|
||||
}
|
||||
|
@ -2231,7 +2231,7 @@ namespace smt {
|
|||
expr_ref implyR11(ctx.mk_eq_atom(mk_strlen(arg0), mk_int(makeUpLenArg0)), m);
|
||||
assert_implication(implyL11, implyR11);
|
||||
} else {
|
||||
expr_ref neg(m.mk_not(implyL11), m);
|
||||
expr_ref neg(mk_not(m, implyL11), m);
|
||||
assert_axiom(neg);
|
||||
}
|
||||
}
|
||||
|
@ -2762,7 +2762,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
if (!can_two_nodes_eq(new_nn1, new_nn2)) {
|
||||
expr_ref detected(m.mk_not(ctx.mk_eq_atom(new_nn1, new_nn2)), m);
|
||||
expr_ref detected(mk_not(m, ctx.mk_eq_atom(new_nn1, new_nn2)), m);
|
||||
TRACE("str", tout << "inconsistency detected: " << mk_ismt2_pp(detected, m) << std::endl;);
|
||||
assert_axiom(detected);
|
||||
return;
|
||||
|
@ -5008,7 +5008,7 @@ namespace smt {
|
|||
implyR = boolVar;
|
||||
} else {
|
||||
//implyR = Z3_mk_eq(ctx, boolVar, Z3_mk_false(ctx));
|
||||
implyR = m.mk_not(boolVar);
|
||||
implyR = mk_not(m, boolVar);
|
||||
}
|
||||
} else {
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -5037,7 +5037,7 @@ namespace smt {
|
|||
litems.push_back(ctx.mk_eq_atom(substrAst, aConcat));
|
||||
}
|
||||
//implyR = Z3_mk_eq(ctx, boolVar, Z3_mk_false(ctx));
|
||||
implyR = m.mk_not(boolVar);
|
||||
implyR = mk_not(m, boolVar);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -5076,7 +5076,7 @@ namespace smt {
|
|||
implyR = boolVar;
|
||||
} else {
|
||||
// implyR = Z3_mk_eq(ctx, boolVar, Z3_mk_false(ctx));
|
||||
implyR = m.mk_not(boolVar);
|
||||
implyR = mk_not(m, boolVar);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5146,7 +5146,7 @@ namespace smt {
|
|||
litems.push_back(ctx.mk_eq_atom(substrAst, aConcat));
|
||||
}
|
||||
expr_ref implyLHS(mk_and(litems), m);
|
||||
expr_ref implyR(m.mk_not(boolVar), m);
|
||||
expr_ref implyR(mk_not(m, boolVar), m);
|
||||
assert_implication(implyLHS, implyR);
|
||||
break;
|
||||
}
|
||||
|
@ -6515,7 +6515,7 @@ namespace smt {
|
|||
if (matchRes) {
|
||||
assert_implication(implyL, boolVar);
|
||||
} else {
|
||||
assert_implication(implyL, m.mk_not(boolVar));
|
||||
assert_implication(implyL, mk_not(m, boolVar));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6603,7 +6603,7 @@ namespace smt {
|
|||
<< arg1_str << "\" + \"" << arg2_str <<
|
||||
"\" != \"" << const_str << "\"" << "\n";);
|
||||
expr_ref equality(ctx.mk_eq_atom(concat, str), m);
|
||||
expr_ref diseq(m.mk_not(equality), m);
|
||||
expr_ref diseq(mk_not(m, equality), m);
|
||||
assert_axiom(diseq);
|
||||
return;
|
||||
}
|
||||
|
@ -6621,7 +6621,7 @@ namespace smt {
|
|||
"\" is longer than \"" << const_str << "\","
|
||||
<< " so cannot be concatenated with anything to form it" << "\n";);
|
||||
expr_ref equality(ctx.mk_eq_atom(newConcat, str), m);
|
||||
expr_ref diseq(m.mk_not(equality), m);
|
||||
expr_ref diseq(mk_not(m, equality), m);
|
||||
assert_axiom(diseq);
|
||||
return;
|
||||
} else {
|
||||
|
@ -6635,7 +6635,7 @@ namespace smt {
|
|||
<< "actually \"" << arg2_str << "\""
|
||||
<< "\n";);
|
||||
expr_ref equality(ctx.mk_eq_atom(newConcat, str), m);
|
||||
expr_ref diseq(m.mk_not(equality), m);
|
||||
expr_ref diseq(mk_not(m, equality), m);
|
||||
assert_axiom(diseq);
|
||||
return;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue