[silver:util:graph]

Contents of [silver:util:graph]:

Defined in this grammar:

ffi type Graph

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 9.

A primitive graph representation. Edges has no special value they either exist or do not.


fun empty   (Ord a => Graph<a> ::= )

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 14.

Returns an empty graph using Ord for comparison.


function emptyWith   (Graph<a> ::= comparator::(Integer ::= a a) )

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 19.

Returns an empty graph using the specified vertex comparator.


function add   (Graph<a> ::= lst::[Pair<a a>] graph::Graph<a> )

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 30.

Adds a list of edges to the map


function edgesFrom   (set:Set<a> ::= vertex::a graph::Graph<a> )

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 41.

Returns a set of edges FROM a particular vertex


function contains   (Boolean ::= edge::Pair<a a> graph::Graph<a> )

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 52.

Determines whether an edge already exists in the graph.


function toList   ([Pair<a a>] ::= graph::Graph<a> )

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 63.

Returns the list of edges that make up the graph.


function transitiveClosure   (Graph<a> ::= graph::Graph<a> )

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 74.

Returns the transitiveClosure of a graph


function repairClosure   (Graph<a> ::= lst::[Pair<a a>] graph::Graph<a> )

Contained in grammar [silver:util:graph]. Defined at silver/util/graph/Graph.sv line 86.

Assumes graph is already a transitive closure, adds the new edges, and repair the transitive closure.