Skip to content

Commit 37fb0c0

Browse files
authored
Merge pull request #5555 from tautschnig/remove-deprecated-constructors
Remove deprecated function_application_exprt constructor
2 parents 5c7a529 + 32715b4 commit 37fb0c0

File tree

6 files changed

+32
-35
lines changed

6 files changed

+32
-35
lines changed

jbmc/src/java_bytecode/java_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ exprt make_function_application(
408408
symbol_table);
409409

410410
// Function application
411-
return function_application_exprt(symbol.symbol_expr(), arguments, range);
411+
return function_application_exprt{symbol.symbol_expr(), arguments};
412412
}
413413

414414
/// Strip java:: prefix from given identifier

jbmc/unit/solvers/strings/string_constraint_instantiation/instantiate_not_contains.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Author: Jesse Sigal, [email protected]
2020
#include <solvers/strings/string_constraint_instantiation.h>
2121

2222
#include <util/config.h>
23+
#include <util/mathematical_expr.h>
24+
#include <util/mathematical_types.h>
2325
#include <util/simplify_expr.h>
2426

2527
/// \class Types used throughout the test. Currently it is impossible to
@@ -203,10 +205,12 @@ SCENARIO(
203205
GIVEN("The not_contains axioms of String.lastIndexOf(String, Int)")
204206
{
205207
// Creating "ab".lastIndexOf("b", 0)
206-
const function_application_exprt func(
207-
symbol_exprt(ID_cprover_string_last_index_of_func, t.length_type()),
208-
{ab, b, from_integer(2)},
209-
t.length_type());
208+
mathematical_function_typet::domaint domain{
209+
{ab.type(), b.type(), t.length_type()}};
210+
const function_application_exprt func{
211+
symbol_exprt{ID_cprover_string_last_index_of_func,
212+
mathematical_function_typet{domain, t.length_type()}},
213+
{ab, b, from_integer(2)}};
210214

211215
// Generating the corresponding axioms and simplifying, recording info
212216
string_constraint_generatort generator(empty_ns);

jbmc/unit/solvers/strings/string_refinement/dependency_graph.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ Author: Diffblue Ltd.
1111

1212
#include <java_bytecode/java_types.h>
1313
#include <solvers/strings/string_dependencies.h>
14+
1415
#include <util/arith_tools.h>
16+
#include <util/mathematical_expr.h>
17+
#include <util/mathematical_types.h>
1518
#include <util/std_expr.h>
1619
#include <util/std_types.h>
1720

@@ -55,30 +58,24 @@ SCENARIO("dependency_graph", "[core][solvers][refinement][string_refinement]")
5558
const symbol_exprt lhs("lhs", unsignedbv_typet(32));
5659
const symbol_exprt lhs2("lhs2", unsignedbv_typet(32));
5760
const symbol_exprt lhs3("lhs3", unsignedbv_typet(32));
58-
const java_method_typet fun_type(
59-
{java_method_typet::parametert(length_type()),
60-
java_method_typet::parametert(pointer_type(java_char_type())),
61-
java_method_typet::parametert(string_type),
62-
java_method_typet::parametert(string_type)},
61+
const mathematical_function_typet fun_type(
62+
{length_type(), pointer_type(java_char_type()), string_type, string_type},
6363
unsignedbv_typet(32));
6464

6565
// fun1 is s3 = s1.concat(s2)
6666
const function_application_exprt fun1(
6767
symbol_exprt(ID_cprover_string_concat_func, fun_type),
68-
{string3.op0(), string3.op1(), string1, string2},
69-
fun_type);
68+
{string3.op0(), string3.op1(), string1, string2});
7069

7170
// fun2 is s5 = s3.concat(s4)
7271
const function_application_exprt fun2(
7372
symbol_exprt(ID_cprover_string_concat_func, fun_type),
74-
{string5.op0(), string5.op1(), string3, string4},
75-
fun_type);
73+
{string5.op0(), string5.op1(), string3, string4});
7674

7775
// fun3 is s6 = s5.concat(s2)
7876
const function_application_exprt fun3(
7977
symbol_exprt(ID_cprover_string_concat_func, fun_type),
80-
{string6.op0(), string6.op1(), string5, string2},
81-
fun_type);
78+
{string6.op0(), string6.op1(), string5, string2});
8279

8380
const equal_exprt equation1(lhs, fun1);
8481
const equal_exprt equation2(lhs2, fun2);

jbmc/unit/solvers/strings/string_refinement/string_symbol_resolution.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ Author: Diffblue Ltd.
1515
#include <iostream>
1616
#include <java_bytecode/java_bytecode_language.h>
1717
#include <langapi/mode.h>
18+
1819
#include <util/arith_tools.h>
1920
#include <util/c_types.h>
21+
#include <util/mathematical_expr.h>
22+
#include <util/mathematical_types.h>
2023
#include <util/std_expr.h>
2124
#include <util/symbol_table.h>
2225

@@ -63,11 +66,10 @@ SCENARIO(
6366

6467
WHEN("There is a function call")
6568
{
66-
java_method_typet::parameterst parameters;
67-
typet return_type;
69+
mathematical_function_typet::domaint domain{{string_typet{}}};
6870
symbol_exprt fun_sym(
69-
"f", java_method_typet(std::move(parameters), return_type));
70-
const function_application_exprt fun(fun_sym, {c}, bool_typet());
71+
"f", mathematical_function_typet{domain, bool_typet{}});
72+
const function_application_exprt fun{fun_sym, {c}};
7173
symbol_exprt bool_sym("bool_b", bool_typet());
7274
equations.emplace_back(bool_sym, fun);
7375
union_find_replacet symbol_resolve =

src/goto-programs/builtin_functions.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Author: Daniel Kroening, [email protected]
1919
#include <util/expr_initializer.h>
2020
#include <util/expr_util.h>
2121
#include <util/mathematical_expr.h>
22+
#include <util/mathematical_types.h>
2223
#include <util/pointer_offset_size.h>
2324
#include <util/prefix.h>
2425
#include <util/rational.h>
@@ -893,7 +894,14 @@ void goto_convertt::do_function_call_symbol(
893894
if(lhs.is_nil())
894895
return;
895896

896-
const function_application_exprt rhs(function, arguments, lhs.type());
897+
const code_typet &function_call_type = to_code_type(function.type());
898+
mathematical_function_typet::domaint domain;
899+
for(const auto &parameter : function_call_type.parameters())
900+
domain.push_back(parameter.type());
901+
mathematical_function_typet function_type{domain,
902+
function_call_type.return_type()};
903+
const function_application_exprt rhs(
904+
symbol_exprt{function.get_identifier(), function_type}, arguments);
897905

898906
code_assignt assignment(lhs, rhs);
899907
assignment.add_source_location()=function.source_location();

src/util/mathematical_expr.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,6 @@ class function_application_exprt : public binary_exprt
192192
public:
193193
using argumentst = exprt::operandst;
194194

195-
DEPRECATED(
196-
SINCE(2019, 3, 3, "use function_application_exprt(fkt, arg) instead"))
197-
function_application_exprt(
198-
const symbol_exprt &_function,
199-
const argumentst &_arguments,
200-
const typet &_type)
201-
: binary_exprt(
202-
_function,
203-
ID_function_application,
204-
tuple_exprt(_arguments),
205-
_type)
206-
{
207-
}
208-
209195
function_application_exprt(const exprt &_function, argumentst _arguments);
210196

211197
exprt &function()

0 commit comments

Comments
 (0)