1 /********************* */
3 ** Original author: mdeters
4 ** Major contributors: dejan
5 ** Minor contributors (to current version): none
6 ** This file is part of the CVC4 prototype.
7 ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys)
8 ** Courant Institute of Mathematical Sciences
10 ** See the file COPYING in the top-level source directory for licensing
13 ** Implementation of command objects.
16 #include "expr/command.h"
17 #include "smt/smt_engine.h"
23 ostream
& operator<<(ostream
& out
, const Command
* command
) {
24 if (command
== NULL
) {
27 command
->toStream(out
);
32 CommandSequence::~CommandSequence() {
33 for(unsigned i
= d_index
; i
< d_commandSequence
.size(); ++i
) {
34 delete d_commandSequence
[i
];
38 void CommandSequence::invoke(SmtEngine
* smtEngine
) {
39 for(; d_index
< d_commandSequence
.size(); ++d_index
) {
40 d_commandSequence
[d_index
]->invoke(smtEngine
);
41 delete d_commandSequence
[d_index
];
45 void CheckSatCommand::toStream(ostream
& out
) const {
49 out
<< "CheckSat(" << d_expr
<< ")";
53 void CommandSequence::toStream(ostream
& out
) const {
54 out
<< "CommandSequence[" << endl
;
55 for(unsigned i
= d_index
; i
< d_commandSequence
.size(); ++i
) {
56 out
<< *d_commandSequence
[i
] << endl
;
61 void DeclarationCommand::toStream(std::ostream
& out
) const {
64 for(unsigned i
= 0; i
< d_declaredSymbols
.size(); ++i
) {
68 out
<< d_declaredSymbols
[i
];
74 void PushCommand::invoke(SmtEngine
* smtEngine
) {
78 void PushCommand::toStream(ostream
& out
) const {
82 void PopCommand::invoke(SmtEngine
* smtEngine
) {
86 void PopCommand::toStream(ostream
& out
) const {