Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
See https://en.wikipedia.org/wiki/Binary_relation#Properties.
Note that these properties do not exhaust all of the possibilities.
For example, the relation \( y = x^2 \) is neither irreflexive, nor coreflexive, nor reflexive, since it contains the pairs \( (0, 0) \) and \( (2, 4) \), but not \( (2, 2) \).
The latter two facts also rule out quasi-reflexivity.
Synopsis
- reflexive :: (r -> r -> Bool) -> r -> Bool
- irreflexive :: (r -> r -> Bool) -> r -> Bool
- coreflexive :: Eq r => (r -> r -> Bool) -> r -> r -> Bool
- coreflexive_on :: (r -> r -> Bool) -> (r -> r -> Bool) -> r -> r -> Bool
- quasireflexive :: (r -> r -> Bool) -> r -> r -> Bool
Documentation
reflexive :: (r -> r -> Bool) -> r -> Bool Source #
\( \forall a: (a \# a) \)
For example, ≥ is a reflexive relation but > is not.
irreflexive :: (r -> r -> Bool) -> r -> Bool Source #
\( \forall a: \neg (a \# a) \)
For example, > is an irreflexive relation, but ≥ is not.
coreflexive :: Eq r => (r -> r -> Bool) -> r -> r -> Bool Source #
\( \forall a, b: ((a \# b) \wedge (b \# a)) \Rightarrow (a \equiv b) \)
For example, the relation over the integers in which each odd number is related to itself is a coreflexive relation. The equality relation is the only example of a relation that is both reflexive and coreflexive, and any coreflexive relation is a subset of the equality relation.
coreflexive_on :: (r -> r -> Bool) -> (r -> r -> Bool) -> r -> r -> Bool Source #
\( \forall a, b: ((a \# b) \wedge (b \# a)) \Rightarrow (a \doteq b) \)
quasireflexive :: (r -> r -> Bool) -> r -> r -> Bool Source #
\( \forall a, b: (a \# b) \Rightarrow ((a \# a) \wedge (b \# b)) \)