From: Morgan Deters Date: Thu, 7 Feb 2013 02:30:35 +0000 (-0500) Subject: make datatypes enumerator behavior clearer (no exceptions in normal operation) X-Git-Tag: cvc5-1.0.0~7420 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a72276859f0af0f5e800434879eca111d8bf6644;p=cvc5.git make datatypes enumerator behavior clearer (no exceptions in normal operation) --- diff --git a/src/theory/datatypes/type_enumerator.h b/src/theory/datatypes/type_enumerator.h index 2a14d7fba..8ee275f70 100644 --- a/src/theory/datatypes/type_enumerator.h +++ b/src/theory/datatypes/type_enumerator.h @@ -139,11 +139,10 @@ public: DatatypesEnumerator& operator++() throw() { if(d_ctor < d_datatype.getNumConstructors()) { for(size_t a = d_datatype[d_ctor].getNumArgs(); a > 0; --a) { - try { - *++*d_argEnumerators[a - 1]; - return *this; - } catch(NoMoreValuesException&) { + if((++*d_argEnumerators[a - 1]).isFinished()) { *d_argEnumerators[a - 1] = TypeEnumerator(Node::fromExpr(d_datatype[d_ctor][a - 1].getSelector()).getType()[1]); + } else { + return *this; } }