1 /********************* */
2 /*! \file options_public_functions.cpp
4 ** Original author: Morgan Deters
5 ** Major contributors: none
6 ** Minor contributors (to current version): Kshitij Bansal
7 ** This file is part of the CVC4 project.
8 ** Copyright (c) 2009-2014 New York University and The University of Iowa
9 ** See the file COPYING in the top-level source directory for licensing
10 ** information.\endverbatim
12 ** \brief Definitions of public facing interface functions for Options.
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.
26 #include "base/listener.h"
27 #include "base/modal_exception.h"
29 #include "options/base_options.h"
30 #include "options/language.h"
31 #include "options/main_options.h"
32 #include "options/parser_options.h"
33 #include "options/printer_modes.h"
34 #include "options/printer_options.h"
35 #include "options/option_exception.h"
36 #include "options/smt_options.h"
37 #include "options/quantifiers_options.h"
41 // Get accessor functions.
42 InputLanguage
Options::getInputLanguage() const {
43 return (*this)[options::inputLanguage
];
46 InstFormatMode
Options::getInstFormatMode() const {
47 return (*this)[options::instFormatMode
];
50 OutputLanguage
Options::getOutputLanguage() const {
51 return (*this)[options::outputLanguage
];
54 bool Options::getCheckProofs() const{
55 return (*this)[options::checkProofs
];
58 bool Options::getContinuedExecution() const{
59 return (*this)[options::continuedExecution
];
62 bool Options::getDumpInstantiations() const{
63 return (*this)[options::dumpInstantiations
];
66 bool Options::getDumpModels() const{
67 return (*this)[options::dumpModels
];
70 bool Options::getDumpProofs() const{
71 return (*this)[options::dumpProofs
];
74 bool Options::getDumpSynth() const{
75 return (*this)[options::dumpSynth
];
78 bool Options::getDumpUnsatCores() const{
79 return (*this)[options::dumpUnsatCores
];
82 bool Options::getEarlyExit() const{
83 return (*this)[options::earlyExit
];
86 bool Options::getFallbackSequential() const{
87 return (*this)[options::fallbackSequential
];
90 bool Options::getFilesystemAccess() const{
91 return (*this)[options::filesystemAccess
];
94 bool Options::getForceNoLimitCpuWhileDump() const{
95 return (*this)[options::forceNoLimitCpuWhileDump
];
98 bool Options::getHelp() const{
99 return (*this)[options::help
];
102 bool Options::getIncrementalParallel() const{
103 return (*this)[options::incrementalParallel
];
106 bool Options::getIncrementalSolving() const{
107 return (*this)[options::incrementalSolving
];
110 bool Options::getInteractive() const{
111 return (*this)[options::interactive
];
114 bool Options::getInteractivePrompt() const{
115 return (*this)[options::interactivePrompt
];
118 bool Options::getLanguageHelp() const{
119 return (*this)[options::languageHelp
];
122 bool Options::getMemoryMap() const{
123 return (*this)[options::memoryMap
];
126 bool Options::getParseOnly() const{
127 return (*this)[options::parseOnly
];
130 bool Options::getProduceModels() const{
131 return (*this)[options::produceModels
];
134 bool Options::getProof() const{
135 return (*this)[options::proof
];
138 bool Options::getSegvSpin() const{
139 return (*this)[options::segvSpin
];
142 bool Options::getSemanticChecks() const{
143 return (*this)[options::semanticChecks
];
146 bool Options::getStatistics() const{
147 return (*this)[options::statistics
];
150 bool Options::getStatsEveryQuery() const{
151 return (*this)[options::statsEveryQuery
];
154 bool Options::getStatsHideZeros() const{
155 return (*this)[options::statsHideZeros
];
158 bool Options::getStrictParsing() const{
159 return (*this)[options::strictParsing
];
162 bool Options::getTearDownIncremental() const{
163 return (*this)[options::tearDownIncremental
];
166 bool Options::getVersion() const{
167 return (*this)[options::version
];
170 bool Options::getWaitToJoin() const{
171 return (*this)[options::waitToJoin
];
174 const std::string
& Options::getForceLogicString() const{
175 return (*this)[options::forceLogicString
];
178 const std::vector
<std::string
>& Options::getThreadArgv() const{
179 return (*this)[options::threadArgv
];
182 int Options::getSharingFilterByLength() const{
183 return (*this)[options::sharingFilterByLength
];
186 int Options::getThreadId() const{
187 return (*this)[options::thread_id
];
190 int Options::getVerbosity() const{
191 return (*this)[options::verbosity
];
194 std::istream
* Options::getIn() const{
195 return (*this)[options::in
];
198 std::ostream
* Options::getErr(){
199 return (*this)[options::err
];
202 std::ostream
* Options::getOut(){
203 return (*this)[options::out
];
206 std::ostream
* Options::getOutConst() const{
207 #warning "Remove Options::getOutConst"
208 return (*this)[options::out
];
211 std::string
Options::getBinaryName() const{
212 return (*this)[options::binary_name
];
215 std::string
Options::getReplayInputFilename() const{
216 return (*this)[options::replayInputFilename
];
219 unsigned Options::getParseStep() const{
220 return (*this)[options::parseStep
];
223 unsigned Options::getThreadStackSize() const{
224 return (*this)[options::threadStackSize
];
227 unsigned Options::getThreads() const{
228 return (*this)[options::threads
];
231 int Options::currentGetSharingFilterByLength() {
232 return current()->getSharingFilterByLength();
235 int Options::currentGetThreadId() {
236 return current()->getThreadId();
239 std::ostream
* Options::currentGetOut() {
240 return current()->getOut();
244 // TODO: Document these.
245 void Options::setCeGuidedInst(bool value
) {
246 set(options::ceGuidedInst
, value
);
249 void Options::setDumpSynth(bool value
) {
250 set(options::dumpSynth
, value
);
253 void Options::setInputLanguage(InputLanguage value
) {
254 set(options::inputLanguage
, value
);
257 void Options::setInteractive(bool value
) {
258 set(options::interactive
, value
);
261 void Options::setOut(std::ostream
* value
) {
262 set(options::out
, value
);
265 void Options::setOutputLanguage(OutputLanguage value
) {
266 set(options::outputLanguage
, value
);
269 void Options::setSharingFilterByLength(int length
) {
270 set(options::sharingFilterByLength
, length
);
273 void Options::setThreadId(int value
) {
274 set(options::thread_id
, value
);
277 bool Options::wasSetByUserCeGuidedInst() const {
278 return wasSetByUser(options::ceGuidedInst
);
281 bool Options::wasSetByUserDumpSynth() const {
282 return wasSetByUser(options::dumpSynth
);
285 bool Options::wasSetByUserEarlyExit() const {
286 return wasSetByUser(options::earlyExit
);
289 bool Options::wasSetByUserForceLogicString() const {
290 return wasSetByUser(options::forceLogicString
);
293 bool Options::wasSetByUserIncrementalSolving() const {
294 return wasSetByUser(options::incrementalSolving
);
297 bool Options::wasSetByUserInteractive() const {
298 return wasSetByUser(options::interactive
);
301 bool Options::wasSetByUserThreadStackSize() const {
302 return wasSetByUser(options::threadStackSize
);
305 bool Options::wasSetByUserThreads() const {
306 return wasSetByUser(options::threads
);
310 void Options::flushErr() {
311 if(getErr() != NULL
) {
312 *(getErr()) << std::flush
;
316 void Options::flushOut() {
317 if(getOut() != NULL
) {
318 *(getOut()) << std::flush
;
322 }/* CVC4 namespace */