@@ -937,66 +937,6 @@ java_string_library_preprocesst::string_literal_to_string_expr(
937
937
ID_cprover_string_literal_func, {expr}, loc, symbol_table, code);
938
938
}
939
939
940
- // / Used to provide code for the Java String.equals(Object) function.
941
- // / \param type: type of the function call
942
- // / \param loc: location in the program_invocation_name
943
- // / \param symbol_table: symbol table
944
- // / \return Code corresponding to:
945
- // / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
946
- // / IF arg->@class_identifier == "java.lang.String"
947
- // / THEN
948
- // / string_expr1 = {this->length; *this->data}
949
- // / string_expr2 = {arg->length; *arg->data}
950
- // / bool string_equals_tmp = cprover_string_equal(string_expr1, string_expr2)
951
- // / return string_equals_tmp
952
- // / ELSE
953
- // / return false
954
- // / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
955
- codet java_string_library_preprocesst::make_equals_function_code (
956
- const code_typet &type,
957
- const source_locationt &loc,
958
- const irep_idt &function_id,
959
- symbol_table_baset &symbol_table)
960
- {
961
- const typet &return_type = type.return_type ();
962
- exprt::operandst ops;
963
- for (const auto &p : type.parameters ())
964
- {
965
- symbol_exprt sym (p.get_identifier (), p.type ());
966
- ops.push_back (sym);
967
- }
968
-
969
- code_ifthenelset code;
970
- code.cond () = [&] {
971
- const member_exprt class_identifier (
972
- checked_dereference (ops[1 ], ops[1 ].type ().subtype ()),
973
- " @class_identifier" ,
974
- string_typet ());
975
- return equal_exprt (
976
- class_identifier,
977
- constant_exprt (" java::java.lang.String" , string_typet ()));
978
- }();
979
-
980
- code.then_case () = [&] {
981
- code_blockt instance_case;
982
- // Check content equality
983
- const symbolt string_equals_sym = get_fresh_aux_symbol (
984
- return_type, " string_equals" , " str_eq" , loc, ID_java, symbol_table);
985
- const symbol_exprt string_equals = string_equals_sym.symbol_expr ();
986
- instance_case.add (code_declt (string_equals), loc);
987
- const exprt::operandst args =
988
- process_equals_function_operands (ops, loc, symbol_table, instance_case);
989
- const auto fun_app = make_function_application (
990
- ID_cprover_string_equal_func, args, return_type, symbol_table);
991
- instance_case.add (code_assignt (string_equals, fun_app), loc);
992
- instance_case.add (code_returnt (string_equals), loc);
993
- return instance_case;
994
- }();
995
-
996
- code.else_case () = code_returnt (from_integer (false , return_type));
997
- return code;
998
- }
999
-
1000
940
// / Provide code for the String.valueOf(F) function.
1001
941
// / \param type: type of the function call
1002
942
// / \param loc: location in the program_invocation_name
@@ -2006,15 +1946,6 @@ void java_string_library_preprocesst::initialize_conversion_table()
2006
1946
cprover_equivalent_to_java_function
2007
1947
[" java::java.lang.String.endsWith:(Ljava/lang/String;)Z" ]=
2008
1948
ID_cprover_string_endswith_func;
2009
-
2010
- conversion_table[" java::java.lang.String.equals:(Ljava/lang/Object;)Z" ] =
2011
- std::bind (
2012
- &java_string_library_preprocesst::make_equals_function_code,
2013
- this ,
2014
- std::placeholders::_1,
2015
- std::placeholders::_2,
2016
- std::placeholders::_3,
2017
- std::placeholders::_4);
2018
1949
cprover_equivalent_to_java_function
2019
1950
[" java::java.lang.String.equalsIgnoreCase:(Ljava/lang/String;)Z" ]=
2020
1951
ID_cprover_string_equals_ignore_case_func;
0 commit comments