Shared_ast.Coveragemodule FileMap : Catala_utils.Map.S with type key = Catala_utils.File.tMore efficient File map module
module ScopeSet : sig ... endMore efficient ScopeName set module
A position can either be Unreached or Reached_by a set of test scopes.
val format_cover : Stdlib.Format.formatter -> cover -> unitval from_pos : Catala_utils.Pos.t -> itvval format_itv : Stdlib.Format.formatter -> itv -> unitval empty : coverage_mapval reached_pos :
Catala_utils.Pos.t ->
Shared_ast__.Definitions.ScopeName.t ->
coverage_map ->
coverage_mapreached_pos p s m marks the position p as reached by the scope s in the map m. Merge scopes if the position was already reached by another scope.
val unreached_pos : Catala_utils.Pos.t -> coverage_map -> coverage_mapunreached_pos p m marks the position p as unreached in the map m. Does not overwrite the existing cover.
val reachable_positions :
((_, _, _) Shared_ast__.Definitions.base_gexpr,
_ Shared_ast__.Definitions.mark)
Catala_utils.Mark.ed
Shared_ast__.Definitions.program ->
coverage_mapreachable_positions prg iterates over the program p's expressions to build a Unreached only coverage_map.
val merge_with_reachable_positions :
reachable:coverage_map ->
reached:coverage_map ->
coverage_mapmerge_with_reachable_positions ~reachable ~reached computes the union between reachable and reached but filter out files that do not contain reached positions. When a conflict occurs, the cover are merged, i.e., scopes are merged together.
val filter_files :
(Catala_utils.File.t -> bool) ->
coverage_map ->
coverage_mapfilter_files p m removes the files from the coverage map that do not satisfy the predicate p. Used to filter out the stdlib.
val union : coverage_map -> coverage_map -> coverage_mapval fold :
((Catala_utils.File.t * itv) -> cover -> 'a -> 'a) ->
coverage_map ->
'a ->
'aval format_coverage_hex_dump : Stdlib.Format.formatter -> coverage_map -> unitMarshal the coverage map and prints it as hexadecimal.
val of_hex : string -> coverage_mapUnmarshal the coverage map from an hexadecimal string.
type interval_tree = interval_node listn-ary tree that modelize the coverage of a file. Every node's sub-trees are comprised in their parent wrt. their interval. This is the structure that should be exported.
val compute_interval_trees : coverage_map -> interval_tree FileMap.tBuild and normalize a coverage map into an interval tree.
val all_scopes : interval_tree -> ScopeSet.tall_scopes itvt iterates over the interval tree itvt and returns the union of all scopes that produced a Reached_by cover.
val format_interval_tree : Stdlib.Format.formatter -> interval_tree -> unit