status = pExecutor->doCommand(cmd);
needReset = true;
} else {
- Command* copy = cmd->clone();
- allCommands.back().push_back(copy);
+ // We shouldn't copy certain commands, because they can cause
+ // an error on replay since there's no associated sat/unsat check
+ // preceding them.
+ if(dynamic_cast<GetUnsatCoreCommand*>(cmd) == NULL &&
+ dynamic_cast<GetProofCommand*>(cmd) == NULL &&
+ dynamic_cast<GetValueCommand*>(cmd) == NULL &&
+ dynamic_cast<GetModelCommand*>(cmd) == NULL &&
+ dynamic_cast<GetAssignmentCommand*>(cmd) == NULL &&
+ dynamic_cast<GetInstantiationsCommand*>(cmd) == NULL) {
+ Command* copy = cmd->clone();
+ allCommands.back().push_back(copy);
+ }
status = pExecutor->doCommand(cmd);
if(dynamic_cast<QuitCommand*>(cmd) != NULL) {
delete cmd;