| Copyright | Guillaume Sabbagh 2022 |
|---|---|
| License | GPL-3 |
| Maintainer | guillaumesabbagh@protonmail.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Math.Categories.FinGrph
Description
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
- 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.
Constructors
| Arrow | |
Fields
| |
Instances
| (PrettyPrint n, PrettyPrint e) => PrettyPrint (Arrow n e) Source # | |
Defined in Math.Categories.FinGrph | |
| (Show n, Show e) => Show (Arrow n e) Source # | |
| (Eq n, Eq e) => Eq (Arrow n e) Source # | |
Instances
| (PrettyPrint n, PrettyPrint e, Eq n, Eq e) => PrettyPrint (Graph n e) Source # | |
Defined in Math.Categories.FinGrph | |
| (Show n, Show e) => Show (Graph n e) Source # | |
| (Eq n, Eq e) => Eq (Graph n e) Source # | |
| (Eq n, Eq e) => Morphism (GraphHomomorphism n e) (Graph n e) Source # | |
Defined in Math.Categories.FinGrph Methods (@?) :: GraphHomomorphism n e -> GraphHomomorphism n e -> Maybe (GraphHomomorphism n e) Source # source :: GraphHomomorphism n e -> Graph n e Source # target :: GraphHomomorphism n e -> Graph n e Source # | |
| (Eq n, Eq e, Show n, Show e) => Category (FinGrph n e) (GraphHomomorphism n e) (Graph n e) Source # | |
Defined in Math.Categories.FinGrph Methods identity :: FinGrph n e -> Graph n e -> GraphHomomorphism n e Source # ar :: FinGrph n e -> Graph n e -> Graph n e -> Set (GraphHomomorphism n e) Source # genAr :: FinGrph n e -> Graph n e -> Graph n e -> Set (GraphHomomorphism n e) Source # decompose :: FinGrph n e -> GraphHomomorphism n e -> [GraphHomomorphism n e] Source # | |
Getters
Smart constructors
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.
Constructors
| FinGrph |
Instances
| (PrettyPrint n, PrettyPrint e, Eq n, Eq e) => PrettyPrint (FinGrph n e) Source # | |
Defined in Math.Categories.FinGrph | |
| Show (FinGrph n e) Source # | |
| Eq (FinGrph n e) Source # | |
| (Eq n, Eq e, Show n, Show e) => Category (FinGrph n e) (GraphHomomorphism n e) (Graph n e) Source # | |
Defined in Math.Categories.FinGrph Methods identity :: FinGrph n e -> Graph n e -> GraphHomomorphism n e Source # ar :: FinGrph n e -> Graph n e -> Graph n e -> Set (GraphHomomorphism n e) Source # genAr :: FinGrph n e -> Graph n e -> Graph n e -> Set (GraphHomomorphism n e) Source # decompose :: FinGrph n e -> GraphHomomorphism n e -> [GraphHomomorphism n e] Source # | |
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.