let on_context (pool,env) (where:string)
(akind,omega) closing assigns
(f : L.env -> assigns_kind -> F.pred -> F.pred) : t_prop
=
let context = D.push where pool omega.bindings in
try
let wp = ref F.p_false in
begin
try
let prop =
try f env akind omega.property
with Failed -> F.p_false
in
let huge =
let m = Wp_parameters.Huge.get () in
if m < 1 then 1 else if m > 29 then max_int else 1 lsl m
in
if F.huge_pred huge prop then
(raise(Wp_error.Error("WP","Huge property"))) ;
wp := prop ;
with err ->
let (source,reason) = Wp_error.protect err in
Datalib.Collector.add_warning ~source ~reason ~severe:true
"Abort goal generation" ;
end ;
let asgns =
match assigns , akind with
| Goal_assigns gref , _ -> !gref
| Keep_assigns , a -> a
| Clear_assigns , _ | _ , NoAssigns -> NoAssigns
| Label_assigns l , EffectAssigns a when a.a_label = l ->
let ze = WpModel.dzone_empty () in
wp := D.subst a.a_effect ze (D.subst a.a_locals ze !wp) ;
NoAssigns
| Label_assigns _ , a -> a
in
asgns , close_property where context !wp closing
with err ->
D.kill where context ;
raise err