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