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 |
|
ONE_CONSTANT, CONSTANT, NONE, 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 |
|
SIMPLE_ABORT, NONE, 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 |
24136 |
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 stringEager = false; |
69 |
|
bool stringEagerWasSetByUser = false; |
70 |
|
bool stringEagerEval = true; |
71 |
|
bool stringEagerEvalWasSetByUser = false; |
72 |
|
bool stringEagerLen = true; |
73 |
|
bool stringEagerLenWasSetByUser = false; |
74 |
|
bool stringExp = false; |
75 |
|
bool stringExpWasSetByUser = false; |
76 |
|
bool stringFlatForms = true; |
77 |
|
bool stringFlatFormsWasSetByUser = false; |
78 |
|
bool stringFMF = false; |
79 |
|
bool stringFMFWasSetByUser = false; |
80 |
|
bool stringGuessModel = false; |
81 |
|
bool stringGuessModelWasSetByUser = false; |
82 |
|
bool stringInferAsLemmas = false; |
83 |
|
bool stringInferAsLemmasWasSetByUser = false; |
84 |
|
bool stringInferSym = true; |
85 |
|
bool stringInferSymWasSetByUser = false; |
86 |
|
bool stringLazyPreproc = true; |
87 |
|
bool stringLazyPreprocWasSetByUser = false; |
88 |
|
bool stringLenNorm = true; |
89 |
|
bool stringLenNormWasSetByUser = false; |
90 |
|
bool stringMinPrefixExplain = true; |
91 |
|
bool stringMinPrefixExplainWasSetByUser = false; |
92 |
|
ProcessLoopMode stringProcessLoopMode = ProcessLoopMode::FULL; |
93 |
|
bool stringProcessLoopModeWasSetByUser = false; |
94 |
|
bool stringRExplainLemmas = true; |
95 |
|
bool stringRExplainLemmasWasSetByUser = false; |
96 |
|
bool stringUnifiedVSpt = true; |
97 |
|
bool stringUnifiedVSptWasSetByUser = false; |
98 |
|
// clang-format on |
99 |
|
}; |
100 |
|
|
101 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
102 |
|
|
103 |
|
// clang-format off |
104 |
125165 |
inline bool regExpElim() { return Options::current().strings.regExpElim; } |
105 |
9940 |
inline bool regExpElimAgg() { return Options::current().strings.regExpElimAgg; } |
106 |
1846 |
inline RegExpInterMode stringRegExpInterMode() { return Options::current().strings.stringRegExpInterMode; } |
107 |
4543 |
inline bool stringCheckEntailLen() { return Options::current().strings.stringCheckEntailLen; } |
108 |
18924 |
inline bool stringEager() { return Options::current().strings.stringEager; } |
109 |
9940 |
inline bool stringEagerEval() { return Options::current().strings.stringEagerEval; } |
110 |
55823 |
inline bool stringEagerLen() { return Options::current().strings.stringEagerLen; } |
111 |
203338 |
inline bool stringExp() { return Options::current().strings.stringExp; } |
112 |
9462 |
inline bool stringFlatForms() { return Options::current().strings.stringFlatForms; } |
113 |
124861 |
inline bool stringFMF() { return Options::current().strings.stringFMF; } |
114 |
8663 |
inline bool stringGuessModel() { return Options::current().strings.stringGuessModel; } |
115 |
41127 |
inline bool stringInferAsLemmas() { return Options::current().strings.stringInferAsLemmas; } |
116 |
188687 |
inline bool stringInferSym() { return Options::current().strings.stringInferSym; } |
117 |
13797 |
inline bool stringLazyPreproc() { return Options::current().strings.stringLazyPreproc; } |
118 |
9462 |
inline bool stringLenNorm() { return Options::current().strings.stringLenNorm; } |
119 |
28476 |
inline bool stringMinPrefixExplain() { return Options::current().strings.stringMinPrefixExplain; } |
120 |
1644 |
inline ProcessLoopMode stringProcessLoopMode() { return Options::current().strings.stringProcessLoopMode; } |
121 |
25297 |
inline bool stringRExplainLemmas() { return Options::current().strings.stringRExplainLemmas; } |
122 |
9362 |
inline bool stringUnifiedVSpt() { return Options::current().strings.stringUnifiedVSpt; } |
123 |
|
// clang-format on |
124 |
|
|
125 |
|
namespace strings |
126 |
|
{ |
127 |
|
// clang-format off |
128 |
|
static constexpr const char* regExpElim__name = "re-elim"; |
129 |
|
static constexpr const char* regExpElimAgg__name = "re-elim-agg"; |
130 |
|
static constexpr const char* stringRegExpInterMode__name = "re-inter-mode"; |
131 |
|
static constexpr const char* stringCheckEntailLen__name = "strings-check-entail-len"; |
132 |
|
static constexpr const char* stringEager__name = "strings-eager"; |
133 |
|
static constexpr const char* stringEagerEval__name = "strings-eager-eval"; |
134 |
|
static constexpr const char* stringEagerLen__name = "strings-eager-len"; |
135 |
|
static constexpr const char* stringExp__name = "strings-exp"; |
136 |
|
static constexpr const char* stringFlatForms__name = "strings-ff"; |
137 |
|
static constexpr const char* stringFMF__name = "strings-fmf"; |
138 |
|
static constexpr const char* stringGuessModel__name = "strings-guess-model"; |
139 |
|
static constexpr const char* stringInferAsLemmas__name = "strings-infer-as-lemmas"; |
140 |
|
static constexpr const char* stringInferSym__name = "strings-infer-sym"; |
141 |
|
static constexpr const char* stringLazyPreproc__name = "strings-lazy-pp"; |
142 |
|
static constexpr const char* stringLenNorm__name = "strings-len-norm"; |
143 |
|
static constexpr const char* stringMinPrefixExplain__name = "strings-min-prefix-explain"; |
144 |
|
static constexpr const char* stringProcessLoopMode__name = "strings-process-loop-mode"; |
145 |
|
static constexpr const char* stringRExplainLemmas__name = "strings-rexplain-lemmas"; |
146 |
|
static constexpr const char* stringUnifiedVSpt__name = "strings-unified-vspt"; |
147 |
|
|
148 |
|
void setDefaultRegExpElim(Options& opts, bool value); |
149 |
|
void setDefaultRegExpElimAgg(Options& opts, bool value); |
150 |
|
void setDefaultStringRegExpInterMode(Options& opts, RegExpInterMode value); |
151 |
|
void setDefaultStringCheckEntailLen(Options& opts, bool value); |
152 |
|
void setDefaultStringEager(Options& opts, bool value); |
153 |
|
void setDefaultStringEagerEval(Options& opts, bool value); |
154 |
|
void setDefaultStringEagerLen(Options& opts, bool value); |
155 |
|
void setDefaultStringExp(Options& opts, bool value); |
156 |
|
void setDefaultStringFlatForms(Options& opts, bool value); |
157 |
|
void setDefaultStringFMF(Options& opts, bool value); |
158 |
|
void setDefaultStringGuessModel(Options& opts, bool value); |
159 |
|
void setDefaultStringInferAsLemmas(Options& opts, bool value); |
160 |
|
void setDefaultStringInferSym(Options& opts, bool value); |
161 |
|
void setDefaultStringLazyPreproc(Options& opts, bool value); |
162 |
|
void setDefaultStringLenNorm(Options& opts, bool value); |
163 |
|
void setDefaultStringMinPrefixExplain(Options& opts, bool value); |
164 |
|
void setDefaultStringProcessLoopMode(Options& opts, ProcessLoopMode value); |
165 |
|
void setDefaultStringRExplainLemmas(Options& opts, bool value); |
166 |
|
void setDefaultStringUnifiedVSpt(Options& opts, bool value); |
167 |
|
// clang-format on |
168 |
|
} |
169 |
|
|
170 |
|
} // namespace cvc5::options |
171 |
|
|
172 |
|
#endif /* CVC5__OPTIONS__STRINGS_H */ |