Hets - the Heterogeneous Tool Set

Copyright(c) Martin Erwig Christian Maeder and Uni Bremen 1999-2006
LicenseGPLv2 or higher, see LICENSE.txt
MaintainerChristian.Maeder@dfki.de
Stabilityprovisional
Portabilityportable
Safe HaskellSafe

Common.Lib.Graph

Description

Tree-based implementation of Graph and DynGraph using Data.IntMap instead of Data.Graph.Inductive.Internal.FiniteMap

Synopsis

Documentation

newtype Gr a b Source #

the graph type constructor

Constructors

Gr 

Fields

Instances

Graph Gr Source # 

Methods

empty :: Gr a b

isEmpty :: Gr a b -> Bool

match :: Node -> Gr a b -> Decomp Gr a b

mkGraph :: [LNode a] -> [LEdge b] -> Gr a b

labNodes :: Gr a b -> [LNode a]

matchAny :: Gr a b -> GDecomp Gr a b

noNodes :: Gr a b -> Int

nodeRange :: Gr a b -> (Node, Node)

labEdges :: Gr a b -> [LEdge b]

DynGraph Gr Source # 

Methods

(&) :: Context a b -> Gr a b -> Gr a b

(Data b, Data a) => Data (Gr a b) Source # 

Methods

gfoldl :: (forall d c. Data d => c (d -> c) -> d -> c c) -> (forall g. g -> c g) -> Gr a b -> c (Gr a b)

gunfold :: (forall c r. Data c => c (c -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Gr a b)

toConstr :: Gr a b -> Constr

dataTypeOf :: Gr a b -> DataType

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Gr a b))

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Gr a b))

gmapT :: (forall c. Data c => c -> c) -> Gr a b -> Gr a b

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Gr a b -> r

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Gr a b -> r

gmapQ :: (forall d. Data d => d -> u) -> Gr a b -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> Gr a b -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Gr a b -> m (Gr a b)

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Gr a b -> m (Gr a b)

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Gr a b -> m (Gr a b)

(Show a, Show b) => Show (Gr a b) Source # 

Methods

showsPrec :: Int -> Gr a b -> ShowS

show :: Gr a b -> String

showList :: [Gr a b] -> ShowS

(ShATermLG a, ShATermLG b) => ShATermLG (Gr a b) Source # 

Methods

toShATermLG :: ATermTable -> Gr a b -> IO (ATermTable, Int) Source #

fromShATermLG :: LogicGraph -> Int -> ATermTable -> (ATermTable, Gr a b) Source #

data GrContext a b Source #

Constructors

GrContext 

Fields

Instances

(Data b, Data a) => Data (GrContext a b) Source # 

Methods

gfoldl :: (forall d c. Data d => c (d -> c) -> d -> c c) -> (forall g. g -> c g) -> GrContext a b -> c (GrContext a b)

gunfold :: (forall c r. Data c => c (c -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (GrContext a b)

toConstr :: GrContext a b -> Constr

dataTypeOf :: GrContext a b -> DataType

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (GrContext a b))

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (GrContext a b))

gmapT :: (forall c. Data c => c -> c) -> GrContext a b -> GrContext a b

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GrContext a b -> r

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GrContext a b -> r

gmapQ :: (forall d. Data d => d -> u) -> GrContext a b -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> GrContext a b -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GrContext a b -> m (GrContext a b)

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GrContext a b -> m (GrContext a b)

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GrContext a b -> m (GrContext a b)

(ShATermLG a, ShATermLG b) => ShATermLG (GrContext a b) Source # 

Methods

toShATermLG :: ATermTable -> GrContext a b -> IO (ATermTable, Int) Source #

fromShATermLG :: LogicGraph -> Int -> ATermTable -> (ATermTable, GrContext a b) Source #

unsafeConstructGr :: IntMap (GrContext a b) -> Gr a b Source #

decomposeGr :: Node -> Gr a b -> Maybe (GrContext a b, Gr a b) Source #

getPaths :: Node -> Gr a b -> [[LEdge b]] Source #

compute the possible cycle free paths from a start node

getAllPathsTo :: Node -> Gr a b -> [[LEdge b]] Source #

compute the possible cycle free reversed paths from a start node

getPathsTo :: Node -> Node -> Gr a b -> [[LEdge b]] Source #

compute the possible cycle free paths from a start node to a target node.

getLEdges :: Node -> Node -> Gr a b -> [b] Source #

get all the edge labels between two nodes

delLEdge :: (b -> b -> Ordering) -> LEdge b -> Gr a b -> Gr a b Source #

delete a labeled edge from a graph

insLEdge :: Bool -> (b -> b -> Ordering) -> LEdge b -> Gr a b -> (Gr a b, Bool) Source #

insert a labeled edge into a graph, returns False if edge exists

delLNode :: (a -> a -> Bool) -> LNode a -> Gr a b -> Gr a b Source #

delete a labeled node

labelNode :: LNode a -> Gr a b -> (Gr a b, a) Source #

sets the node with new label and returns the new graph and the old label

getNewNode :: Gr a b -> Node Source #

returns one new node id for the given graph

rmIsolated :: Gr a b -> Gr a b Source #

remove isolated nodes without edges