diff options
Diffstat (limited to 'lib/configuration/graph_tree.ml')
| -rw-r--r-- | lib/configuration/graph_tree.ml | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/lib/configuration/graph_tree.ml b/lib/configuration/graph_tree.ml index 240c1c9..64cef40 100644 --- a/lib/configuration/graph_tree.ml +++ b/lib/configuration/graph_tree.ml @@ -7,7 +7,7 @@ cycle analysis. *) module Vertex = struct - type t = Model.Reference.t Model.Content.t + type t = Model.content let compare t1 t2 = Model.Identifier.compare (Model.Content.id t1) (Model.Content.id t2) @@ -19,7 +19,7 @@ module Vertex = struct end module Edge = struct - type t = Default | Field of Model.Reference.t Model.Field.t + type t = Default | Field of Model.field let compare e1 e2 = match (e1, e2) with @@ -52,24 +52,15 @@ type t = G.t let create : unit -> t = G.create -let add_edge : - t -> - Model.Reference.t Model.Content.t -> - Model.Reference.t Model.Field.t -> - Model.Reference.t Model.Content.t -> - unit = +let add_edge : t -> Model.content -> Model.field -> Model.content -> unit = fun t src field dst -> G.add_edge_e t (src, Edge.Field field, dst) -let add_content : t -> Model.Reference.t Model.Content.t -> unit = G.add_vertex +let add_content : t -> Model.content -> unit = G.add_vertex let pp : Format.formatter -> t -> unit = GV_Printer.fprint_graph +let fold : (Model.content -> 'a -> 'a) -> t -> 'a -> 'a = Topological.fold +let iter : (Model.content -> unit) -> t -> unit = Topological.iter -let fold : (Model.Reference.t Model.Content.t -> 'a -> 'a) -> t -> 'a -> 'a = - Topological.fold - -let iter : (Model.Reference.t Model.Content.t -> unit) -> t -> unit = - Topological.iter - -exception Cycle of Model.Reference.t Model.Content.t list +exception Cycle of Model.content list let check_cycle : t -> unit = fun t -> Cycle.iter_cycles (fun vertexes -> raise_notrace (Cycle vertexes)) t |
