GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/smt_options.h Lines: 30 32 93.8 %
Date: 2021-09-10 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
  NONE,
39
  VALUES
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 DifficultyMode
48
{
49
  LEMMA_LITERAL,
50
  MODEL_CHECK
51
};
52
53
static constexpr size_t DifficultyMode__numValues = 2;
54
55
std::ostream& operator<<(std::ostream& os, DifficultyMode mode);
56
DifficultyMode stringToDifficultyMode(const std::string& optarg);
57
58
enum class IandMode
59
{
60
  BITWISE,
61
  VALUE,
62
  SUM
63
};
64
65
static constexpr size_t IandMode__numValues = 3;
66
67
std::ostream& operator<<(std::ostream& os, IandMode mode);
68
IandMode stringToIandMode(const std::string& optarg);
69
70
enum class ModelCoresMode
71
{
72
  NONE,
73
  SIMPLE,
74
  NON_IMPLIED
75
};
76
77
static constexpr size_t ModelCoresMode__numValues = 3;
78
79
std::ostream& operator<<(std::ostream& os, ModelCoresMode mode);
80
ModelCoresMode stringToModelCoresMode(const std::string& optarg);
81
82
enum class ModelUninterpPrintMode
83
{
84
  DeclFun,
85
  None,
86
  DeclSortAndFun
87
};
88
89
static constexpr size_t ModelUninterpPrintMode__numValues = 3;
90
91
std::ostream& operator<<(std::ostream& os, ModelUninterpPrintMode mode);
92
ModelUninterpPrintMode stringToModelUninterpPrintMode(const std::string& optarg);
93
94
enum class ProduceInterpols
95
{
96
  ASSUMPTIONS,
97
  SHARED,
98
  CONJECTURE,
99
  NONE,
100
  ALL,
101
  DEFAULT
102
};
103
104
static constexpr size_t ProduceInterpols__numValues = 6;
105
106
std::ostream& operator<<(std::ostream& os, ProduceInterpols mode);
107
ProduceInterpols stringToProduceInterpols(const std::string& optarg);
108
109
enum class SimplificationMode
110
{
111
  NONE,
112
  BATCH
113
};
114
115
static constexpr size_t SimplificationMode__numValues = 2;
116
117
std::ostream& operator<<(std::ostream& os, SimplificationMode mode);
118
SimplificationMode stringToSimplificationMode(const std::string& optarg);
119
120
enum class SolveBVAsIntMode
121
{
122
  BV,
123
  IAND,
124
  SUM,
125
  OFF
126
};
127
128
static constexpr size_t SolveBVAsIntMode__numValues = 4;
129
130
std::ostream& operator<<(std::ostream& os, SolveBVAsIntMode mode);
131
SolveBVAsIntMode stringToSolveBVAsIntMode(const std::string& optarg);
132
133
enum class SygusSolutionOutMode
134
{
135
  STATUS_OR_DEF,
136
  STATUS_AND_DEF,
137
  STATUS,
138
  STANDARD
139
};
140
141
static constexpr size_t SygusSolutionOutMode__numValues = 4;
142
143
std::ostream& operator<<(std::ostream& os, SygusSolutionOutMode mode);
144
SygusSolutionOutMode stringToSygusSolutionOutMode(const std::string& optarg);
145
146
enum class UnsatCoresMode
147
{
148
  SAT_PROOF,
149
  ASSUMPTIONS,
150
  FULL_PROOF,
151
  OFF
152
};
153
154
static constexpr size_t UnsatCoresMode__numValues = 4;
155
156
std::ostream& operator<<(std::ostream& os, UnsatCoresMode mode);
157
UnsatCoresMode stringToUnsatCoresMode(const std::string& optarg);
158
// clang-format on
159
160
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
161
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
162
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
163
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
164
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
165
166
62564
struct HolderSMT
167
{
168
// clang-format off
169
  bool abstractValues = false;
170
  bool abstractValuesWasSetByUser = false;
171
  bool ackermann = false;
172
  bool ackermannWasSetByUser = false;
173
  BlockModelsMode blockModelsMode = BlockModelsMode::NONE;
174
  bool blockModelsModeWasSetByUser = false;
175
  uint64_t BVAndIntegerGranularity = 1;
176
  bool BVAndIntegerGranularityWasSetByUser = false;
177
  bool checkAbducts = false;
178
  bool checkAbductsWasSetByUser = false;
179
  bool checkInterpols = false;
180
  bool checkInterpolsWasSetByUser = false;
181
  bool checkModels;
182
  bool checkModelsWasSetByUser = false;
183
  bool checkProofs;
184
  bool checkProofsWasSetByUser = false;
185
  bool checkSynthSol = false;
186
  bool checkSynthSolWasSetByUser = false;
187
  bool checkUnsatCores;
188
  bool checkUnsatCoresWasSetByUser = false;
189
  bool debugCheckModels;
190
  bool debugCheckModelsWasSetByUser = false;
191
  DifficultyMode difficultyMode = DifficultyMode::LEMMA_LITERAL;
192
  bool difficultyModeWasSetByUser = false;
193
  ManagedOut dumpToFileName;
194
  bool dumpToFileNameWasSetByUser = false;
195
  std::string dumpModeString;
196
  bool dumpModeStringWasSetByUser = false;
197
  bool earlyIteRemoval = false;
198
  bool earlyIteRemovalWasSetByUser = false;
199
  bool expandDefinitions = false;
200
  bool expandDefinitionsWasSetByUser = false;
201
  bool extRewPrep = false;
202
  bool extRewPrepWasSetByUser = false;
203
  bool extRewPrepAgg = false;
204
  bool extRewPrepAggWasSetByUser = false;
205
  bool foreignTheoryRewrite = false;
206
  bool foreignTheoryRewriteWasSetByUser = false;
207
  IandMode iandMode = IandMode::VALUE;
208
  bool iandModeWasSetByUser = false;
209
  bool interactiveMode;
210
  bool interactiveModeWasSetByUser = false;
211
  bool doITESimp;
212
  bool doITESimpWasSetByUser = false;
213
  bool learnedRewrite = false;
214
  bool learnedRewriteWasSetByUser = false;
215
  bool minimalUnsatCores = false;
216
  bool minimalUnsatCoresWasSetByUser = false;
217
  ModelCoresMode modelCoresMode = ModelCoresMode::NONE;
218
  bool modelCoresModeWasSetByUser = false;
219
  ModelUninterpPrintMode modelUninterpPrint = ModelUninterpPrintMode::None;
220
  bool modelUninterpPrintWasSetByUser = false;
221
  bool modelWitnessValue = false;
222
  bool modelWitnessValueWasSetByUser = false;
223
  bool doITESimpOnRepeat = false;
224
  bool doITESimpOnRepeatWasSetByUser = false;
225
  bool produceAbducts = false;
226
  bool produceAbductsWasSetByUser = false;
227
  bool produceAssertions;
228
  bool produceAssertionsWasSetByUser = false;
229
  bool produceAssignments = false;
230
  bool produceAssignmentsWasSetByUser = false;
231
  ProduceInterpols produceInterpols = ProduceInterpols::NONE;
232
  bool produceInterpolsWasSetByUser = false;
233
  bool produceModels = false;
234
  bool produceModelsWasSetByUser = false;
235
  bool produceProofs = false;
236
  bool produceProofsWasSetByUser = false;
237
  bool unsatAssumptions = false;
238
  bool unsatAssumptionsWasSetByUser = false;
239
  bool unsatCores;
240
  bool unsatCoresWasSetByUser = false;
241
  bool repeatSimp;
242
  bool repeatSimpWasSetByUser = false;
243
  bool compressItes = false;
244
  bool compressItesWasSetByUser = false;
245
  uint64_t zombieHuntThreshold = 524288;
246
  bool zombieHuntThresholdWasSetByUser = false;
247
  bool simplifyWithCareEnabled = false;
248
  bool simplifyWithCareEnabledWasSetByUser = false;
249
  SimplificationMode simplificationMode = SimplificationMode::BATCH;
250
  bool simplificationModeWasSetByUser = false;
251
  SolveBVAsIntMode solveBVAsInt = SolveBVAsIntMode::OFF;
252
  bool solveBVAsIntWasSetByUser = false;
253
  uint64_t solveIntAsBV = 0;
254
  bool solveIntAsBVWasSetByUser = false;
255
  bool solveRealAsInt = false;
256
  bool solveRealAsIntWasSetByUser = false;
257
  bool sortInference = false;
258
  bool sortInferenceWasSetByUser = false;
259
  bool doStaticLearning = true;
260
  bool doStaticLearningWasSetByUser = false;
261
  SygusSolutionOutMode sygusOut = SygusSolutionOutMode::STANDARD;
262
  bool sygusOutWasSetByUser = false;
263
  bool sygusPrintCallbacks = true;
264
  bool sygusPrintCallbacksWasSetByUser = false;
265
  bool unconstrainedSimp = false;
266
  bool unconstrainedSimpWasSetByUser = false;
267
  UnsatCoresMode unsatCoresMode = UnsatCoresMode::OFF;
268
  bool unsatCoresModeWasSetByUser = false;
269
// clang-format on
270
};
271
272
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
273
274
// clang-format off
275
8
inline bool abstractValues() { return Options::current().smt.abstractValues; }
276
13778
inline bool ackermann() { return Options::current().smt.ackermann; }
277
inline BlockModelsMode blockModelsMode() { return Options::current().smt.blockModelsMode; }
278
inline uint64_t BVAndIntegerGranularity() { return Options::current().smt.BVAndIntegerGranularity; }
279
14
inline bool checkAbducts() { return Options::current().smt.checkAbducts; }
280
10
inline bool checkInterpols() { return Options::current().smt.checkInterpols; }
281
inline bool checkModels() { return Options::current().smt.checkModels; }
282
inline bool checkProofs() { return Options::current().smt.checkProofs; }
283
198
inline bool checkSynthSol() { return Options::current().smt.checkSynthSol; }
284
inline bool checkUnsatCores() { return Options::current().smt.checkUnsatCores; }
285
2756
inline bool debugCheckModels() { return Options::current().smt.debugCheckModels; }
286
inline DifficultyMode difficultyMode() { return Options::current().smt.difficultyMode; }
287
inline ManagedOut dumpToFileName() { return Options::current().smt.dumpToFileName; }
288
inline std::string dumpModeString() { return Options::current().smt.dumpModeString; }
289
13778
inline bool earlyIteRemoval() { return Options::current().smt.earlyIteRemoval; }
290
inline bool expandDefinitions() { return Options::current().smt.expandDefinitions; }
291
13778
inline bool extRewPrep() { return Options::current().smt.extRewPrep; }
292
inline bool extRewPrepAgg() { return Options::current().smt.extRewPrepAgg; }
293
13778
inline bool foreignTheoryRewrite() { return Options::current().smt.foreignTheoryRewrite; }
294
inline IandMode iandMode() { return Options::current().smt.iandMode; }
295
inline bool interactiveMode() { return Options::current().smt.interactiveMode; }
296
12928
inline bool doITESimp() { return Options::current().smt.doITESimp; }
297
13778
inline bool learnedRewrite() { return Options::current().smt.learnedRewrite; }
298
1428
inline bool minimalUnsatCores() { return Options::current().smt.minimalUnsatCores; }
299
inline ModelCoresMode modelCoresMode() { return Options::current().smt.modelCoresMode; }
300
14
inline ModelUninterpPrintMode modelUninterpPrint() { return Options::current().smt.modelUninterpPrint; }
301
inline bool modelWitnessValue() { return Options::current().smt.modelWitnessValue; }
302
inline bool doITESimpOnRepeat() { return Options::current().smt.doITESimpOnRepeat; }
303
16
inline bool produceAbducts() { return Options::current().smt.produceAbducts; }
304
9913
inline bool produceAssertions() { return Options::current().smt.produceAssertions; }
305
inline bool produceAssignments() { return Options::current().smt.produceAssignments; }
306
53
inline ProduceInterpols produceInterpols() { return Options::current().smt.produceInterpols; }
307
19011
inline bool produceModels() { return Options::current().smt.produceModels; }
308
38180018
inline bool produceProofs() { return Options::current().smt.produceProofs; }
309
inline bool unsatAssumptions() { return Options::current().smt.unsatAssumptions; }
310
13024926
inline bool unsatCores() { return Options::current().smt.unsatCores; }
311
26706
inline bool repeatSimp() { return Options::current().smt.repeatSimp; }
312
inline bool compressItes() { return Options::current().smt.compressItes; }
313
inline uint64_t zombieHuntThreshold() { return Options::current().smt.zombieHuntThreshold; }
314
inline bool simplifyWithCareEnabled() { return Options::current().smt.simplifyWithCareEnabled; }
315
14499
inline SimplificationMode simplificationMode() { return Options::current().smt.simplificationMode; }
316
13778
inline SolveBVAsIntMode solveBVAsInt() { return Options::current().smt.solveBVAsInt; }
317
28987
inline uint64_t solveIntAsBV() { return Options::current().smt.solveIntAsBV; }
318
29000
inline bool solveRealAsInt() { return Options::current().smt.solveRealAsInt; }
319
23691
inline bool sortInference() { return Options::current().smt.sortInference; }
320
13778
inline bool doStaticLearning() { return Options::current().smt.doStaticLearning; }
321
709
inline SygusSolutionOutMode sygusOut() { return Options::current().smt.sygusOut; }
322
inline bool sygusPrintCallbacks() { return Options::current().smt.sygusPrintCallbacks; }
323
26706
inline bool unconstrainedSimp() { return Options::current().smt.unconstrainedSimp; }
324
1138778
inline UnsatCoresMode unsatCoresMode() { return Options::current().smt.unsatCoresMode; }
325
// clang-format on
326
327
namespace smt
328
{
329
// clang-format off
330
static constexpr const char* abstractValues__name = "abstract-values";
331
static constexpr const char* ackermann__name = "ackermann";
332
static constexpr const char* blockModelsMode__name = "block-models";
333
static constexpr const char* BVAndIntegerGranularity__name = "bvand-integer-granularity";
334
static constexpr const char* checkAbducts__name = "check-abducts";
335
static constexpr const char* checkInterpols__name = "check-interpols";
336
static constexpr const char* checkModels__name = "check-models";
337
static constexpr const char* checkProofs__name = "check-proofs";
338
static constexpr const char* checkSynthSol__name = "check-synth-sol";
339
static constexpr const char* checkUnsatCores__name = "check-unsat-cores";
340
static constexpr const char* debugCheckModels__name = "debug-check-models";
341
static constexpr const char* difficultyMode__name = "difficulty-mode";
342
static constexpr const char* dumpToFileName__name = "dump-to";
343
static constexpr const char* dumpModeString__name = "dump";
344
static constexpr const char* earlyIteRemoval__name = "early-ite-removal";
345
static constexpr const char* expandDefinitions__name = "expand-definitions";
346
static constexpr const char* extRewPrep__name = "ext-rew-prep";
347
static constexpr const char* extRewPrepAgg__name = "ext-rew-prep-agg";
348
static constexpr const char* foreignTheoryRewrite__name = "foreign-theory-rewrite";
349
static constexpr const char* iandMode__name = "iand-mode";
350
static constexpr const char* interactiveMode__name = "interactive-mode";
351
static constexpr const char* doITESimp__name = "ite-simp";
352
static constexpr const char* learnedRewrite__name = "learned-rewrite";
353
static constexpr const char* minimalUnsatCores__name = "minimal-unsat-cores";
354
static constexpr const char* modelCoresMode__name = "model-cores";
355
static constexpr const char* modelUninterpPrint__name = "model-u-print";
356
static constexpr const char* modelWitnessValue__name = "model-witness-value";
357
static constexpr const char* doITESimpOnRepeat__name = "on-repeat-ite-simp";
358
static constexpr const char* produceAbducts__name = "produce-abducts";
359
static constexpr const char* produceAssertions__name = "produce-assertions";
360
static constexpr const char* produceAssignments__name = "produce-assignments";
361
static constexpr const char* produceInterpols__name = "produce-interpols";
362
static constexpr const char* produceModels__name = "produce-models";
363
static constexpr const char* produceProofs__name = "produce-proofs";
364
static constexpr const char* unsatAssumptions__name = "produce-unsat-assumptions";
365
static constexpr const char* unsatCores__name = "produce-unsat-cores";
366
static constexpr const char* repeatSimp__name = "repeat-simp";
367
static constexpr const char* compressItes__name = "simp-ite-compress";
368
static constexpr const char* zombieHuntThreshold__name = "simp-ite-hunt-zombies";
369
static constexpr const char* simplifyWithCareEnabled__name = "simp-with-care";
370
static constexpr const char* simplificationMode__name = "simplification";
371
static constexpr const char* solveBVAsInt__name = "solve-bv-as-int";
372
static constexpr const char* solveIntAsBV__name = "solve-int-as-bv";
373
static constexpr const char* solveRealAsInt__name = "solve-real-as-int";
374
static constexpr const char* sortInference__name = "sort-inference";
375
static constexpr const char* doStaticLearning__name = "static-learning";
376
static constexpr const char* sygusOut__name = "sygus-out";
377
static constexpr const char* sygusPrintCallbacks__name = "sygus-print-callbacks";
378
static constexpr const char* unconstrainedSimp__name = "unconstrained-simp";
379
static constexpr const char* unsatCoresMode__name = "unsat-cores-mode";
380
381
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 setDefaultDifficultyMode(Options& opts, DifficultyMode 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);
382
// clang-format on
383
}
384
385
}  // namespace cvc5::options
386
387
#endif /* CVC5__OPTIONS__SMT_H */