Previously we were not printing unsat cores when passing the option to dump them if we used the check-sat-assuming command or the QUERY command. This commit fixes this.
It also kills the redundant dump-synth option, as it simplifies a bit what is going on in the command executor.
if(cs != nullptr) {
d_result = res = cs->getResult();
}
+ const CheckSatAssumingCommand* csa =
+ dynamic_cast<const CheckSatAssumingCommand*>(cmd);
+ if (csa != nullptr)
+ {
+ d_result = res = csa->getResult();
+ }
const QueryCommand* q = dynamic_cast<const QueryCommand*>(cmd);
if(q != nullptr) {
d_result = res = q->getResult();
}
- const CheckSynthCommand* csy = dynamic_cast<const CheckSynthCommand*>(cmd);
- if(csy != nullptr) {
- d_result = res = csy->getResult();
- }
if((cs != nullptr || q != nullptr) && d_options.getStatsEveryQuery()) {
std::ostringstream ossCurStats;
d_lastStatistics = ossCurStats.str();
}
+ bool isResultUnsat = res.isUnsat() || res.isEntailed();
+
// dump the model/proof/unsat core if option is set
if (status) {
std::vector<std::unique_ptr<Command> > getterCommands;
{
getterCommands.emplace_back(new GetModelCommand());
}
- if (d_options.getDumpProofs() && res.isUnsat())
+ if (d_options.getDumpProofs() && isResultUnsat)
{
getterCommands.emplace_back(new GetProofCommand());
}
&& (res.isSat()
|| (res.isSatUnknown()
&& res.getResult().whyUnknown() == Result::INCOMPLETE)))
- || res.isUnsat()))
+ || isResultUnsat))
{
getterCommands.emplace_back(new GetInstantiationsCommand());
}
- if (d_options.getDumpSynth() && res.isUnsat())
- {
- getterCommands.emplace_back(new GetSynthSolutionCommand());
- }
-
- if (d_options.getDumpUnsatCores() && res.isUnsat())
+ if (d_options.getDumpUnsatCores() && isResultUnsat)
{
getterCommands.emplace_back(new GetUnsatCoreCommand());
}
bool getDumpInstantiations() const;
bool getDumpModels() const;
bool getDumpProofs() const;
- bool getDumpSynth() const;
bool getDumpUnsatCores() const;
bool getEarlyExit() const;
bool getFilesystemAccess() const;
void setOut(std::ostream*);
void setOutputLanguage(OutputLanguage);
- bool wasSetByUserDumpSynth() const;
bool wasSetByUserEarlyExit() const;
bool wasSetByUserForceLogicString() const;
bool wasSetByUserIncrementalSolving() const;
return (*this)[options::dumpProofs];
}
-bool Options::getDumpSynth() const{
- return (*this)[options::dumpSynth];
-}
-
bool Options::getDumpUnsatCores() const{
// dump unsat cores full enables dumpUnsatCores
return (*this)[options::dumpUnsatCores]
set(options::outputLanguage, value);
}
-bool Options::wasSetByUserDumpSynth() const {
- return wasSetByUser(options::dumpSynth);
-}
-
bool Options::wasSetByUserEarlyExit() const {
return wasSetByUser(options::earlyExit);
}
read_only = true
help = "use sygus print callbacks to print sygus terms in the user-provided form (disable for debugging)"
-[[option]]
- name = "dumpSynth"
- category = "regular"
- long = "dump-synth"
- type = "bool"
- default = "false"
- help = "output solution for synthesis conjectures after every UNSAT/VALID response"
-
[[option]]
name = "unsatCores"
category = "regular"
Assert(d_master != nullptr);
// we have generated a solution, print it
// get the current output stream
- // this output stream should coincide with wherever --dump-synth is output on
Options& sopts = smt::currentSmtEngine()->getOptions();
printSynthSolution(*sopts.getOut());
excludeCurrentSolution(enums, values);