init : int -> t
This commit is contained in:
parent
a41dedd362
commit
d26445d151
4 changed files with 6 additions and 6 deletions
|
@ -30,7 +30,7 @@ module type DOMAIN =
|
|||
type t
|
||||
|
||||
(* initial environment, with all variables initialized to 0 *)
|
||||
val init: t
|
||||
val init: int -> t
|
||||
|
||||
(* empty set of environments *)
|
||||
val bottom: t
|
||||
|
|
|
@ -98,7 +98,7 @@ open Domain
|
|||
module NonRelational (V : VALUE_DOMAIN) : DOMAIN = struct
|
||||
module VMap = VarMap
|
||||
type t = Bot | E of V.t VMap.t
|
||||
let init = E VMap.empty (* Nonpresent variables are 0 *)
|
||||
let init _ = E VMap.empty (* Nonpresent variables are 0 *)
|
||||
let bottom = Bot
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ open Domain
|
|||
module type ITERABLE = sig
|
||||
type t (*type of a node abst*)
|
||||
val bottom : t
|
||||
val init : t
|
||||
val init : int -> t
|
||||
|
||||
val do_compute : arc -> t (*source*) -> (arc -> unit) -> (func -> t -> t) -> t (*to accumulate*)
|
||||
val accumulate : arc -> t (*source*) -> t (*old dst*) -> t*bool (*dst*)
|
||||
|
@ -15,7 +15,7 @@ module SimpleIterable (D : DOMAIN) : ITERABLE = struct
|
|||
type t = D.t
|
||||
|
||||
let bottom = D.bottom
|
||||
let init = D.init
|
||||
let init x = D.init x
|
||||
|
||||
let do_compute a src cb_fail cb_fun = match a.arc_inst with
|
||||
| CFG_skip _ -> src
|
||||
|
@ -63,7 +63,7 @@ module DisjunctiveIterable (D : DOMAIN) : ITERABLE = struct
|
|||
type t = D.t SCRMap.t
|
||||
|
||||
let bottom = SCRMap.empty
|
||||
let init = SCRMap.singleton [] D.init
|
||||
let init x = SCRMap.singleton [] (D.init x)
|
||||
|
||||
let do_compute a src cb_fail cb_fun = match a.arc_inst with
|
||||
| CFG_skip _ -> src
|
||||
|
|
|
@ -57,7 +57,7 @@ module Iterator (I : ITERABLE) = struct
|
|||
func_exit = cfg.cfg_init_exit;
|
||||
func_args = [];
|
||||
func_ret = None;
|
||||
func_calls = []} I.init in
|
||||
func_calls = []} (I.init (List.length cfg.cfg_vars))in
|
||||
let rec do_main l = match l with
|
||||
| x::_ when x.func_name = "main" -> do_fun x init_st
|
||||
| _::q -> do_main q
|
||||
|
|
Loading…
Reference in a new issue