#include "theory/sets/theory_sets_private.h"
#include <algorithm>
+#include <climits>
#include "expr/emptyset.h"
#include "expr/node_algorithm.h"
d_equalityEngine->addTriggerPredicate(node);
}
break;
+ case kind::JOIN_IMAGE:
+ {
+ // these are logic exceptions, not type checking exceptions
+ if (node[1].getKind() != kind::CONST_RATIONAL)
+ {
+ throw LogicException(
+ "JoinImage cardinality constraint must be a constant");
+ }
+ cvc5::Rational r(INT_MAX);
+ if (node[1].getConst<Rational>() > r)
+ {
+ throw LogicException(
+ "JoinImage Exceeded INT_MAX in cardinality constraint");
+ }
+ if (node[1].getConst<Rational>().getNumerator().getSignedInt() < 0)
+ {
+ throw LogicException(
+ "JoinImage cardinality constraint must be non-negative");
+ }
+ }
+ break;
default: d_equalityEngine->addTerm(node); break;
}
}
throw TypeCheckingExceptionPrivate(
n, " JoinImage cardinality constraint must be integer");
}
- if (n[1].getKind() != kind::CONST_RATIONAL) {
- throw TypeCheckingExceptionPrivate(
- n, " JoinImage cardinality constraint must be a constant");
- }
- cvc5::Rational r(INT_MAX);
- if (n[1].getConst<Rational>() > r) {
- throw TypeCheckingExceptionPrivate(
- n, " JoinImage Exceeded INT_MAX in cardinality constraint");
- }
- if (n[1].getConst<Rational>().getNumerator().getSignedInt() < 0) {
- throw TypeCheckingExceptionPrivate(
- n, " JoinImage cardinality constraint must be non-negative");
- }
std::vector<TypeNode> newTupleTypes;
newTupleTypes.push_back(tupleTypes[0]);
return nodeManager->mkSetType(nodeManager->mkTupleType(newTupleTypes));