Source file bce_pe_fixpoint.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
open Logtk
open Libzipperposition
let k_enabled = Flex_state.create_key ()
module type S = sig
module Env : Env.S
(** {5 Registration} *)
val setup : unit -> unit
end
module Make(E : Env.S) : S with module Env = E = struct
module Env = E
module BCE = Bce.Make(E)
module PE = Pred_elim.Make(E)
let run_fixpoint () =
PE.begin_fixpoint();
BCE.begin_fixpoint();
let done_ = ref false in
while not !done_ do
ignore(PE.fixpoint_step());
done_ := not (BCE.fixpoint_step ());
done;
PE.end_fixpoint();
BCE.end_fixpoint()
let setup () =
if E.flex_get k_enabled then (
Signal.once E.on_start run_fixpoint);
end
let _enabled = ref false
let extension =
let action env =
let module E = (val env : Env.S) in
let module FP = Make(E) in
E.flex_add k_enabled !_enabled;
FP.setup ()
in
{ Extensions.default with Extensions.
name="bce_pe_fp";
prio = 70;
env_actions=[action];
}
let () =
Options.add_opts [
"--bce-pe-fixpoint", Arg.Bool ((:=) _enabled), " enable BCE/PE fixpoint simplification";
]