Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data TypedGraphMorphism a b
- idMap :: TypedGraph a b -> TypedGraph a b -> TypedGraphMorphism a b
- isPartialInjective :: TypedGraphMorphism a b -> TypedGraphMorphism a b -> Bool
- invert :: TypedGraphMorphism a b -> TypedGraphMorphism a b
- nodeIdsFromDomain :: TypedGraphMorphism a b -> [NodeId]
- edgeIdsFromDomain :: TypedGraphMorphism a b -> [EdgeId]
- edgesFromDomain :: TypedGraphMorphism a b -> [Edge (Maybe b)]
- nodeIdsFromCodomain :: TypedGraphMorphism a b -> [NodeId]
- edgeIdsFromCodomain :: TypedGraphMorphism a b -> [EdgeId]
- edgesFromCodomain :: TypedGraphMorphism a b -> [Edge (Maybe b)]
- graphDomain :: TypedGraphMorphism a b -> Graph (Maybe a) (Maybe b)
- graphCodomain :: TypedGraphMorphism a b -> Graph (Maybe a) (Maybe b)
- mapping :: TypedGraphMorphism a b -> GraphMorphism (Maybe a) (Maybe b)
- applyNode :: TypedGraphMorphism a b -> NodeId -> Maybe NodeId
- applyEdge :: TypedGraphMorphism a b -> EdgeId -> Maybe EdgeId
- buildTypedGraphMorphism :: TypedGraph a b -> TypedGraph a b -> GraphMorphism (Maybe a) (Maybe b) -> TypedGraphMorphism a b
- checkDeletion :: Eq t => TypedGraphMorphism a b -> TypedGraphMorphism a b -> (TypedGraphMorphism a b -> t -> Maybe t) -> (TypedGraphMorphism a b -> [t]) -> t -> Bool
- removeNodeFromDomain :: NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- removeEdgeFromDomain :: EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- removeNodeFromCodomain :: NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- removeEdgeFromCodomain :: EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- applyNodeUnsafe :: TypedGraphMorphism a b -> NodeId -> NodeId
- applyEdgeUnsafe :: TypedGraphMorphism a b -> EdgeId -> EdgeId
- createEdgeOnDomain :: EdgeId -> NodeId -> NodeId -> EdgeId -> EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- createEdgeOnCodomain :: EdgeId -> NodeId -> NodeId -> EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- createNodeOnDomain :: NodeId -> NodeId -> NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- createNodeOnCodomain :: NodeId -> NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- updateEdgeRelation :: EdgeId -> EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- updateNodeRelation :: NodeId -> NodeId -> NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- untypedUpdateNodeRelation :: NodeId -> NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b
- orphanTypedNodeIds :: TypedGraphMorphism a b -> [NodeId]
- orphanTypedEdgeIds :: TypedGraphMorphism a b -> [EdgeId]
- orphanTypedEdges :: TypedGraphMorphism a b -> [Edge (Maybe b)]
- reflectIdsFromTypeGraph :: TypedGraphMorphism a b -> TypedGraphMorphism a b
- reflectIdsFromCodomain :: TypedGraphMorphism a b -> TypedGraphMorphism a b
- reflectIdsFromDomains :: (TypedGraphMorphism a b, TypedGraphMorphism a b) -> (TypedGraphMorphism a b, TypedGraphMorphism a b)
Documentation
data TypedGraphMorphism a b Source #
Eq (TypedGraphMorphism a b) Source # | |
Show (TypedGraphMorphism a b) Source # | |
Valid (TypedGraphMorphism a b) Source # | |
Morphism (TypedGraphMorphism a b) Source # | |
type Obj (TypedGraphMorphism a b) Source # | |
idMap :: TypedGraph a b -> TypedGraph a b -> TypedGraphMorphism a b Source #
Creates a TypedGraphMorphism mapping nodes and edges according to their identifiers.
isPartialInjective :: TypedGraphMorphism a b -> TypedGraphMorphism a b -> Bool Source #
Test if a nac
is partial injective (injective out of m
)
invert :: TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
Invert a typed graph morphism
nodeIdsFromDomain :: TypedGraphMorphism a b -> [NodeId] Source #
Return the nodes ids in the domain of a given TypedGraphMorphism
edgeIdsFromDomain :: TypedGraphMorphism a b -> [EdgeId] Source #
Return the edges ids in the domain of a given TypedGraphMorphism
edgesFromDomain :: TypedGraphMorphism a b -> [Edge (Maybe b)] Source #
Return the edges in the domain of a given TypedGraphMorphism
nodeIdsFromCodomain :: TypedGraphMorphism a b -> [NodeId] Source #
Return the nodes ids in the codomain of a given TypedGraphMorphism
edgeIdsFromCodomain :: TypedGraphMorphism a b -> [EdgeId] Source #
Return the edges ids in the codomain of a given TypedGraphMorphism
edgesFromCodomain :: TypedGraphMorphism a b -> [Edge (Maybe b)] Source #
Return the edges in the codomain of a given TypedGraphMorphism
graphDomain :: TypedGraphMorphism a b -> Graph (Maybe a) (Maybe b) Source #
Return the domain graph
graphCodomain :: TypedGraphMorphism a b -> Graph (Maybe a) (Maybe b) Source #
Return the codomain graph
mapping :: TypedGraphMorphism a b -> GraphMorphism (Maybe a) (Maybe b) Source #
applyNode :: TypedGraphMorphism a b -> NodeId -> Maybe NodeId Source #
Given a TypedGraphMorphism t: G1 -> G2
and a node n
in G1
, it returns the node in G2
to which n
gets mapped
applyEdge :: TypedGraphMorphism a b -> EdgeId -> Maybe EdgeId Source #
Given a TypedGraphMorphism t: G1 -> G2
and an edge e
in G1
, it returns the edge in G2
to which e
gets mapped
buildTypedGraphMorphism :: TypedGraph a b -> TypedGraph a b -> GraphMorphism (Maybe a) (Maybe b) -> TypedGraphMorphism a b Source #
Given two TypedGraph
s G1
and G2
and a simple GraphMorphism
between them, it returns a TypedGraphMorphism
from G1
to G2
checkDeletion :: Eq t => TypedGraphMorphism a b -> TypedGraphMorphism a b -> (TypedGraphMorphism a b -> t -> Maybe t) -> (TypedGraphMorphism a b -> [t]) -> t -> Bool Source #
TODO: Find a better name for this function, that was repeated both here and in the GraphRule archive | Given the left-hand-side morphism of a rule l : K -> L, a match m : L -> G for this rule, an element e (that can be either a Node or an Edge) and two functions apply (for applying that element in a TypedGraphMorphism) and list (to get all the corresponding elements in the domain of m), it returns true if e is deleted by this rule for the given match
removeNodeFromDomain :: NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
Remove a node from the domain of a typed graph morphism
removeEdgeFromDomain :: EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
Remove an edge from the domain of a typed graph morphism
removeNodeFromCodomain :: NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
Remove a node from the codomain of a typed graph morphism
removeEdgeFromCodomain :: EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
Remove an edge from the domain of a typed graph morphism
applyNodeUnsafe :: TypedGraphMorphism a b -> NodeId -> NodeId Source #
Given a TypedGraphMorphism
t
and a node n
in the domain of t
, return the node in the image
of t
to which n
gets mapped or error in the case of undefined
applyEdgeUnsafe :: TypedGraphMorphism a b -> EdgeId -> EdgeId Source #
Given a TypedGraphMorphism
t
and an edge e
in the domain of t
, return the edge in the image
of t
to which e
gets mapped or error in the case of undefined
createEdgeOnDomain :: EdgeId -> NodeId -> NodeId -> EdgeId -> EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
This function adds an edge e1 (with source s1, target t1 and type tp) to the domain of the typed graph morphism, and associate it to e2 It assumes s1, t1, e2, tp already exist, and that e1 does not exist.
createEdgeOnCodomain :: EdgeId -> NodeId -> NodeId -> EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
This function adds an edge e2 (with source s2, target t2 and type tp) to the codomain of the typed graph morphism It assumes s2, t2, tp already exist, and that e2 does not exist.
createNodeOnDomain :: NodeId -> NodeId -> NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
This function adds a node n1 (type tp) to the domain of the typed graph morphism, and associate it to n2 It assumes n2 and tp already exist, and that n1 does not exist.
createNodeOnCodomain :: NodeId -> NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
This function adds a node n2 (type tp) to the codomain of the typed graph morphism It assumes tp already exist, and that n2 does not exist.
updateEdgeRelation :: EdgeId -> EdgeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
updates a typed graph morphism, mapping edge e1 to edge e2. It assumes both edges already exist.
updateNodeRelation :: NodeId -> NodeId -> NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
updates a typed graph morphism, mapping node n1 to node n2. It assumes both nodes already exist.
untypedUpdateNodeRelation :: NodeId -> NodeId -> TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
updates a typed graph morphism, mapping node n1 to node n2. It assumes both nodes already exist and are of the same type.
orphanTypedNodeIds :: TypedGraphMorphism a b -> [NodeId] Source #
Given a TypedGraphMorphism
, return its orphan nodes ids
orphanTypedEdgeIds :: TypedGraphMorphism a b -> [EdgeId] Source #
Given a TypedGraphMorphism
, return its orphan edges ids
orphanTypedEdges :: TypedGraphMorphism a b -> [Edge (Maybe b)] Source #
Given a TypedGraphMorphism
, return its orphan edges
reflectIdsFromTypeGraph :: TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
Given a TypedGraphMorphism tgm, creates an isomorphic TypedGraphMorphism tgm' where the mapping between the domain and codomain can be seen as explicit inclusion (the same ids) Attention: It works only when the typing morphism is injective, otherwise it will produce an invalid TypedGraphMorphism
reflectIdsFromCodomain :: TypedGraphMorphism a b -> TypedGraphMorphism a b Source #
Given a TypedGraphMorphism tgm, creates an isomorphic TypedGraphMorphism tgm' where the nodes and edges in the domain have the same ids as the ones in the codomain
reflectIdsFromDomains :: (TypedGraphMorphism a b, TypedGraphMorphism a b) -> (TypedGraphMorphism a b, TypedGraphMorphism a b) Source #