diff --git a/domains/domain.ml b/domains/domain.ml index 03d4e16..483e242 100644 --- a/domains/domain.ml +++ b/domains/domain.ml @@ -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 diff --git a/domains/value_domain.ml b/domains/value_domain.ml index 9958fc8..d6aaebe 100644 --- a/domains/value_domain.ml +++ b/domains/value_domain.ml @@ -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 diff --git a/iterator/iterable.ml b/iterator/iterable.ml index 9a4a389..6352ec3 100644 --- a/iterator/iterable.ml +++ b/iterator/iterable.ml @@ -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 diff --git a/iterator/iterator.ml b/iterator/iterator.ml index e66f417..ba3e431 100644 --- a/iterator/iterator.ml +++ b/iterator/iterator.ml @@ -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