summaryrefslogtreecommitdiff
path: root/src/theory/arith
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-10-26 23:32:38 +0000
committerMorgan Deters <mdeters@gmail.com>2012-10-26 23:32:38 +0000
commitc2d88c4cf9fd2d6a8b0eb8d28019eacd29b913de (patch)
tree16407ca53855adede55099a90ecdfd11d135175c /src/theory/arith
parentb2333e3bb49f84be01ddcc875dc6b01cc6b29307 (diff)
Fix to subrange type enumerator, and its unit test. Resolves bug 436.
(this commit was certified error- and warning-free by the test-and-commit script.)
Diffstat (limited to 'src/theory/arith')
-rw-r--r--src/theory/arith/type_enumerator.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/theory/arith/type_enumerator.h b/src/theory/arith/type_enumerator.h
index 6d8402913..55ebc38c9 100644
--- a/src/theory/arith/type_enumerator.h
+++ b/src/theory/arith/type_enumerator.h
@@ -129,7 +129,7 @@ public:
Assert(d_direction || !d_bounds.lower.hasBound());
}
- Node operator*() throw() {
+ Node operator*() throw(NoMoreValuesException) {
if(isFinished()) {
throw NoMoreValuesException(getType());
}
@@ -145,19 +145,14 @@ public:
// if we're counting down, there's no lower bound
d_int -= 1;
}
- // sequence is 0, 1, -1, 2, -2, 3, -3, ...
- if(d_int <= 0) {
- d_int = -d_int + 1;
- } else {
- d_int = -d_int;
- }
return *this;
}
bool isFinished() throw() {
// if we're counting down, there's no lower bound
return d_direction &&
- (!d_bounds.upper.hasBound() || d_int <= d_bounds.upper.getBound());
+ d_bounds.upper.hasBound() &&
+ d_int > d_bounds.upper.getBound();
}
};/* class SubrangeEnumerator */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback