Fix cvc printer for nullary constructors (#1856)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Thu, 3 May 2018 06:16:08 +0000 (01:16 -0500)
committerAndres Noetzli <andres.noetzli@gmail.com>
Thu, 3 May 2018 06:16:08 +0000 (23:16 -0700)
src/printer/cvc/cvc_printer.cpp

index d778ccc2b1db39e8b9869db1d1ac8dbfeec841fa..f9cd7db839c7932c1e1ca81563d267633216b2e2 100644 (file)
@@ -385,6 +385,12 @@ void CvcPrinter::toStream(
           return;
         }else{
           toStream(op, n.getOperator(), depth, types, false);
+          if (n.getNumChildren() == 0)
+          {
+            // for datatype constants d, we print "d" and not "d()"
+            out << op.str();
+            return;
+          }
         }
       }
       break;