An implementation of term graphs used by the ICurry interpreter.
type NodeID
= Int
type ChoiceID
= Int
data PartCall
Constructors:
Known instances:
data Node
Constructors:
FuncNode
:: String -> [NodeID] -> Node
ConsNode
:: String -> [NodeID] -> Node
PartNode
:: String -> PartCall -> [NodeID] -> Node
ChoiceNode
:: ChoiceID -> NodeID -> NodeID -> Node
FreeNode
:: Node
Known instances:
data Graph
Constructors:
Known instances:
viewDot
:: Maybe String -> Int -> DotGraph -> IO ()
Views a dot graph as PDF.
If the first argument is (Just c), the command c
(e.g., "evince" or "okular --noraise") to view the
generated PDF is started in background, otherwise the viewer is not invoked.
The second argument is the step number and used to index the output files
if it is positive.
nodeChildren
:: Node -> [Int]
addPartialArg
:: Node -> Int -> Node
emptyGraph
:: Graph
lookupNode
:: Int -> Graph -> Node
addNode
:: Node -> Graph -> (Graph, Int)
updateNode
:: Graph -> Int -> Node -> Graph
replaceNode
:: Graph -> Int -> Int -> Graph
showGraphExp
:: Graph -> Int -> String
graphToDot
:: Graph -> [(Int, [(String, String)])] -> Bool -> Bool -> DotGraph
fullGraphToDot
:: Graph -> [(Int, [(String, String)])] -> Bool -> DotGraph
reachableGraph
:: Graph -> [Int] -> Graph