22#ifndef __CVC4__COMMAND_H
23#define __CVC4__COMMAND_H
80 static const int s_iosIndex;
86 static const int s_defaultPrintSuccess =
false;
100 out.iword(s_iosIndex) = d_printSuccess;
104 return out.iword(s_iosIndex);
108 out.iword(s_iosIndex) = printSuccess;
119 bool d_oldPrintSuccess;
123 inline Scope(std::ostream& out,
bool printSuccess)
throw() :
125 d_oldPrintSuccess(CommandPrintSuccess::getPrintSuccess(out)) {
126 CommandPrintSuccess::setPrintSuccess(out, printSuccess);
130 CommandPrintSuccess::setPrintSuccess(d_out, d_oldPrintSuccess);
148 cps.applyPrintSuccess(out);
159 OutputLanguage language = language::output::LANG_AUTO)
const throw();
176 std::string d_message;
213 virtual
void toStream(
std::ostream& out,
int toDepth = -1,
bool types = false,
size_t dag = 1,
214 OutputLanguage language = language::output::LANG_AUTO) const throw();
216 std::
string toString() const throw();
218 virtual
std::
string getCommandName() const throw() = 0;
223 void setMuted(
bool muted) throw() { d_muted = muted; }
234 bool ok()
const throw();
240 bool fail() const throw();
243 const
CommandStatus* getCommandStatus() const throw() {
return d_commandStatus; }
245 virtual void printResult(std::ostream& out, uint32_t verbosity = 2)
const throw();
266 d_exprManager(exprManager),
267 d_variableMap(variableMap) {
270 return e.
exportTo(d_exprManager, d_variableMap);
273 return t.
exportTo(d_exprManager, d_variableMap);
292 std::
string getCommandName() const throw();
306 std::
string getCommandName() const throw();
319 std::
string getCommandName() const throw();
361 bool getPrintInModel() const throw();
362 bool getPrintInModelSetByUser() const throw();
363 void setPrintInModel(
bool p );
367 std::
string getCommandName() const throw();
382 std::
string getCommandName() const throw();
398 std::
string getCommandName() const throw();
409 const std::vector<Expr>& formals,
Expr formula)
throw();
412 const
std::vector<
Expr>& getFormals() const throw();
413 Expr getFormula() const throw();
417 std::
string getCommandName() const throw();
428 const std::vector<Expr>& formals,
Expr formula)
throw();
467 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
470 std::
string getCommandName() const throw();
483 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
486 std::
string getCommandName() const throw();
499 Expr getResult() const throw();
500 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
503 std::
string getCommandName() const throw();
515 Expr getResult() const throw();
516 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
519 std::
string getCommandName() const throw();
532 Expr getResult() const throw();
533 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
536 std::
string getCommandName() const throw();
547 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
550 std::
string getCommandName() const throw();
563 void printResult(std::ostream& out, uint32_t verbosity = 2)
const throw();
566 std::
string getCommandName() const throw();
577 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
580 std::
string getCommandName() const throw();
592 void printResult(std::ostream& out, uint32_t verbosity = 2)
const throw();
595 std::
string getCommandName() const throw();
605 void printResult(std::ostream& out, uint32_t verbosity = 2)
const throw();
608 std::
string getCommandName() const throw();
619 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
622 std::
string getCommandName() const throw();
635 std::
string getCommandName() const throw();
648 std::
string getCommandName() const throw();
663 std::
string getCommandName() const throw();
675 std::
string getResult() const throw();
676 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
679 std::
string getCommandName() const throw();
694 std::
string getCommandName() const throw();
706 std::
string getResult() const throw();
707 void printResult(
std::ostream& out, uint32_t verbosity = 2) const throw();
710 std::
string getCommandName() const throw();
715 std::vector<DatatypeType> d_datatypes;
724 std::
string getCommandName() const throw();
729 typedef std::vector< std::vector< Expr > >
Triggers;
739 const std::vector<Expr>& guards,
742 const Triggers& d_triggers)
throw();
747 const std::vector<Expr>&
getVars()
const throw();
748 const
std::vector<
Expr>& getGuards() const throw();
755 std::
string getCommandName() const throw();
760 typedef std::vector< std::vector< Expr > >
Triggers;
771 const std::vector<Expr>& guards,
772 const std::vector<Expr>& heads,
776 bool d_deduction =
false) throw();
778 const
std::vector<
Expr>& heads,
780 bool d_deduction = false) throw();
782 const std::vector<Expr>&
getVars()
const throw();
783 const
std::vector<
Expr>& getGuards() const throw();
784 const
std::vector<
Expr>& getHeads() const throw();
787 bool isDeduction() const throw();
791 std::
string getCommandName() const throw();
806 std::string d_comment;
814 std::
string getCommandName() const throw();
820 std::vector<Command*> d_commandSequence;
822 unsigned int d_index;
828 void clear() throw();
844 std::
string getCommandName() const throw();
AssertCommand(const Expr &e)
CommandFailure(std::string message)
CommandFailure & clone() const
std::string getMessage() const
Set the print-success state on the output stream for the current stack scope.
Scope(std::ostream &out, bool printSuccess)
IOStream manipulator to print success messages or not.
CommandPrintSuccess(bool printSuccess)
Construct a CommandPrintSuccess with the given setting.
void applyPrintSuccess(std::ostream &out)
static void setPrintSuccess(std::ostream &out, bool printSuccess)
static bool getPrintSuccess(std::ostream &out)
std::vector< Command * >::const_iterator const_iterator
std::vector< Command * >::iterator iterator
void toStream(std::ostream &out, OutputLanguage language=language::output::LANG_AUTO) const
virtual CommandStatus & clone() const =0
CommandStatus & clone() const
static const CommandSuccess * instance()
CommandStatus & clone() const
bool ok() const
Either the command hasn't run yet, or it completed successfully (CommandSuccess, not CommandUnsupport...
CommandPrintSuccess printsuccess
const CommandStatus * d_commandStatus
This field contains a command status if the command has been invoked, or NULL if it has not.
bool isMuted()
Determine whether this Command will print a success message.
bool d_muted
True if this command is "muted"—i.e., don't print "success" on successful execution.
virtual void printResult(std::ostream &out, uint32_t verbosity=2) const
~DatatypeDeclarationCommand()
const std::vector< DatatypeType > & getDatatypes() const
DatatypeDeclarationCommand(const std::vector< DatatypeType > &datatypes)
DatatypeDeclarationCommand(const DatatypeType &datatype)
Class encapsulating the datatype type.
~DeclarationDefinitionCommand()
DeclarationDefinitionCommand(const std::string &id)
std::string getSymbol() const
virtual void invoke(SmtEngine *smtEngine)=0
bool d_printInModelSetByUser
DeclareFunctionCommand(const std::string &id, Expr func, Type type)
~DeclareFunctionCommand()
DeclareTypeCommand(const std::string &id, size_t arity, Type t)
DefineFunctionCommand(const std::string &id, Expr func, const std::vector< Expr > &formals, Expr formula)
DefineFunctionCommand(const std::string &id, Expr func, Expr formula)
std::vector< Expr > d_formals
This differs from DefineFunctionCommand only in that it instructs the SmtEngine to "remember" this fu...
Command * exportTo(ExprManager *exprManager, ExprManagerMapCollection &variableMap)
Maps this Command into one for a different ExprManager, using variableMap for the translation and ext...
DefineNamedFunctionCommand(const std::string &id, Expr func, const std::vector< Expr > &formals, Expr formula)
void invoke(SmtEngine *smtEngine)
Command * clone() const
Clone this Command (make a shallow copy).
std::vector< Type > d_params
const std::vector< Type > & getParameters() const
DefineTypeCommand(const std::string &id, Type t)
DefineTypeCommand(const std::string &id, const std::vector< Type > ¶ms, Type t)
EchoCommand(std::string output="")
std::string getOutput() const
EmptyCommands are the residue of a command after the parser handles them (and there's nothing left to...
std::string getName() const
EmptyCommand(std::string name="")
~ExpandDefinitionsCommand()
ExpandDefinitionsCommand(Expr term)
Class encapsulating CVC4 expressions and methods for constructing new expressions.
Expr exportTo(ExprManager *exprManager, ExprManagerMapCollection &variableMap, uint32_t flags=0) const
Maps this Expr into one for a different ExprManager, using variableMap for the translation and extend...
void invoke(SmtEngine *smtEngine)
std::string getResult() const
void invoke(SmtEngine *smtEngine)
std::string getFlag() const
GetInfoCommand(std::string flag)
GetInstantiationsCommand()
void printResult(std::ostream &out, uint32_t verbosity=2) const
void invoke(SmtEngine *smtEngine)
void invoke(SmtEngine *smtEngine)
void printResult(std::ostream &out, uint32_t verbosity=2) const
GetOptionCommand(std::string flag)
std::string getFlag() const
void invoke(SmtEngine *smtEngine)
Proof * getResult() const
void printResult(std::ostream &out, uint32_t verbosity=2) const
void invoke(SmtEngine *smtEngine)
const std::vector< Expr > & getTerms() const
std::vector< Expr > d_terms
GetValueCommand(const std::vector< Expr > &terms)
GetValueCommand(Expr term)
Command * clone() const
Clone this Command (make a shallow copy).
std::string getCommandName() const
void invoke(SmtEngine *smtEngine)
Command * exportTo(ExprManager *exprManager, ExprManagerMapCollection &variableMap)
Maps this Command into one for a different ExprManager, using variableMap for the translation and ext...
const std::vector< Expr > & getVars() const
PropagateRuleCommand(const std::vector< Expr > &vars, const std::vector< Expr > &guards, const std::vector< Expr > &heads, Expr body, const Triggers &d_triggers, bool d_deduction=false)
std::vector< Expr > VExpr
std::vector< std::vector< Expr > > Triggers
Command * clone() const
Clone this Command (make a shallow copy).
std::string getCommandName() const
void invoke(SmtEngine *smtEngine)
Command * exportTo(ExprManager *exprManager, ExprManagerMapCollection &variableMap)
Maps this Command into one for a different ExprManager, using variableMap for the translation and ext...
QueryCommand(const Expr &e)
Command * clone() const
Clone this Command (make a shallow copy).
void invoke(SmtEngine *smtEngine)
std::string getCommandName() const
Command * exportTo(ExprManager *exprManager, ExprManagerMapCollection &variableMap)
Maps this Command into one for a different ExprManager, using variableMap for the translation and ext...
Three-valued SMT result, with optional explanation.
RewriteRuleCommand(const std::vector< Expr > &vars, const std::vector< Expr > &guards, Expr head, Expr body, const Triggers &d_triggers)
std::vector< Expr > VExpr
const std::vector< Expr > & getVars() const
std::vector< std::vector< Expr > > Triggers
RewriteRuleCommand(const std::vector< Expr > &vars, Expr head, Expr body)
std::string getLogic() const
~SetBenchmarkLogicCommand()
SetBenchmarkLogicCommand(std::string logic)
BenchmarkStatus getStatus() const
~SetBenchmarkStatusCommand()
SetBenchmarkStatusCommand(BenchmarkStatus status)
SetInfoCommand(std::string flag, const SExpr &sexpr)
std::string getFlag() const
SetOptionCommand(std::string flag, const SExpr &sexpr)
std::string getFlag() const
The command when an attribute is set by a user.
~SetUserAttributeCommand()
Command * exportTo(ExprManager *exprManager, ExprManagerMapCollection &variableMap)
Maps this Command into one for a different ExprManager, using variableMap for the translation and ext...
std::string getCommandName() const
Command * clone() const
Clone this Command (make a shallow copy).
SetUserAttributeCommand(const std::string &attr, Expr expr)
void invoke(SmtEngine *smtEngine)
SimplifyCommand(Expr term)
Class encapsulating CVC4 expression types.
Type exportTo(ExprManager *exprManager, ExprManagerMapCollection &vmap) const
Exports this type into a different ExprManager.
Macros that should be defined everywhere during the building of the libraries and driver binary,...
A class representing a Datatype definition.
BenchmarkStatus
The status an SMT benchmark can have.
@ SMT_UNKNOWN
The status of the benchmark is unknown.
@ SMT_SATISFIABLE
Benchmark is satisfiable.
@ SMT_UNSATISFIABLE
Benchmark is unsatisfiable.
std::ostream & operator<<(std::ostream &out, const TypeCheckingException &e)
[[ Add one-line brief description here ]]
Encapsulation of the result of a query.
Simple representation of S-expressions.
Interface for expression types.
[[ Add one-line brief description here ]]