GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/smt_options.h Lines: 35 36 97.2 %
Date: 2021-08-20 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Mathias Preiner, Aina Niemetz
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
 * Contains code for handling command-line options.
14
 *
15
 * For each <module>_options.toml configuration file, mkoptions.py
16
 * expands this template and generates a <module>_options.h file.
17
 */
18
19
#include "cvc5_private.h"
20
21
#ifndef CVC5__OPTIONS__SMT_H
22
#define CVC5__OPTIONS__SMT_H
23
24
#include "options/options.h"
25
26
// clang-format off
27
#include "options/managed_streams.h"
28
#include <iostream>
29
// clang-format on
30
31
namespace cvc5::options {
32
33
// clang-format off
34
35
enum class BlockModelsMode
36
{
37
  LITERALS,
38
  VALUES,
39
  NONE
40
};
41
42
static constexpr size_t BlockModelsMode__numValues = 3;
43
44
std::ostream& operator<<(std::ostream& os, BlockModelsMode mode);
45
BlockModelsMode stringToBlockModelsMode(const std::string& optarg);
46
47
enum class IandMode
48
{
49
  BITWISE,
50
  VALUE,
51
  SUM
52
};
53
54
static constexpr size_t IandMode__numValues = 3;
55
56
std::ostream& operator<<(std::ostream& os, IandMode mode);
57
IandMode stringToIandMode(const std::string& optarg);
58
59
enum class ModelCoresMode
60
{
61
  SIMPLE,
62
  NON_IMPLIED,
63
  NONE
64
};
65
66
static constexpr size_t ModelCoresMode__numValues = 3;
67
68
std::ostream& operator<<(std::ostream& os, ModelCoresMode mode);
69
ModelCoresMode stringToModelCoresMode(const std::string& optarg);
70
71
enum class ModelUninterpPrintMode
72
{
73
  DeclSortAndFun,
74
  DeclFun,
75
  DtEnum,
76
  None
77
};
78
79
static constexpr size_t ModelUninterpPrintMode__numValues = 4;
80
81
std::ostream& operator<<(std::ostream& os, ModelUninterpPrintMode mode);
82
ModelUninterpPrintMode stringToModelUninterpPrintMode(const std::string& optarg);
83
84
enum class ProduceInterpols
85
{
86
  ASSUMPTIONS,
87
  DEFAULT,
88
  CONJECTURE,
89
  SHARED,
90
  ALL,
91
  NONE
92
};
93
94
static constexpr size_t ProduceInterpols__numValues = 6;
95
96
std::ostream& operator<<(std::ostream& os, ProduceInterpols mode);
97
ProduceInterpols stringToProduceInterpols(const std::string& optarg);
98
99
enum class SimplificationMode
100
{
101
  BATCH,
102
  NONE
103
};
104
105
static constexpr size_t SimplificationMode__numValues = 2;
106
107
std::ostream& operator<<(std::ostream& os, SimplificationMode mode);
108
SimplificationMode stringToSimplificationMode(const std::string& optarg);
109
110
enum class SolveBVAsIntMode
111
{
112
  IAND,
113
  OFF,
114
  BV,
115
  SUM
116
};
117
118
static constexpr size_t SolveBVAsIntMode__numValues = 4;
119
120
std::ostream& operator<<(std::ostream& os, SolveBVAsIntMode mode);
121
SolveBVAsIntMode stringToSolveBVAsIntMode(const std::string& optarg);
122
123
enum class SygusSolutionOutMode
124
{
125
  STATUS_OR_DEF,
126
  STATUS_AND_DEF,
127
  STANDARD,
128
  STATUS
129
};
130
131
static constexpr size_t SygusSolutionOutMode__numValues = 4;
132
133
std::ostream& operator<<(std::ostream& os, SygusSolutionOutMode mode);
134
SygusSolutionOutMode stringToSygusSolutionOutMode(const std::string& optarg);
135
136
enum class UnsatCoresMode
137
{
138
  ASSUMPTIONS,
139
  OFF,
140
  SAT_PROOF,
141
  FULL_PROOF
142
};
143
144
static constexpr size_t UnsatCoresMode__numValues = 4;
145
146
std::ostream& operator<<(std::ostream& os, UnsatCoresMode mode);
147
UnsatCoresMode stringToUnsatCoresMode(const std::string& optarg);
148
// clang-format on
149
150
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
151
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
152
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
153
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
154
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
155
156
69277
struct HolderSMT
157
{
158
// clang-format off
159
  bool abstractValues = false;
160
  bool abstractValuesWasSetByUser = false;
161
  bool ackermann = false;
162
  bool ackermannWasSetByUser = false;
163
  BlockModelsMode blockModelsMode = BlockModelsMode::NONE;
164
  bool blockModelsModeWasSetByUser = false;
165
  uint64_t BVAndIntegerGranularity = 1;
166
  bool BVAndIntegerGranularityWasSetByUser = false;
167
  bool checkAbducts = false;
168
  bool checkAbductsWasSetByUser = false;
169
  bool checkInterpols = false;
170
  bool checkInterpolsWasSetByUser = false;
171
  bool checkModels;
172
  bool checkModelsWasSetByUser = false;
173
  bool checkProofs;
174
  bool checkProofsWasSetByUser = false;
175
  bool checkSynthSol = false;
176
  bool checkSynthSolWasSetByUser = false;
177
  bool checkUnsatCores;
178
  bool checkUnsatCoresWasSetByUser = false;
179
  bool debugCheckModels;
180
  bool debugCheckModelsWasSetByUser = false;
181
  ManagedOut dumpToFileName;
182
  bool dumpToFileNameWasSetByUser = false;
183
  std::string dumpModeString;
184
  bool dumpModeStringWasSetByUser = false;
185
  bool earlyIteRemoval = false;
186
  bool earlyIteRemovalWasSetByUser = false;
187
  bool expandDefinitions = false;
188
  bool expandDefinitionsWasSetByUser = false;
189
  bool extRewPrep = false;
190
  bool extRewPrepWasSetByUser = false;
191
  bool extRewPrepAgg = false;
192
  bool extRewPrepAggWasSetByUser = false;
193
  bool foreignTheoryRewrite = false;
194
  bool foreignTheoryRewriteWasSetByUser = false;
195
  IandMode iandMode = IandMode::VALUE;
196
  bool iandModeWasSetByUser = false;
197
  bool interactiveMode;
198
  bool interactiveModeWasSetByUser = false;
199
  bool doITESimp;
200
  bool doITESimpWasSetByUser = false;
201
  bool learnedRewrite = false;
202
  bool learnedRewriteWasSetByUser = false;
203
  bool minimalUnsatCores = false;
204
  bool minimalUnsatCoresWasSetByUser = false;
205
  ModelCoresMode modelCoresMode = ModelCoresMode::NONE;
206
  bool modelCoresModeWasSetByUser = false;
207
  ModelUninterpPrintMode modelUninterpPrint = ModelUninterpPrintMode::None;
208
  bool modelUninterpPrintWasSetByUser = false;
209
  bool modelWitnessValue = false;
210
  bool modelWitnessValueWasSetByUser = false;
211
  bool doITESimpOnRepeat = false;
212
  bool doITESimpOnRepeatWasSetByUser = false;
213
  bool produceAbducts = false;
214
  bool produceAbductsWasSetByUser = false;
215
  bool produceAssertions;
216
  bool produceAssertionsWasSetByUser = false;
217
  bool produceAssignments = false;
218
  bool produceAssignmentsWasSetByUser = false;
219
  ProduceInterpols produceInterpols = ProduceInterpols::NONE;
220
  bool produceInterpolsWasSetByUser = false;
221
  bool produceModels = false;
222
  bool produceModelsWasSetByUser = false;
223
  bool produceProofs = false;
224
  bool produceProofsWasSetByUser = false;
225
  bool unsatAssumptions = false;
226
  bool unsatAssumptionsWasSetByUser = false;
227
  bool unsatCores;
228
  bool unsatCoresWasSetByUser = false;
229
  bool repeatSimp;
230
  bool repeatSimpWasSetByUser = false;
231
  bool compressItes = false;
232
  bool compressItesWasSetByUser = false;
233
  uint64_t zombieHuntThreshold = 524288;
234
  bool zombieHuntThresholdWasSetByUser = false;
235
  bool simplifyWithCareEnabled = false;
236
  bool simplifyWithCareEnabledWasSetByUser = false;
237
  SimplificationMode simplificationMode = SimplificationMode::BATCH;
238
  bool simplificationModeWasSetByUser = false;
239
  SolveBVAsIntMode solveBVAsInt = SolveBVAsIntMode::OFF;
240
  bool solveBVAsIntWasSetByUser = false;
241
  uint64_t solveIntAsBV = 0;
242
  bool solveIntAsBVWasSetByUser = false;
243
  bool solveRealAsInt = false;
244
  bool solveRealAsIntWasSetByUser = false;
245
  bool sortInference = false;
246
  bool sortInferenceWasSetByUser = false;
247
  bool doStaticLearning = true;
248
  bool doStaticLearningWasSetByUser = false;
249
  SygusSolutionOutMode sygusOut = SygusSolutionOutMode::STANDARD;
250
  bool sygusOutWasSetByUser = false;
251
  bool sygusPrintCallbacks = true;
252
  bool sygusPrintCallbacksWasSetByUser = false;
253
  bool unconstrainedSimp = false;
254
  bool unconstrainedSimpWasSetByUser = false;
255
  UnsatCoresMode unsatCoresMode = UnsatCoresMode::OFF;
256
  bool unsatCoresModeWasSetByUser = false;
257
// clang-format on
258
};
259
260
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
261
262
// clang-format off
263
8
inline bool abstractValues() { return Options::current().smt.abstractValues; }
264
13750
inline bool ackermann() { return Options::current().smt.ackermann; }
265
inline BlockModelsMode blockModelsMode() { return Options::current().smt.blockModelsMode; }
266
15
inline uint64_t BVAndIntegerGranularity() { return Options::current().smt.BVAndIntegerGranularity; }
267
14
inline bool checkAbducts() { return Options::current().smt.checkAbducts; }
268
10
inline bool checkInterpols() { return Options::current().smt.checkInterpols; }
269
inline bool checkModels() { return Options::current().smt.checkModels; }
270
inline bool checkProofs() { return Options::current().smt.checkProofs; }
271
197
inline bool checkSynthSol() { return Options::current().smt.checkSynthSol; }
272
inline bool checkUnsatCores() { return Options::current().smt.checkUnsatCores; }
273
2729
inline bool debugCheckModels() { return Options::current().smt.debugCheckModels; }
274
inline ManagedOut dumpToFileName() { return Options::current().smt.dumpToFileName; }
275
inline std::string dumpModeString() { return Options::current().smt.dumpModeString; }
276
13750
inline bool earlyIteRemoval() { return Options::current().smt.earlyIteRemoval; }
277
inline bool expandDefinitions() { return Options::current().smt.expandDefinitions; }
278
13750
inline bool extRewPrep() { return Options::current().smt.extRewPrep; }
279
24
inline bool extRewPrepAgg() { return Options::current().smt.extRewPrepAgg; }
280
13750
inline bool foreignTheoryRewrite() { return Options::current().smt.foreignTheoryRewrite; }
281
inline IandMode iandMode() { return Options::current().smt.iandMode; }
282
inline bool interactiveMode() { return Options::current().smt.interactiveMode; }
283
12916
inline bool doITESimp() { return Options::current().smt.doITESimp; }
284
13750
inline bool learnedRewrite() { return Options::current().smt.learnedRewrite; }
285
1425
inline bool minimalUnsatCores() { return Options::current().smt.minimalUnsatCores; }
286
inline ModelCoresMode modelCoresMode() { return Options::current().smt.modelCoresMode; }
287
45
inline ModelUninterpPrintMode modelUninterpPrint() { return Options::current().smt.modelUninterpPrint; }
288
inline bool modelWitnessValue() { return Options::current().smt.modelWitnessValue; }
289
inline bool doITESimpOnRepeat() { return Options::current().smt.doITESimpOnRepeat; }
290
16
inline bool produceAbducts() { return Options::current().smt.produceAbducts; }
291
9856
inline bool produceAssertions() { return Options::current().smt.produceAssertions; }
292
inline bool produceAssignments() { return Options::current().smt.produceAssignments; }
293
53
inline ProduceInterpols produceInterpols() { return Options::current().smt.produceInterpols; }
294
19293
inline bool produceModels() { return Options::current().smt.produceModels; }
295
38718210
inline bool produceProofs() { return Options::current().smt.produceProofs; }
296
inline bool unsatAssumptions() { return Options::current().smt.unsatAssumptions; }
297
13008196
inline bool unsatCores() { return Options::current().smt.unsatCores; }
298
26666
inline bool repeatSimp() { return Options::current().smt.repeatSimp; }
299
2
inline bool compressItes() { return Options::current().smt.compressItes; }
300
2
inline uint64_t zombieHuntThreshold() { return Options::current().smt.zombieHuntThreshold; }
301
2
inline bool simplifyWithCareEnabled() { return Options::current().smt.simplifyWithCareEnabled; }
302
14471
inline SimplificationMode simplificationMode() { return Options::current().smt.simplificationMode; }
303
13830
inline SolveBVAsIntMode solveBVAsInt() { return Options::current().smt.solveBVAsInt; }
304
28970
inline uint64_t solveIntAsBV() { return Options::current().smt.solveIntAsBV; }
305
28942
inline bool solveRealAsInt() { return Options::current().smt.solveRealAsInt; }
306
23630
inline bool sortInference() { return Options::current().smt.sortInference; }
307
13750
inline bool doStaticLearning() { return Options::current().smt.doStaticLearning; }
308
705
inline SygusSolutionOutMode sygusOut() { return Options::current().smt.sygusOut; }
309
inline bool sygusPrintCallbacks() { return Options::current().smt.sygusPrintCallbacks; }
310
26666
inline bool unconstrainedSimp() { return Options::current().smt.unconstrainedSimp; }
311
1130913
inline UnsatCoresMode unsatCoresMode() { return Options::current().smt.unsatCoresMode; }
312
// clang-format on
313
314
namespace smt
315
{
316
// clang-format off
317
static constexpr const char* abstractValues__name = "abstract-values";
318
static constexpr const char* ackermann__name = "ackermann";
319
static constexpr const char* blockModelsMode__name = "block-models";
320
static constexpr const char* BVAndIntegerGranularity__name = "bvand-integer-granularity";
321
static constexpr const char* checkAbducts__name = "check-abducts";
322
static constexpr const char* checkInterpols__name = "check-interpols";
323
static constexpr const char* checkModels__name = "check-models";
324
static constexpr const char* checkProofs__name = "check-proofs";
325
static constexpr const char* checkSynthSol__name = "check-synth-sol";
326
static constexpr const char* checkUnsatCores__name = "check-unsat-cores";
327
static constexpr const char* debugCheckModels__name = "debug-check-models";
328
static constexpr const char* dumpToFileName__name = "dump-to";
329
static constexpr const char* dumpModeString__name = "dump";
330
static constexpr const char* earlyIteRemoval__name = "early-ite-removal";
331
static constexpr const char* expandDefinitions__name = "expand-definitions";
332
static constexpr const char* extRewPrep__name = "ext-rew-prep";
333
static constexpr const char* extRewPrepAgg__name = "ext-rew-prep-agg";
334
static constexpr const char* foreignTheoryRewrite__name = "foreign-theory-rewrite";
335
static constexpr const char* iandMode__name = "iand-mode";
336
static constexpr const char* interactiveMode__name = "interactive-mode";
337
static constexpr const char* doITESimp__name = "ite-simp";
338
static constexpr const char* learnedRewrite__name = "learned-rewrite";
339
static constexpr const char* minimalUnsatCores__name = "minimal-unsat-cores";
340
static constexpr const char* modelCoresMode__name = "model-cores";
341
static constexpr const char* modelUninterpPrint__name = "model-u-print";
342
static constexpr const char* modelWitnessValue__name = "model-witness-value";
343
static constexpr const char* doITESimpOnRepeat__name = "on-repeat-ite-simp";
344
static constexpr const char* produceAbducts__name = "produce-abducts";
345
static constexpr const char* produceAssertions__name = "produce-assertions";
346
static constexpr const char* produceAssignments__name = "produce-assignments";
347
static constexpr const char* produceInterpols__name = "produce-interpols";
348
static constexpr const char* produceModels__name = "produce-models";
349
static constexpr const char* produceProofs__name = "produce-proofs";
350
static constexpr const char* unsatAssumptions__name = "produce-unsat-assumptions";
351
static constexpr const char* unsatCores__name = "produce-unsat-cores";
352
static constexpr const char* repeatSimp__name = "repeat-simp";
353
static constexpr const char* compressItes__name = "simp-ite-compress";
354
static constexpr const char* zombieHuntThreshold__name = "simp-ite-hunt-zombies";
355
static constexpr const char* simplifyWithCareEnabled__name = "simp-with-care";
356
static constexpr const char* simplificationMode__name = "simplification";
357
static constexpr const char* solveBVAsInt__name = "solve-bv-as-int";
358
static constexpr const char* solveIntAsBV__name = "solve-int-as-bv";
359
static constexpr const char* solveRealAsInt__name = "solve-real-as-int";
360
static constexpr const char* sortInference__name = "sort-inference";
361
static constexpr const char* doStaticLearning__name = "static-learning";
362
static constexpr const char* sygusOut__name = "sygus-out";
363
static constexpr const char* sygusPrintCallbacks__name = "sygus-print-callbacks";
364
static constexpr const char* unconstrainedSimp__name = "unconstrained-simp";
365
static constexpr const char* unsatCoresMode__name = "unsat-cores-mode";
366
367
void setDefaultAbstractValues(Options& opts, bool value);void setDefaultAckermann(Options& opts, bool value);void setDefaultBlockModelsMode(Options& opts, BlockModelsMode value);void setDefaultBVAndIntegerGranularity(Options& opts, uint64_t value);void setDefaultCheckAbducts(Options& opts, bool value);void setDefaultCheckInterpols(Options& opts, bool value);void setDefaultCheckModels(Options& opts, bool value);void setDefaultCheckProofs(Options& opts, bool value);void setDefaultCheckSynthSol(Options& opts, bool value);void setDefaultCheckUnsatCores(Options& opts, bool value);void setDefaultDebugCheckModels(Options& opts, bool value);void setDefaultDumpToFileName(Options& opts, ManagedOut value);void setDefaultDumpModeString(Options& opts, std::string value);void setDefaultEarlyIteRemoval(Options& opts, bool value);void setDefaultExpandDefinitions(Options& opts, bool value);void setDefaultExtRewPrep(Options& opts, bool value);void setDefaultExtRewPrepAgg(Options& opts, bool value);void setDefaultForeignTheoryRewrite(Options& opts, bool value);void setDefaultIandMode(Options& opts, IandMode value);void setDefaultInteractiveMode(Options& opts, bool value);void setDefaultDoITESimp(Options& opts, bool value);void setDefaultLearnedRewrite(Options& opts, bool value);void setDefaultMinimalUnsatCores(Options& opts, bool value);void setDefaultModelCoresMode(Options& opts, ModelCoresMode value);void setDefaultModelUninterpPrint(Options& opts, ModelUninterpPrintMode value);void setDefaultModelWitnessValue(Options& opts, bool value);void setDefaultDoITESimpOnRepeat(Options& opts, bool value);void setDefaultProduceAbducts(Options& opts, bool value);void setDefaultProduceAssertions(Options& opts, bool value);void setDefaultProduceAssignments(Options& opts, bool value);void setDefaultProduceInterpols(Options& opts, ProduceInterpols value);void setDefaultProduceModels(Options& opts, bool value);void setDefaultProduceProofs(Options& opts, bool value);void setDefaultUnsatAssumptions(Options& opts, bool value);void setDefaultUnsatCores(Options& opts, bool value);void setDefaultRepeatSimp(Options& opts, bool value);void setDefaultCompressItes(Options& opts, bool value);void setDefaultZombieHuntThreshold(Options& opts, uint64_t value);void setDefaultSimplifyWithCareEnabled(Options& opts, bool value);void setDefaultSimplificationMode(Options& opts, SimplificationMode value);void setDefaultSolveBVAsInt(Options& opts, SolveBVAsIntMode value);void setDefaultSolveIntAsBV(Options& opts, uint64_t value);void setDefaultSolveRealAsInt(Options& opts, bool value);void setDefaultSortInference(Options& opts, bool value);void setDefaultDoStaticLearning(Options& opts, bool value);void setDefaultSygusOut(Options& opts, SygusSolutionOutMode value);void setDefaultSygusPrintCallbacks(Options& opts, bool value);void setDefaultUnconstrainedSimp(Options& opts, bool value);void setDefaultUnsatCoresMode(Options& opts, UnsatCoresMode value);
368
// clang-format on
369
}
370
371
}  // namespace cvc5::options
372
373
#endif /* CVC5__OPTIONS__SMT_H */