modern-compiler-ml/tiger/chap9/graph.sig
jmug 33d8bac511 Add the tiger source code bundle from the book site
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2024-12-18 15:18:45 -08:00

23 lines
545 B
Standard ML

signature GRAPH =
sig
type graph
type node
val nodes: graph -> node list
val succ: node -> node list
val pred: node -> node list
val adj: node -> node list (* succ+pred *)
val eq: node*node -> bool
val newGraph: unit -> graph
val newNode : graph -> node
exception GraphEdge
val mk_edge: {from: node, to: node} -> unit
val rm_edge: {from: node, to: node} -> unit
structure Table : TABLE
sharing type Table.key = node
val nodename: node->string (* for debugging only *)
end