Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreynol committed Jan 15, 2025
1 parent c27f5d6 commit 0ec00cc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/smt/expand_definitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ Node ExpandDefs::expandDefinitions(TNode n,
result.push(ret.isNull() ? n : ret);
continue;
}
theory::TheoryId tid = d_env.theoryOf(node);
// ensure rewritten
Node nr = rewrite(n);
// now get the appropriate theory
theory::TheoryId tid = d_env.theoryOf(nr);
theory::TheoryRewriter* tr = rr->getTheoryRewriter(tid);

Assert(tr != NULL);
// ensure rewritten
Node nr = rewrite(n);
Trace("expand") << "Expand definition on " << nr << " (from " << n << ")" << std::endl;
Node nre = tr->expandDefinition(nr);
Trace("expand") << "...returns " << nre << std::endl;
node = nre.isNull() ? nr : nre;
// the partial functions can fall through, in which case we still
// consider their children
Expand Down
2 changes: 2 additions & 0 deletions src/theory/datatypes/datatypes_rewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,9 @@ Node DatatypesRewriter::expandDefinition(Node n)
{
case Kind::APPLY_SELECTOR:
{
Trace("dt-expand") << "expand selector, share sel = " << d_opts.datatypes.dtSharedSelectors << std::endl;
ret = expandApplySelector(n, d_opts.datatypes.dtSharedSelectors);
Trace("dt-expand") << "...returns " << ret << std::endl;
}
break;
case Kind::APPLY_UPDATER:
Expand Down
1 change: 1 addition & 0 deletions test/regress/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ set(regress_0_tests
regress0/datatypes/proj-issue172.smt2
regress0/datatypes/proj-issue474-app-cons-value.smt2
regress0/datatypes/proj-issue578-clash-pf.smt2
regress0/datatypes/proj-issue754-check-model.smt2
regress0/datatypes/rec1.cvc.smt2
regress0/datatypes/rec2.cvc.smt2
regress0/datatypes/rec4.cvc.smt2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; EXPECT: sat
(set-logic QF_BVDT)
(declare-datatypes ((d 0)) (((c) (_c (s Bool)))))
(declare-const x d)
(check-sat-assuming ((ite (s c) (s x) (s x))))

0 comments on commit 0ec00cc

Please sign in to comment.