summaryrefslogtreecommitdiff
path: root/src/theory/arith
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2012-05-18 23:48:38 +0000
committerTim King <taking@cs.nyu.edu>2012-05-18 23:48:38 +0000
commitea8139dc7b727bf48bd7b7c6b169d763618a1f2a (patch)
tree95701608122c2a6e232ee22979e9da757bf4e2dd /src/theory/arith
parent3b93d45dab9513195d5604a069423ed13e173f49 (diff)
This commit adds TypeNode::leastCommonTypeNode(). The special case for arithmetic in TypeNode::operator==() has been removed. A number of faulty type checking checks were switched to use isSubtypeOf. The resolves bug #339
Diffstat (limited to 'src/theory/arith')
-rw-r--r--src/theory/arith/theory_arith_type_rules.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/theory/arith/theory_arith_type_rules.h b/src/theory/arith/theory_arith_type_rules.h
index 69c98a255..af358b00d 100644
--- a/src/theory/arith/theory_arith_type_rules.h
+++ b/src/theory/arith/theory_arith_type_rules.h
@@ -59,7 +59,7 @@ public:
}
}
if( check ) {
- if(childType != integerType && childType != realType) {
+ if(!childType.isReal()) {
throw TypeCheckingExceptionPrivate(n, "expecting an arithmetic subterm");
}
}
@@ -73,14 +73,13 @@ public:
inline static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check)
throw (TypeCheckingExceptionPrivate, AssertionException) {
if( check ) {
- TypeNode integerType = nodeManager->integerType();
- TypeNode realType = nodeManager->realType();
TypeNode lhsType = n[0].getType(check);
- if (lhsType != integerType && lhsType != realType) {
+ if (!lhsType.isReal()) {
+ std::cout << lhsType << " : " << n[0] << std::endl;
throw TypeCheckingExceptionPrivate(n, "expecting an arithmetic term on the left-hand-side");
}
TypeNode rhsType = n[1].getType(check);
- if (rhsType != integerType && rhsType != realType) {
+ if (!rhsType.isReal()) {
throw TypeCheckingExceptionPrivate(n, "expecting an arithmetic term on the right-hand-side");
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback