let get_strategies_for_froms kf =
if not (Kernel_function.is_definition kf) then
begin
Wp_parameters.warning
"Function %a has no body : cannot prove its \\from properties (skip)"
Kernel_function.pretty kf;
[]
end
else
let stmt_bhvs = Kernel_function.internal_function_behaviors kf in
if stmt_bhvs <> [] then
Wp_parameters.warning
"Not implemented: prove local \\from properties (skip)";
let spec = Kernel_function.get_spec kf in
let cfg = Cil2cfg.get kf in
let add_bhv acc bhv =
let pre = get_bhv_pre kf bhv in
let add_assign_strategy acc (b,f) =
match f with
| FromAny -> acc
| From _l ->
let stg = mk_strategy_for_fct_from cfg bhv pre (b,f) in
stg::acc
in
match bhv.b_assigns with
| WritesAny -> acc
| Writes l ->
try List.fold_left add_assign_strategy acc l
with e ->
Wp_parameters.warning
"cannot check \\from properties of '%a':@,@[%a@]"
Kernel_function.pretty kf pp_err e;
acc
in List.fold_left add_bhv [] spec.spec_behavior