Change how RANs are printed (#7955)
authorGereon Kremer <gkremer@stanford.edu>
Sat, 15 Jan 2022 03:17:29 +0000 (19:17 -0800)
committerGitHub <noreply@github.com>
Sat, 15 Jan 2022 03:17:29 +0000 (03:17 +0000)
This PR adds real algebraic number as a special case in the smt2 printer.

src/printer/smt2/smt2_printer.cpp

index eb1afb5c8258abc9da4a50b8619a81b09385c561..fd7825ac1d652fdf5ba4861297683e0d4679c3a9 100644 (file)
@@ -52,6 +52,7 @@
 #include "util/floatingpoint.h"
 #include "util/iand.h"
 #include "util/indexed_root_predicate.h"
+#include "util/real_algebraic_number.h"
 #include "util/regexp.h"
 #include "util/smt2_quote_string.h"
 #include "util/string.h"
@@ -651,6 +652,13 @@ void Smt2Printer::toStream(std::ostream& out,
       out << "(_ divisible " << n.getOperator().getConst<Divisible>().k << ")";
       stillNeedToPrintParams = false;
       break;
+    case kind::REAL_ALGEBRAIC_NUMBER:
+    {
+      const RealAlgebraicNumber& ran = n.getOperator().getConst<RealAlgebraicNumber>();
+      out << "(_ real_algebraic_number " << ran << ")";
+      stillNeedToPrintParams = false;
+      break;
+    }
     case kind::INDEXED_ROOT_PREDICATE_OP:
     {
       const IndexedRootPredicate& irp = n.getConst<IndexedRootPredicate>();