Skip to content

Commit 4eacbd3

Browse files
Renaming add_axioms_from_float to add_axioms_for_string_of_float
This function name is more explicit about what the function does
1 parent 105925a commit 4eacbd3

5 files changed

+14
-13
lines changed

src/solvers/refinement/string_constraint_generator.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ class string_constraint_generatort
236236
// and minus infinity the string are "Infinity" and "-Infinity respectively
237237
// otherwise the string contains only characters in [0123456789.] and '-' at
238238
// the start for negative number
239-
string_exprt add_axioms_from_float(const function_application_exprt &f);
240-
string_exprt add_axioms_from_float(
239+
string_exprt add_axioms_for_string_of_float(
240+
const function_application_exprt &f);
241+
string_exprt add_axioms_for_string_of_float(
241242
const exprt &f, const refined_string_typet &ref_type);
242243

243244
string_exprt add_axioms_for_fractional_part(

src/solvers/refinement/string_constraint_generator_concat.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_double(
174174
string_exprt s1=get_string_expr(args(f, 2)[0]);
175175
PRECONDITION(refined_string_typet::is_refined_string_type(f.type()));
176176
refined_string_typet ref_type=to_refined_string_type(f.type());
177-
string_exprt s2=add_axioms_from_float(args(f, 2)[1], ref_type, true);
177+
string_exprt s2=add_axioms_for_string_of_float(args(f, 2)[1], ref_type);
178178
return add_axioms_for_concat(s1, s2);
179179
}
180180

@@ -187,7 +187,7 @@ string_exprt string_constraint_generatort::add_axioms_for_concat_float(
187187
string_exprt s1=get_string_expr(args(f, 2)[0]);
188188
PRECONDITION(refined_string_typet::is_refined_string_type(f.type()));
189189
refined_string_typet ref_type=to_refined_string_type(f.type());
190-
string_exprt s2=add_axioms_from_float(args(f, 2)[1], ref_type, false);
190+
string_exprt s2=add_axioms_for_string_of_float(args(f, 2)[1], ref_type);
191191
return add_axioms_for_concat(s1, s2);
192192
}
193193

src/solvers/refinement/string_constraint_generator_float.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ exprt estimate_decimal_exponent(const exprt &f, const ieee_float_spect &spec)
150150
/// Add axioms corresponding to the String.valueOf(F) java function
151151
/// \param f: function application with one float argument
152152
/// \return a new string expression
153-
string_exprt string_constraint_generatort::add_axioms_from_float(
153+
string_exprt string_constraint_generatort::add_axioms_for_string_of_float(
154154
const function_application_exprt &f)
155155
{
156-
const refined_string_typet &ref_type=to_refined_string_type(f.type());
157-
return add_axioms_from_float(args(f, 1)[0], ref_type);
156+
return add_axioms_for_string_of_float(
157+
args(f, 1)[0], to_refined_string_type(f.type()));
158158
}
159159

160160
/// Add axioms corresponding to the String.valueOf(D) java function
@@ -163,8 +163,8 @@ string_exprt string_constraint_generatort::add_axioms_from_float(
163163
string_exprt string_constraint_generatort::add_axioms_from_double(
164164
const function_application_exprt &f)
165165
{
166-
const refined_string_typet &ref_type=to_refined_string_type(f.type());
167-
return add_axioms_from_float(args(f, 1)[0], ref_type);
166+
return add_axioms_for_string_of_float(
167+
args(f, 1)[0], to_refined_string_type(f.type()));
168168
}
169169

170170
/// Add axioms corresponding to the integer part of m, in decimal form with no
@@ -176,7 +176,7 @@ string_exprt string_constraint_generatort::add_axioms_from_double(
176176
/// \param f: expression representing a float
177177
/// \param ref_type: refined type for strings
178178
/// \return a new string expression
179-
string_exprt string_constraint_generatort::add_axioms_from_float(
179+
string_exprt string_constraint_generatort::add_axioms_for_string_of_float(
180180
const exprt &f, const refined_string_typet &ref_type)
181181
{
182182
const floatbv_typet &type=to_floatbv_type(f.type());

src/solvers/refinement/string_constraint_generator_insert.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ string_exprt string_constraint_generatort::add_axioms_for_insert_double(
119119
{
120120
string_exprt s1=get_string_expr(args(f, 3)[0]);
121121
const refined_string_typet &ref_type=to_refined_string_type(s1.type());
122-
string_exprt s2=add_axioms_from_float(args(f, 3)[2], ref_type);
122+
string_exprt s2=add_axioms_for_string_of_float(args(f, 3)[2], ref_type);
123123
return add_axioms_for_insert(s1, s2, args(f, 3)[1]);
124124
}
125125

@@ -133,7 +133,7 @@ string_exprt string_constraint_generatort::add_axioms_for_insert_float(
133133
{
134134
string_exprt s1=get_string_expr(args(f, 3)[0]);
135135
const refined_string_typet &ref_type=to_refined_string_type(s1.type());
136-
string_exprt s2=add_axioms_from_float(args(f, 3)[2], ref_type);
136+
string_exprt s2=add_axioms_for_string_of_float(args(f, 3)[2], ref_type);
137137
return add_axioms_for_insert(s1, s2, args(f, 3)[1]);
138138
}
139139

src/solvers/refinement/string_constraint_generator_main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ exprt string_constraint_generatort::add_axioms_for_function_application(
453453
else if(id==ID_cprover_string_of_int_hex_func)
454454
res=add_axioms_from_int_hex(expr);
455455
else if(id==ID_cprover_string_of_float_func)
456-
res=add_axioms_from_float(expr);
456+
res=add_axioms_for_string_of_float(expr);
457457
else if(id==ID_cprover_string_of_float_scientific_notation_func)
458458
res=add_axioms_from_float_scientific_notation(expr);
459459
else if(id==ID_cprover_string_of_double_func)

0 commit comments

Comments
 (0)