package libsail

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Jib_compile.IdGraphSource

include Graph.S with type node = Ast.id
Sourcetype node = Ast.id
Sourcetype graph
Sourcetype node_set
Sourceval leaves : graph -> node_set
Sourceval empty : graph
Sourceval add_edge : node -> node -> graph -> graph

Add an edge from the first node to the second node, creating the nodes if they do not exist.

Sourceval add_edges : node -> node list -> graph -> graph
Sourceval children : graph -> node -> node list
Sourceval nodes : graph -> node list
Sourceval reachable : node_set -> node_set -> graph -> node_set

Return the set of nodes that are reachable from the first set of nodes (roots), without passing through the second set of nodes (cuts).

Sourceval prune : node_set -> node_set -> graph -> graph

Prune a graph from roots to cuts.

Sourceval remove_self_loops : graph -> graph
Sourceval self_loops : graph -> node list
Sourceval reverse : graph -> graph
Sourceexception Not_a_DAG of node * graph
Sourceval topsort : graph -> node list

Topologically sort a graph. Throws Not_a_DAG if the graph is not directed acyclic.

Sourceval scc : ?original_order:node list -> graph -> node list list

Find strongly connected components using Tarjan's algorithm. This algorithm also returns a topological sorting of the graph components.

Sourceval make_dot : (node -> string) -> (node -> node -> string) -> (node -> string) -> out_channel -> graph -> unit
OCaml

Innovation. Community. Security.