graph

File graph.str
Author unknown
Since unknown

A generic algorithm for mapping a graph to a collection of nodes reachablefrom a given root node.

Basic idea: configuration of the form (todo, done, files), keep adding files corresponding to the names in \verb|todo| until empty




Statistics


General
Lines of code 74
Stratego
Module number 1 (100% documented)
Constructor number 0
Overlay number 0
Strategy number 6 (16% documented)
Rule number 6 (0% documented)
DynamicRule number 0



Strategy summary


graph-nodes(Strategy get-node, Strategy out-edges, Strategy add-node) The strategy 'graph-nodes' is a generic algorithm for mapping a graph to a collection of nodes reachable from a given root node graph.str
graph-nodes-roots(Strategy get-node, Strategy out-edges, Strategy add-node) n/a graph.str
graph-nodes-undef(Strategy get-node, Strategy out-edges, Strategy add-node) n/a graph.str
graph-nodes-undef-chgr(Strategy get-node, Strategy out-edges, Strategy add-node) n/a graph.str
graph-nodes-undef-roots(Strategy get-node, Strategy out-edges, Strategy add-node) n/a graph.str
graph-nodes-undef-roots-chgr(Strategy get-node, Strategy out-edges, Strategy add-node) n/a graph.str

Rule summary


GnExit n/a graph.str
GnInit n/a graph.str
GnInitRoots n/a graph.str
GnNext(Strategy get-node, Strategy out-edges, Strategy add-node) n/a graph.str
GnNextChangeGraph(Strategy get-node, Strategy out-edges, Strategy add-node) n/a graph.str
GnUndefined n/a graph.str



Strategy details


ATerm graph-nodes(Strategy get-node, Strategy out-edges, Strategy add-node)
File graph.str
Author unknown
Since unknown
 

The strategy 'graph-nodes' is a genericalgorithm for mapping a graph to a collection of nodes reachablefrom a given root node. The algorithm is parameterized with thefollowing notions: 'get-node' maps a node name and a graph to thenode itself, 'out-edges' maps a node to the names of its outedges, 'add-node' that adds a name and its corresponding node to acollection of nodes.

get-node :: name * graph -> node out-edges :: node -> List(name)add-node :: name * node * nodes -> nodes