verigraph-1.1.1: Software specification and verification tool based on graph rewriting.

Safe HaskellSafe
LanguageHaskell2010

TypedGraph.Morphism

Synopsis

Documentation

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

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 TypedGraphs 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 tand 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 tand 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