Remove `Options::wasSetByUser()` (#6682)
[cvc5.git] / src / options / options_public.cpp
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 one line wrappers for accessing the internal option data.
16 */
17
18 #include "options_public.h"
19
20 #include <fstream>
21 #include <ostream>
22 #include <string>
23 #include <vector>
24
25 #include "base/listener.h"
26 #include "base/modal_exception.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/options.h"
32 #include "options/parser_options.h"
33 #include "options/printer_modes.h"
34 #include "options/printer_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::options {
40
41 InputLanguage getInputLanguage(const Options& opts)
42 {
43 return opts.base.inputLanguage;
44 }
45 InstFormatMode getInstFormatMode(const Options& opts)
46 {
47 return opts.printer.instFormatMode;
48 }
49 OutputLanguage getOutputLanguage(const Options& opts)
50 {
51 return opts.base.outputLanguage;
52 }
53 bool getUfHo(const Options& opts) { return opts.uf.ufHo; }
54 bool getDumpInstantiations(const Options& opts)
55 {
56 return opts.smt.dumpInstantiations;
57 }
58 bool getDumpModels(const Options& opts) { return opts.smt.dumpModels; }
59 bool getDumpProofs(const Options& opts) { return opts.smt.dumpProofs; }
60 bool getDumpUnsatCores(const Options& opts)
61 {
62 return opts.smt.dumpUnsatCores || opts.smt.dumpUnsatCoresFull;
63 }
64 bool getFilesystemAccess(const Options& opts)
65 {
66 return opts.parser.filesystemAccess;
67 }
68 bool getForceNoLimitCpuWhileDump(const Options& opts)
69 {
70 return opts.smt.forceNoLimitCpuWhileDump;
71 }
72 bool getIncrementalSolving(const Options& opts)
73 {
74 return opts.smt.incrementalSolving;
75 }
76 bool getLanguageHelp(const Options& opts) { return opts.base.languageHelp; }
77 bool getMemoryMap(const Options& opts) { return opts.parser.memoryMap; }
78 bool getParseOnly(const Options& opts) { return opts.base.parseOnly; }
79 bool getProduceModels(const Options& opts) { return opts.smt.produceModels; }
80 bool getSemanticChecks(const Options& opts)
81 {
82 return opts.parser.semanticChecks;
83 }
84 bool getStatistics(const Options& opts) { return opts.base.statistics; }
85 bool getStatsEveryQuery(const Options& opts)
86 {
87 return opts.base.statisticsEveryQuery;
88 }
89 bool getStrictParsing(const Options& opts)
90 {
91 return opts.parser.strictParsing;
92 }
93 uint64_t getCumulativeTimeLimit(const Options& opts)
94 {
95 return opts.resman.cumulativeMillisecondLimit;
96 }
97 const std::string& getForceLogicString(const Options& opts)
98 {
99 return opts.parser.forceLogicString;
100 }
101 int32_t getVerbosity(const Options& opts) { return opts.base.verbosity; }
102
103 std::istream* getIn(const Options& opts) { return opts.base.in; }
104 std::ostream* getErr(const Options& opts) { return opts.base.err; }
105 std::ostream* getOut(const Options& opts) { return opts.base.out; }
106 const std::string& getBinaryName(const Options& opts)
107 {
108 return opts.base.binary_name;
109 }
110
111 void setInputLanguage(InputLanguage val, Options& opts)
112 {
113 opts.base.inputLanguage = val;
114 }
115 void setOut(std::ostream* val, Options& opts) { opts.base.out = val; }
116 void setOutputLanguage(OutputLanguage val, Options& opts)
117 {
118 opts.base.outputLanguage = val;
119 }
120
121 bool wasSetByUserEarlyExit(const Options& opts)
122 {
123 return opts.driver.earlyExitWasSetByUser;
124 }
125 bool wasSetByUserForceLogicString(const Options& opts)
126 {
127 return opts.parser.forceLogicStringWasSetByUser;
128 }
129 bool wasSetByUserIncrementalSolving(const Options& opts)
130 {
131 return opts.smt.incrementalSolvingWasSetByUser;
132 }
133 bool wasSetByUserInteractive(const Options& opts)
134 {
135 return opts.driver.interactiveWasSetByUser;
136 }
137
138 } // namespace cvc5::options