Fix bug where strict mode didn't allow DIV or MOD, and Ints permitted real division
authorMorgan Deters <mdeters@cs.nyu.edu>
Tue, 28 May 2013 23:06:12 +0000 (19:06 -0400)
committerMorgan Deters <mdeters@cs.nyu.edu>
Wed, 29 May 2013 14:07:26 +0000 (10:07 -0400)
src/parser/smt2/smt2.cpp

index a4623bdfc6976e5140e5be82d39860eb9d9f8ced..c042c39926e7adefcd6beeefe5003a647e71ead4 100644 (file)
@@ -36,7 +36,6 @@ void Smt2::addArithmeticOperators() {
   addOperator(kind::MINUS);
   addOperator(kind::UMINUS);
   addOperator(kind::MULT);
-  addOperator(kind::DIVISION);
   addOperator(kind::LT);
   addOperator(kind::LEQ);
   addOperator(kind::GT);
@@ -106,16 +105,20 @@ void Smt2::addTheory(Theory theory) {
 
   case THEORY_REALS_INTS:
     defineType("Real", getExprManager()->realType());
-    // falling-through on purpose, to add Ints part of RealsInts
+    addOperator(kind::DIVISION);
+    // falling through on purpose, to add Ints part of Reals_Ints
 
   case THEORY_INTS:
     defineType("Int", getExprManager()->integerType());
     addArithmeticOperators();
+    addOperator(kind::INTS_DIVISION);
+    addOperator(kind::INTS_MODULUS);
     break;
 
   case THEORY_REALS:
     defineType("Real", getExprManager()->realType());
     addArithmeticOperators();
+    addOperator(kind::DIVISION);
     break;
 
   case THEORY_BITVECTORS: