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__STRINGS_H |
22 |
|
#define CVC5__OPTIONS__STRINGS_H |
23 |
|
|
24 |
|
#include "options/options.h" |
25 |
|
|
26 |
|
// clang-format off |
27 |
|
|
28 |
|
// clang-format on |
29 |
|
|
30 |
|
namespace cvc5::options { |
31 |
|
|
32 |
|
// clang-format off |
33 |
|
|
34 |
|
enum class RegExpInterMode |
35 |
|
{ |
36 |
|
NONE, |
37 |
|
CONSTANT, |
38 |
|
ALL, |
39 |
|
ONE_CONSTANT |
40 |
|
}; |
41 |
|
|
42 |
|
static constexpr size_t RegExpInterMode__numValues = 4; |
43 |
|
|
44 |
|
std::ostream& operator<<(std::ostream& os, RegExpInterMode mode); |
45 |
|
RegExpInterMode stringToRegExpInterMode(const std::string& optarg); |
46 |
|
|
47 |
|
enum class ProcessLoopMode |
48 |
|
{ |
49 |
|
FULL, |
50 |
|
ABORT, |
51 |
|
SIMPLE_ABORT, |
52 |
|
NONE, |
53 |
|
SIMPLE |
54 |
|
}; |
55 |
|
|
56 |
|
static constexpr size_t ProcessLoopMode__numValues = 5; |
57 |
|
|
58 |
|
std::ostream& operator<<(std::ostream& os, ProcessLoopMode mode); |
59 |
|
ProcessLoopMode stringToProcessLoopMode(const std::string& optarg); |
60 |
|
// clang-format on |
61 |
|
|
62 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
63 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
64 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
65 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
66 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
67 |
|
|
68 |
24069 |
struct HolderSTRINGS |
69 |
|
{ |
70 |
|
// clang-format off |
71 |
|
bool regExpElim = false; |
72 |
|
bool regExpElimWasSetByUser = false; |
73 |
|
bool regExpElimAgg = false; |
74 |
|
bool regExpElimAggWasSetByUser = false; |
75 |
|
RegExpInterMode stringRegExpInterMode = RegExpInterMode::CONSTANT; |
76 |
|
bool stringRegExpInterModeWasSetByUser = false; |
77 |
|
bool stringCheckEntailLen = true; |
78 |
|
bool stringCheckEntailLenWasSetByUser = false; |
79 |
|
bool stringEager = false; |
80 |
|
bool stringEagerWasSetByUser = false; |
81 |
|
bool stringEagerEval = true; |
82 |
|
bool stringEagerEvalWasSetByUser = false; |
83 |
|
bool stringEagerLen = true; |
84 |
|
bool stringEagerLenWasSetByUser = false; |
85 |
|
bool stringExp = false; |
86 |
|
bool stringExpWasSetByUser = false; |
87 |
|
bool stringFlatForms = true; |
88 |
|
bool stringFlatFormsWasSetByUser = false; |
89 |
|
bool stringFMF = false; |
90 |
|
bool stringFMFWasSetByUser = false; |
91 |
|
bool stringGuessModel = false; |
92 |
|
bool stringGuessModelWasSetByUser = false; |
93 |
|
bool stringInferAsLemmas = false; |
94 |
|
bool stringInferAsLemmasWasSetByUser = false; |
95 |
|
bool stringInferSym = true; |
96 |
|
bool stringInferSymWasSetByUser = false; |
97 |
|
bool stringLazyPreproc = true; |
98 |
|
bool stringLazyPreprocWasSetByUser = false; |
99 |
|
bool stringLenNorm = true; |
100 |
|
bool stringLenNormWasSetByUser = false; |
101 |
|
bool stringLenPropCsp = false; |
102 |
|
bool stringLenPropCspWasSetByUser = false; |
103 |
|
bool stringMinPrefixExplain = true; |
104 |
|
bool stringMinPrefixExplainWasSetByUser = false; |
105 |
|
ProcessLoopMode stringProcessLoopMode = ProcessLoopMode::FULL; |
106 |
|
bool stringProcessLoopModeWasSetByUser = false; |
107 |
|
bool stringRExplainLemmas = true; |
108 |
|
bool stringRExplainLemmasWasSetByUser = false; |
109 |
|
bool stringUnifiedVSpt = true; |
110 |
|
bool stringUnifiedVSptWasSetByUser = false; |
111 |
|
// clang-format on |
112 |
|
}; |
113 |
|
|
114 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
115 |
|
|
116 |
|
// clang-format off |
117 |
125165 |
inline bool regExpElim() { return Options::current().strings.regExpElim; } |
118 |
9915 |
inline bool regExpElimAgg() { return Options::current().strings.regExpElimAgg; } |
119 |
1846 |
inline RegExpInterMode stringRegExpInterMode() { return Options::current().strings.stringRegExpInterMode; } |
120 |
4543 |
inline bool stringCheckEntailLen() { return Options::current().strings.stringCheckEntailLen; } |
121 |
18878 |
inline bool stringEager() { return Options::current().strings.stringEager; } |
122 |
9915 |
inline bool stringEagerEval() { return Options::current().strings.stringEagerEval; } |
123 |
55754 |
inline bool stringEagerLen() { return Options::current().strings.stringEagerLen; } |
124 |
203241 |
inline bool stringExp() { return Options::current().strings.stringExp; } |
125 |
9439 |
inline bool stringFlatForms() { return Options::current().strings.stringFlatForms; } |
126 |
124815 |
inline bool stringFMF() { return Options::current().strings.stringFMF; } |
127 |
8659 |
inline bool stringGuessModel() { return Options::current().strings.stringGuessModel; } |
128 |
41127 |
inline bool stringInferAsLemmas() { return Options::current().strings.stringInferAsLemmas; } |
129 |
188687 |
inline bool stringInferSym() { return Options::current().strings.stringInferSym; } |
130 |
13780 |
inline bool stringLazyPreproc() { return Options::current().strings.stringLazyPreproc; } |
131 |
9439 |
inline bool stringLenNorm() { return Options::current().strings.stringLenNorm; } |
132 |
|
inline bool stringLenPropCsp() { return Options::current().strings.stringLenPropCsp; } |
133 |
28476 |
inline bool stringMinPrefixExplain() { return Options::current().strings.stringMinPrefixExplain; } |
134 |
1644 |
inline ProcessLoopMode stringProcessLoopMode() { return Options::current().strings.stringProcessLoopMode; } |
135 |
25297 |
inline bool stringRExplainLemmas() { return Options::current().strings.stringRExplainLemmas; } |
136 |
9362 |
inline bool stringUnifiedVSpt() { return Options::current().strings.stringUnifiedVSpt; } |
137 |
|
// clang-format on |
138 |
|
|
139 |
|
namespace strings |
140 |
|
{ |
141 |
|
// clang-format off |
142 |
|
static constexpr const char* regExpElim__name = "re-elim"; |
143 |
|
static constexpr const char* regExpElimAgg__name = "re-elim-agg"; |
144 |
|
static constexpr const char* stringRegExpInterMode__name = "re-inter-mode"; |
145 |
|
static constexpr const char* stringCheckEntailLen__name = "strings-check-entail-len"; |
146 |
|
static constexpr const char* stringEager__name = "strings-eager"; |
147 |
|
static constexpr const char* stringEagerEval__name = "strings-eager-eval"; |
148 |
|
static constexpr const char* stringEagerLen__name = "strings-eager-len"; |
149 |
|
static constexpr const char* stringExp__name = "strings-exp"; |
150 |
|
static constexpr const char* stringFlatForms__name = "strings-ff"; |
151 |
|
static constexpr const char* stringFMF__name = "strings-fmf"; |
152 |
|
static constexpr const char* stringGuessModel__name = "strings-guess-model"; |
153 |
|
static constexpr const char* stringInferAsLemmas__name = "strings-infer-as-lemmas"; |
154 |
|
static constexpr const char* stringInferSym__name = "strings-infer-sym"; |
155 |
|
static constexpr const char* stringLazyPreproc__name = "strings-lazy-pp"; |
156 |
|
static constexpr const char* stringLenNorm__name = "strings-len-norm"; |
157 |
|
static constexpr const char* stringLenPropCsp__name = "strings-lprop-csp"; |
158 |
|
static constexpr const char* stringMinPrefixExplain__name = "strings-min-prefix-explain"; |
159 |
|
static constexpr const char* stringProcessLoopMode__name = "strings-process-loop-mode"; |
160 |
|
static constexpr const char* stringRExplainLemmas__name = "strings-rexplain-lemmas"; |
161 |
|
static constexpr const char* stringUnifiedVSpt__name = "strings-unified-vspt"; |
162 |
|
|
163 |
|
void setDefaultRegExpElim(Options& opts, bool value);void setDefaultRegExpElimAgg(Options& opts, bool value);void setDefaultStringRegExpInterMode(Options& opts, RegExpInterMode value);void setDefaultStringCheckEntailLen(Options& opts, bool value);void setDefaultStringEager(Options& opts, bool value);void setDefaultStringEagerEval(Options& opts, bool value);void setDefaultStringEagerLen(Options& opts, bool value);void setDefaultStringExp(Options& opts, bool value);void setDefaultStringFlatForms(Options& opts, bool value);void setDefaultStringFMF(Options& opts, bool value);void setDefaultStringGuessModel(Options& opts, bool value);void setDefaultStringInferAsLemmas(Options& opts, bool value);void setDefaultStringInferSym(Options& opts, bool value);void setDefaultStringLazyPreproc(Options& opts, bool value);void setDefaultStringLenNorm(Options& opts, bool value);void setDefaultStringLenPropCsp(Options& opts, bool value);void setDefaultStringMinPrefixExplain(Options& opts, bool value);void setDefaultStringProcessLoopMode(Options& opts, ProcessLoopMode value);void setDefaultStringRExplainLemmas(Options& opts, bool value);void setDefaultStringUnifiedVSpt(Options& opts, bool value); |
164 |
|
// clang-format on |
165 |
|
} |
166 |
|
|
167 |
|
} // namespace cvc5::options |
168 |
|
|
169 |
|
#endif /* CVC5__OPTIONS__STRINGS_H */ |