GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/options/options_public_functions.cpp Lines: 90 103 87.4 %
Date: 2021-03-22 Branches: 28 90 31.1 %

Line Exec Source
1
/*********************                                                        */
2
/*! \file options_public_functions.cpp
3
 ** \verbatim
4
 ** Top contributors (to current version):
5
 **   Tim King, Andrew Reynolds, Gereon Kremer
6
 ** This file is part of the CVC4 project.
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.\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/option_exception.h"
32
#include "options/parser_options.h"
33
#include "options/printer_modes.h"
34
#include "options/printer_options.h"
35
#include "options/quantifiers_options.h"
36
#include "options/smt_options.h"
37
#include "options/uf_options.h"
38
39
namespace CVC4 {
40
41
// Get accessor functions.
42
846438
InputLanguage Options::getInputLanguage() const {
43
846438
  return (*this)[options::inputLanguage];
44
}
45
46
89
options::InstFormatMode Options::getInstFormatMode() const
47
{
48
89
  return (*this)[options::instFormatMode];
49
}
50
51
10933
OutputLanguage Options::getOutputLanguage() const {
52
10933
  return (*this)[options::outputLanguage];
53
}
54
55
2826567
bool Options::getUfHo() const { return (*this)[options::ufHo]; }
56
57
283111
bool Options::getDumpInstantiations() const{
58
566238
  return (*this)[options::dumpInstantiations];
59
}
60
61
283111
bool Options::getDumpModels() const{
62
283111
  return (*this)[options::dumpModels];
63
}
64
65
283111
bool Options::getDumpProofs() const{
66
283111
  return (*this)[options::dumpProofs];
67
}
68
69
283111
bool Options::getDumpUnsatCores() const{
70
  // dump unsat cores full enables dumpUnsatCores
71
283111
  return (*this)[options::dumpUnsatCores]
72
283111
         || (*this)[options::dumpUnsatCoresFull];
73
}
74
75
5434
bool Options::getEarlyExit() const{
76
16302
  return (*this)[options::earlyExit];
77
}
78
79
5686
bool Options::getFilesystemAccess() const{
80
5686
  return (*this)[options::filesystemAccess];
81
}
82
83
23
bool Options::getForceNoLimitCpuWhileDump() const{
84
46
  return (*this)[options::forceNoLimitCpuWhileDump];
85
}
86
87
5456
bool Options::getHelp() const{
88
10912
  return (*this)[options::help];
89
}
90
91
bool Options::getIncrementalSolving() const{
92
  return (*this)[options::incrementalSolving];
93
}
94
95
5455
bool Options::getInteractive() const{
96
21822
  return (*this)[options::interactive];
97
}
98
99
28
bool Options::getInteractivePrompt() const{
100
56
  return (*this)[options::interactivePrompt];
101
}
102
103
5456
bool Options::getLanguageHelp() const{
104
5456
  return (*this)[options::languageHelp];
105
}
106
107
5686
bool Options::getMemoryMap() const{
108
11372
  return (*this)[options::memoryMap];
109
}
110
111
292338
bool Options::getParseOnly() const{
112
584676
  return (*this)[options::parseOnly];
113
}
114
115
bool Options::getProduceModels() const{
116
  return (*this)[options::produceModels];
117
}
118
119
5456
bool Options::getSegvSpin() const{
120
10912
  return (*this)[options::segvSpin];
121
}
122
123
5686
bool Options::getSemanticChecks() const{
124
11372
  return (*this)[options::semanticChecks];
125
}
126
127
5455
bool Options::getStatistics() const{
128
  // statsEveryQuery enables stats
129
24030
  return (*this)[options::statistics] || (*this)[options::statsEveryQuery];
130
}
131
132
7665
bool Options::getStatsEveryQuery() const{
133
7665
  return (*this)[options::statsEveryQuery];
134
}
135
136
bool Options::getStatsHideZeros() const{
137
  return (*this)[options::statsHideZeros];
138
}
139
140
5686
bool Options::getStrictParsing() const{
141
11392
  return (*this)[options::strictParsing];
142
}
143
144
5455
int Options::getTearDownIncremental() const{
145
10910
  return (*this)[options::tearDownIncremental];
146
}
147
148
5456
unsigned long Options::getCumulativeTimeLimit() const {
149
10912
  return (*this)[options::cumulativeMillisecondLimit];
150
}
151
152
5456
bool Options::getVersion() const{
153
10912
  return (*this)[options::version];
154
}
155
156
9
const std::string& Options::getForceLogicString() const{
157
5734
  return (*this)[options::forceLogicString];
158
}
159
160
566277
int Options::getVerbosity() const{
161
566277
  return (*this)[options::verbosity];
162
}
163
164
12
std::istream* Options::getIn() const{
165
24
  return (*this)[options::in];
166
}
167
168
10874
std::ostream* Options::getErr(){
169
10874
  return (*this)[options::err];
170
}
171
172
301019
std::ostream* Options::getOut(){
173
301019
  return (*this)[options::out];
174
}
175
176
12
std::ostream* Options::getOutConst() const{
177
  // #warning "Remove Options::getOutConst"
178
12
  return (*this)[options::out];
179
}
180
181
5456
std::string Options::getBinaryName() const{
182
10912
  return (*this)[options::binary_name];
183
}
184
185
unsigned Options::getParseStep() const{
186
  return (*this)[options::parseStep];
187
}
188
189
std::ostream* Options::currentGetOut() {
190
  return current()->getOut();
191
}
192
193
194
// TODO: Document these.
195
196
5058
void Options::setInputLanguage(InputLanguage value) {
197
5058
  set(options::inputLanguage, value);
198
5058
}
199
200
5456
void Options::setInteractive(bool value) {
201
5456
  set(options::interactive, value);
202
5456
}
203
204
void Options::setOut(std::ostream* value) {
205
  set(options::out, value);
206
}
207
208
5457
void Options::setOutputLanguage(OutputLanguage value) {
209
5457
  set(options::outputLanguage, value);
210
5457
}
211
212
5434
bool Options::wasSetByUserEarlyExit() const {
213
5434
  return wasSetByUser(options::earlyExit);
214
}
215
216
5698
bool Options::wasSetByUserForceLogicString() const {
217
5698
  return wasSetByUser(options::forceLogicString);
218
}
219
220
5455
bool Options::wasSetByUserIncrementalSolving() const {
221
5455
  return wasSetByUser(options::incrementalSolving);
222
}
223
224
5456
bool Options::wasSetByUserInteractive() const {
225
5456
  return wasSetByUser(options::interactive);
226
}
227
228
229
5434
void Options::flushErr() {
230
5434
  if(getErr() != NULL) {
231
5434
    *(getErr()) << std::flush;
232
  }
233
5434
}
234
235
5434
void Options::flushOut() {
236
5434
  if(getOut() != NULL) {
237
5434
    *(getOut()) << std::flush;
238
  }
239
5434
}
240
241
703552
}/* CVC4 namespace */