CurryInfo: icurry-3.2.0 / TermGraph.XML.choiceReachableFrom

definition:
choiceReachableFrom :: [(NodeID,Node)] -> FingerPrint -> [NodeID] -> NodeID
                    -> NodeID -> Bool
choiceReachableFrom graph cms visited toNId fromNId
  | fromNId == toNId = True
  | otherwise
  = let node   = fromMaybe (error "choiceReachableFrom: Reached a node that is not in the graph")
                           (lookup fromNId graph)
        newvis = fromNId : visited
    in case node of
      ChoiceNode cid c1 c2
        | chDst == 1 -> choiceReachableFrom graph cms newvis toNId c1
        | chDst == 2 -> choiceReachableFrom graph cms newvis toNId c2
        | otherwise  -> False
        where chDst = fromMaybe 0 (lookup cid cms)
      _ -> or $ map (choiceReachableFrom graph cms newvis toNId)
                    (nub $ nodeChildren node)
demand:
no demanded arguments
deterministic:
deterministic operation
documentation:
--Function isn't very efficient, recursive application on children needs to be folded
--so that visited nodes get carried over.
failfree:
(_, _, _, _, _)
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_,_,_,_) |-> _}
name:
choiceReachableFrom
precedence:
no precedence defined
result-values:
_
signature:
[(Prelude.Int, ICurry.Graph.Node)] -> [(Prelude.Int, Prelude.Int)]
-> [Prelude.Int] -> Prelude.Int -> Prelude.Int -> Prelude.Bool
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term