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() const41InputLanguage Options::getInputLanguage() const { 42 return (*this)[options::inputLanguage]; 43 } 44 getInstFormatMode() const45InstFormatMode Options::getInstFormatMode() const { 46 return (*this)[options::instFormatMode]; 47 } 48 getOutputLanguage() const49OutputLanguage Options::getOutputLanguage() const { 50 return (*this)[options::outputLanguage]; 51 } 52 getCheckProofs() const53bool Options::getCheckProofs() const{ 54 return (*this)[options::checkProofs]; 55 } 56 getContinuedExecution() const57bool Options::getContinuedExecution() const{ 58 return (*this)[options::continuedExecution]; 59 } 60 getDumpInstantiations() const61bool Options::getDumpInstantiations() const{ 62 return (*this)[options::dumpInstantiations]; 63 } 64 getDumpModels() const65bool Options::getDumpModels() const{ 66 return (*this)[options::dumpModels]; 67 } 68 getDumpProofs() const69bool Options::getDumpProofs() const{ 70 return (*this)[options::dumpProofs]; 71 } 72 getDumpSynth() const73bool Options::getDumpSynth() const{ 74 return (*this)[options::dumpSynth]; 75 } 76 getDumpUnsatCores() const77bool Options::getDumpUnsatCores() const{ 78 return (*this)[options::dumpUnsatCores]; 79 } 80 getEarlyExit() const81bool Options::getEarlyExit() const{ 82 return (*this)[options::earlyExit]; 83 } 84 getFallbackSequential() const85bool Options::getFallbackSequential() const{ 86 return (*this)[options::fallbackSequential]; 87 } 88 getFilesystemAccess() const89bool Options::getFilesystemAccess() const{ 90 return (*this)[options::filesystemAccess]; 91 } 92 getForceNoLimitCpuWhileDump() const93bool Options::getForceNoLimitCpuWhileDump() const{ 94 return (*this)[options::forceNoLimitCpuWhileDump]; 95 } 96 getHelp() const97bool Options::getHelp() const{ 98 return (*this)[options::help]; 99 } 100 getIncrementalParallel() const101bool Options::getIncrementalParallel() const{ 102 return (*this)[options::incrementalParallel]; 103 } 104 getIncrementalSolving() const105bool Options::getIncrementalSolving() const{ 106 return (*this)[options::incrementalSolving]; 107 } 108 getInteractive() const109bool Options::getInteractive() const{ 110 return (*this)[options::interactive]; 111 } 112 getInteractivePrompt() const113bool Options::getInteractivePrompt() const{ 114 return (*this)[options::interactivePrompt]; 115 } 116 getLanguageHelp() const117bool Options::getLanguageHelp() const{ 118 return (*this)[options::languageHelp]; 119 } 120 getMemoryMap() const121bool Options::getMemoryMap() const{ 122 return (*this)[options::memoryMap]; 123 } 124 getParseOnly() const125bool Options::getParseOnly() const{ 126 return (*this)[options::parseOnly]; 127 } 128 getProduceModels() const129bool Options::getProduceModels() const{ 130 return (*this)[options::produceModels]; 131 } 132 getProof() const133bool Options::getProof() const{ 134 return (*this)[options::proof]; 135 } 136 getSegvSpin() const137bool Options::getSegvSpin() const{ 138 return (*this)[options::segvSpin]; 139 } 140 getSemanticChecks() const141bool Options::getSemanticChecks() const{ 142 return (*this)[options::semanticChecks]; 143 } 144 getStatistics() const145bool Options::getStatistics() const{ 146 return (*this)[options::statistics]; 147 } 148 getStatsEveryQuery() const149bool Options::getStatsEveryQuery() const{ 150 return (*this)[options::statsEveryQuery]; 151 } 152 getStatsHideZeros() const153bool Options::getStatsHideZeros() const{ 154 return (*this)[options::statsHideZeros]; 155 } 156 getStrictParsing() const157bool Options::getStrictParsing() const{ 158 return (*this)[options::strictParsing]; 159 } 160 getTearDownIncremental() const161int Options::getTearDownIncremental() const{ 162 return (*this)[options::tearDownIncremental]; 163 } 164 getVersion() const165bool Options::getVersion() const{ 166 return (*this)[options::version]; 167 } 168 getWaitToJoin() const169bool Options::getWaitToJoin() const{ 170 return (*this)[options::waitToJoin]; 171 } 172 getForceLogicString() const173const std::string& Options::getForceLogicString() const{ 174 return (*this)[options::forceLogicString]; 175 } 176 getThreadArgv() const177const std::vector<std::string>& Options::getThreadArgv() const{ 178 return (*this)[options::threadArgv]; 179 } 180 getSharingFilterByLength() const181int Options::getSharingFilterByLength() const{ 182 return (*this)[options::sharingFilterByLength]; 183 } 184 getThreadId() const185int Options::getThreadId() const{ 186 return (*this)[options::thread_id]; 187 } 188 getVerbosity() const189int Options::getVerbosity() const{ 190 return (*this)[options::verbosity]; 191 } 192 getIn() const193std::istream* Options::getIn() const{ 194 return (*this)[options::in]; 195 } 196 getErr()197std::ostream* Options::getErr(){ 198 return (*this)[options::err]; 199 } 200 getOut()201std::ostream* Options::getOut(){ 202 return (*this)[options::out]; 203 } 204 getOutConst() const205std::ostream* Options::getOutConst() const{ 206 // #warning "Remove Options::getOutConst" 207 return (*this)[options::out]; 208 } 209 getBinaryName() const210std::string Options::getBinaryName() const{ 211 return (*this)[options::binary_name]; 212 } 213 getReplayInputFilename() const214std::string Options::getReplayInputFilename() const{ 215 return (*this)[options::replayInputFilename]; 216 } 217 getParseStep() const218unsigned Options::getParseStep() const{ 219 return (*this)[options::parseStep]; 220 } 221 getThreadStackSize() const222unsigned Options::getThreadStackSize() const{ 223 return (*this)[options::threadStackSize]; 224 } 225 getThreads() const226unsigned Options::getThreads() const{ 227 return (*this)[options::threads]; 228 } 229 currentGetSharingFilterByLength()230int Options::currentGetSharingFilterByLength() { 231 return current()->getSharingFilterByLength(); 232 } 233 currentGetThreadId()234int Options::currentGetThreadId() { 235 return current()->getThreadId(); 236 } 237 currentGetOut()238std::ostream* Options::currentGetOut() { 239 return current()->getOut(); 240 } 241 242 243 // TODO: Document these. 244 setInputLanguage(InputLanguage value)245void Options::setInputLanguage(InputLanguage value) { 246 set(options::inputLanguage, value); 247 } 248 setInteractive(bool value)249void Options::setInteractive(bool value) { 250 set(options::interactive, value); 251 } 252 setOut(std::ostream * value)253void Options::setOut(std::ostream* value) { 254 set(options::out, value); 255 } 256 setOutputLanguage(OutputLanguage value)257void Options::setOutputLanguage(OutputLanguage value) { 258 set(options::outputLanguage, value); 259 } 260 setSharingFilterByLength(int length)261void Options::setSharingFilterByLength(int length) { 262 set(options::sharingFilterByLength, length); 263 } 264 setThreadId(int value)265void Options::setThreadId(int value) { 266 set(options::thread_id, value); 267 } 268 wasSetByUserCeGuidedInst() const269bool Options::wasSetByUserCeGuidedInst() const { 270 return wasSetByUser(options::ceGuidedInst); 271 } 272 wasSetByUserDumpSynth() const273bool Options::wasSetByUserDumpSynth() const { 274 return wasSetByUser(options::dumpSynth); 275 } 276 wasSetByUserEarlyExit() const277bool Options::wasSetByUserEarlyExit() const { 278 return wasSetByUser(options::earlyExit); 279 } 280 wasSetByUserForceLogicString() const281bool Options::wasSetByUserForceLogicString() const { 282 return wasSetByUser(options::forceLogicString); 283 } 284 wasSetByUserIncrementalSolving() const285bool Options::wasSetByUserIncrementalSolving() const { 286 return wasSetByUser(options::incrementalSolving); 287 } 288 wasSetByUserInteractive() const289bool Options::wasSetByUserInteractive() const { 290 return wasSetByUser(options::interactive); 291 } 292 wasSetByUserThreadStackSize() const293bool Options::wasSetByUserThreadStackSize() const { 294 return wasSetByUser(options::threadStackSize); 295 } 296 wasSetByUserThreads() const297bool Options::wasSetByUserThreads() const { 298 return wasSetByUser(options::threads); 299 } 300 301 flushErr()302void Options::flushErr() { 303 if(getErr() != NULL) { 304 *(getErr()) << std::flush; 305 } 306 } 307 flushOut()308void Options::flushOut() { 309 if(getOut() != NULL) { 310 *(getOut()) << std::flush; 311 } 312 } 313 314 }/* CVC4 namespace */ 315