diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2017-11-22 14:25:59 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-22 14:25:59 -0600 |
commit | 20704741e4609055d61e010b6981c6916d28019a (patch) | |
tree | a8e8beec06083b91c2336e3013538e86eb177a29 /src/printer/smt2/smt2_printer.cpp | |
parent | 047b8f69db1ab46ad68a2693565066f2a8d40b29 (diff) |
Sygus Lambda Grammars (#1390)
Diffstat (limited to 'src/printer/smt2/smt2_printer.cpp')
-rw-r--r-- | src/printer/smt2/smt2_printer.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp index 6ceb79001..82871a1d5 100644 --- a/src/printer/smt2/smt2_printer.cpp +++ b/src/printer/smt2/smt2_printer.cpp @@ -1325,7 +1325,7 @@ void Smt2Printer::toStreamSygus(std::ostream& out, TNode n) const throw() int cIndex = Datatype::indexOf(n.getOperator().toExpr()); Assert(!dt[cIndex].getSygusOp().isNull()); SygusPrintCallback* spc = dt[cIndex].getSygusPrintCallback(); - if (spc != nullptr) + if (spc != nullptr && options::sygusPrintCallbacks()) { spc->toStreamSygus(this, out, n.toExpr()); } @@ -1351,8 +1351,16 @@ void Smt2Printer::toStreamSygus(std::ostream& out, TNode n) const throw() } else { - // cannot convert term to analog, print original - toStream(out, n, -1, false, 1); + Node p = n.getAttribute(theory::SygusPrintProxyAttribute()); + if (!p.isNull()) + { + out << p; + } + else + { + // cannot convert term to analog, print original + out << n; + } } } |