    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE ScopedTypeVariables #-}

    module Test.Validity.Relations.Antireflexivity
      ( antireflexiveOnElem,
        antireflexivityOnGen,
        antireflexivity,
        antireflexivityOnArbitrary,
      )
    where

    import Data.GenValidity
    import Test.QuickCheck

    -- |
    --
    -- \[
    --   Antireflexive(\prec)
    --   \quad\equiv\quad
    --   \forall a: \neg (a \prec a)
    -- \]
    antireflexiveOnElem ::
      -- | A relation
      (a -> a -> Bool) ->
      -- | An element
      a ->
      Bool
    antireflexiveOnElem :: forall a. (a -> a -> Bool) -> a -> Bool
    antireflexiveOnElem a -> a -> Bool
    func a
    a = Bool -> Bool
    not (Bool -> Bool) -> Bool -> Bool
    forall a b. (a -> b) -> a -> b
    $ a -> a -> Bool
    func a
    a a
    a

    antireflexivityOnGen ::
      Show a => (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    antireflexivityOnGen :: forall a.
    Show a =>
    (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    antireflexivityOnGen a -> a -> Bool
    func Gen a
    gen a -> [a]
    s = Gen a -> (a -> [a]) -> (a -> Bool) -> Property
    forall a prop.
    (Show a, Testable prop) =>
    Gen a -> (a -> [a]) -> (a -> prop) -> Property
    forAllShrink Gen a
    gen a -> [a]
    s ((a -> Bool) -> Property) -> (a -> Bool) -> Property
    forall a b. (a -> b) -> a -> b
    $ (a -> a -> Bool) -> a -> Bool
    forall a. (a -> a -> Bool) -> a -> Bool
    antireflexiveOnElem a -> a -> Bool
    func

    -- |
    --
    -- prop> antireflexivity ((<) :: Int -> Int -> Bool)
    -- prop> antireflexivity ((/=) :: Int -> Int -> Bool)
    -- prop> antireflexivity ((>) :: Int -> Int -> Bool)
    antireflexivity :: (Show a, GenValid a) => (a -> a -> Bool) -> Property
    antireflexivity :: forall a. (Show a, GenValid a) => (a -> a -> Bool) -> Property
    antireflexivity a -> a -> Bool
    func = (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    forall a.
    Show a =>
    (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    antireflexivityOnGen a -> a -> Bool
    func Gen a
    forall a. GenValid a => Gen a
    genValid a -> [a]
    forall a. GenValid a => a -> [a]
    shrinkValid

    -- |
    --
    -- prop> antireflexivityOnArbitrary ((<) :: Int -> Int -> Bool)
    -- prop> antireflexivityOnArbitrary ((/=) :: Int -> Int -> Bool)
    -- prop> antireflexivityOnArbitrary ((>) :: Int -> Int -> Bool)
    antireflexivityOnArbitrary ::
      (Show a, Arbitrary a) => (a -> a -> Bool) -> Property
    antireflexivityOnArbitrary :: forall a. (Show a, Arbitrary a) => (a -> a -> Bool) -> Property
    antireflexivityOnArbitrary a -> a -> Bool
    func = (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    forall a.
    Show a =>
    (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    antireflexivityOnGen a -> a -> Bool
    func Gen a
    forall a. Arbitrary a => Gen a
    arbitrary a -> [a]
    forall a. Arbitrary a => a -> [a]
    shrink