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

[wp] Improves initialization filter

parent 56614d6c
No related branches found
No related tags found
No related merge requests found
...@@ -1592,12 +1592,21 @@ struct ...@@ -1592,12 +1592,21 @@ struct
exception Found exception Found
let has_init filter pred = let has_init filter pred =
let rec term_is_init_in_state t s = let visited = ref Tset.empty in
match Mstate.lookup s t with let rec term_is_init_in_states states t =
| Mlval(_, KInit) | Mchunk(_, KInit) -> raise Found let raise_if_is_init t s =
| _ -> Lang.F.lc_iter (fun t -> term_is_init_in_state t s) t match Mstate.lookup s t with
| Mlval(_, KInit) | Mchunk(_, KInit) -> raise Found
| _ -> ()
in
if Tset.mem t !visited then ()
else begin
visited := Tset.add t !visited ;
List.iter (raise_if_is_init t) states ;
Lang.F.lc_iter (term_is_init_in_states states) t
end
in in
try List.iter (term_is_init_in_state (F.e_prop pred)) filter ; false try term_is_init_in_states filter (F.e_prop pred) ; false
with Found -> true with Found -> true
let rec do_filter filter p = let rec do_filter filter p =
......
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