@@ -11,24 +11,6 @@ module M = Messages
1111 * other functions. *)
1212type fundecs = fundec list * fundec list * fundec list
1313
14- module type SysVar =
15- sig
16- type t
17- val is_write_only : t -> bool
18- end
19-
20- module type VarType =
21- sig
22- include Hashtbl. HashedType
23- include SysVar with type t := t
24- val pretty_trace : unit -> t -> doc
25- val compare : t -> t -> int
26-
27- val printXml : 'a BatInnerIO .output -> t -> unit
28- val var_id : t -> string
29- val node : t -> MyCFG .node
30- val relift : t -> t (* needed only for incremental+hashcons to re-hashcons contexts after loading *)
31- end
3214
3315module Var =
3416struct
6951module type SpecSysVar =
7052sig
7153 include Printable. S
72- include SysVar with type t := t
54+ include ConstrSys. SysVar with type t := t
7355end
7456
7557module GVarF (V : SpecSysVar ) =
@@ -318,110 +300,6 @@ type increment_data = {
318300 restarting : VarQuery .t list ;
319301}
320302
321- (* * Abstract incremental change to constraint system.
322- @param 'v constrain system variable type *)
323- type 'v sys_change_info = {
324- obsolete : 'v list ; (* * Variables to destabilize. *)
325- delete : 'v list ; (* * Variables to delete. *)
326- reluctant : 'v list ; (* * Variables to solve reluctantly. *)
327- restart : 'v list ; (* * Variables to restart. *)
328- }
329-
330- (* * A side-effecting system. *)
331- module type MonSystem =
332- sig
333- type v (* variables *)
334- type d (* values *)
335- type 'a m (* basically a monad carrier *)
336-
337- (* * Variables must be hashable, comparable, etc. *)
338- module Var : VarType with type t = v
339-
340- (* * Values must form a lattice. *)
341- module Dom : Lattice .S with type t = d
342-
343- (* * The system in functional form. *)
344- val system : v -> ((v -> d ) -> (v -> d -> unit ) -> d ) m
345-
346- val sys_change : (v -> d ) -> v sys_change_info
347- (* * Compute incremental constraint system change from old solution. *)
348- end
349-
350- (* * Any system of side-effecting equations over lattices. *)
351- module type EqConstrSys = MonSystem with type 'a m := 'a option
352-
353- (* * A side-effecting system with globals. *)
354- module type GlobConstrSys =
355- sig
356- module LVar : VarType
357- module GVar : VarType
358-
359- module D : Lattice .S
360- module G : Lattice .S
361- val system : LVar .t -> ((LVar .t -> D .t ) -> (LVar .t -> D .t -> unit ) -> (GVar .t -> G .t ) -> (GVar .t -> G .t -> unit ) -> D .t ) option
362- val iter_vars : (LVar .t -> D .t ) -> (GVar .t -> G .t ) -> VarQuery .t -> LVar .t VarQuery .f -> GVar .t VarQuery .f -> unit
363- val sys_change : (LVar .t -> D .t ) -> (GVar .t -> G .t ) -> [`L of LVar .t | `G of GVar .t ] sys_change_info
364- end
365-
366- (* * A solver is something that can translate a system into a solution (hash-table).
367- Incremental solver has data to be marshaled. *)
368- module type GenericEqIncrSolverBase =
369- functor (S :EqConstrSys ) ->
370- functor (H :Hashtbl.S with type key=S.v ) ->
371- sig
372- type marshal
373-
374- val copy_marshal : marshal -> marshal
375- val relift_marshal : marshal -> marshal
376-
377- (* * The hash-map that is the first component of [solve xs vs] is a local solution for interesting variables [vs],
378- reached from starting values [xs].
379- As a second component the solver returns data structures for incremental serialization. *)
380- val solve : (S .v * S .d ) list -> S .v list -> marshal option -> S .d H .t * marshal
381- end
382-
383- (* * (Incremental) solver argument, indicating which postsolving should be performed by the solver. *)
384- module type IncrSolverArg =
385- sig
386- val should_prune : bool
387- val should_verify : bool
388- val should_warn : bool
389- val should_save_run : bool
390- end
391-
392- (* * An incremental solver takes the argument about postsolving. *)
393- module type GenericEqIncrSolver =
394- functor (Arg : IncrSolverArg ) ->
395- GenericEqIncrSolverBase
396-
397- (* * A solver is something that can translate a system into a solution (hash-table) *)
398- module type GenericEqSolver =
399- functor (S :EqConstrSys ) ->
400- functor (H :Hashtbl.S with type key=S.v ) ->
401- sig
402- (* * The hash-map that is the first component of [solve xs vs] is a local solution for interesting variables [vs],
403- reached from starting values [xs]. *)
404- val solve : (S .v * S .d ) list -> S .v list -> S .d H .t
405- end
406-
407- (* * A solver is something that can translate a system into a solution (hash-table) *)
408- module type GenericGlobSolver =
409- functor (S :GlobConstrSys ) ->
410- functor (LH :Hashtbl.S with type key=S.LVar.t ) ->
411- functor (GH :Hashtbl.S with type key=S.GVar.t ) ->
412- sig
413- type marshal
414-
415- val copy_marshal : marshal -> marshal
416- val relift_marshal : marshal -> marshal
417-
418- (* * The hash-map that is the first component of [solve xs vs] is a local solution for interesting variables [vs],
419- reached from starting values [xs].
420- As a second component the solver returns data structures for incremental serialization. *)
421- val solve : (S.LVar .t * S .D .t) list -> (S.GVar .t * S .G .t) list -> S.LVar .t list -> marshal option -> (S .D .t LH .t * S .G .t GH .t ) * marshal
422- end
423-
424-
425303module StdV =
426304struct
427305 let is_write_only _ = false
542420module type SpecSys =
543421sig
544422 module Spec : Spec
545- module EQSys : GlobConstrSys with module LVar = VarF (Spec. C )
423+ module EQSys : ConstrSys . GlobConstrSys with module LVar = VarF (Spec. C )
546424 and module GVar = GVarF (Spec. V )
547425 and module D = Spec. D
548426 and module G = GVarG (Spec. G ) (Spec. C )
0 commit comments