![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Tropical (min-plus) m-semiring over \(\mathbb{R} \cup \{+\infty\}\). More...


Go to the source code of this file.
Classes | |
| class | semiring::Tropical |
Tropical (min-plus) m-semiring over double. More... | |
Namespaces | |
| namespace | semiring |
Tropical (min-plus) m-semiring over \(\mathbb{R} \cup \{+\infty\}\).
The tropical m-semiring ( \(\mathbb{R} \cup \{+\infty\}\), \(\min\), \(+\), \(+\infty\), 0) is used to model shortest-path/least-cost provenance: input gates carry edge weights (or costs), \(\oplus = \min\) selects the cheapest derivation, and \(\otimes = +\) accumulates cost along a derivation.
Operations:
zero() → \(+\infty\)one() → 0plus() → minimum of all operands (empty list → \(+\infty\))times() → sum of all operands (empty list → 0)monus() → \(+\infty\) if \(x \ge y\) in the usual order, \(x\) otherwise (note this is the reverse of the natural semiring order; see Lean reference)delta() → \(+\infty\) if x is \(+\infty\), else 0Absorptivity: absorptive() returns false. The Lean formalisation proves absorptivity only for canonically-ordered carriers (e.g. \(\mathbb{N}\)); over arbitrary double values (including negatives) \(\mathbb{1} \oplus a = \min(0, a)\) is not always 0.
instSemiringWithMonusTropicalWithTop, with proofs of Tropical.absorptive (under CanonicallyOrderedAdd) and Tropical.mul_sub_left_distributive. Definition in file Tropical.h.