3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 02:15:19 +00:00

reorder fields, rename overload name clash

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-08-25 16:01:39 -03:00
parent 64f4c9794d
commit 75a40d8f8e
7 changed files with 23 additions and 28 deletions

View file

@ -1861,15 +1861,6 @@ class QuantifierRef(BoolRef):
"""
return Z3_is_lambda(self.ctx_ref(), self.ast)
def __getitem__(self, arg):
"""Return the Z3 expression `self[arg]`.
"""
if z3_debug():
_z3_assert(self.is_lambda(), "quantifier should be a lambda expression")
arg = self.sort().domain().cast(arg)
return _to_expr_ref(Z3_mk_select(self.ctx_ref(), self.as_ast(), arg.as_ast()), self.ctx)
def weight(self):
"""Return the weight annotation of `self`.
@ -4297,9 +4288,6 @@ def is_array(a):
"""
return isinstance(a, ArrayRef)
def is_array_sort(a):
return Z3_get_sort_kind(a.ctx.ref(), Z3_get_sort(a.ctx.ref(), a.ast)) == Z3_ARRAY_SORT
def is_const_array(a):
"""Return `True` if `a` is a Z3 constant array.
@ -4424,7 +4412,7 @@ def Update(a, i, v):
proved
"""
if z3_debug():
_z3_assert(is_array_sort(a), "First argument must be a Z3 array expression")
_z3_assert(is_array(a), "First argument must be a Z3 array expression")
i = a.domain().cast(i)
v = a.range().cast(v)
ctx = a.ctx
@ -4437,7 +4425,7 @@ def Default(a):
proved
"""
if z3_debug():
_z3_assert(is_array_sort(a), "First argument must be a Z3 array expression")
_z3_assert(is_array(a), "First argument must be a Z3 array expression")
return a.default()
@ -4468,7 +4456,7 @@ def Select(a, i):
True
"""
if z3_debug():
_z3_assert(is_array_sort(a), "First argument must be a Z3 array expression")
_z3_assert(is_array(a), "First argument must be a Z3 array expression")
return a[i]
@ -4488,7 +4476,7 @@ def Map(f, *args):
if z3_debug():
_z3_assert(len(args) > 0, "At least one Z3 array expression expected")
_z3_assert(is_func_decl(f), "First argument must be a Z3 function declaration")
_z3_assert(all([is_array_sort(a) for a in args]), "Z3 array expected expected")
_z3_assert(all([is_array(a) for a in args]), "Z3 array expected expected")
_z3_assert(len(args) == f.arity(), "Number of arguments mismatch")
_args, sz = _to_ast_array(args)
ctx = f.ctx
@ -4523,7 +4511,7 @@ def Ext(a, b):
"""
ctx = a.ctx
if z3_debug():
_z3_assert(is_array_sort(a) and is_array_sort(b), "arguments must be arrays")
_z3_assert(is_array(a) and is_array(b), "arguments must be arrays")
return _to_expr_ref(Z3_mk_array_ext(ctx.ref(), a.as_ast(), b.as_ast()), ctx)
def SetHasSize(a, k):
@ -9988,7 +9976,7 @@ class SeqRef(ExprRef):
def __getitem__(self, i):
if _is_int(i):
i = IntVal(i, self.ctx)
return _to_expr_ref(Z3_mk_seq_nth(self.ctx_ref(), self.as_ast(), i.as_ast()), self.ctx)
return SeqRef(Z3_mk_seq_nth(self.ctx_ref(), self.as_ast(), i.as_ast()), self.ctx)
def at(self, i):
if _is_int(i):

View file

@ -29,12 +29,12 @@ namespace sat {
m_out(nullptr),
m_bout(nullptr),
m_inconsistent(false),
m_num_add(0),
m_num_del(0),
m_check_unsat(false),
m_check_sat(false),
m_check(false),
m_activity(false),
m_num_add(0),
m_num_del(0)
m_activity(false)
{
if (s.get_config().m_drat && s.get_config().m_drat_file != symbol()) {
auto mode = s.get_config().m_drat_binary ? (std::ios_base::binary | std::ios_base::out | std::ios_base::trunc) : std::ios_base::out;

View file

@ -1311,7 +1311,7 @@ namespace smt {
The deletion event handler is ignored if binary clause optimization is applicable.
*/
clause * context::mk_clause(unsigned num_lits, literal * lits, justification * j, clause_kind k, clause_del_eh * del_eh) {
TRACE("mk_clause", tout << "creating clause:\n"; display_literals_verbose(tout, num_lits, lits); tout << "\n";);
TRACE("mk_clause", display_literals_verbose(tout << "creating clause: " << literal_vector(num_lits, lits) << "\n", num_lits, lits) << "\n";);
m_clause_proof.add(num_lits, lits, k, j);
switch (k) {
case CLS_AUX:

View file

@ -3885,7 +3885,14 @@ std::ostream& theory_seq::display_disequation(std::ostream& out, ne const& e) co
out << "\n";
}
for (unsigned j = 0; j < e.ls().size(); ++j) {
out << e.ls(j) << " != " << e.rs(j) << "\n";
for (expr* t : e.ls(j)) {
out << mk_bounded_pp(t, m) << " ";
}
out << " != ";
for (expr* t : e.rs(j)) {
out << mk_bounded_pp(t, m) << " ";
}
out << "\n";
}
if (e.dep()) {
display_deps(out, e.dep());

View file

@ -268,8 +268,8 @@ namespace smt {
};
class replay_unit_literal : public apply {
bool m_sign;
expr_ref m_e;
bool m_sign;
public:
replay_unit_literal(ast_manager& m, expr* e, bool sign) : m_e(e, m), m_sign(sign) {}
~replay_unit_literal() override {}

View file

@ -263,10 +263,10 @@ namespace smt {
void enforce_parity();
void validate_model();
bool eval(expr* e);
void model_validate();
rational eval_num(expr* e);
bool check_z_consistency();

View file

@ -777,11 +777,11 @@ namespace smt {
enforce_parity();
m_graph.set_to_zero(to_var(m_zero), neg(to_var(m_zero)));
compute_delta();
DEBUG_CODE(validate_model(););
DEBUG_CODE(model_validate(););
}
template<typename Ext>
void theory_utvpi<Ext>::validate_model() {
void theory_utvpi<Ext>::model_validate() {
context& ctx = get_context();
unsigned sz = m_atoms.size();
for (unsigned i = 0; i < sz; ++i) {