summaryrefslogtreecommitdiff
path: root/src/theory/strings
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2017-12-08 10:14:31 -0600
committerGitHub <noreply@github.com>2017-12-08 10:14:31 -0600
commit564234963dd7e76c8d9b88ef941a6683694e5b53 (patch)
tree313e46520c07d1536fffbad4b7080937cfc09aae /src/theory/strings
parent805d4b7483e51a9b4d24058d493f85700a87f099 (diff)
Make collect model info return a Bool (#1421)
Diffstat (limited to 'src/theory/strings')
-rw-r--r--src/theory/strings/theory_strings.cpp24
-rw-r--r--src/theory/strings/theory_strings.h8
2 files changed, 21 insertions, 11 deletions
diff --git a/src/theory/strings/theory_strings.cpp b/src/theory/strings/theory_strings.cpp
index 9b259bf97..e6b8807e9 100644
--- a/src/theory/strings/theory_strings.cpp
+++ b/src/theory/strings/theory_strings.cpp
@@ -447,8 +447,8 @@ void TheoryStrings::presolve() {
// MODEL GENERATION
/////////////////////////////////////////////////////////////////////////////
-
-void TheoryStrings::collectModelInfo( TheoryModel* m ) {
+bool TheoryStrings::collectModelInfo(TheoryModel* m)
+{
Trace("strings-model") << "TheoryStrings : Collect model info" << std::endl;
Trace("strings-model") << "TheoryStrings : assertEqualityEngine." << std::endl;
@@ -458,9 +458,12 @@ void TheoryStrings::collectModelInfo( TheoryModel* m ) {
// Compute terms appearing in assertions and shared terms
//computeRelevantTerms(termSet);
//m->assertEqualityEngine( &d_equalityEngine, &termSet );
-
- m->assertEqualityEngine( &d_equalityEngine );
-
+
+ if (!m->assertEqualityEngine(&d_equalityEngine))
+ {
+ return false;
+ }
+
// Generate model
std::vector< Node > nodes;
getEquivalenceClasses( nodes );
@@ -554,7 +557,10 @@ void TheoryStrings::collectModelInfo( TheoryModel* m ) {
++sel;
Trace("strings-model") << "*** Assigned constant " << c << " for " << pure_eq[j] << std::endl;
processed[pure_eq[j]] = c;
- m->assertEquality( pure_eq[j], c, true );
+ if (!m->assertEquality(pure_eq[j], c, true))
+ {
+ return false;
+ }
}
}
}
@@ -583,11 +589,15 @@ void TheoryStrings::collectModelInfo( TheoryModel* m ) {
Assert( cc.getKind()==kind::CONST_STRING );
Trace("strings-model") << "*** Determined constant " << cc << " for " << nodes[i] << std::endl;
processed[nodes[i]] = cc;
- m->assertEquality( nodes[i], cc, true );
+ if (!m->assertEquality(nodes[i], cc, true))
+ {
+ return false;
+ }
}
}
//Trace("strings-model") << "String Model : Assigned." << std::endl;
Trace("strings-model") << "String Model : Finished." << std::endl;
+ return true;
}
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/theory/strings/theory_strings.h b/src/theory/strings/theory_strings.h
index 39ab70e2f..70706bbd4 100644
--- a/src/theory/strings/theory_strings.h
+++ b/src/theory/strings/theory_strings.h
@@ -214,11 +214,11 @@ private:
// MODEL GENERATION
/////////////////////////////////////////////////////////////////////////////
public:
- void collectModelInfo(TheoryModel* m);
+ bool collectModelInfo(TheoryModel* m) override;
- /////////////////////////////////////////////////////////////////////////////
- // NOTIFICATIONS
- /////////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////////
+ // NOTIFICATIONS
+ /////////////////////////////////////////////////////////////////////////////
public:
void presolve();
void shutdown() { }
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback