oalg-base-3.0.0.0: Algebraic structures on oriented entities and limits as a tool kit to solve algebraic problems.
Copyright(c) Erich Gut
LicenseBSD3
Maintainerzerich.gut@gmail.com
Safe HaskellNone
LanguageHaskell2010

OAlg.Entity.Sequence.Graph

Description

graphs of entities in x.

Synopsis

Graph

newtype Graph i x Source #

mapping from an ordered index type i to a Entity type x.

Property Let g = Graph ixs be in Graph i x for a ordered Entity type i and Entity type x, then holds:

  1. For all ..(i,_):(j,_).. in ixs holds: i < j.
  2. lengthN g == lengthN ixs.

Constructors

Graph [(i, x)] 

Instances

Instances details
Functor (Graph i) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

fmap :: (a -> b) -> Graph i a -> Graph i b #

(<$) :: a -> Graph i b -> Graph i a #

Filterable (Graph i) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

filter :: (x -> Bool) -> Graph i x -> Graph i x Source #

(Entity x, Entity i, Ord i) => ConstructableSequence (Graph i) i x Source # 
Instance details

Defined in OAlg.Entity.Sequence.Definition

Methods

sequence :: (i -> Maybe x) -> Set i -> Graph i x Source #

(<&) :: Graph i x -> Set i -> Graph i x Source #

Ord i => Sequence (Graph i) i x Source # 
Instance details

Defined in OAlg.Entity.Sequence.Definition

Methods

graph :: p i -> Graph i x -> Graph i x Source #

list :: p i -> Graph i x -> [(x, i)] Source #

(??) :: Graph i x -> i -> Maybe x Source #

(Show i, Show x) => Show (Graph i x) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

showsPrec :: Int -> Graph i x -> ShowS #

show :: Graph i x -> String #

showList :: [Graph i x] -> ShowS #

(Eq i, Eq x) => Eq (Graph i x) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

(==) :: Graph i x -> Graph i x -> Bool #

(/=) :: Graph i x -> Graph i x -> Bool #

(Ord i, Ord x) => Ord (Graph i x) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

compare :: Graph i x -> Graph i x -> Ordering #

(<) :: Graph i x -> Graph i x -> Bool #

(<=) :: Graph i x -> Graph i x -> Bool #

(>) :: Graph i x -> Graph i x -> Bool #

(>=) :: Graph i x -> Graph i x -> Bool #

max :: Graph i x -> Graph i x -> Graph i x #

min :: Graph i x -> Graph i x -> Graph i x #

(Ord a, Ord b) => Erasable (Graph a (Set b)) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

(//) :: Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #

(Ord a, Ord b) => Logical (Graph a (Set b)) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

(||) :: Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #

(&&) :: Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #

LengthN (Graph i x) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

lengthN :: Graph i x -> N Source #

(Entity x, Entity i, Ord i) => Validable (Graph i x) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

valid :: Graph i x -> Statement Source #

(Ord a, Ord b) => Lattice (Graph a (Set b)) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

(Ord a, Ord b) => Empty (Graph a (Set b)) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

empty :: Graph a (Set b) Source #

isEmpty :: Graph a (Set b) -> Bool Source #

(Ord a, Ord b) => PartiallyOrdered (Graph a (Set b)) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Graph

Methods

(<<=) :: Graph a (Set b) -> Graph a (Set b) -> Bool Source #

gphLength :: Graph i x -> N Source #

the length of a graph.

gphxs :: Graph i x -> [(i, x)] Source #

the underlying associations.

gphSqc :: (i -> Maybe x) -> Set i -> Graph i x Source #

the induced graph given by a set of indices and a mapping.

gphLookup :: Ord i => Graph i x -> i -> Maybe x Source #

looks up the mapping of an index.

gphTakeN :: N -> Graph i x -> Graph i x Source #

takes the first n elements.

gphSetFilter :: (b -> Bool) -> Graph a (Set b) -> Graph a (Set b) Source #

filtering elements of the associated sets.

Lattice

gphUnion :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #

the union of two graphs on sets.

gphIntersection :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #

the intersection of two graphs on sets.

gphDifference :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Graph a (Set b) Source #

the difference of two graphs on sets.

isSubGraph :: (Ord a, Ord b) => Graph a (Set b) -> Graph a (Set b) -> Bool Source #

testing of being a sub graph.

Conversions

gphset :: Graph a (Set b) -> Set (a, b) Source #

converts a graph of sets to a set of pairs. The inverse is given by setgph.

Note

  1. This works also with infinite graphs of sets.
  2. It is not true that setgph and gphset are inverse in the strict sense, but almost, i.e. only in one restricts the graph to not empty associations. For example Graph [(1,Set []) :: Graph N (Set Char) and Graph [] :: Graph N (Set Char) both are mapped under gphset to Set [] :: Set (N,Char).

setgph :: Eq a => Set (a, b) -> Graph a (Set b) Source #

converts a set of pairs to a graph of sets. The inverse is given by gphset.

Note This works also with infinite sets of pairs..