Do not print tuples. (#1874)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Fri, 4 May 2018 16:46:31 +0000 (11:46 -0500)
committerAndres Noetzli <andres.noetzli@gmail.com>
Fri, 4 May 2018 16:46:31 +0000 (09:46 -0700)
src/printer/smt2/smt2_printer.cpp

index 5d2b8972d4e2bfe836f12d8b30bad0cac6b5ed47..96bee9724eb37a3ad3d9239bfbd2fe4091219334 100644 (file)
@@ -1441,10 +1441,7 @@ void Smt2Printer::toStream(std::ostream& out,
   else if (const DatatypeDeclarationCommand* datatype_declaration_command =
                dynamic_cast<const DatatypeDeclarationCommand*>(command))
   {
-    if (!datatype_declaration_command->getDatatypes()[0].isTuple())
-    {
-      out << command << endl;
-    }
+    toStream(out, datatype_declaration_command, -1, false, 1);
   }
   else
   {
@@ -1903,8 +1900,14 @@ static void toStream(std::ostream& out,
                      Variant v)
 {
   const vector<DatatypeType>& datatypes = c->getDatatypes();
-  out << "(declare-";
   Assert(!datatypes.empty());
+  if (datatypes[0].getDatatype().isTuple())
+  {
+    // not necessary to print tuples
+    Assert(datatypes.size() == 1);
+    return;
+  }
+  out << "(declare-";
   if (datatypes[0].getDatatype().isCodatatype())
   {
     out << "co";