@@ -433,8 +433,7 @@ code_contractst::create_ensures_instruction(
433433bool code_contractst::apply_function_contract (
434434 const irep_idt &function,
435435 goto_programt &function_body,
436- goto_programt::targett &target,
437- const std::set<std::string> &enforced_functions)
436+ goto_programt::targett &target)
438437{
439438 const auto &const_target =
440439 static_cast <const goto_programt::targett &>(target);
@@ -568,30 +567,9 @@ bool code_contractst::apply_function_contract(
568567 {
569568 assigns_clauset assigns_clause (targets.operands (), log, ns);
570569
571- // Retrieve assigns clause of the caller function if exists.
572- auto caller_assigns =
573- to_code_with_contract_type (ns.lookup (function).type ).assigns ();
574-
575- if (enforced_functions.find (function.c_str ()) != enforced_functions.end ())
576- {
577- // check subset relationship of assigns clause for called function
578- assigns_clauset caller_assigns_clause (caller_assigns, log, ns);
579- goto_programt subset_check_assertion;
580- subset_check_assertion.add (goto_programt::make_assertion (
581- caller_assigns_clause.generate_subset_check (assigns_clause),
582- const_target->source_location ));
583- subset_check_assertion.instructions .back ().source_location .set_comment (
584- " Check that " + id2string (target_function) +
585- " 's assigns clause is a subset of " +
586- id2string (const_target->source_location .get_function ()) +
587- " 's assigns clause" );
588- insert_before_swap_and_advance (
589- function_body, target, subset_check_assertion);
590- }
591-
592570 // Havoc all targets in global write set
593571 auto assigns_havoc =
594- assigns_clause.generate_havoc_code (const_target ->source_location );
572+ assigns_clause.generate_havoc_code (target ->source_location );
595573
596574 // Insert the non-deterministic assignment immediately before the call site.
597575 insert_before_swap_and_advance (function_body, target, assigns_havoc);
@@ -1097,9 +1075,7 @@ void code_contractst::add_contract_check(
10971075 dest.destructive_insert (dest.instructions .begin (), check);
10981076}
10991077
1100- bool code_contractst::replace_calls (
1101- const std::set<std::string> &to_replace,
1102- const std::set<std::string> &to_enforce)
1078+ bool code_contractst::replace_calls (const std::set<std::string> &to_replace)
11031079{
11041080 if (to_replace.empty ())
11051081 return false ;
@@ -1123,7 +1099,7 @@ bool code_contractst::replace_calls(
11231099 continue ;
11241100
11251101 fail |= apply_function_contract (
1126- goto_function.first , goto_function.second .body , ins, to_enforce );
1102+ goto_function.first , goto_function.second .body , ins);
11271103 }
11281104 }
11291105 }
0 commit comments