Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Test.Property.Relation.Reflexive
Description
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=x2 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 #
∀a:(a#a)
For example, ≥ is a reflexive relation but > is not.
irreflexive :: (r -> r -> Bool) -> r -> Bool Source #
∀a:¬(a#a)
For example, > is an irreflexive relation, but ≥ is not.
coreflexive :: Eq r => (r -> r -> Bool) -> r -> r -> Bool Source #
∀a,b:((a#b)∧(b#a))⇒(a≡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 #
∀a,b:((a#b)∧(b#a))⇒(a≐b)
quasireflexive :: (r -> r -> Bool) -> r -> r -> Bool Source #
∀a,b:(a#b)⇒((a#a)∧(b#b))