Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class BoundedLattice a => HeytingAlgebra a where
- iff :: HeytingAlgebra a => a -> a -> a
- iff' :: (Eq a, HeytingAlgebra a) => a -> a -> Bool
- toBoolean :: HeytingAlgebra a => a -> a
- prop_BoundedMeetSemiLattice :: (BoundedMeetSemiLattice a, Eq a, Show a) => a -> a -> a -> Property
- prop_BoundedJoinSemiLattice :: (BoundedJoinSemiLattice a, Eq a, Show a) => a -> a -> a -> Property
- prop_HeytingAlgebra :: (HeytingAlgebra a, Eq a, Show a) => a -> a -> a -> Property
- prop_implies :: (HeytingAlgebra a, Eq a, Show a) => a -> a -> a -> Property
Documentation
class BoundedLattice a => HeytingAlgebra a where Source #
Heyting algebra is a bounded semi-lattice with implication which should satisfy the following law:
x ∧ a ≤ b ⇔ x ≤ (a ⇒ b)
This means a ⇒ b
is an
exponential object,
which makes any Heyting algebra
a cartesian
closed category.
Some useful properties of Heyting algebras:
(a ⇒ b) ∧ a ≤ b
b ≤ a ⇒ a ∧ b
a ≤ b iff a ⇒ b = ⊤
b ≤ b' then a ⇒ b ≤ a ⇒ b'
a'≤ a then a' ⇒ b ≤ a ⇒ b
(==>) :: a -> a -> a infixr 4 Source #
Default implementation: a ==> b = not a / b
, it requires not
to
satisfy Boolean axioms, which will make it into a Boolean algebra.
Instances
toBoolean :: HeytingAlgebra a => a -> a Source #
Every Heyting algebra contains a Boolean algebra.
maps onto it;
moreover it is a monad (Heyting algebra is a category as every poset is) which
preserves finite infima.toBoolean
Properties
Properties are exported only if export-properties
cabal flag is defined.
prop_BoundedMeetSemiLattice :: (BoundedMeetSemiLattice a, Eq a, Show a) => a -> a -> a -> Property Source #
Verfifies bounded meet semilattice laws.
prop_BoundedJoinSemiLattice :: (BoundedJoinSemiLattice a, Eq a, Show a) => a -> a -> a -> Property Source #
Verfifies bounded join semilattice laws.
prop_HeytingAlgebra :: (HeytingAlgebra a, Eq a, Show a) => a -> a -> a -> Property Source #
Usefull for testing valid instances of
type class. It
validates:HeytingAlgebra
- bounded lattice laws
prop_implies
prop_implies :: (HeytingAlgebra a, Eq a, Show a) => a -> a -> a -> Property Source #
Verifies the Heyting algebra law for ==>
:
for all a
: _ / a
is left adjoint to a ==>