* Used as a predicate for options preprocessor.
*/
static void beforeSearch(std::string option, bool value, SmtEngine* smt) throw(ModalException) {
- // FIXME: should be the following test...
- // if(smt != NULL && (smt->d_queryMade || smt->d_problemExtended)) {
- // ...but addToModelType() etc. make a stronger assumption:
if(smt != NULL && smt->d_fullyInited) {
std::stringstream ss;
- ss << "cannot change option `" << option << "' after assertions have been made";
+ ss << "cannot change option `" << option << "' after final initialization (i.e., after logic has been set)";
throw ModalException(ss.str());
}
}
return *this;
}
+ bool isFinished() throw() {
+ return false;
+ }
+
};/* class RationalEnumerator */
class IntegerEnumerator : public TypeEnumeratorBase<IntegerEnumerator> {
return *this;
}
+ bool isFinished() throw() {
+ return false;
+ }
+
};/* class IntegerEnumerator */
}/* CVC4::theory::arith namespace */
return *this;
}
+ bool isFinished() throw() {
+ Unimplemented();
+ }
+
};/* class ArrayEnumerator */
}/* CVC4::theory::arrays namespace */
return *this;
}
+ bool isFinished() throw() {
+ return d_value == DONE;
+ }
+
};/* class BooleanEnumerator */
}/* CVC4::theory::booleans namespace */
return *this;
}
+ bool isFinished() throw() {
+ return false;
+ }
+
};/* class UninterpretedSortEnumerator */
}/* CVC4::theory::builtin namespace */
return *this;
}
+ bool isFinished() throw() {
+ return d_bits != d_bits.modByPow2(d_size);
+ }
+
};/* BitVectorEnumerator */
}/* CVC4::theory::bv namespace */
return *this;
}
+ bool isFinished() throw() {
+ return d_ctor >= d_datatype.getNumConstructors();
+ }
+
};/* DatatypesEnumerator */
}/* CVC4::theory::datatypes namespace */
virtual ~TypeEnumeratorInterface() {}
+ /** Is this enumerator out of constants to enumerate? */
+ virtual bool isFinished() throw() = 0;
+
+ /** Get the current constant of this type (throws if no such constant exists) */
virtual Node operator*() throw(NoMoreValuesException) = 0;
+ /** Increment the pointer to the next available constant */
virtual TypeEnumeratorInterface& operator++() throw() = 0;
+ /** Clone this enumerator */
virtual TypeEnumeratorInterface* clone() const = 0;
+ /** Get the type from which we're enumerating constants */
TypeNode getType() const throw() { return d_type; }
};/* class TypeEnumeratorInterface */
~TypeEnumerator() { delete d_te; }
+ bool isFinished() throw() { return d_te->isFinished(); }
Node operator*() throw(NoMoreValuesException) { return **d_te; }
TypeEnumerator& operator++() throw() { ++*d_te; return *this; }
TypeEnumerator operator++(int) throw() { TypeEnumerator te = *this; ++*d_te; return te; }