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