using namespace CVC4::theory;
namespace CVC4 {
-
namespace smt {
+struct DeleteCommandFunction : public std::unary_function<const Command*, void>
+{
+ void operator()(const Command* command) { delete command; }
+};
+
+void DeleteAndClearCommandVector(std::vector<Command*>& commands) {
+ std::for_each(commands.begin(), commands.end(), DeleteCommandFunction());
+ commands.clear();
+}
+
/** Useful for counting the number of recursive calls. */
class ScopeCounter {
private:
}
d_dumpCommands.clear();
+ DeleteAndClearCommandVector(d_modelGlobalCommands);
+
if(d_modelCommands != NULL) {
d_modelCommands->deleteSelf();
}
Assert(d_userLevels.size() == 0 && d_userContext->getLevel() == 1);
d_context->popto(0);
d_userContext->popto(0);
- d_modelGlobalCommands.clear();
+ DeleteAndClearCommandVector(d_modelGlobalCommands);
d_userContext->push();
d_context->push();
}
bool d_needPostsolve;
/*
- * Whether to call theory preprocessing during simplification - on by default* but gets turned off if arithRewriteEq is on
+ * Whether to call theory preprocessing during simplification - on
+ * by default* but gets turned off if arithRewriteEq is on
*/
bool d_earlyTheoryPP;
-
/**
* Most recent result of last checkSat/query or (set-info :status).
*/