summaryrefslogtreecommitdiff
path: root/src/parser/smt1/smt1.h
blob: 49a4b80001822e63b47de6075471ff9de2ab7c3f (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
/*********************                                                        */
/*! \file smt1.h
 ** \verbatim
 ** Top contributors (to current version):
 **   Christopher L. Conway, Morgan Deters, Paul Meng
 ** This file is part of the CVC4 project.
 ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS
 ** in the top-level source directory) and their institutional affiliations.
 ** All rights reserved.  See the file COPYING in the top-level source
 ** directory for licensing information.\endverbatim
 **
 ** Definitions of SMT constants.
 **/

#include "cvc4parser_private.h"

#ifndef __CVC4__PARSER__SMT1_H
#define __CVC4__PARSER__SMT1_H

#include <string>
#include <unordered_map>

#include "parser/parser.h"

namespace CVC4 {

class SExpr;

namespace parser {

class Smt1 : public Parser {
  friend class ParserBuilder;

public:
 enum Logic {
   UNSET = 0,  // This indicates that the logic has not been set.
   AUFLIA,     // +p and -p?
   AUFLIRA,
   AUFNIRA,
   LRA,
   QF_ABV,
   QF_AUFBV,
   QF_AUFBVLIA,
   QF_AUFBVLRA,
   QF_AUFLIA,
   QF_AUFLIRA,
   QF_AX,
   QF_BV,
   QF_IDL,
   QF_LIA,
   QF_LRA,
   QF_NIA,
   QF_NRA,
   QF_RDL,
   QF_S,  // nonstandard (for string theory)
   QF_SAT,
   QF_UF,
   QF_UFIDL,
   QF_UFBV,
   QF_UFLIA,
   QF_UFNIA,  // nonstandard
   QF_UFLRA,
   QF_UFLIRA,  // nonstandard
   QF_UFNIRA,  // nonstandard
   QF_UFNRA,
   SAT,
   UFLRA,
   UFNIRA,  // nonstandard
   UFNIA,
   QF_ALL_SUPPORTED,  // nonstandard
   ALL_SUPPORTED      // nonstandard
 };

 enum Theory {
   THEORY_ARRAYS,
   THEORY_ARRAYS_EX,
   THEORY_BITVECTORS,
   THEORY_BITVECTORS_32,
   THEORY_BITVECTOR_ARRAYS_EX,
   THEORY_EMPTY,
   THEORY_INTS,
   THEORY_INT_ARRAYS,
   THEORY_INT_ARRAYS_EX,
   THEORY_INT_INT_REAL_ARRAY_ARRAYS_EX,
   THEORY_REALS,
   THEORY_REALS_INTS,
   THEORY_STRINGS,
   THEORY_QUANTIFIERS,
   THEORY_CARDINALITY_CONSTRAINT
 };

private:
  Logic d_logic;

protected:
  Smt1(ExprManager* exprManager, Input* input, bool strictMode = false, bool parseOnly = false);

public:
  /**
   * Add theory symbols to the parser state.
   *
   * @param theory the theory to open (e.g., Core, Ints)
   */
  void addTheory(Theory theory);

  bool logicIsSet();

  /**
   * Sets the logic for the current benchmark. Declares any logic and theory symbols.
   *
   * @param name the name of the logic (e.g., QF_UF, AUFLIA)
   */
  void setLogic(const std::string& name);

  static Logic toLogic(const std::string& name);

private:

  void addArithmeticOperators();
  static std::unordered_map<std::string, Logic> newLogicMap();
};/* class Smt1 */

}/* CVC4::parser namespace */
}/* CVC4 namespace */

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