summaryrefslogtreecommitdiff
path: root/src/util/command.h
blob: 57edfea01ba0052586d4d86b1dcee6756f285398 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*********************                                           -*- C++ -*-  */
/** command.h
 ** Original author: mdeters
 ** Major contributors: dejan
 ** Minor contributors (to current version): cconway
 ** This file is part of the CVC4 prototype.
 ** Copyright (c) 2009 The Analysis of Computer Systems Group (ACSys)
 ** Courant Institute of Mathematical Sciences
 ** New York University
 ** See the file COPYING in the top-level source directory for licensing
 ** information.
 **
 ** Implementation of the command pattern on SmtEngines.  Generated by
 ** the parser.
 **/

#ifndef __CVC4__COMMAND_H
#define __CVC4__COMMAND_H

#include <iostream>

#include "cvc4_config.h"
#include "expr/expr.h"

namespace CVC4 {
  class SmtEngine;
  class Command;
}/* CVC4 namespace */

namespace CVC4 {

std::ostream& operator<<(std::ostream&, const Command&) CVC4_PUBLIC;
std::ostream& operator<<(std::ostream&, const Command*) CVC4_PUBLIC;

class CVC4_PUBLIC Command {
public:
  virtual void invoke(CVC4::SmtEngine* smt_engine) = 0;
  virtual ~Command() {};
  virtual void toStream(std::ostream&) const = 0;
  std::string toString() const;
};/* class Command */

class CVC4_PUBLIC EmptyCommand : public Command {
public:
  EmptyCommand(std::string name = "");
  void invoke(CVC4::SmtEngine* smt_engine);
  void toStream(std::ostream& out) const;
private:
  std::string d_name;
};/* class EmptyCommand */


class CVC4_PUBLIC AssertCommand : public Command {
public:
  AssertCommand(const BoolExpr& e);
  void invoke(CVC4::SmtEngine* smt_engine);
  void toStream(std::ostream& out) const;
protected:
  BoolExpr d_expr;
};/* class AssertCommand */


class CVC4_PUBLIC DeclarationCommand : public EmptyCommand {
public:
  DeclarationCommand(const std::vector<std::string>& ids);
  void toStream(std::ostream& out) const;
protected:
  std::vector<std::string> d_declaredSymbols;
};

class CVC4_PUBLIC CheckSatCommand : public Command {
public:
  CheckSatCommand();
  CheckSatCommand(const BoolExpr& e);
  void invoke(SmtEngine* smt);
  void toStream(std::ostream& out) const;
protected:
  BoolExpr d_expr;
};/* class CheckSatCommand */


class CVC4_PUBLIC QueryCommand : public Command {
public:
  QueryCommand(const BoolExpr& e);
  void invoke(SmtEngine* smt);
  void toStream(std::ostream& out) const;
protected:
  BoolExpr d_expr;
};/* class QueryCommand */


class CVC4_PUBLIC SetBenchmarkStatusCommand : public Command {
public:
  /** The status an SMT benchmark can have */
  enum BenchmarkStatus {
    /** Benchmark is satisfiable */
    SMT_SATISFIABLE,
    /** Benchmark is unsatisfiable */
    SMT_UNSATISFIABLE,
    /** The status of the benchmark is unknown */
    SMT_UNKNOWN
  };
  SetBenchmarkStatusCommand(BenchmarkStatus status);
  void invoke(SmtEngine* smt);
  void toStream(std::ostream& out) const;
protected:
  BenchmarkStatus d_status;
};/* class QueryCommand */

class CVC4_PUBLIC SetBenchmarkLogicCommand : public Command {
public:
  SetBenchmarkLogicCommand(std::string logic);
  void invoke(SmtEngine* smt);
  void toStream(std::ostream& out) const;
protected:
  std::string d_logic;
};/* class QueryCommand */



class CVC4_PUBLIC CommandSequence : public Command {
public:
  CommandSequence();
  ~CommandSequence();
  void invoke(SmtEngine* smt);
  void addCommand(Command* cmd);
  void toStream(std::ostream& out) const;
private:
  /** All the commands to be executed (in sequence) */
  std::vector<Command*> d_command_sequence;
  /** Next command to be executed */
  unsigned int d_last_index;
};/* class CommandSequence */

}/* CVC4 namespace */

#endif /* __CVC4__COMMAND_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback