@@ -6,19 +6,21 @@ open Analyses
66open GobConfig
77
88
9- (* * Lifts a [Spec] so that the domain is [Hashcons]d *)
10- module HashconsLifter (S :Spec )
9+ module type LatticeLifter =
10+ functor (L : Lattice.S ) ->
11+ sig
12+ include Lattice. S
13+
14+ val lift : L .t -> t
15+ val unlift : t -> L .t
16+ end
17+
18+ module DomainLifter (F : LatticeLifter ) (S :Spec )
1119 : Spec with module G = S. G
1220 and module C = S. C
1321=
1422struct
15- module HConsedArg =
16- struct
17- (* We do refine int values on narrow and meet {!IntDomain.IntDomTupleImpl}, which can lead to fixpoint issues if we assume x op x = x *)
18- (* see https://github.com/goblint/analyzer/issues/1005 *)
19- let assume_idempotent = GobConfig. get_string " ana.int.refinement" = " never"
20- end
21- module D = Lattice. HConsed (S. D ) (HConsedArg )
23+ module D = F (S. D )
2224 module G = S. G
2325 module C = S. C
2426 module V = S. V
2830 let of_elt x = of_elt (D. unlift x)
2931 end
3032
31- let name () = S. name () ^ " hashconsed"
33+ let name () = S. name () ^ " hashconsed" (* TODO: configurable name *)
3234
3335 type marshal = S .marshal (* TODO: should hashcons table be in here to avoid relift altogether? *)
3436 let init = S. init
@@ -98,6 +100,19 @@ struct
98100 D. lift @@ S. event (conv man) e (conv oman)
99101end
100102
103+ (* * Lifts a [Spec] so that the domain is [Hashcons]d *)
104+ module HashconsLifter (S : Spec ) =
105+ struct
106+ module HConsedArg =
107+ struct
108+ (* We do refine int values on narrow and meet {!IntDomain.IntDomTupleImpl}, which can lead to fixpoint issues if we assume x op x = x *)
109+ (* see https://github.com/goblint/analyzer/issues/1005 *)
110+ let assume_idempotent = GobConfig. get_string " ana.int.refinement" = " never"
111+ end
112+ module F (L : Lattice.S ) = Lattice. HConsed (L ) (HConsedArg )
113+ include DomainLifter (F ) (S )
114+ end
115+
101116module type PrintableLifter =
102117 functor (P : Printable.S ) ->
103118 sig
0 commit comments