Skip to content

Commit 1a642b4

Browse files
na
1 parent 93004a9 commit 1a642b4

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/ast/datatype_decl_plugin.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,15 @@ namespace datatype {
340340
bool is_is(func_decl * f) const { return is_decl_of(f, fid(), OP_DT_IS); }
341341
bool is_accessor(func_decl * f) const { return is_decl_of(f, fid(), OP_DT_ACCESSOR); }
342342
bool is_update_field(func_decl * f) const { return is_decl_of(f, fid(), OP_DT_UPDATE_FIELD); }
343-
bool is_constructor(app * f) const { return is_app_of(f, fid(), OP_DT_CONSTRUCTOR); }
344-
bool is_constructor(expr* e) const { return is_app(e) && is_constructor(to_app(e)); }
345-
bool is_recognizer0(app * f) const { return is_app_of(f, fid(), OP_DT_RECOGNISER);}
346-
bool is_is(app * f) const { return is_app_of(f, fid(), OP_DT_IS);}
347-
bool is_is(expr * e) const { return is_app(e) && is_is(to_app(e)); }
348-
bool is_recognizer(app * f) const { return is_recognizer0(f) || is_is(f); }
349-
bool is_accessor(expr * e) const { return is_app(e) && is_app_of(to_app(e), fid(), OP_DT_ACCESSOR); }
343+
bool is_constructor(app const * f) const { return is_app_of(f, fid(), OP_DT_CONSTRUCTOR); }
344+
bool is_constructor(expr const * e) const { return is_app(e) && is_constructor(to_app(e)); }
345+
bool is_recognizer0(app const* f) const { return is_app_of(f, fid(), OP_DT_RECOGNISER);}
346+
bool is_is(app const * f) const { return is_app_of(f, fid(), OP_DT_IS);}
347+
bool is_is(expr const * e) const { return is_app(e) && is_is(to_app(e)); }
348+
bool is_recognizer(expr const * f) const { return is_app(f) && is_recognizer0(to_app(f)) || is_is(to_app(f)); }
349+
MATCH_UNARY(is_recognizer);
350+
bool is_accessor(expr const* e) const { return is_app(e) && is_app_of(to_app(e), fid(), OP_DT_ACCESSOR); }
351+
MATCH_UNARY(is_accessor);
350352
bool is_update_field(app * f) const { return is_app_of(f, fid(), OP_DT_UPDATE_FIELD); }
351353
app* mk_is(func_decl * c, expr *f);
352354
ptr_vector<func_decl> const * get_datatype_constructors(sort * ty);

src/smt/smt_consequences.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ namespace smt {
4747
//
4848
void context::extract_fixed_consequences(literal lit, index_set const& assumptions, expr_ref_vector& conseq) {
4949
datatype_util dt(m);
50-
expr* e1, *e2;
50+
expr* e1, *e2, *arg;
5151
expr_ref fml(m);
5252
if (lit == true_literal) return;
5353
expr* e = bool_var2expr(lit.var());
54-
TRACE("context", display(tout << mk_pp(e, m) << "\n"););
54+
TRACE("context", tout << mk_pp(e, m) << "\n";);
5555
index_set s;
5656
if (assumptions.contains(lit.var())) {
5757
s.insert(lit.var());
@@ -60,9 +60,6 @@ namespace smt {
6060
justify(lit, s);
6161
}
6262
m_antecedents.insert(lit.var(), s);
63-
TRACE("context", display_literal_verbose(tout, lit);
64-
for (auto v : s) tout << " " << v;
65-
tout << "\n";);
6663
bool found = false;
6764
if (m_var2val.contains(e)) {
6865
found = true;
@@ -85,11 +82,11 @@ namespace smt {
8582
fml = m.mk_eq(e1, e2);
8683
}
8784
}
88-
else if (!lit.sign() && is_app(e) && dt.is_recognizer(to_app(e)->get_decl())) {
89-
if (m_var2val.contains(to_app(e)->get_arg(0))) {
85+
else if (!lit.sign() && dt.is_recognizer(e, arg)) {
86+
if (m_var2val.contains(arg)) {
9087
found = true;
91-
fml = m.mk_eq(to_app(e)->get_arg(0), m.mk_const(dt.get_recognizer_constructor(to_app(e)->get_decl())));
92-
m_var2val.erase(to_app(e)->get_arg(0));
88+
fml = m.mk_eq(arg, m.mk_const(dt.get_recognizer_constructor(to_app(e)->get_decl())));
89+
m_var2val.erase(arg);
9390
}
9491
}
9592
if (found) {
@@ -172,7 +169,7 @@ namespace smt {
172169
TRACE("context",
173170
tout << "checking " << mk_pp(k, m) << " "
174171
<< mk_pp(v, m) << " " << get_assignment(lit) << "\n";
175-
display(tout);
172+
//display(tout);
176173
);
177174
switch (get_assignment(lit)) {
178175
case l_true:
@@ -424,6 +421,7 @@ namespace smt {
424421
m_not_l = null_literal;
425422
}
426423
if (is_sat == l_true) {
424+
TRACE("context", display(tout););
427425
delete_unfixed(unfixed);
428426
}
429427
extract_fixed_consequences(num_units, _assumptions, conseq);
@@ -639,7 +637,7 @@ namespace smt {
639637
for (expr* a : assumptions) {
640638
assert_expr(a);
641639
}
642-
TRACE("context", tout << "checking: " << mk_pp(c, m) << "\n";);
640+
TRACE("context", tout << "checking fixed: " << mk_pp(c, m) << "\n";);
643641
tmp = m.mk_not(c);
644642
assert_expr(tmp);
645643
VERIFY(check() != l_true);

0 commit comments

Comments
 (0)