|
definition: |
followPath :: Graph -> NodeID -> [Int] -> NodeID
followPath _ n [] = n
followPath g n (i:is) = case lookupNode n g of
ConsNode _ ns -> followPath g (selectArg ns) is
FuncNode _ ns -> followPath g (selectArg ns) is
PartNode _ _ ns -> followPath g (selectArg ns) is
ChoiceNode _ n1 n2 -> followPath g (selectArg [n1,n2]) is
FreeNode -> error "followPath: FreeNode"
where
selectArg ns | i >= length ns = error "followPath: argument does not exist!"
| otherwise = ns !! i
|
|
demand: |
argument 3 |
|
deterministic: |
deterministic operation |
|
documentation: |
Follows a path from a given node. |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,{[]}) |-> _ || (_,_,{:}) |-> _}
|
|
name: |
followPath |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
ICurry.Graph.Graph -> Prelude.Int -> [Prelude.Int] -> Prelude.Int |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |