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