Skip to content

Commit 07d923a

Browse files
authored
Merge pull request #4601 from allredj/stringsolv-remove-array-pool-arg
String solver refactor: Remove array_pool arg from non-static function [TG-7439]
2 parents f74ea2e + 75191d0 commit 07d923a

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/solvers/strings/string_constraint_generator.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ class string_constraint_generatort final
7878
// Add axioms corresponding to the String.hashCode java function
7979
// The specification is partial: the actual value is not actually computed
8080
// but we ensure that hash codes of equal strings are equal.
81-
std::pair<exprt, string_constraintst> add_axioms_for_hash_code(
82-
const function_application_exprt &f,
83-
array_poolt &pool);
81+
std::pair<exprt, string_constraintst>
82+
add_axioms_for_hash_code(const function_application_exprt &f);
8483

8584
// MEMBERS
8685
const messaget message;

src/solvers/strings/string_constraint_generator_comparison.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,14 @@ std::pair<exprt, string_constraintst> add_axioms_for_equals_ignore_case(
184184
/// * \f$ hash(str)=hash(s) \lor |str| \ne |s|
185185
/// \lor (|str|=|s| \land \exists i<|s|.\ s[i]\ne str[i]) \f$
186186
/// \param f: function application with argument refined_string `str`
187-
/// \param pool: pool of arrays representing strings
188187
/// \return integer expression `hash(str)`
189188
std::pair<exprt, string_constraintst>
190189
string_constraint_generatort::add_axioms_for_hash_code(
191-
const function_application_exprt &f,
192-
array_poolt &pool)
190+
const function_application_exprt &f)
193191
{
194192
PRECONDITION(f.arguments().size() == 1);
195193
string_constraintst hash_constraints;
196-
const array_string_exprt str = get_string_expr(pool, f.arguments()[0]);
194+
const array_string_exprt str = get_string_expr(array_pool, f.arguments()[0]);
197195
const typet &return_type = f.type();
198196
const typet &index_type = str.length().type();
199197

src/solvers/strings/string_constraint_generator_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ string_constraint_generatort::add_axioms_for_function_application(
241241
else if(id == ID_cprover_string_contains_func)
242242
return add_axioms_for_contains(fresh_symbol, expr, array_pool);
243243
else if(id == ID_cprover_string_hash_code_func)
244-
return add_axioms_for_hash_code(expr, array_pool);
244+
return add_axioms_for_hash_code(expr);
245245
else if(id == ID_cprover_string_index_of_func)
246246
return add_axioms_for_index_of(fresh_symbol, expr, array_pool);
247247
else if(id == ID_cprover_string_last_index_of_func)

0 commit comments

Comments
 (0)