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