| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
NumHask.Algebra.Quantale
Contents
Description
Synopsis
- class (CompleteJoinSemiLattice a, Multiplicative a) => Quantale a
- class Quantale a => Residuated a where
- class Quantale a => StarAutonomous a where
Documentation
class (CompleteJoinSemiLattice a, Multiplicative a) => Quantale a Source #
A quantale is a monoid in complete join-semilattices: a complete
join-semilattice equipped with an associative multiplication (*) and unit
(one) that distributes over arbitrary joins.
a * joins xs == joins (fmap (a *) xs) joins xs * a == joins (fmap (* a) xs) a * bottom == bottom bottom * a == bottom
Instances
| Quantale Warshall Source # | Boolean quantale: join is disjunction, multiplication is conjunction. |
Defined in NumHask.Algebra.Quantale | |
| Quantale Bool Source # | Boolean quantale: join is disjunction, multiplication is conjunction. |
Defined in NumHask.Algebra.Quantale | |
| (Ord a, Multiplicative a) => Quantale (Set a) Source # | |
Defined in NumHask.Algebra.Quantale | |
| Quantale (MinPlus Double) Source # | Tropical (min-plus) quantale: join is minimum, bottom is positive infinity, multiplication is addition. |
Defined in NumHask.Algebra.Quantale | |
class Quantale a => Residuated a where Source #
If a quantale is also a StarSemiring, then star
is the least fixed point, equivalently the join of the geometric series:
star a == joins (iterate (a *) one)
A KleeneAlgebra is therefore the fragment of a
(commutative) quantale that only needs these iterative joins, while a
quantale admits arbitrary joins.
A residuated quantale: a quantale equipped with the left and right residuals of multiplication.
In any quantale, multiplication by a fixed element preserves joins, so it has both left and right adjoints. These adjoints are the residuals:
a * lres a b <= b lres a b == joins [ x | a * x <= b ]
rres a b * a <= b rres a b == joins [ x | x * a <= b ]
The order <= is the one induced by the join-semilattice:
x <= y iff x / y == y.
For commutative quantales the two residuals coincide: lres = rres.
Methods
Left residual of multiplication: the greatest x with a * x <= b.
Right residual of multiplication: the greatest x with x * a <= b.
Instances
| Residuated Warshall Source # | Boolean implication as the residual of conjunction.
|
| Residuated Bool Source # | Boolean implication as the residual of conjunction. |
| Residuated (MinPlus Double) Source # | Tropical residual is truncated subtraction.
|
class Quantale a => StarAutonomous a where Source #
A star-autonomous quantale: a quantale with an involutive, order-reversing linear negation.
The negation is an anti-automorphism of the underlying quantale:
neg (neg a) == a joinLeq a b == joinLeq (neg b) (neg a) neg (a * b) == neg b * neg a
Multiplicative disjunction (par) and its unit (bot) are the duals of
(*) and one:
par a b == neg (neg a * neg b) bot == neg one
This is the missing connective that turns a quantale into a model of classical linear logic.
Minimal complete definition
Methods
Linear negation.
Multiplicative disjunction (par), dual to multiplication.
Instances
| StarAutonomous Warshall Source # | Boolean negation as complement; |
| StarAutonomous Bool Source # | Boolean negation is complement; |
| StarAutonomous (MinPlus Double) Source # | Tropical linear negation is additive inverse; |
Orphan instances
| (Ord a, Multiplicative a) => Multiplicative (Set a) Source # | Power-set quantale of a monoid: join is union, bottom is the empty set,
multiplication is pointwise product of subsets, and the unit is the
singleton set containing This is the language quantale when the underlying monoid is the free monoid over an alphabet. |