Skip to content

Commit a11dc5d

Browse files
shuffle checks for enable_edge around fix #4159
1 parent 71e9bf1 commit a11dc5d

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

src/ast/datatype_decl_plugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ namespace datatype {
346346
bool is_is(app * f) const { return is_app_of(f, fid(), OP_DT_IS);}
347347
bool is_is(expr * e) const { return is_app(e) && is_is(to_app(e)); }
348348
bool is_recognizer(app * f) const { return is_recognizer0(f) || is_is(f); }
349-
bool is_accessor(app * f) const { return is_app_of(f, fid(), OP_DT_ACCESSOR); }
349+
bool is_accessor(expr * e) const { return is_app(e) && is_app_of(to_app(e), fid(), OP_DT_ACCESSOR); }
350350
bool is_update_field(app * f) const { return is_app_of(f, fid(), OP_DT_UPDATE_FIELD); }
351351
app* mk_is(func_decl * c, expr *f);
352352
ptr_vector<func_decl> const * get_datatype_constructors(sort * ty);

src/ast/rewriter/value_sweep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void value_sweep::set_value_core(expr* e, expr* v) {
3535
}
3636

3737
void value_sweep::set_value(expr* e, expr* v) {
38-
if (!is_reducible(e)) {
38+
if (!is_reducible(e) || m_dt.is_accessor(e)) {
3939
set_value_core(e, v);
4040
m_pinned.push_back(e);
4141
}

src/smt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ z3_add_component(smt
3434
smt_farkas_util.cpp
3535
smt_for_each_relevant_expr.cpp
3636
smt_implied_equalities.cpp
37+
smt_induction.cpp
3738
smt_internalizer.cpp
3839
smt_justification.cpp
3940
smt_kernel.cpp

src/smt/theory_utvpi_def.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ namespace smt {
510510

511511
template<typename Ext>
512512
void theory_utvpi<Ext>::propagate() {
513-
bool consistent = true;
513+
bool consistent = is_consistent() && !get_context().inconsistent();
514514
while (consistent && can_propagate()) {
515515
unsigned idx = m_asserted_atoms[m_asserted_qhead];
516516
m_asserted_qhead++;
@@ -520,13 +520,9 @@ namespace smt {
520520

521521
template<typename Ext>
522522
bool theory_utvpi<Ext>::propagate_atom(atom const& a) {
523-
context& ctx = get_context();
524-
TRACE("utvpi", a.display(*this, tout); tout << "\n";);
525-
if (ctx.inconsistent()) {
526-
return false;
527-
}
523+
TRACE("utvpi", a.display(*this, tout); tout << "\n";);
528524
int edge_id = a.get_asserted_edge();
529-
if (!enable_edge(edge_id) || !is_consistent()) {
525+
if (!enable_edge(edge_id)) {
530526
m_graph.traverse_neg_cycle2(m_params.m_arith_stronger_lemmas, m_nc_functor);
531527
set_conflict();
532528
return false;
@@ -698,10 +694,9 @@ namespace smt {
698694

699695
template<typename Ext>
700696
bool theory_utvpi<Ext>::enable_edge(edge_id id) {
701-
return
702-
(id == null_edge_id) ||
703-
(m_graph.enable_edge(id) && m_graph.enable_edge(id+1)) ||
704-
m_non_utvpi_exprs;
697+
return
698+
(id == null_edge_id) ||
699+
(m_graph.enable_edge(id) && m_graph.enable_edge(id + 1));
705700
}
706701

707702
template<typename Ext>

0 commit comments

Comments
 (0)