Skip to content

Commit a479356

Browse files
committed
Update smt_response_validation to use std::optional
1 parent 1ab6db2 commit a479356

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/solvers/smt2_incremental/smt_response_validation.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ validate_string_literal(const irept &parse_tree)
125125
/// \note: Because this kind of response does not start with an identifying
126126
/// keyword, it will be considered that the response is intended to be a
127127
/// get-value response if it is composed of a collection of one or more pairs.
128-
static optionalt<response_or_errort<smt_responset>>
128+
static std::optional<response_or_errort<smt_responset>>
129129
valid_smt_error_response(const irept &parse_tree)
130130
{
131131
// Check if the parse tree looks to be an error response.
@@ -162,7 +162,7 @@ static bool all_subs_are_pairs(const irept &parse_tree)
162162

163163
/// Checks for valid bit vector constants of the form `(_ bv(value) (width))`
164164
/// for example - `(_ bv4 64)`.
165-
static optionalt<smt_termt>
165+
static std::optional<smt_termt>
166166
valid_smt_indexed_bit_vector(const irept &parse_tree)
167167
{
168168
if(parse_tree.get_sub().size() != 3)
@@ -189,7 +189,7 @@ valid_smt_indexed_bit_vector(const irept &parse_tree)
189189
return smt_bit_vector_constant_termt{value, bit_width};
190190
}
191191

192-
static optionalt<smt_termt> valid_smt_bool(const irept &parse_tree)
192+
static std::optional<smt_termt> valid_smt_bool(const irept &parse_tree)
193193
{
194194
if(!parse_tree.get_sub().empty())
195195
return {};
@@ -200,7 +200,7 @@ static optionalt<smt_termt> valid_smt_bool(const irept &parse_tree)
200200
return {};
201201
}
202202

203-
static optionalt<smt_termt> valid_smt_binary(const std::string &text)
203+
static std::optional<smt_termt> valid_smt_binary(const std::string &text)
204204
{
205205
static const std::regex binary_format{"#b[01]+"};
206206
if(!std::regex_match(text, binary_format))
@@ -211,7 +211,7 @@ static optionalt<smt_termt> valid_smt_binary(const std::string &text)
211211
return {smt_bit_vector_constant_termt{value, width}};
212212
}
213213

214-
static optionalt<smt_termt> valid_smt_hex(const std::string &text)
214+
static std::optional<smt_termt> valid_smt_hex(const std::string &text)
215215
{
216216
static const std::regex hex_format{"#x[0-9A-Za-z]+"};
217217
if(!std::regex_match(text, hex_format))
@@ -225,7 +225,7 @@ static optionalt<smt_termt> valid_smt_hex(const std::string &text)
225225
return {smt_bit_vector_constant_termt{value, width}};
226226
}
227227

228-
static optionalt<smt_termt>
228+
static std::optional<smt_termt>
229229
valid_smt_bit_vector_constant(const irept &parse_tree)
230230
{
231231
if(const auto indexed = valid_smt_indexed_bit_vector(parse_tree))
@@ -240,7 +240,7 @@ valid_smt_bit_vector_constant(const irept &parse_tree)
240240
return {};
241241
}
242242

243-
static optionalt<response_or_errort<smt_termt>> try_select_validation(
243+
static std::optional<response_or_errort<smt_termt>> try_select_validation(
244244
const irept &parse_tree,
245245
const std::unordered_map<irep_idt, smt_identifier_termt> &identifier_table)
246246
{
@@ -321,7 +321,7 @@ validate_valuation_pair(
321321
/// \note: Because this kind of response does not start with an identifying
322322
/// keyword, it will be considered that the response is intended to be a
323323
/// get-value response if it is composed of a collection of one or more pairs.
324-
static optionalt<response_or_errort<smt_responset>>
324+
static std::optional<response_or_errort<smt_responset>>
325325
valid_smt_get_value_response(
326326
const irept &parse_tree,
327327
const std::unordered_map<irep_idt, smt_identifier_termt> &identifier_table)

0 commit comments

Comments
 (0)