summaryrefslogtreecommitdiff
path: root/src/util/util_model.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-11-27 02:13:38 +0000
committerMorgan Deters <mdeters@gmail.com>2012-11-27 02:13:38 +0000
commitb122cec27ca27d0b48e786191448e0053be78ed0 (patch)
tree615981d8623e830894f02fc528b173ac7461f934 /src/util/util_model.cpp
parent3da16da97df7cd2efd4b113db3bfef8b9c138ebe (diff)
Tuples and records merge. Resolves bug 270.
Also some fixes to parametric datatypes I found, and fixes for a handful of bugs, including some observed with --check-models --incremental on together. (this commit was certified error- and warning-free by the test-and-commit script.)
Diffstat (limited to 'src/util/util_model.cpp')
-rw-r--r--src/util/util_model.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/util_model.cpp b/src/util/util_model.cpp
index bb2924b51..0c058fce9 100644
--- a/src/util/util_model.cpp
+++ b/src/util/util_model.cpp
@@ -36,11 +36,17 @@ Model::Model() :
}
size_t Model::getNumCommands() const {
- return d_smt.d_modelCommands->size();
+ return d_smt.d_modelCommands->size() + d_smt.d_modelGlobalCommands.size();
}
const Command* Model::getCommand(size_t i) const {
- return (*d_smt.d_modelCommands)[i];
+ Assert(i < getNumCommands());
+ // index the global commands first, then the locals
+ if(i < d_smt.d_modelGlobalCommands.size()) {
+ return d_smt.d_modelGlobalCommands[i];
+ } else {
+ return (*d_smt.d_modelCommands)[i - d_smt.d_modelGlobalCommands.size()];
+ }
}
}/* CVC4 namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback