1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Mathias Preiner, Aina Niemetz |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
7 |
|
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS |
8 |
|
* in the top-level source directory and their institutional affiliations. |
9 |
|
* All rights reserved. See the file COPYING in the top-level source |
10 |
|
* directory for licensing information. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* Contains code for handling command-line options. |
14 |
|
* |
15 |
|
* For each <module>_options.toml configuration file, mkoptions.py |
16 |
|
* expands this template and generates a <module>_options.h file. |
17 |
|
*/ |
18 |
|
|
19 |
|
#include "cvc5_private.h" |
20 |
|
|
21 |
|
#ifndef CVC5__OPTIONS__THEORY_H |
22 |
|
#define CVC5__OPTIONS__THEORY_H |
23 |
|
|
24 |
|
#include "options/options.h" |
25 |
|
|
26 |
|
// clang-format off |
27 |
|
|
28 |
|
// clang-format on |
29 |
|
|
30 |
|
namespace cvc5 { |
31 |
|
namespace options { |
32 |
|
|
33 |
|
// clang-format off |
34 |
|
|
35 |
|
enum class EqEngineMode |
36 |
|
{ |
37 |
|
DISTRIBUTED |
38 |
|
}; |
39 |
|
std::ostream& operator<<(std::ostream& os, EqEngineMode mode); |
40 |
|
EqEngineMode stringToEqEngineMode(const std::string& optarg); |
41 |
|
enum class TcMode |
42 |
|
{ |
43 |
|
CARE_GRAPH |
44 |
|
}; |
45 |
|
std::ostream& operator<<(std::ostream& os, TcMode mode); |
46 |
|
TcMode stringToTcMode(const std::string& optarg); |
47 |
|
enum class TheoryOfMode |
48 |
|
{ |
49 |
|
THEORY_OF_TYPE_BASED, |
50 |
|
THEORY_OF_TERM_BASED |
51 |
|
}; |
52 |
|
std::ostream& operator<<(std::ostream& os, TheoryOfMode mode); |
53 |
|
TheoryOfMode stringToTheoryOfMode(const std::string& optarg); |
54 |
|
// clang-format on |
55 |
|
|
56 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
57 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
58 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
59 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
60 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
61 |
|
|
62 |
24449 |
struct HolderTHEORY |
63 |
|
{ |
64 |
|
// clang-format off |
65 |
|
bool assignFunctionValues = true;\ |
66 |
|
bool assignFunctionValues__setByUser__ = false; |
67 |
|
bool condenseFunctionValues = true;\ |
68 |
|
bool condenseFunctionValues__setByUser__ = false; |
69 |
|
EqEngineMode eeMode = EqEngineMode::DISTRIBUTED;\ |
70 |
|
bool eeMode__setByUser__ = false; |
71 |
|
bool relevanceFilter = false;\ |
72 |
|
bool relevanceFilter__setByUser__ = false; |
73 |
|
TcMode tcMode = TcMode::CARE_GRAPH;\ |
74 |
|
bool tcMode__setByUser__ = false; |
75 |
|
TheoryOfMode theoryOfMode = TheoryOfMode::THEORY_OF_TYPE_BASED;\ |
76 |
|
bool theoryOfMode__setByUser__ = false; |
77 |
|
// clang-format on |
78 |
|
}; |
79 |
|
|
80 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
81 |
|
|
82 |
|
// clang-format off |
83 |
|
extern struct assignFunctionValues__option_t |
84 |
|
{ |
85 |
|
typedef bool type; |
86 |
|
type operator()() const; |
87 |
|
} thread_local assignFunctionValues; |
88 |
|
extern struct condenseFunctionValues__option_t |
89 |
|
{ |
90 |
|
typedef bool type; |
91 |
|
type operator()() const; |
92 |
|
} thread_local condenseFunctionValues; |
93 |
|
extern struct eeMode__option_t |
94 |
|
{ |
95 |
|
typedef EqEngineMode type; |
96 |
|
type operator()() const; |
97 |
|
} thread_local eeMode; |
98 |
|
extern struct relevanceFilter__option_t |
99 |
|
{ |
100 |
|
typedef bool type; |
101 |
|
type operator()() const; |
102 |
|
} thread_local relevanceFilter; |
103 |
|
extern struct tcMode__option_t |
104 |
|
{ |
105 |
|
typedef TcMode type; |
106 |
|
type operator()() const; |
107 |
|
} thread_local tcMode; |
108 |
|
extern struct theoryOfMode__option_t |
109 |
|
{ |
110 |
|
typedef TheoryOfMode type; |
111 |
|
type operator()() const; |
112 |
|
} thread_local theoryOfMode; |
113 |
|
// clang-format on |
114 |
|
|
115 |
|
namespace theory |
116 |
|
{ |
117 |
|
// clang-format off |
118 |
|
static constexpr const char* assignFunctionValues__name = "assign-function-values"; |
119 |
|
static constexpr const char* condenseFunctionValues__name = "condense-function-values"; |
120 |
|
static constexpr const char* eeMode__name = "ee-mode"; |
121 |
|
static constexpr const char* relevanceFilter__name = "relevance-filter"; |
122 |
|
static constexpr const char* tcMode__name = "tc-mode"; |
123 |
|
static constexpr const char* theoryOfMode__name = "theoryof-mode"; |
124 |
|
// clang-format on |
125 |
|
} |
126 |
|
|
127 |
|
} // namespace options |
128 |
|
|
129 |
|
// clang-format off |
130 |
|
template <> options::assignFunctionValues__option_t::type& Options::ref( |
131 |
|
options::assignFunctionValues__option_t); |
132 |
|
template <> const options::assignFunctionValues__option_t::type& Options::operator[]( |
133 |
|
options::assignFunctionValues__option_t) const; |
134 |
|
template <> bool Options::wasSetByUser(options::assignFunctionValues__option_t) const; |
135 |
|
template <> options::condenseFunctionValues__option_t::type& Options::ref( |
136 |
|
options::condenseFunctionValues__option_t); |
137 |
|
template <> const options::condenseFunctionValues__option_t::type& Options::operator[]( |
138 |
|
options::condenseFunctionValues__option_t) const; |
139 |
|
template <> bool Options::wasSetByUser(options::condenseFunctionValues__option_t) const; |
140 |
|
template <> options::eeMode__option_t::type& Options::ref( |
141 |
|
options::eeMode__option_t); |
142 |
|
template <> const options::eeMode__option_t::type& Options::operator[]( |
143 |
|
options::eeMode__option_t) const; |
144 |
|
template <> bool Options::wasSetByUser(options::eeMode__option_t) const; |
145 |
|
template <> options::relevanceFilter__option_t::type& Options::ref( |
146 |
|
options::relevanceFilter__option_t); |
147 |
|
template <> const options::relevanceFilter__option_t::type& Options::operator[]( |
148 |
|
options::relevanceFilter__option_t) const; |
149 |
|
template <> bool Options::wasSetByUser(options::relevanceFilter__option_t) const; |
150 |
|
template <> options::tcMode__option_t::type& Options::ref( |
151 |
|
options::tcMode__option_t); |
152 |
|
template <> const options::tcMode__option_t::type& Options::operator[]( |
153 |
|
options::tcMode__option_t) const; |
154 |
|
template <> bool Options::wasSetByUser(options::tcMode__option_t) const; |
155 |
|
template <> options::theoryOfMode__option_t::type& Options::ref( |
156 |
|
options::theoryOfMode__option_t); |
157 |
|
template <> const options::theoryOfMode__option_t::type& Options::operator[]( |
158 |
|
options::theoryOfMode__option_t) const; |
159 |
|
template <> bool Options::wasSetByUser(options::theoryOfMode__option_t) const; |
160 |
|
// clang-format on |
161 |
|
|
162 |
|
namespace options { |
163 |
|
// clang-format off |
164 |
24305 |
inline assignFunctionValues__option_t::type assignFunctionValues__option_t::operator()() const |
165 |
|
{ |
166 |
24305 |
return Options::current()[*this]; |
167 |
|
} |
168 |
228763 |
inline condenseFunctionValues__option_t::type condenseFunctionValues__option_t::operator()() const |
169 |
|
{ |
170 |
228763 |
return Options::current()[*this]; |
171 |
|
} |
172 |
8954 |
inline eeMode__option_t::type eeMode__option_t::operator()() const |
173 |
|
{ |
174 |
8954 |
return Options::current()[*this]; |
175 |
|
} |
176 |
8977 |
inline relevanceFilter__option_t::type relevanceFilter__option_t::operator()() const |
177 |
|
{ |
178 |
8977 |
return Options::current()[*this]; |
179 |
|
} |
180 |
8954 |
inline tcMode__option_t::type tcMode__option_t::operator()() const |
181 |
|
{ |
182 |
8954 |
return Options::current()[*this]; |
183 |
|
} |
184 |
154631676 |
inline theoryOfMode__option_t::type theoryOfMode__option_t::operator()() const |
185 |
|
{ |
186 |
154631676 |
return Options::current()[*this]; |
187 |
|
} |
188 |
|
// clang-format on |
189 |
|
|
190 |
|
} // namespace options |
191 |
|
} // namespace cvc5 |
192 |
|
|
193 |
|
#endif /* CVC5__OPTIONS__THEORY_H */ |