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

Safe HaskellSafe
LanguageHaskell2010

Graph.GraphMorphism

Contents

Synopsis

Types

Construction

empty :: Graph a b -> Graph a b -> GraphMorphism a b Source #

An empty morphism between two graphs.

buildGraphMorphism :: Graph a b -> Graph a b -> [(Int, Int)] -> [(Int, Int)] -> GraphMorphism a b Source #

Construct a graph morphism

fromGraphsAndRelations :: Graph a b -> Graph a b -> Relation NodeId -> Relation EdgeId -> GraphMorphism a b Source #

Constructs a GraphMorphism from two Graphs, a node relation and a edge relation.

Transformation

invertGraphMorphism :: GraphMorphism a b -> GraphMorphism a b Source #

The inverse graph morphism.

updateCodomain :: Graph a b -> GraphMorphism a b -> GraphMorphism a b Source #

Set a new codomain.

updateDomain :: Graph a b -> GraphMorphism a b -> GraphMorphism a b Source #

Set a new domain.

updateNodes :: NodeId -> NodeId -> GraphMorphism a b -> GraphMorphism a b Source #

Add a mapping between both nodes into the morphism. If ln is already mapped, or neither nodes are in their respective graphs, return the original morphism.

updateNodeRelation :: NodeId -> NodeId -> GraphMorphism (Maybe a) b -> GraphMorphism (Maybe a) b Source #

Inserts nodes in a graph morphism, if the nodes do not exist, they are created

updateEdgeRelation :: EdgeId -> EdgeId -> GraphMorphism a b -> GraphMorphism a b Source #

Modifies a graph morphism, mapping edge e1 to edge e2. It assumes both edges already exist.

updateEdges :: EdgeId -> EdgeId -> GraphMorphism a b -> GraphMorphism a b Source #

Add a mapping between both edges into the morphism. If le is already mapped, or neither edges are in their respective graphs, return the original morphism.

removeEdgeFromDomain :: EdgeId -> GraphMorphism a b -> GraphMorphism a b Source #

Remove an edge from the domain of the morphism

removeEdgeFromCodomain :: EdgeId -> GraphMorphism a b -> GraphMorphism a b Source #

Remove an edge from the codomain of the morphism

removeNodeFromDomain :: NodeId -> GraphMorphism a b -> GraphMorphism a b Source #

Remove a node from the domain of the morphism. Don't change the morphism if there were edges incident to the node.

removeNodeFromDomainForced :: NodeId -> GraphMorphism a b -> GraphMorphism a b Source #

Remove a node from the domain of the morphism It does not verify if the node has incident edges, thus it may generate invalid graph morphisms.

removeNodeFromCodomain :: NodeId -> GraphMorphism a b -> GraphMorphism a b Source #

Remove a node from the codomain of the morphism Don't change the morphism if there were edges incident to the node.

createEdgeOnDomain :: EdgeId -> NodeId -> NodeId -> EdgeId -> GraphMorphism a (Maybe b) -> GraphMorphism a (Maybe b) Source #

This function adds an edge e1 (with source s1 and target t1) to the domain of the morphism, and associate it to e2 It assumes s1, t1, e2 already exist, and that e1 does not exist.

createEdgeOnCodomain :: EdgeId -> NodeId -> NodeId -> GraphMorphism a (Maybe b) -> GraphMorphism a (Maybe b) Source #

This function adds an edge e2 (with source s2 and target t2) to the codomain of the morphism. It assumes that s2,t2 exist, and that e2 does not exist

createNodeOnDomain :: NodeId -> NodeId -> GraphMorphism (Maybe a) b -> GraphMorphism (Maybe a) b Source #

This function adds an edge e1 (with source s1 and target t1) to the domain of the morphism, and associate it to e2 It assumes s1, t1, e2 already exist, and that e1 does not exist.

createNodeOnCodomain :: NodeId -> GraphMorphism (Maybe a) b -> GraphMorphism (Maybe a) b Source #

This function adds an edge e2 (with source s2 and target t2) to the codomain of the morphism. It assumes that s2,t2 exist, and that e2 does not exist

Query

applyNode :: GraphMorphism a b -> NodeId -> Maybe NodeId Source #

Return the node to which ln gets mapped.

applyNodeUnsafe :: GraphMorphism a b -> NodeId -> NodeId Source #

Return the node to which le gets mapped or error in the case of undefined

applyEdge :: GraphMorphism a b -> EdgeId -> Maybe EdgeId Source #

Return the edge to which le gets mapped.

applyEdgeUnsafe :: GraphMorphism a b -> EdgeId -> EdgeId Source #

Return the edge to which le gets mapped or error in the case of undefined

orphanNodeIds :: GraphMorphism a b -> [NodeId] Source #

Return the orphan nodes ids in a graph morphism

orphanEdgeIds :: GraphMorphism a b -> [EdgeId] Source #

Return the orphan edgesIds in a graph morphism

orphanEdges :: GraphMorphism a b -> [Edge b] Source #

Return the orphan edges in a graph morphism

isPartialInjective :: GraphMorphism a b -> GraphMorphism a b -> Bool Source #

Test if a nac is partial injective (injective out of q)