Skip to content
Snippets Groups Projects
Commit 30779d95 authored by Allan Blanchard's avatar Allan Blanchard
Browse files

[wp] Fixes formals scope

parent 4831554b
No related branches found
No related tags found
No related merge requests found
...@@ -347,13 +347,6 @@ struct ...@@ -347,13 +347,6 @@ struct
if not (is_default_bhv mode) then [] if not (is_default_bhv mode) then []
else CfgAnnot.get_disjoint_behaviors kf else CfgAnnot.get_disjoint_behaviors kf
let body env ~ensures ~exits w =
let rw = List.fold_right (prove_property env) ensures w in
let rk = List.fold_right (prove_property env) exits env.wk in
Vhash.add env.wp env.cfg.return_point (Some rw) ;
env.wk <- rk ;
wp env env.cfg.entry_point
(* Putting everything together *) (* Putting everything together *)
let compute ~mode ~props = let compute ~mode ~props =
let kf = mode.kf in let kf = mode.kf in
...@@ -386,16 +379,22 @@ struct ...@@ -386,16 +379,22 @@ struct
(* frame-in *) (* frame-in *)
W.scope env.we xs SC_Frame_in @@ W.scope env.we xs SC_Frame_in @@
(* function body *) (* function body *)
body env begin fun w ->
~ensures:bhv.bhv_ensures Vhash.add env.wp env.cfg.return_point (Some w) ;
~exits:bhv.bhv_exits @@ wp env env.cfg.entry_point
end @@
(* frame-out *) (* frame-out *)
W.label env.we None Clabels.post @@
(fun t ->
if not has_exit then env.wk <- t
else env.wk <- prove_assigns env bhv.bhv_exit_assigns t ;
prove_assigns env bhv.bhv_post_assigns t) @@
W.scope env.we xs SC_Frame_out @@ W.scope env.we xs SC_Frame_out @@
(* Post-conds*)
W.label env.we None Clabels.post @@
begin fun w ->
env.wk <-
List.fold_right (prove_property env) bhv.bhv_exits @@
if not has_exit then w else prove_assigns env bhv.bhv_exit_assigns w ;
List.fold_right (prove_property env) bhv.bhv_ensures @@
prove_assigns env bhv.bhv_post_assigns w
end @@
(* wp-end *) (* wp-end *)
W.empty W.empty
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment