relation-0.5.2.0: A data structure representing Relations on Sets.

Safe HaskellSafe
LanguageHaskell2010

Data.Relation.Ops

Synopsis

Documentation

Primitive implementation for the right selection and left selection operators.

PICA provides both operators: |> and <| and |$> and <$|

in this library, for working with Relations and OIS (Ordered, Inductive Sets?).

PICA exposes the operators defined here, so as not to interfere with the abstraction of the Relation type and because having access to Relation hidden components is a more efficient implementation of the operation of restriction.

    (a <$| b) r

      denotes: for every element     b from the Set      B,
               select an element a     from the Set A     ,
                             if  a
                  is related to      b
                  in r
    (a |$> b) r

      denotes: for every element a      from the Set A    ,
               select an element     b  from the Set     B,
                             if  a
                  is related to      b
                  in r

With regard to domain restriction and range restriction operators of the language, those are described differently and return the domain or the range.

(|$>) :: (Ord a, Ord b) => Set a -> Set b -> Relation a b -> Set b Source #

(Case a |> r b)

(<$|) :: (Ord a, Ord b) => Set a -> Set b -> Relation a b -> Set a Source #

(Case b <| r a)

(<|) :: (Ord a, Ord b) => Set a -> Relation a b -> Relation a b Source #

Domain restriction for a relation. Modeled on z.

(|>) :: (Ord a, Ord b) => Relation a b -> Set b -> Relation a b Source #

Range restriction for a relation. Modeled on z.