1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Tim King, Gereon Kremer, Andrew Reynolds |
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 |
|
* Definitions of public facing interface functions for Options. |
14 |
|
* |
15 |
|
* These are all 1 line wrappers for Options::get<T>, Options::set<T>, and |
16 |
|
* Options::wasSetByUser<T> for different option types T. |
17 |
|
*/ |
18 |
|
|
19 |
|
#include <fstream> |
20 |
|
#include <ostream> |
21 |
|
#include <string> |
22 |
|
#include <vector> |
23 |
|
|
24 |
|
#include "base/listener.h" |
25 |
|
#include "base/modal_exception.h" |
26 |
|
#include "options/options.h" |
27 |
|
#include "options/base_options.h" |
28 |
|
#include "options/language.h" |
29 |
|
#include "options/main_options.h" |
30 |
|
#include "options/option_exception.h" |
31 |
|
#include "options/parser_options.h" |
32 |
|
#include "options/printer_modes.h" |
33 |
|
#include "options/printer_options.h" |
34 |
|
#include "options/quantifiers_options.h" |
35 |
|
#include "options/resource_manager_options.h" |
36 |
|
#include "options/smt_options.h" |
37 |
|
#include "options/uf_options.h" |
38 |
|
|
39 |
|
namespace cvc5 { |
40 |
|
|
41 |
|
// Get accessor functions. |
42 |
790520 |
InputLanguage Options::getInputLanguage() const { |
43 |
790520 |
return (*this)[options::inputLanguage]; |
44 |
|
} |
45 |
|
|
46 |
153 |
options::InstFormatMode Options::getInstFormatMode() const |
47 |
|
{ |
48 |
153 |
return (*this)[options::instFormatMode]; |
49 |
|
} |
50 |
|
|
51 |
11776 |
OutputLanguage Options::getOutputLanguage() const { |
52 |
11776 |
return (*this)[options::outputLanguage]; |
53 |
|
} |
54 |
|
|
55 |
2954696 |
bool Options::getUfHo() const { return (*this)[options::ufHo]; } |
56 |
|
|
57 |
301173 |
bool Options::getDumpInstantiations() const{ |
58 |
602358 |
return (*this)[options::dumpInstantiations]; |
59 |
|
} |
60 |
|
|
61 |
301173 |
bool Options::getDumpModels() const{ |
62 |
301173 |
return (*this)[options::dumpModels]; |
63 |
|
} |
64 |
|
|
65 |
301173 |
bool Options::getDumpProofs() const{ |
66 |
301173 |
return (*this)[options::dumpProofs]; |
67 |
|
} |
68 |
|
|
69 |
301173 |
bool Options::getDumpUnsatCores() const{ |
70 |
|
// dump unsat cores full enables dumpUnsatCores |
71 |
301173 |
return (*this)[options::dumpUnsatCores] |
72 |
301173 |
|| (*this)[options::dumpUnsatCoresFull]; |
73 |
|
} |
74 |
|
|
75 |
5857 |
bool Options::getEarlyExit() const{ |
76 |
17571 |
return (*this)[options::earlyExit]; |
77 |
|
} |
78 |
|
|
79 |
6108 |
bool Options::getFilesystemAccess() const{ |
80 |
6108 |
return (*this)[options::filesystemAccess]; |
81 |
|
} |
82 |
|
|
83 |
28 |
bool Options::getForceNoLimitCpuWhileDump() const{ |
84 |
56 |
return (*this)[options::forceNoLimitCpuWhileDump]; |
85 |
|
} |
86 |
|
|
87 |
5878 |
bool Options::getHelp() const{ |
88 |
11756 |
return (*this)[options::help]; |
89 |
|
} |
90 |
|
|
91 |
|
bool Options::getIncrementalSolving() const{ |
92 |
|
return (*this)[options::incrementalSolving]; |
93 |
|
} |
94 |
|
|
95 |
5877 |
bool Options::getInteractive() const{ |
96 |
23510 |
return (*this)[options::interactive]; |
97 |
|
} |
98 |
|
|
99 |
28 |
bool Options::getInteractivePrompt() const{ |
100 |
56 |
return (*this)[options::interactivePrompt]; |
101 |
|
} |
102 |
|
|
103 |
5878 |
bool Options::getLanguageHelp() const{ |
104 |
5878 |
return (*this)[options::languageHelp]; |
105 |
|
} |
106 |
|
|
107 |
5877 |
bool Options::getMemoryMap() const{ |
108 |
11754 |
return (*this)[options::memoryMap]; |
109 |
|
} |
110 |
|
|
111 |
312412 |
bool Options::getParseOnly() const{ |
112 |
624824 |
return (*this)[options::parseOnly]; |
113 |
|
} |
114 |
|
|
115 |
|
bool Options::getProduceModels() const{ |
116 |
|
return (*this)[options::produceModels]; |
117 |
|
} |
118 |
|
|
119 |
5878 |
bool Options::getSegvSpin() const{ |
120 |
11756 |
return (*this)[options::segvSpin]; |
121 |
|
} |
122 |
|
|
123 |
6108 |
bool Options::getSemanticChecks() const{ |
124 |
12216 |
return (*this)[options::semanticChecks]; |
125 |
|
} |
126 |
|
|
127 |
5877 |
bool Options::getStatistics() const{ |
128 |
|
// statsEveryQuery enables stats |
129 |
27091 |
return (*this)[options::statistics] || (*this)[options::statisticsEveryQuery]; |
130 |
|
} |
131 |
|
|
132 |
9460 |
bool Options::getStatsEveryQuery() const{ |
133 |
9460 |
return (*this)[options::statisticsEveryQuery]; |
134 |
|
} |
135 |
|
|
136 |
6108 |
bool Options::getStrictParsing() const{ |
137 |
12225 |
return (*this)[options::strictParsing]; |
138 |
|
} |
139 |
|
|
140 |
5877 |
int Options::getTearDownIncremental() const{ |
141 |
11754 |
return (*this)[options::tearDownIncremental]; |
142 |
|
} |
143 |
|
|
144 |
5878 |
uint64_t Options::getCumulativeTimeLimit() const |
145 |
|
{ |
146 |
11756 |
return (*this)[options::cumulativeMillisecondLimit]; |
147 |
|
} |
148 |
|
|
149 |
5878 |
bool Options::getVersion() const{ |
150 |
11756 |
return (*this)[options::version]; |
151 |
|
} |
152 |
|
|
153 |
9 |
const std::string& Options::getForceLogicString() const{ |
154 |
6147 |
return (*this)[options::forceLogicString]; |
155 |
|
} |
156 |
|
|
157 |
602388 |
int Options::getVerbosity() const{ |
158 |
602388 |
return (*this)[options::verbosity]; |
159 |
|
} |
160 |
|
|
161 |
12 |
std::istream* Options::getIn() const{ |
162 |
24 |
return (*this)[options::in]; |
163 |
|
} |
164 |
|
|
165 |
17575 |
std::ostream* Options::getErr(){ |
166 |
17575 |
return (*this)[options::err]; |
167 |
|
} |
168 |
|
|
169 |
319911 |
std::ostream* Options::getOut(){ |
170 |
319911 |
return (*this)[options::out]; |
171 |
|
} |
172 |
|
|
173 |
12 |
std::ostream* Options::getOutConst() const{ |
174 |
|
// #warning "Remove Options::getOutConst" |
175 |
12 |
return (*this)[options::out]; |
176 |
|
} |
177 |
|
|
178 |
5878 |
std::string Options::getBinaryName() const{ |
179 |
11756 |
return (*this)[options::binary_name]; |
180 |
|
} |
181 |
|
|
182 |
|
std::ostream* Options::currentGetOut() { |
183 |
|
return current().getOut(); |
184 |
|
} |
185 |
|
|
186 |
|
|
187 |
|
// TODO: Document these. |
188 |
|
|
189 |
5655 |
void Options::setInputLanguage(InputLanguage value) { |
190 |
5655 |
set(options::inputLanguage, value); |
191 |
5655 |
} |
192 |
|
|
193 |
5878 |
void Options::setInteractive(bool value) { |
194 |
5878 |
set(options::interactive, value); |
195 |
5878 |
} |
196 |
|
|
197 |
|
void Options::setOut(std::ostream* value) { |
198 |
|
set(options::out, value); |
199 |
|
} |
200 |
|
|
201 |
5879 |
void Options::setOutputLanguage(OutputLanguage value) { |
202 |
5879 |
set(options::outputLanguage, value); |
203 |
5879 |
} |
204 |
|
|
205 |
5857 |
bool Options::wasSetByUserEarlyExit() const { |
206 |
5857 |
return wasSetByUser(options::earlyExit); |
207 |
|
} |
208 |
|
|
209 |
6120 |
bool Options::wasSetByUserForceLogicString() const { |
210 |
6120 |
return wasSetByUser(options::forceLogicString); |
211 |
|
} |
212 |
|
|
213 |
5877 |
bool Options::wasSetByUserIncrementalSolving() const { |
214 |
5877 |
return wasSetByUser(options::incrementalSolving); |
215 |
|
} |
216 |
|
|
217 |
5878 |
bool Options::wasSetByUserInteractive() const { |
218 |
5878 |
return wasSetByUser(options::interactive); |
219 |
|
} |
220 |
|
|
221 |
|
|
222 |
5857 |
void Options::flushErr() { |
223 |
5857 |
if(getErr() != NULL) { |
224 |
5857 |
*(getErr()) << std::flush; |
225 |
|
} |
226 |
5857 |
} |
227 |
|
|
228 |
5857 |
void Options::flushOut() { |
229 |
5857 |
if(getOut() != NULL) { |
230 |
5857 |
*(getOut()) << std::flush; |
231 |
|
} |
232 |
5857 |
} |
233 |
|
|
234 |
751924 |
} // namespace cvc5 |