}
}
+ bool printDebug = options::debugSygus();
if (!constructed_cand)
{
// get the model value of the relevant terms from the master module
Trace("sygus-engine-debug") << "...empty model, fail." << std::endl;
return !activeIncomplete;
}
- // debug print
- if (Trace.isOn("sygus-engine"))
+ // Must separately compute whether trace is on due to compilation of
+ // Trace.isOn.
+ bool traceIsOn = Trace.isOn("sygus-engine");
+ if (printDebug || traceIsOn)
{
Trace("sygus-engine") << " * Value is : ";
+ std::stringstream sygusEnumOut;
for (unsigned i = 0, size = terms.size(); i < size; i++)
{
Node nv = enum_values[i];
TypeNode tn = onv.getType();
std::stringstream ss;
Printer::getPrinter(options::outputLanguage())->toStreamSygus(ss, onv);
+ if (printDebug)
+ {
+ sygusEnumOut << " " << ss.str();
+ }
Trace("sygus-engine") << terms[i] << " -> ";
if (nv.isNull())
{
}
}
Trace("sygus-engine") << std::endl;
+ if (printDebug)
+ {
+ Options& sopts = smt::currentSmtEngine()->getOptions();
+ std::ostream& out = *sopts.getOut();
+ out << "(sygus-enum" << sygusEnumOut.str() << ")" << std::endl;
+ }
}
Assert(candidate_values.empty());
constructed_cand = d_master->constructCandidates(
std::vector<Node> vars;
if (constructed_cand)
{
+ if (printDebug)
+ {
+ Options& sopts = smt::currentSmtEngine()->getOptions();
+ std::ostream& out = *sopts.getOut();
+ out << "(sygus-candidate ";
+ Assert(d_quant[0].getNumChildren() == candidate_values.size());
+ for (unsigned i = 0, ncands = candidate_values.size(); i < ncands; i++)
+ {
+ Node v = candidate_values[i];
+ std::stringstream ss;
+ Printer::getPrinter(options::outputLanguage())->toStreamSygus(ss, v);
+ out << "(" << d_quant[0][i] << " " << ss.str() << ")";
+ }
+ out << ")" << std::endl;
+ }
if (inst.getKind() == NOT && inst[0].getKind() == FORALL)
{
for (const Node& v : inst[0][0])
regress0/sygus/parse-bv-let.sy
regress0/sygus/pbe-pred-contra.sy
regress0/sygus/pLTL-sygus-syntax-err.sy
+ regress0/sygus/print-debug.sy
regress0/sygus/print-define-fun.sy
regress0/sygus/real-si-all.sy
regress0/sygus/sygus-no-wf.sy
--- /dev/null
+; COMMAND-LINE: --debug-sygus
+; EXPECT: (sygus-enum 0)
+; EXPECT: (sygus-candidate (f 0))
+; EXPECT: (sygus-enum 1)
+; EXPECT: (sygus-candidate (f 1))
+; EXPECT: unsat
+; EXPECT: (define-fun f () Int 1)
+(set-logic LIA)
+
+(synth-fun f () Int ((Start Int)) ((Start Int (0 1))))
+
+(constraint (not (= f 0)))
+
+(check-synth)