Min-max semiring #
This file defines the min-max semiring MinMax α over a bounded linear order α,
where addition is min and multiplication is max. The natural order is the
reverse of the order on α (so ⊤ is the additive identity and ⊥ the
multiplicative identity). This semiring models security levels or (dually) the fuzzy
semiring.
Also defined:
MaxMin α = MinMax (OrderDual α)– the dual semiring withmaxfor addition andminfor multiplicationTVL– three-valued logic{⊥, unknown, ⊤}, an instance ofMaxMin
MinMax α is absorptive and idempotent. The dual MaxMin TVL does not satisfy
left-distributivity of multiplication over monus.
The security/access control semiring is discussed in Green & Tannen, The Semiring Framework for Database Provenance.
References #
Equations
- instCoeMinMax = { coe := MinMax.val }
Equations
- One or more equations did not get rendered due to their size.
Equations
- instZeroMinMax = { zero := ⊤ }
Equations
- instOneMinMax = { one := ⊥ }
Equations
- One or more equations did not get rendered due to their size.
MinMax α is a commutative m-semiring for any bounded linear order α.
Equations
- One or more equations did not get rendered due to their size.
Equations
- instCommSemiringWithMonusMinMax = { toSemiringWithMonus := instSemiringWithMonusMinMax, mul_comm := ⋯ }
MinMax α has characteristic 0 in the CharP sense whenever α is nontrivial:
it is idempotent, and (0 : MinMax α) = ⟨⊤⟩ differs from (1 : MinMax α) = ⟨⊥⟩
since ⊥ ≠ ⊤ in a nontrivial bounded order.
Equations
- instCommSemiringMaxMin = { toSemiring := instSemiringWithMonusMinMax.toSemiring, mul_comm := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- instCommSemiringWithMonusMaxMin = { toSemiringWithMonus := instSemiringWithMonusMaxMin, mul_comm := ⋯ }
Equations
- instReprTVL = { reprPrec := instReprTVL.repr }
Equations
- instReprTVL.repr TVL.bot prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TVL.bot")).group prec✝
- instReprTVL.repr TVL.unknown prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TVL.unknown")).group prec✝
- instReprTVL.repr TVL.top prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TVL.top")).group prec✝
Instances For
Equations
- instOrdTVL.ord x✝ y✝ = compare x✝.ctorIdx y✝.ctorIdx
Instances For
Equations
- instOrdTVL = { compare := instOrdTVL.ord }
Equations
- One or more equations did not get rendered due to their size.
Equations
- instOrderBotTVL = { bot := TVL.bot, bot_le := instOrderBotTVL._proof_1 }
Equations
- instOrderTopTVL = { top := TVL.top, le_top := instOrderTopTVL._proof_1 }
Equations
Equations
MaxMin α has characteristic 0 in the CharP sense whenever α is nontrivial:
this lifts the general MinMax instance to the dual order through
MaxMin α = MinMax (OrderDual α). In particular it applies to MaxMin TVL since
TVL is nontrivial.
There is no semiring homomorphism from BoolFunc Y to MaxMin TVL sending the
variables to arbitrary values. The semiring MaxMin TVL is absorptive and has
both idempotent addition and idempotent multiplication, so the simple
obstructions don't apply: the failure is more subtle.
The argument uses only that a semiring homomorphism preserves + and *
(monus is irrelevant here, even though one of the elements we exhibit
happens to be written using BoolFunc's monus). In BoolFunc Y, the element
c := 1 - var i satisfies two purely additive/multiplicative identities:
var i + c = 1 and var i * c = 0. Applying any semiring homomorphism φ
and writing y := φ c (an arbitrary element of the target), this forces
φ (var i) + y = 1 and φ (var i) * y = 0. Setting φ (var i) = ⟨unknown⟩
in MaxMin TVL: the first equation reduces to max(unknown, y.val) = top,
forcing y.val = top; the second reduces to min(unknown, y.val) = bot,
forcing y.val = bot. The two are incompatible.
The same obstruction extends to MinMax α whenever α has at least three
distinct order values.