Skip to content

Commit 75a40d8

Browse files
reorder fields, rename overload name clash
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent 64f4c97 commit 75a40d8

File tree

7 files changed

+23
-28
lines changed

7 files changed

+23
-28
lines changed

src/api/python/z3/z3.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,15 +1861,6 @@ def is_lambda(self):
18611861
"""
18621862
return Z3_is_lambda(self.ctx_ref(), self.ast)
18631863

1864-
def __getitem__(self, arg):
1865-
"""Return the Z3 expression `self[arg]`.
1866-
"""
1867-
if z3_debug():
1868-
_z3_assert(self.is_lambda(), "quantifier should be a lambda expression")
1869-
arg = self.sort().domain().cast(arg)
1870-
return _to_expr_ref(Z3_mk_select(self.ctx_ref(), self.as_ast(), arg.as_ast()), self.ctx)
1871-
1872-
18731864
def weight(self):
18741865
"""Return the weight annotation of `self`.
18751866
@@ -4297,9 +4288,6 @@ def is_array(a):
42974288
"""
42984289
return isinstance(a, ArrayRef)
42994290

4300-
def is_array_sort(a):
4301-
return Z3_get_sort_kind(a.ctx.ref(), Z3_get_sort(a.ctx.ref(), a.ast)) == Z3_ARRAY_SORT
4302-
43034291
def is_const_array(a):
43044292
"""Return `True` if `a` is a Z3 constant array.
43054293
@@ -4424,7 +4412,7 @@ def Update(a, i, v):
44244412
proved
44254413
"""
44264414
if z3_debug():
4427-
_z3_assert(is_array_sort(a), "First argument must be a Z3 array expression")
4415+
_z3_assert(is_array(a), "First argument must be a Z3 array expression")
44284416
i = a.domain().cast(i)
44294417
v = a.range().cast(v)
44304418
ctx = a.ctx
@@ -4437,7 +4425,7 @@ def Default(a):
44374425
proved
44384426
"""
44394427
if z3_debug():
4440-
_z3_assert(is_array_sort(a), "First argument must be a Z3 array expression")
4428+
_z3_assert(is_array(a), "First argument must be a Z3 array expression")
44414429
return a.default()
44424430

44434431

@@ -4468,7 +4456,7 @@ def Select(a, i):
44684456
True
44694457
"""
44704458
if z3_debug():
4471-
_z3_assert(is_array_sort(a), "First argument must be a Z3 array expression")
4459+
_z3_assert(is_array(a), "First argument must be a Z3 array expression")
44724460
return a[i]
44734461

44744462

@@ -4488,7 +4476,7 @@ def Map(f, *args):
44884476
if z3_debug():
44894477
_z3_assert(len(args) > 0, "At least one Z3 array expression expected")
44904478
_z3_assert(is_func_decl(f), "First argument must be a Z3 function declaration")
4491-
_z3_assert(all([is_array_sort(a) for a in args]), "Z3 array expected expected")
4479+
_z3_assert(all([is_array(a) for a in args]), "Z3 array expected expected")
44924480
_z3_assert(len(args) == f.arity(), "Number of arguments mismatch")
44934481
_args, sz = _to_ast_array(args)
44944482
ctx = f.ctx
@@ -4523,7 +4511,7 @@ def Ext(a, b):
45234511
"""
45244512
ctx = a.ctx
45254513
if z3_debug():
4526-
_z3_assert(is_array_sort(a) and is_array_sort(b), "arguments must be arrays")
4514+
_z3_assert(is_array(a) and is_array(b), "arguments must be arrays")
45274515
return _to_expr_ref(Z3_mk_array_ext(ctx.ref(), a.as_ast(), b.as_ast()), ctx)
45284516

45294517
def SetHasSize(a, k):
@@ -9988,7 +9976,7 @@ def __radd__(self, other):
99889976
def __getitem__(self, i):
99899977
if _is_int(i):
99909978
i = IntVal(i, self.ctx)
9991-
return _to_expr_ref(Z3_mk_seq_nth(self.ctx_ref(), self.as_ast(), i.as_ast()), self.ctx)
9979+
return SeqRef(Z3_mk_seq_nth(self.ctx_ref(), self.as_ast(), i.as_ast()), self.ctx)
99929980

99939981
def at(self, i):
99949982
if _is_int(i):

src/sat/sat_drat.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ namespace sat {
2929
m_out(nullptr),
3030
m_bout(nullptr),
3131
m_inconsistent(false),
32+
m_num_add(0),
33+
m_num_del(0),
3234
m_check_unsat(false),
3335
m_check_sat(false),
3436
m_check(false),
35-
m_activity(false),
36-
m_num_add(0),
37-
m_num_del(0)
37+
m_activity(false)
3838
{
3939
if (s.get_config().m_drat && s.get_config().m_drat_file != symbol()) {
4040
auto mode = s.get_config().m_drat_binary ? (std::ios_base::binary | std::ios_base::out | std::ios_base::trunc) : std::ios_base::out;

src/smt/smt_internalizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ namespace smt {
13111311
The deletion event handler is ignored if binary clause optimization is applicable.
13121312
*/
13131313
clause * context::mk_clause(unsigned num_lits, literal * lits, justification * j, clause_kind k, clause_del_eh * del_eh) {
1314-
TRACE("mk_clause", tout << "creating clause:\n"; display_literals_verbose(tout, num_lits, lits); tout << "\n";);
1314+
TRACE("mk_clause", display_literals_verbose(tout << "creating clause: " << literal_vector(num_lits, lits) << "\n", num_lits, lits) << "\n";);
13151315
m_clause_proof.add(num_lits, lits, k, j);
13161316
switch (k) {
13171317
case CLS_AUX:

src/smt/theory_seq.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3885,7 +3885,14 @@ std::ostream& theory_seq::display_disequation(std::ostream& out, ne const& e) co
38853885
out << "\n";
38863886
}
38873887
for (unsigned j = 0; j < e.ls().size(); ++j) {
3888-
out << e.ls(j) << " != " << e.rs(j) << "\n";
3888+
for (expr* t : e.ls(j)) {
3889+
out << mk_bounded_pp(t, m) << " ";
3890+
}
3891+
out << " != ";
3892+
for (expr* t : e.rs(j)) {
3893+
out << mk_bounded_pp(t, m) << " ";
3894+
}
3895+
out << "\n";
38893896
}
38903897
if (e.dep()) {
38913898
display_deps(out, e.dep());

src/smt/theory_seq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ namespace smt {
268268
};
269269

270270
class replay_unit_literal : public apply {
271-
bool m_sign;
272271
expr_ref m_e;
272+
bool m_sign;
273273
public:
274274
replay_unit_literal(ast_manager& m, expr* e, bool sign) : m_e(e, m), m_sign(sign) {}
275275
~replay_unit_literal() override {}

src/smt/theory_utvpi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ namespace smt {
263263

264264
void enforce_parity();
265265

266-
void validate_model();
267-
268266
bool eval(expr* e);
269267

268+
void model_validate();
269+
270270
rational eval_num(expr* e);
271271

272272
bool check_z_consistency();

src/smt/theory_utvpi_def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,11 @@ namespace smt {
777777
enforce_parity();
778778
m_graph.set_to_zero(to_var(m_zero), neg(to_var(m_zero)));
779779
compute_delta();
780-
DEBUG_CODE(validate_model(););
780+
DEBUG_CODE(model_validate(););
781781
}
782782

783783
template<typename Ext>
784-
void theory_utvpi<Ext>::validate_model() {
784+
void theory_utvpi<Ext>::model_validate() {
785785
context& ctx = get_context();
786786
unsigned sz = m_atoms.size();
787787
for (unsigned i = 0; i < sz; ++i) {

0 commit comments

Comments
 (0)