void TheoryDatatypes::preRegisterTerm(TNode n)
{
- Debug("datatypes-prereg")
+ Trace("datatypes-prereg")
<< "TheoryDatatypes::preRegisterTerm() " << n << endl;
+ // must ensure the type is well founded and has no nested recursion if
+ // the option dtNestedRec is not set to true.
+ TypeNode tn = n.getType();
+ if (tn.isDatatype())
+ {
+ const DType& dt = tn.getDType();
+ Trace("dt-expand") << "Check properties of " << dt.getName() << std::endl;
+ if (!dt.isWellFounded())
+ {
+ std::stringstream ss;
+ ss << "Cannot handle non-well-founded datatype " << dt.getName();
+ throw LogicException(ss.str());
+ }
+ Trace("dt-expand") << "...well-founded ok" << std::endl;
+ if (!options::dtNestedRec())
+ {
+ if (dt.hasNestedRecursion())
+ {
+ std::stringstream ss;
+ ss << "Cannot handle nested-recursive datatype " << dt.getName();
+ throw LogicException(ss.str());
+ }
+ Trace("dt-expand") << "...nested recursion ok" << std::endl;
+ }
+ }
collectTerms( n );
switch (n.getKind()) {
case kind::EQUAL:
TrustNode TheoryDatatypes::expandDefinition(Node n)
{
NodeManager* nm = NodeManager::currentNM();
- // must ensure the type is well founded and has no nested recursion if
- // the option dtNestedRec is not set to true.
TypeNode tn = n.getType();
- if (tn.isDatatype())
- {
- const DType& dt = tn.getDType();
- if (!dt.isWellFounded())
- {
- std::stringstream ss;
- ss << "Cannot handle non-well-founded datatype " << dt.getName();
- throw LogicException(ss.str());
- }
- if (!options::dtNestedRec())
- {
- if (dt.hasNestedRecursion())
- {
- std::stringstream ss;
- ss << "Cannot handle nested-recursive datatype " << dt.getName();
- throw LogicException(ss.str());
- }
- }
- }
Node ret;
switch (n.getKind())
{
regress0/datatypes/is_test.smt2
regress0/datatypes/issue1433.smt2
regress0/datatypes/issue2838.cvc
+ regress0/datatypes/issue5280-no-nrec.smt2
regress0/datatypes/jsat-2.6.smt2
regress0/datatypes/list-bool.smt2
regress0/datatypes/model-subterms-min.smt2