1 /*********************                                                        */
2 /*! \file options_public_functions.cpp
3  ** \verbatim
4  ** Top contributors (to current version):
5  **   Tim King, Paul Meng
6  ** This file is part of the CVC4 project.
7  ** Copyright (c) 2009-2019 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.\endverbatim
11  **
12  ** \brief Definitions of public facing interface functions for Options.
13  **
14  ** Definitions of public facing interface functions for Options. These are
15  ** 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 "options.h"
20 
21 #include <fstream>
22 #include <ostream>
23 #include <string>
24 #include <vector>
25 
26 #include "base/listener.h"
27 #include "base/modal_exception.h"
28 #include "options/base_options.h"
29 #include "options/language.h"
30 #include "options/main_options.h"
31 #include "options/parser_options.h"
32 #include "options/printer_modes.h"
33 #include "options/printer_options.h"
34 #include "options/option_exception.h"
35 #include "options/smt_options.h"
36 #include "options/quantifiers_options.h"
37 
38 namespace CVC4 {
39 
40 // Get accessor functions.
getInputLanguage() const41 InputLanguage Options::getInputLanguage() const {
42   return (*this)[options::inputLanguage];
43 }
44 
getInstFormatMode() const45 InstFormatMode Options::getInstFormatMode() const {
46   return (*this)[options::instFormatMode];
47 }
48 
getOutputLanguage() const49 OutputLanguage Options::getOutputLanguage() const {
50   return (*this)[options::outputLanguage];
51 }
52 
getCheckProofs() const53 bool Options::getCheckProofs() const{
54   return (*this)[options::checkProofs];
55 }
56 
getContinuedExecution() const57 bool Options::getContinuedExecution() const{
58   return (*this)[options::continuedExecution];
59 }
60 
getDumpInstantiations() const61 bool Options::getDumpInstantiations() const{
62   return (*this)[options::dumpInstantiations];
63 }
64 
getDumpModels() const65 bool Options::getDumpModels() const{
66   return (*this)[options::dumpModels];
67 }
68 
getDumpProofs() const69 bool Options::getDumpProofs() const{
70   return (*this)[options::dumpProofs];
71 }
72 
getDumpSynth() const73 bool Options::getDumpSynth() const{
74   return (*this)[options::dumpSynth];
75 }
76 
getDumpUnsatCores() const77 bool Options::getDumpUnsatCores() const{
78   return (*this)[options::dumpUnsatCores];
79 }
80 
getEarlyExit() const81 bool Options::getEarlyExit() const{
82   return (*this)[options::earlyExit];
83 }
84 
getFallbackSequential() const85 bool Options::getFallbackSequential() const{
86   return (*this)[options::fallbackSequential];
87 }
88 
getFilesystemAccess() const89 bool Options::getFilesystemAccess() const{
90   return (*this)[options::filesystemAccess];
91 }
92 
getForceNoLimitCpuWhileDump() const93 bool Options::getForceNoLimitCpuWhileDump() const{
94   return (*this)[options::forceNoLimitCpuWhileDump];
95 }
96 
getHelp() const97 bool Options::getHelp() const{
98   return (*this)[options::help];
99 }
100 
getIncrementalParallel() const101 bool Options::getIncrementalParallel() const{
102   return (*this)[options::incrementalParallel];
103 }
104 
getIncrementalSolving() const105 bool Options::getIncrementalSolving() const{
106   return (*this)[options::incrementalSolving];
107 }
108 
getInteractive() const109 bool Options::getInteractive() const{
110   return (*this)[options::interactive];
111 }
112 
getInteractivePrompt() const113 bool Options::getInteractivePrompt() const{
114   return (*this)[options::interactivePrompt];
115 }
116 
getLanguageHelp() const117 bool Options::getLanguageHelp() const{
118   return (*this)[options::languageHelp];
119 }
120 
getMemoryMap() const121 bool Options::getMemoryMap() const{
122   return (*this)[options::memoryMap];
123 }
124 
getParseOnly() const125 bool Options::getParseOnly() const{
126   return (*this)[options::parseOnly];
127 }
128 
getProduceModels() const129 bool Options::getProduceModels() const{
130   return (*this)[options::produceModels];
131 }
132 
getProof() const133 bool Options::getProof() const{
134   return (*this)[options::proof];
135 }
136 
getSegvSpin() const137 bool Options::getSegvSpin() const{
138   return (*this)[options::segvSpin];
139 }
140 
getSemanticChecks() const141 bool Options::getSemanticChecks() const{
142   return (*this)[options::semanticChecks];
143 }
144 
getStatistics() const145 bool Options::getStatistics() const{
146   return (*this)[options::statistics];
147 }
148 
getStatsEveryQuery() const149 bool Options::getStatsEveryQuery() const{
150   return (*this)[options::statsEveryQuery];
151 }
152 
getStatsHideZeros() const153 bool Options::getStatsHideZeros() const{
154   return (*this)[options::statsHideZeros];
155 }
156 
getStrictParsing() const157 bool Options::getStrictParsing() const{
158   return (*this)[options::strictParsing];
159 }
160 
getTearDownIncremental() const161 int Options::getTearDownIncremental() const{
162   return (*this)[options::tearDownIncremental];
163 }
164 
getVersion() const165 bool Options::getVersion() const{
166   return (*this)[options::version];
167 }
168 
getWaitToJoin() const169 bool Options::getWaitToJoin() const{
170   return (*this)[options::waitToJoin];
171 }
172 
getForceLogicString() const173 const std::string& Options::getForceLogicString() const{
174   return (*this)[options::forceLogicString];
175 }
176 
getThreadArgv() const177 const std::vector<std::string>& Options::getThreadArgv() const{
178   return (*this)[options::threadArgv];
179 }
180 
getSharingFilterByLength() const181 int Options::getSharingFilterByLength() const{
182   return (*this)[options::sharingFilterByLength];
183 }
184 
getThreadId() const185 int Options::getThreadId() const{
186   return (*this)[options::thread_id];
187 }
188 
getVerbosity() const189 int Options::getVerbosity() const{
190   return (*this)[options::verbosity];
191 }
192 
getIn() const193 std::istream* Options::getIn() const{
194   return (*this)[options::in];
195 }
196 
getErr()197 std::ostream* Options::getErr(){
198   return (*this)[options::err];
199 }
200 
getOut()201 std::ostream* Options::getOut(){
202   return (*this)[options::out];
203 }
204 
getOutConst() const205 std::ostream* Options::getOutConst() const{
206   // #warning "Remove Options::getOutConst"
207   return (*this)[options::out];
208 }
209 
getBinaryName() const210 std::string Options::getBinaryName() const{
211   return (*this)[options::binary_name];
212 }
213 
getReplayInputFilename() const214 std::string Options::getReplayInputFilename() const{
215   return (*this)[options::replayInputFilename];
216 }
217 
getParseStep() const218 unsigned Options::getParseStep() const{
219   return (*this)[options::parseStep];
220 }
221 
getThreadStackSize() const222 unsigned Options::getThreadStackSize() const{
223   return (*this)[options::threadStackSize];
224 }
225 
getThreads() const226 unsigned Options::getThreads() const{
227   return (*this)[options::threads];
228 }
229 
currentGetSharingFilterByLength()230 int Options::currentGetSharingFilterByLength() {
231   return current()->getSharingFilterByLength();
232 }
233 
currentGetThreadId()234 int Options::currentGetThreadId() {
235   return current()->getThreadId();
236 }
237 
currentGetOut()238 std::ostream* Options::currentGetOut() {
239   return current()->getOut();
240 }
241 
242 
243 // TODO: Document these.
244 
setInputLanguage(InputLanguage value)245 void Options::setInputLanguage(InputLanguage value) {
246   set(options::inputLanguage, value);
247 }
248 
setInteractive(bool value)249 void Options::setInteractive(bool value) {
250   set(options::interactive, value);
251 }
252 
setOut(std::ostream * value)253 void Options::setOut(std::ostream* value) {
254   set(options::out, value);
255 }
256 
setOutputLanguage(OutputLanguage value)257 void Options::setOutputLanguage(OutputLanguage value) {
258   set(options::outputLanguage, value);
259 }
260 
setSharingFilterByLength(int length)261 void Options::setSharingFilterByLength(int length) {
262   set(options::sharingFilterByLength, length);
263 }
264 
setThreadId(int value)265 void Options::setThreadId(int value) {
266   set(options::thread_id, value);
267 }
268 
wasSetByUserCeGuidedInst() const269 bool Options::wasSetByUserCeGuidedInst() const {
270   return wasSetByUser(options::ceGuidedInst);
271 }
272 
wasSetByUserDumpSynth() const273 bool Options::wasSetByUserDumpSynth() const {
274   return wasSetByUser(options::dumpSynth);
275 }
276 
wasSetByUserEarlyExit() const277 bool Options::wasSetByUserEarlyExit() const {
278   return wasSetByUser(options::earlyExit);
279 }
280 
wasSetByUserForceLogicString() const281 bool Options::wasSetByUserForceLogicString() const {
282   return wasSetByUser(options::forceLogicString);
283 }
284 
wasSetByUserIncrementalSolving() const285 bool Options::wasSetByUserIncrementalSolving() const {
286   return wasSetByUser(options::incrementalSolving);
287 }
288 
wasSetByUserInteractive() const289 bool Options::wasSetByUserInteractive() const {
290   return wasSetByUser(options::interactive);
291 }
292 
wasSetByUserThreadStackSize() const293 bool Options::wasSetByUserThreadStackSize() const {
294   return wasSetByUser(options::threadStackSize);
295 }
296 
wasSetByUserThreads() const297 bool Options::wasSetByUserThreads() const {
298   return wasSetByUser(options::threads);
299 }
300 
301 
flushErr()302 void Options::flushErr() {
303   if(getErr() != NULL) {
304     *(getErr()) << std::flush;
305   }
306 }
307 
flushOut()308 void Options::flushOut() {
309   if(getOut() != NULL) {
310     *(getOut()) << std::flush;
311   }
312 }
313 
314 }/* CVC4 namespace */
315