GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/options/options_public_functions.cpp Lines: 90 103 87.4 %
Date: 2021-03-23 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
846460
InputLanguage Options::getInputLanguage() const {
43
846460
  return (*this)[options::inputLanguage];
44
}
45
46
89
options::InstFormatMode Options::getInstFormatMode() const
47
{
48
89
  return (*this)[options::instFormatMode];
49
}
50
51
10937
OutputLanguage Options::getOutputLanguage() const {
52
10937
  return (*this)[options::outputLanguage];
53
}
54
55
2826589
bool Options::getUfHo() const { return (*this)[options::ufHo]; }
56
57
283121
bool Options::getDumpInstantiations() const{
58
566258
  return (*this)[options::dumpInstantiations];
59
}
60
61
283121
bool Options::getDumpModels() const{
62
283121
  return (*this)[options::dumpModels];
63
}
64
65
283121
bool Options::getDumpProofs() const{
66
283121
  return (*this)[options::dumpProofs];
67
}
68
69
283121
bool Options::getDumpUnsatCores() const{
70
  // dump unsat cores full enables dumpUnsatCores
71
283121
  return (*this)[options::dumpUnsatCores]
72
283121
         || (*this)[options::dumpUnsatCoresFull];
73
}
74
75
5436
bool Options::getEarlyExit() const{
76
16308
  return (*this)[options::earlyExit];
77
}
78
79
5688
bool Options::getFilesystemAccess() const{
80
5688
  return (*this)[options::filesystemAccess];
81
}
82
83
23
bool Options::getForceNoLimitCpuWhileDump() const{
84
46
  return (*this)[options::forceNoLimitCpuWhileDump];
85
}
86
87
5458
bool Options::getHelp() const{
88
10916
  return (*this)[options::help];
89
}
90
91
bool Options::getIncrementalSolving() const{
92
  return (*this)[options::incrementalSolving];
93
}
94
95
5457
bool Options::getInteractive() const{
96
21830
  return (*this)[options::interactive];
97
}
98
99
28
bool Options::getInteractivePrompt() const{
100
56
  return (*this)[options::interactivePrompt];
101
}
102
103
5458
bool Options::getLanguageHelp() const{
104
5458
  return (*this)[options::languageHelp];
105
}
106
107
5688
bool Options::getMemoryMap() const{
108
11376
  return (*this)[options::memoryMap];
109
}
110
111
292350
bool Options::getParseOnly() const{
112
584700
  return (*this)[options::parseOnly];
113
}
114
115
bool Options::getProduceModels() const{
116
  return (*this)[options::produceModels];
117
}
118
119
5458
bool Options::getSegvSpin() const{
120
10916
  return (*this)[options::segvSpin];
121
}
122
123
5688
bool Options::getSemanticChecks() const{
124
11376
  return (*this)[options::semanticChecks];
125
}
126
127
5457
bool Options::getStatistics() const{
128
  // statsEveryQuery enables stats
129
24038
  return (*this)[options::statistics] || (*this)[options::statsEveryQuery];
130
}
131
132
7667
bool Options::getStatsEveryQuery() const{
133
7667
  return (*this)[options::statsEveryQuery];
134
}
135
136
bool Options::getStatsHideZeros() const{
137
  return (*this)[options::statsHideZeros];
138
}
139
140
5688
bool Options::getStrictParsing() const{
141
11396
  return (*this)[options::strictParsing];
142
}
143
144
5457
int Options::getTearDownIncremental() const{
145
10914
  return (*this)[options::tearDownIncremental];
146
}
147
148
5458
unsigned long Options::getCumulativeTimeLimit() const {
149
10916
  return (*this)[options::cumulativeMillisecondLimit];
150
}
151
152
5458
bool Options::getVersion() const{
153
10916
  return (*this)[options::version];
154
}
155
156
9
const std::string& Options::getForceLogicString() const{
157
5736
  return (*this)[options::forceLogicString];
158
}
159
160
566297
int Options::getVerbosity() const{
161
566297
  return (*this)[options::verbosity];
162
}
163
164
12
std::istream* Options::getIn() const{
165
24
  return (*this)[options::in];
166
}
167
168
10878
std::ostream* Options::getErr(){
169
10878
  return (*this)[options::err];
170
}
171
172
301035
std::ostream* Options::getOut(){
173
301035
  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
5458
std::string Options::getBinaryName() const{
182
10916
  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
5060
void Options::setInputLanguage(InputLanguage value) {
197
5060
  set(options::inputLanguage, value);
198
5060
}
199
200
5458
void Options::setInteractive(bool value) {
201
5458
  set(options::interactive, value);
202
5458
}
203
204
void Options::setOut(std::ostream* value) {
205
  set(options::out, value);
206
}
207
208
5459
void Options::setOutputLanguage(OutputLanguage value) {
209
5459
  set(options::outputLanguage, value);
210
5459
}
211
212
5436
bool Options::wasSetByUserEarlyExit() const {
213
5436
  return wasSetByUser(options::earlyExit);
214
}
215
216
5700
bool Options::wasSetByUserForceLogicString() const {
217
5700
  return wasSetByUser(options::forceLogicString);
218
}
219
220
5457
bool Options::wasSetByUserIncrementalSolving() const {
221
5457
  return wasSetByUser(options::incrementalSolving);
222
}
223
224
5458
bool Options::wasSetByUserInteractive() const {
225
5458
  return wasSetByUser(options::interactive);
226
}
227
228
229
5436
void Options::flushErr() {
230
5436
  if(getErr() != NULL) {
231
5436
    *(getErr()) << std::flush;
232
  }
233
5436
}
234
235
5436
void Options::flushOut() {
236
5436
  if(getOut() != NULL) {
237
5436
    *(getOut()) << std::flush;
238
  }
239
5436
}
240
241
703619
}/* CVC4 namespace */