Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/options/printer_options.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ header = "options/printer_options.h"
# name = "szs"
# help = "Print instantiations as SZS compliant proof."

[[option]]
name = "deleteQuantifiers"
category = "regular"
long = "delete-quant"
type = "bool"
default = "false"
help = "delete quantifiers in printer, replace by sko,ems"

[[option]]
name = "flattenHOChains"
category = "regular"
Expand Down
35 changes: 22 additions & 13 deletions src/printer/smt2/smt2_printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "expr/node_manager_attributes.h"
#include "expr/node_visitor.h"
#include "expr/sequence.h"
#include "expr/node_algorithm.h"
#include "expr/skolem_manager.h"
#include "options/bv_options.h"
#include "options/language.h"
#include "options/printer_options.h"
Expand Down Expand Up @@ -924,21 +926,26 @@ void Smt2Printer::toStream(std::ostream& out,
case kind::LAMBDA:
case kind::WITNESS:
{
out << smtKindString(k, d_variant) << " ";
toStream(out, n[0], toDepth, lbind);
out << " ";
if (n.getNumChildren() == 3)
{
out << "(! ";
}
toStreamWithLetify(out, n[1], toDepth - 1, lbind);
if (n.getNumChildren() == 3)
{
if (options::deleteQuantifiers()) {
Node sk = NodeManager::currentNM()->getSkolemManager()->mkPurifySkolem(n, "quant_del_bool");
out << "@quantifier_bool_skolem_" << sk << endl;
} else {
out << smtKindString(k, d_variant) << " ";
toStream(out, n[0], toDepth, lbind);
out << " ";
toStream(out, n[2], toDepth, lbind);
if (n.getNumChildren() == 3)
{
out << "(! ";
}
toStreamWithLetify(out, n[1], toDepth - 1, lbind);
if (n.getNumChildren() == 3)
{
out << " ";
toStream(out, n[2], toDepth, lbind);
out << ")";
}
out << ")";
}
out << ")";
return;
break;
}
Expand Down Expand Up @@ -1498,7 +1505,9 @@ void Smt2Printer::toStreamModelTerm(std::ostream& out,

void Smt2Printer::toStreamCmdAssert(std::ostream& out, Node n) const
{
out << "(assert " << n << ')' << std::endl;
if (!options::deleteQuantifiers() || !expr::hasClosure(n) ) {
out << "(assert " << n << ')' << std::endl;
}
}

void Smt2Printer::toStreamCmdPush(std::ostream& out) const
Expand Down