GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/smt_options.h Lines: 32 33 97.0 %
Date: 2021-09-18 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
  LITERALS, NONE, VALUES
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
  None, DeclFun, DeclSortAndFun
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
  SHARED, CONJECTURE, NONE, ASSUMPTIONS, DEFAULT, ALL
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
  IAND, SUM, OFF, BV
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_OR_DEF, STANDARD, STATUS, STATUS_AND_DEF
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
  ASSUMPTIONS, PP_ONLY, FULL_PROOF, SAT_PROOF, OFF
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
62763
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 unconstrainedSimp = false;
222
  bool unconstrainedSimpWasSetByUser = false;
223
  UnsatCoresMode unsatCoresMode = UnsatCoresMode::OFF;
224
  bool unsatCoresModeWasSetByUser = false;
225
// clang-format on
226
};
227
228
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
229
230
// clang-format off
231
8
inline bool abstractValues() { return Options::current().smt.abstractValues; }
232
13797
inline bool ackermann() { return Options::current().smt.ackermann; }
233
inline BlockModelsMode blockModelsMode() { return Options::current().smt.blockModelsMode; }
234
inline uint64_t BVAndIntegerGranularity() { return Options::current().smt.BVAndIntegerGranularity; }
235
14
inline bool checkAbducts() { return Options::current().smt.checkAbducts; }
236
10
inline bool checkInterpols() { return Options::current().smt.checkInterpols; }
237
inline bool checkModels() { return Options::current().smt.checkModels; }
238
inline bool checkProofs() { return Options::current().smt.checkProofs; }
239
200
inline bool checkSynthSol() { return Options::current().smt.checkSynthSol; }
240
inline bool checkUnsatCores() { return Options::current().smt.checkUnsatCores; }
241
2758
inline bool debugCheckModels() { return Options::current().smt.debugCheckModels; }
242
4
inline DifficultyMode difficultyMode() { return Options::current().smt.difficultyMode; }
243
inline std::string dumpModeString() { return Options::current().smt.dumpModeString; }
244
inline ManagedOut dumpToFileName() { return Options::current().smt.dumpToFileName; }
245
13797
inline bool earlyIteRemoval() { return Options::current().smt.earlyIteRemoval; }
246
inline bool expandDefinitions() { return Options::current().smt.expandDefinitions; }
247
13797
inline bool extRewPrep() { return Options::current().smt.extRewPrep; }
248
inline bool extRewPrepAgg() { return Options::current().smt.extRewPrepAgg; }
249
13797
inline bool foreignTheoryRewrite() { return Options::current().smt.foreignTheoryRewrite; }
250
inline IandMode iandMode() { return Options::current().smt.iandMode; }
251
inline bool interactiveMode() { return Options::current().smt.interactiveMode; }
252
12947
inline bool doITESimp() { return Options::current().smt.doITESimp; }
253
13797
inline bool learnedRewrite() { return Options::current().smt.learnedRewrite; }
254
1431
inline bool minimalUnsatCores() { return Options::current().smt.minimalUnsatCores; }
255
inline ModelCoresMode modelCoresMode() { return Options::current().smt.modelCoresMode; }
256
14
inline ModelUninterpPrintMode modelUninterpPrint() { return Options::current().smt.modelUninterpPrint; }
257
inline bool modelWitnessValue() { return Options::current().smt.modelWitnessValue; }
258
inline bool doITESimpOnRepeat() { return Options::current().smt.doITESimpOnRepeat; }
259
16
inline bool produceAbducts() { return Options::current().smt.produceAbducts; }
260
9940
inline bool produceAssertions() { return Options::current().smt.produceAssertions; }
261
inline bool produceAssignments() { return Options::current().smt.produceAssignments; }
262
9944
inline bool produceDifficulty() { return Options::current().smt.produceDifficulty; }
263
53
inline ProduceInterpols produceInterpols() { return Options::current().smt.produceInterpols; }
264
19014
inline bool produceModels() { return Options::current().smt.produceModels; }
265
38174019
inline bool produceProofs() { return Options::current().smt.produceProofs; }
266
inline bool unsatAssumptions() { return Options::current().smt.unsatAssumptions; }
267
13055965
inline bool unsatCores() { return Options::current().smt.unsatCores; }
268
26744
inline bool repeatSimp() { return Options::current().smt.repeatSimp; }
269
inline bool compressItes() { return Options::current().smt.compressItes; }
270
inline uint64_t zombieHuntThreshold() { return Options::current().smt.zombieHuntThreshold; }
271
inline bool simplifyWithCareEnabled() { return Options::current().smt.simplifyWithCareEnabled; }
272
14524
inline SimplificationMode simplificationMode() { return Options::current().smt.simplificationMode; }
273
13797
inline SolveBVAsIntMode solveBVAsInt() { return Options::current().smt.solveBVAsInt; }
274
29031
inline uint64_t solveIntAsBV() { return Options::current().smt.solveIntAsBV; }
275
29044
inline bool solveRealAsInt() { return Options::current().smt.solveRealAsInt; }
276
23737
inline bool sortInference() { return Options::current().smt.sortInference; }
277
13797
inline bool doStaticLearning() { return Options::current().smt.doStaticLearning; }
278
717
inline SygusSolutionOutMode sygusOut() { return Options::current().smt.sygusOut; }
279
26744
inline bool unconstrainedSimp() { return Options::current().smt.unconstrainedSimp; }
280
1652109
inline UnsatCoresMode unsatCoresMode() { return Options::current().smt.unsatCoresMode; }
281
// clang-format on
282
283
namespace smt
284
{
285
// clang-format off
286
static constexpr const char* abstractValues__name = "abstract-values";
287
static constexpr const char* ackermann__name = "ackermann";
288
static constexpr const char* blockModelsMode__name = "block-models";
289
static constexpr const char* BVAndIntegerGranularity__name = "bvand-integer-granularity";
290
static constexpr const char* checkAbducts__name = "check-abducts";
291
static constexpr const char* checkInterpols__name = "check-interpols";
292
static constexpr const char* checkModels__name = "check-models";
293
static constexpr const char* checkProofs__name = "check-proofs";
294
static constexpr const char* checkSynthSol__name = "check-synth-sol";
295
static constexpr const char* checkUnsatCores__name = "check-unsat-cores";
296
static constexpr const char* debugCheckModels__name = "debug-check-models";
297
static constexpr const char* difficultyMode__name = "difficulty-mode";
298
static constexpr const char* dumpModeString__name = "dump";
299
static constexpr const char* dumpToFileName__name = "dump-to";
300
static constexpr const char* earlyIteRemoval__name = "early-ite-removal";
301
static constexpr const char* expandDefinitions__name = "expand-definitions";
302
static constexpr const char* extRewPrep__name = "ext-rew-prep";
303
static constexpr const char* extRewPrepAgg__name = "ext-rew-prep-agg";
304
static constexpr const char* foreignTheoryRewrite__name = "foreign-theory-rewrite";
305
static constexpr const char* iandMode__name = "iand-mode";
306
static constexpr const char* interactiveMode__name = "interactive-mode";
307
static constexpr const char* doITESimp__name = "ite-simp";
308
static constexpr const char* learnedRewrite__name = "learned-rewrite";
309
static constexpr const char* minimalUnsatCores__name = "minimal-unsat-cores";
310
static constexpr const char* modelCoresMode__name = "model-cores";
311
static constexpr const char* modelUninterpPrint__name = "model-u-print";
312
static constexpr const char* modelWitnessValue__name = "model-witness-value";
313
static constexpr const char* doITESimpOnRepeat__name = "on-repeat-ite-simp";
314
static constexpr const char* produceAbducts__name = "produce-abducts";
315
static constexpr const char* produceAssertions__name = "produce-assertions";
316
static constexpr const char* produceAssignments__name = "produce-assignments";
317
static constexpr const char* produceDifficulty__name = "produce-difficulty";
318
static constexpr const char* produceInterpols__name = "produce-interpols";
319
static constexpr const char* produceModels__name = "produce-models";
320
static constexpr const char* produceProofs__name = "produce-proofs";
321
static constexpr const char* unsatAssumptions__name = "produce-unsat-assumptions";
322
static constexpr const char* unsatCores__name = "produce-unsat-cores";
323
static constexpr const char* repeatSimp__name = "repeat-simp";
324
static constexpr const char* compressItes__name = "simp-ite-compress";
325
static constexpr const char* zombieHuntThreshold__name = "simp-ite-hunt-zombies";
326
static constexpr const char* simplifyWithCareEnabled__name = "simp-with-care";
327
static constexpr const char* simplificationMode__name = "simplification";
328
static constexpr const char* solveBVAsInt__name = "solve-bv-as-int";
329
static constexpr const char* solveIntAsBV__name = "solve-int-as-bv";
330
static constexpr const char* solveRealAsInt__name = "solve-real-as-int";
331
static constexpr const char* sortInference__name = "sort-inference";
332
static constexpr const char* doStaticLearning__name = "static-learning";
333
static constexpr const char* sygusOut__name = "sygus-out";
334
static constexpr const char* unconstrainedSimp__name = "unconstrained-simp";
335
static constexpr const char* unsatCoresMode__name = "unsat-cores-mode";
336
337
void setDefaultAbstractValues(Options& opts, bool value);
338
void setDefaultAckermann(Options& opts, bool value);
339
void setDefaultBlockModelsMode(Options& opts, BlockModelsMode value);
340
void setDefaultBVAndIntegerGranularity(Options& opts, uint64_t value);
341
void setDefaultCheckAbducts(Options& opts, bool value);
342
void setDefaultCheckInterpols(Options& opts, bool value);
343
void setDefaultCheckModels(Options& opts, bool value);
344
void setDefaultCheckProofs(Options& opts, bool value);
345
void setDefaultCheckSynthSol(Options& opts, bool value);
346
void setDefaultCheckUnsatCores(Options& opts, bool value);
347
void setDefaultDebugCheckModels(Options& opts, bool value);
348
void setDefaultDifficultyMode(Options& opts, DifficultyMode value);
349
void setDefaultDumpModeString(Options& opts, std::string value);
350
void setDefaultDumpToFileName(Options& opts, ManagedOut value);
351
void setDefaultEarlyIteRemoval(Options& opts, bool value);
352
void setDefaultExpandDefinitions(Options& opts, bool value);
353
void setDefaultExtRewPrep(Options& opts, bool value);
354
void setDefaultExtRewPrepAgg(Options& opts, bool value);
355
void setDefaultForeignTheoryRewrite(Options& opts, bool value);
356
void setDefaultIandMode(Options& opts, IandMode value);
357
void setDefaultInteractiveMode(Options& opts, bool value);
358
void setDefaultDoITESimp(Options& opts, bool value);
359
void setDefaultLearnedRewrite(Options& opts, bool value);
360
void setDefaultMinimalUnsatCores(Options& opts, bool value);
361
void setDefaultModelCoresMode(Options& opts, ModelCoresMode value);
362
void setDefaultModelUninterpPrint(Options& opts, ModelUninterpPrintMode value);
363
void setDefaultModelWitnessValue(Options& opts, bool value);
364
void setDefaultDoITESimpOnRepeat(Options& opts, bool value);
365
void setDefaultProduceAbducts(Options& opts, bool value);
366
void setDefaultProduceAssertions(Options& opts, bool value);
367
void setDefaultProduceAssignments(Options& opts, bool value);
368
void setDefaultProduceDifficulty(Options& opts, bool value);
369
void setDefaultProduceInterpols(Options& opts, ProduceInterpols value);
370
void setDefaultProduceModels(Options& opts, bool value);
371
void setDefaultProduceProofs(Options& opts, bool value);
372
void setDefaultUnsatAssumptions(Options& opts, bool value);
373
void setDefaultUnsatCores(Options& opts, bool value);
374
void setDefaultRepeatSimp(Options& opts, bool value);
375
void setDefaultCompressItes(Options& opts, bool value);
376
void setDefaultZombieHuntThreshold(Options& opts, uint64_t value);
377
void setDefaultSimplifyWithCareEnabled(Options& opts, bool value);
378
void setDefaultSimplificationMode(Options& opts, SimplificationMode value);
379
void setDefaultSolveBVAsInt(Options& opts, SolveBVAsIntMode value);
380
void setDefaultSolveIntAsBV(Options& opts, uint64_t value);
381
void setDefaultSolveRealAsInt(Options& opts, bool value);
382
void setDefaultSortInference(Options& opts, bool value);
383
void setDefaultDoStaticLearning(Options& opts, bool value);
384
void setDefaultSygusOut(Options& opts, SygusSolutionOutMode value);
385
void setDefaultUnconstrainedSimp(Options& opts, bool value);
386
void setDefaultUnsatCoresMode(Options& opts, UnsatCoresMode value);
387
// clang-format on
388
}
389
390
}  // namespace cvc5::options
391
392
#endif /* CVC5__OPTIONS__SMT_H */