Copyright | Guillaume Sabbagh 2022 |
---|---|
License | GPL-3 |
Maintainer | guillaumesabbagh@protonmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The FinGrph
category has finite multidigraphs as objects and multidigraph homomorphisms as morphisms.
Synopsis
- data Arrow n e = Arrow {
- sourceArrow :: n
- targetArrow :: n
- labelArrow :: e
- data Graph n e
- nodes :: Graph n e -> Set n
- edges :: Graph n e -> Set (Arrow n e)
- graph :: Eq n => Set n -> Set (Arrow n e) -> Maybe (Graph n e)
- unsafeGraph :: Set n -> Set (Arrow n e) -> Graph n e
- mapOnNodes :: (n1 -> n2) -> Graph n1 e -> Graph n2 e
- mapOnEdges :: (e1 -> e2) -> Graph n e1 -> Graph n e2
- data GraphHomomorphism n e
- nodeMap :: GraphHomomorphism n e -> Map n n
- edgeMap :: GraphHomomorphism n e -> Map (Arrow n e) (Arrow n e)
- checkGraphHomomorphism :: (Eq n, Eq e) => GraphHomomorphism n e -> Bool
- graphHomomorphism :: (Eq n, Eq e) => Map n n -> Map (Arrow n e) (Arrow n e) -> Graph n e -> Maybe (GraphHomomorphism n e)
- unsafeGraphHomomorphism :: Map n n -> Map (Arrow n e) (Arrow n e) -> Graph n e -> GraphHomomorphism n e
- data FinGrph n e = FinGrph
- underlyingGraph :: (FiniteCategory c m o, Morphism m o) => c -> Graph o m
- underlyingGraphFormat :: (FiniteCategory c m o, Morphism m o) => (o -> a) -> (m -> b) -> c -> Graph a b
Graph
An Arrow
is composed of a source node, a target node and a label.
Arrow | |
|
Instances
(PrettyPrint n, PrettyPrint e) => PrettyPrint (Arrow n e) Source # | |
(Simplifiable n, Simplifiable e) => Simplifiable (Arrow n e) Source # | |
Defined in Math.Categories.FinGrph | |
Generic (Arrow n e) Source # | |
(Show n, Show e) => Show (Arrow n e) Source # | |
(Eq n, Eq e) => Eq (Arrow n e) Source # | |
type Rep (Arrow n e) Source # | |
Defined in Math.Categories.FinGrph type Rep (Arrow n e) = D1 ('MetaData "Arrow" "Math.Categories.FinGrph" "FiniteCategories-0.6.0.1-L2v014CZIYe4CTCeXkyH5k" 'False) (C1 ('MetaCons "Arrow" 'PrefixI 'True) (S1 ('MetaSel ('Just "sourceArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 n) :*: (S1 ('MetaSel ('Just "targetArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 n) :*: S1 ('MetaSel ('Just "labelArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 e)))) |
Instances
Getters
Smart constructors
Transformation
Graph homomorphism
data GraphHomomorphism n e Source #
A GraphHomomorphism
is composed of a map between the nodes of the graphs, a map between the edges of the graphs, and the target Graph
so that we can recover it from the morphism.
It must follow axioms such that the image of an arrow is not torn appart, that is why the constructor is private. Use the smart constructor graphHomomorphism
instead.
Instances
Getters
nodeMap :: GraphHomomorphism n e -> Map n n Source #
The mapping of nodes.
Smart constructor
checkGraphHomomorphism :: (Eq n, Eq e) => GraphHomomorphism n e -> Bool Source #
Check wether the structure of GraphHomomorphism
is respected or not.
graphHomomorphism :: (Eq n, Eq e) => Map n n -> Map (Arrow n e) (Arrow n e) -> Graph n e -> Maybe (GraphHomomorphism n e) Source #
The smart constructor of GraphHomomorphism
.
unsafeGraphHomomorphism :: Map n n -> Map (Arrow n e) (Arrow n e) -> Graph n e -> GraphHomomorphism n e Source #
Unsafe constructor of GraphHomomorphism
which does not check the structure of the GraphHomomorphism
.
FinGrph
The category of finite graphs.
Instances
underlyingGraph :: (FiniteCategory c m o, Morphism m o) => c -> Graph o m Source #
Return the underlying graph of a FiniteCategory
.
underlyingGraphFormat :: (FiniteCategory c m o, Morphism m o) => (o -> a) -> (m -> b) -> c -> Graph a b Source #
Return the underlying graph of a FiniteCategory
and apply formatting functions on objects and arrows.