@@ -942,72 +942,6 @@ java_string_library_preprocesst::string_literal_to_string_expr(
942
942
ID_cprover_string_literal_func, {expr}, loc, symbol_table, code);
943
943
}
944
944
945
- // / Used to provide code for the Java String.equals(Object) function.
946
- // / \param type: type of the function call
947
- // / \param loc: location in the program_invocation_name
948
- // / \param symbol_table: symbol table
949
- // / \param function_id: unused
950
- // / \return Code corresponding to:
951
- // / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
952
- // / IF arg->@class_identifier == "java.lang.String"
953
- // / THEN
954
- // / string_expr1 = {this->length; *this->data}
955
- // / string_expr2 = {arg->length; *arg->data}
956
- // / bool string_equals_tmp = cprover_string_equal(string_expr1, string_expr2)
957
- // / return string_equals_tmp
958
- // / ELSE
959
- // / return false
960
- // / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
961
- codet java_string_library_preprocesst::make_equals_function_code (
962
- const java_method_typet &type,
963
- const source_locationt &loc,
964
- const irep_idt &function_id,
965
- symbol_table_baset &symbol_table)
966
- {
967
- const typet &return_type = type.return_type ();
968
- exprt::operandst ops;
969
- for (const auto &p : type.parameters ())
970
- {
971
- symbol_exprt sym (p.get_identifier (), p.type ());
972
- ops.push_back (sym);
973
- }
974
-
975
- code_ifthenelset code;
976
- code.cond () = [&] {
977
- const member_exprt class_identifier (
978
- checked_dereference (ops[1 ], ops[1 ].type ().subtype ()),
979
- " @class_identifier" ,
980
- string_typet ());
981
- return equal_exprt (
982
- class_identifier,
983
- constant_exprt (" java::java.lang.String" , string_typet ()));
984
- }();
985
-
986
- code.then_case () = [&] {
987
- code_blockt instance_case;
988
- // Check content equality
989
- const symbolt string_equals_sym = get_fresh_aux_symbol (
990
- return_type,
991
- id2string (function_id),
992
- " str_eq" ,
993
- loc,
994
- ID_java,
995
- symbol_table);
996
- const symbol_exprt string_equals = string_equals_sym.symbol_expr ();
997
- instance_case.add (code_declt (string_equals), loc);
998
- const exprt::operandst args =
999
- process_equals_function_operands (ops, loc, symbol_table, instance_case);
1000
- const auto fun_app = make_function_application (
1001
- ID_cprover_string_equal_func, args, return_type, symbol_table);
1002
- instance_case.add (code_assignt (string_equals, fun_app), loc);
1003
- instance_case.add (code_returnt (string_equals), loc);
1004
- return instance_case;
1005
- }();
1006
-
1007
- code.else_case () = code_returnt (from_integer (false , return_type));
1008
- return code;
1009
- }
1010
-
1011
945
// / Provide code for the String.valueOf(F) function.
1012
946
// / \param type: type of the function call
1013
947
// / \param loc: location in the program_invocation_name
@@ -2031,15 +1965,6 @@ void java_string_library_preprocesst::initialize_conversion_table()
2031
1965
cprover_equivalent_to_java_function
2032
1966
[" java::java.lang.String.endsWith:(Ljava/lang/String;)Z" ]=
2033
1967
ID_cprover_string_endswith_func;
2034
-
2035
- conversion_table[" java::java.lang.String.equals:(Ljava/lang/Object;)Z" ] =
2036
- std::bind (
2037
- &java_string_library_preprocesst::make_equals_function_code,
2038
- this ,
2039
- std::placeholders::_1,
2040
- std::placeholders::_2,
2041
- std::placeholders::_3,
2042
- std::placeholders::_4);
2043
1968
cprover_equivalent_to_java_function
2044
1969
[" java::java.lang.String.equalsIgnoreCase:(Ljava/lang/String;)Z" ]=
2045
1970
ID_cprover_string_equals_ignore_case_func;
0 commit comments