@ -44,6 +44,8 @@ module type S = sig
val of_source : Source . t -> t
val of_source : Source . t -> t
val of_footprint : AccessPath . Abs . t -> t
val add : Source . t -> t -> t
val add : Source . t -> t -> t
val get_footprint_indexes : t -> IntSet . t
val get_footprint_indexes : t -> IntSet . t
@ -88,8 +90,11 @@ module type S = sig
val of_source : Source . t -> t
val of_source : Source . t -> t
(* * create a trace from a source *)
(* * create a trace from a source *)
val of_footprint : AccessPath . Abs . t -> t
(* * create a trace from a footprint access path *)
val add_source : Source . t -> t -> t
val add_source : Source . t -> t -> t
(* * ad a source to the current trace *)
(* * ad d a source to the current trace *)
val add_sink : Sink . t -> t -> t
val add_sink : Sink . t -> t -> t
(* * add a sink to the current trace. *)
(* * add a sink to the current trace. *)
@ -183,26 +188,17 @@ module Make (Spec : Spec) = struct
let is_empty { known ; footprint } = Known . is_empty known && Footprint . BaseMap . is_empty footprint
let is_empty { known ; footprint } = Known . is_empty known && Footprint . BaseMap . is_empty footprint
let add_footprint_access_path access_path footprint =
let of_footprint access_path =
Footprint . add_trace access_path true footprint
let footprint = Footprint . add_trace access_path true Footprint . empty in
{ empty with footprint }
let of_source source =
let of_source source =
match Source . get_footprint_access_path source with
let known = Known . singleton source in
| Some access_path
{ empty with known }
-> let footprint = add_footprint_access_path access_path Footprint . empty in
{ empty with footprint }
| None
-> let known = Known . singleton source in
{ empty with known }
let add source astate =
let add source astate =
match Source . get_footprint_access_path source with
let known = Known . add source astate . known in
| Some access_path
{ astate with known }
-> let footprint = add_footprint_access_path access_path astate . footprint in
{ astate with footprint }
| None
-> let known = Known . add source astate . known in
{ astate with known }
let get_footprint_indexes { footprint } =
let get_footprint_indexes { footprint } =
Footprint . BaseMap . fold
Footprint . BaseMap . fold
@ -408,12 +404,19 @@ module Make (Spec : Spec) = struct
~ f : ( fun acc source -> trace_elems_of_source source acc )
~ f : ( fun acc source -> trace_elems_of_source source acc )
~ init : trace_prefix sources_with_level
~ init : trace_prefix sources_with_level
let of_source source =
let of_sources sources =
let sources = Sources . of_source source in
let passthroughs = Passthroughs . empty in
let passthroughs = Passthroughs . empty in
let sinks = Sinks . empty in
let sinks = Sinks . empty in
{ sources ; passthroughs ; sinks }
{ sources ; passthroughs ; sinks }
let of_source source =
let sources = Sources . of_source source in
of_sources sources
let of_footprint access_path =
let sources = Sources . of_footprint access_path in
of_sources sources
let add_source source t =
let add_source source t =
let sources = Sources . add source t . sources in
let sources = Sources . add source t . sources in
{ t with sources }
{ t with sources }