let add_fct_pre config acc spec =
let kf = config.kf in
let add_bhv_pre_hyp b acc =
let impl_assumes = false in
let kind = WpStrategy.Ahyp in
WpStrategy.add_prop_fct_bhv_pre acc kind kf b ~impl_assumes
in
let add_def_pre_hyp acc =
match Cil.find_default_behavior spec with None -> acc
| Some bdef -> add_bhv_pre_hyp bdef acc
in
let acc = match get_behav config Kglobal spec.spec_behavior with
| None -> add_def_pre_hyp acc
| Some b ->
let acc =
if not (Cil.is_default_behavior b) then add_def_pre_hyp acc else acc
in
let acc =
if WpStrategy.is_main_init kf then
let add_both acc p =
let id = WpPropId.mk_pre_id kf Kglobal b p in
let goal = goal_to_select config id in
let kind = WpStrategy.Aboth goal in
WpStrategy.add_prop_fct_pre acc kind kf b ~assumes:None p
in
let acc = List.fold_left add_both acc b.b_requires in
let add_hyp acc p =
let kind = WpStrategy.Ahyp in
WpStrategy.add_prop_fct_pre acc kind kf b ~assumes:None p
in List.fold_left add_hyp acc b.b_assumes
else add_bhv_pre_hyp b acc
in acc
in acc