diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2017-12-08 10:14:31 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-08 10:14:31 -0600 |
commit | 564234963dd7e76c8d9b88ef941a6683694e5b53 (patch) | |
tree | 313e46520c07d1536fffbad4b7080937cfc09aae /src/theory/sets | |
parent | 805d4b7483e51a9b4d24058d493f85700a87f099 (diff) |
Make collect model info return a Bool (#1421)
Diffstat (limited to 'src/theory/sets')
-rw-r--r-- | src/theory/sets/theory_sets.cpp | 5 | ||||
-rw-r--r-- | src/theory/sets/theory_sets.h | 2 | ||||
-rw-r--r-- | src/theory/sets/theory_sets_private.cpp | 19 | ||||
-rw-r--r-- | src/theory/sets/theory_sets_private.h | 2 |
4 files changed, 18 insertions, 10 deletions
diff --git a/src/theory/sets/theory_sets.cpp b/src/theory/sets/theory_sets.cpp index 263d61934..9fcf3c089 100644 --- a/src/theory/sets/theory_sets.cpp +++ b/src/theory/sets/theory_sets.cpp @@ -50,8 +50,9 @@ bool TheorySets::needsCheckLastEffort() { return d_internal->needsCheckLastEffort(); } -void TheorySets::collectModelInfo(TheoryModel* m) { - d_internal->collectModelInfo(m); +bool TheorySets::collectModelInfo(TheoryModel* m) +{ + return d_internal->collectModelInfo(m); } void TheorySets::computeCareGraph() { diff --git a/src/theory/sets/theory_sets.h b/src/theory/sets/theory_sets.h index 3ecd404bb..1f0fbdd1f 100644 --- a/src/theory/sets/theory_sets.h +++ b/src/theory/sets/theory_sets.h @@ -52,7 +52,7 @@ public: bool needsCheckLastEffort(); - void collectModelInfo(TheoryModel* m); + bool collectModelInfo(TheoryModel* m) override; void computeCareGraph(); diff --git a/src/theory/sets/theory_sets_private.cpp b/src/theory/sets/theory_sets_private.cpp index 3013711eb..6bafbb0de 100644 --- a/src/theory/sets/theory_sets_private.cpp +++ b/src/theory/sets/theory_sets_private.cpp @@ -1911,16 +1911,19 @@ EqualityStatus TheorySetsPrivate::getEqualityStatus(TNode a, TNode b) { /******************** Model generation ********************/ /******************** Model generation ********************/ - -void TheorySetsPrivate::collectModelInfo(TheoryModel* m) { +bool TheorySetsPrivate::collectModelInfo(TheoryModel* m) +{ Trace("sets-model") << "Set collect model info" << std::endl; set<Node> termSet; // Compute terms appearing in assertions and shared terms d_external.computeRelevantTerms(termSet); // Assert equalities and disequalities to the model - m->assertEqualityEngine(&d_equalityEngine,&termSet); - + if (!m->assertEqualityEngine(&d_equalityEngine, &termSet)) + { + return false; + } + std::map< Node, Node > mvals; for( int i=(int)(d_set_eqc.size()-1); i>=0; i-- ){ Node eqc = d_set_eqc[i]; @@ -1970,10 +1973,14 @@ void TheorySetsPrivate::collectModelInfo(TheoryModel* m) { rep = Rewriter::rewrite( rep ); Trace("sets-model") << "* Assign representative of " << eqc << " to " << rep << std::endl; mvals[eqc] = rep; - m->assertEquality( eqc, rep, true ); - m->assertRepresentative( rep ); + if (!m->assertEquality(eqc, rep, true)) + { + return false; + } + m->assertSkeleton(rep); } } + return true; } /********************** Helper functions ***************************/ diff --git a/src/theory/sets/theory_sets_private.h b/src/theory/sets/theory_sets_private.h index 175e82bb8..bd63ff43d 100644 --- a/src/theory/sets/theory_sets_private.h +++ b/src/theory/sets/theory_sets_private.h @@ -178,7 +178,7 @@ public: bool needsCheckLastEffort(); - void collectModelInfo(TheoryModel* m); + bool collectModelInfo(TheoryModel* m); void computeCareGraph(); |