This commit removes support for the extended `(check-sat <term>)` command which overlaps in functionality with the standard `(check-sat-assuming (<prop_literal>*))` command.
(assert (= a_31_1 a_30_0))
(echo "Check unsatisfiability assuming a_31_31 != a_0_0")
-(check-sat (not (= a_31_31 a_0_0)))
\ No newline at end of file
+(check-sat-assuming ((not (= a_31_31 a_0_0))))
}
| /* check-sat */
CHECK_SAT_TOK { PARSER_STATE->checkThatLogicIsSet(); }
- { if( PARSER_STATE->sygus() ){
+ { if (PARSER_STATE->sygus()) {
PARSER_STATE->parseError("Sygus does not support check-sat command.");
}
+ cmd->reset(new CheckSatCommand());
}
- ( term[expr, expr2]
- { if(PARSER_STATE->strictModeEnabled()) {
- PARSER_STATE->parseError(
- "Extended commands (such as check-sat with an argument) are not "
- "permitted while operating in strict compliance mode.");
- }
- }
- | { expr = api::Term(); }
- )
- { cmd->reset(new CheckSatCommand(expr)); }
| /* check-sat-assuming */
CHECK_SAT_ASSUMING_TOK { PARSER_STATE->checkThatLogicIsSet(); }
( LPAREN_TOK termList[terms,expr] RPAREN_TOK
out << "Pop()" << std::endl;
}
-void AstPrinter::toStreamCmdCheckSat(std::ostream& out, Node n) const
+void AstPrinter::toStreamCmdCheckSat(std::ostream& out) const
{
- if (n.isNull())
- {
- out << "CheckSat()";
- }
- else
- {
- out << "CheckSat(" << n << ')';
- }
- out << std::endl;
+ out << "CheckSat()" << std::endl;
}
void AstPrinter::toStreamCmdCheckSatAssuming(
Node formula) const override;
/** Print check-sat command */
- void toStreamCmdCheckSat(std::ostream& out,
- Node n = Node::null()) const override;
+ void toStreamCmdCheckSat(std::ostream& out) const override;
/** Print check-sat-assuming command */
void toStreamCmdCheckSatAssuming(
printUnknownCommand(out, "set-user-attribute");
}
-void Printer::toStreamCmdCheckSat(std::ostream& out, Node n) const
+void Printer::toStreamCmdCheckSat(std::ostream& out) const
{
printUnknownCommand(out, "check-sat");
}
Node n) const;
/** Print check-sat command */
- virtual void toStreamCmdCheckSat(std::ostream& out,
- Node n = Node::null()) const;
+ virtual void toStreamCmdCheckSat(std::ostream& out) const;
/** Print check-sat-assuming command */
virtual void toStreamCmdCheckSatAssuming(
out << "(pop 1)" << std::endl;
}
-void Smt2Printer::toStreamCmdCheckSat(std::ostream& out, Node n) const
+void Smt2Printer::toStreamCmdCheckSat(std::ostream& out) const
{
- if (!n.isNull())
- {
- toStreamCmdPush(out);
- out << std::endl;
- toStreamCmdAssert(out, n);
- out << std::endl;
- toStreamCmdCheckSat(out);
- out << std::endl;
- toStreamCmdPop(out);
- }
- else
- {
- out << "(check-sat)";
- }
- out << std::endl;
+ out << "(check-sat)" << std::endl;
}
void Smt2Printer::toStreamCmdCheckSatAssuming(
const std::vector<Node>& formulas) const override;
/** Print check-sat command */
- void toStreamCmdCheckSat(std::ostream& out,
- Node n = Node::null()) const override;
+ void toStreamCmdCheckSat(std::ostream& out) const override;
/** Print check-sat-assuming command */
void toStreamCmdCheckSatAssuming(
#include "expr/node.h"
#include "expr/symbol_manager.h"
#include "expr/type_node.h"
-#include "options/options.h"
#include "options/main_options.h"
+#include "options/options.h"
#include "options/printer_options.h"
#include "options/smt_options.h"
#include "printer/printer.h"
: sortToTypeNode(grammar->resolve());
}
-
/* -------------------------------------------------------------------------- */
/* class EmptyCommand */
/* -------------------------------------------------------------------------- */
/* class CheckSatCommand */
/* -------------------------------------------------------------------------- */
-CheckSatCommand::CheckSatCommand() : d_term() {}
+CheckSatCommand::CheckSatCommand() {}
-CheckSatCommand::CheckSatCommand(const api::Term& term) : d_term(term) {}
-
-api::Term CheckSatCommand::getTerm() const { return d_term; }
void CheckSatCommand::invoke(api::Solver* solver, SymbolManager* sm)
{
Trace("dtview::command") << "* ~COMMAND: " << getCommandName() << "~"
<< std::endl;
try
{
- d_result =
- d_term.isNull() ? solver->checkSat() : solver->checkSatAssuming(d_term);
-
+ d_result = solver->checkSat();
d_commandStatus = CommandSuccess::instance();
}
catch (exception& e)
}
api::Result CheckSatCommand::getResult() const { return d_result; }
+
void CheckSatCommand::printResult(std::ostream& out, uint32_t verbosity) const
{
if (!ok())
Command* CheckSatCommand::clone() const
{
- CheckSatCommand* c = new CheckSatCommand(d_term);
+ CheckSatCommand* c = new CheckSatCommand();
c->d_result = d_result;
return c;
}
size_t dag,
Language language) const
{
- Printer::getPrinter(language)->toStreamCmdCheckSat(out, termToNode(d_term));
+ Printer::getPrinter(language)->toStreamCmdCheckSat(out);
}
/* -------------------------------------------------------------------------- */
{
public:
CheckSatCommand();
- CheckSatCommand(const api::Term& term);
-
- api::Term getTerm() const;
api::Result getResult() const;
void invoke(api::Solver* solver, SymbolManager* sm) override;
void printResult(std::ostream& out, uint32_t verbosity = 2) const override;
Language language = Language::LANG_AUTO) const override;
private:
- api::Term d_term;
api::Result d_result;
}; /* class CheckSatCommand */
{
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdCheckSat(d_env->getDumpOut(), assumption);
+ getPrinter().toStreamCmdCheckSatAssuming(d_env->getDumpOut(), {assumption});
}
std::vector<Node> assump;
if (!assumption.isNull())
const Printer& printer = d_env.getPrinter();
std::ostream& out = d_env.getDumpOut();
printer.toStreamCmdSetInfo(out, "notes", "theory lemma: expect valid");
- printer.toStreamCmdCheckSat(out, n);
+ printer.toStreamCmdCheckSatAssuming(out, {n});
}
// assert the lemma
const Printer& printer = d_env.getPrinter();
std::ostream& out = d_env.getDumpOut();
printer.toStreamCmdSetInfo(out, "notes", "theory conflict: expect unsat");
- printer.toStreamCmdCheckSat(out, conflict);
+ printer.toStreamCmdCheckSatAssuming(out, {conflict});
}
// In the multiple-theories case, we need to reconstruct the conflict
(assert (or (< a 1) (> c 1)))
(check-sat)
(assert (= b (- 1)))
-(check-sat true)
-(check-sat)
\ No newline at end of file
+(check-sat-assuming (true))
+(check-sat)
(assert (= (/ 0 a) 1))
(check-sat)
(assert (= (+ a b) 0))
-(check-sat (> b 1))
-(check-sat)
\ No newline at end of file
+(check-sat-assuming ((> b 1)))
+(check-sat)
; COMMAND-LINE: -q
; EXPECT: unsat
-(check-sat false)
+(check-sat-assuming (false))