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.
As an example over the natural numbers, the relation \(a \# b \) defined by \( a > 2 \) is neither symmetric nor antisymmetric, let alone asymmetric.
Synopsis
- symmetric :: (r -> r -> Bool) -> r -> r -> Bool
- asymmetric :: (r -> r -> Bool) -> r -> r -> Bool
- antisymmetric :: Eq r => (r -> r -> Bool) -> r -> r -> Bool
- antisymmetric_on :: (r -> r -> Bool) -> (r -> r -> Bool) -> r -> r -> Bool
Documentation
symmetric :: (r -> r -> Bool) -> r -> r -> Bool Source #
\( \forall a, b: (a \# b) \Leftrightarrow (b \# a) \)
For example, "is a blood relative of" is a symmetric relation, because A is a blood relative of B if and only if B is a blood relative of A.
asymmetric :: (r -> r -> Bool) -> r -> r -> Bool Source #
\( \forall a, b: (a \# b) \Rightarrow \neg (b \# a) \)
For example, > is an asymmetric relation, but ≥ is not.
A relation is asymmetric if and only if it is both antisymmetric and irreflexive.