From 181cac8b630609dc982887c5c4cea1e46b319811 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Wed, 29 Sep 2021 19:37:22 -0700 Subject: [PATCH] [Printer] Only quote `set-info` value if necessary (#7262) PR #7240 changed the printing of set-info to always include quote the value. This commit changes the policy to only quote a symbol if necessary using existing an existing helper method. Otherwise, (set-info :status sat) is for example printed as (set-info :status |sat|), which is a bit unusual and may break certain scripts. --- src/printer/smt2/smt2_printer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index e6aff1ace..fd98bdeca 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -1622,7 +1622,8 @@ void Smt2Printer::toStreamCmdSetInfo(std::ostream& out, const std::string& flag, const std::string& value) const { - out << "(set-info :" << flag << " |" << value << "|)" << std::endl; + out << "(set-info :" << flag << " " << cvc5::quoteSymbol(value) << ")" + << std::endl; } void Smt2Printer::toStreamCmdGetInfo(std::ostream& out, -- 2.30.2