|
| | MinMax (Oid enum_type_oid, bool reverse_) |
| virtual value_type | zero () const override |
| | Return the additive identity \(\mathbb{0}\).
|
| virtual value_type | one () const override |
| | Return the multiplicative identity \(\mathbb{1}\).
|
| virtual value_type | plus (const std::vector< value_type > &v) const override |
| | Apply the additive operation to a list of values.
|
| virtual value_type | times (const std::vector< value_type > &v) const override |
| | Apply the multiplicative operation to a list of values.
|
| virtual value_type | monus (value_type x, value_type y) const override |
| | Apply the monus (m-semiring difference) operation.
|
| virtual value_type | delta (value_type x) const override |
| | Apply the \(\delta\) operator.
|
| virtual bool | absorptive () const override |
| | Return true if this semiring is absorptive ( \(\mathbb{1} \oplus a = \mathbb{1}\) for all \(a\)).
|
| virtual bool | compatibleWithBooleanRewrite () const override |
| | No semiring homomorphism BoolFunc(Y) →+* MinMax exists (the enum-min / enum-max structure cannot model the Boolean-functions semiring), so the safe-query Boolean rewrite is unsound under MinMax / MaxMin.
|
| Datum | parse_leaf (const char *str) const |
| | Parse an enum text literal to a Datum.
|
| virtual value_type | cmp (value_type s1, ComparisonOperator op, value_type s2) const |
| | Evaluate a comparison gate.
|
| virtual value_type | semimod (value_type x, value_type s) const |
| | Apply a semimodule scalar multiplication.
|
| virtual value_type | agg (AggregationOperator op, const std::vector< value_type > &s) |
| | Evaluate an aggregation gate.
|
| virtual value_type | value (const std::string &s) const |
| | Interpret a literal string as a semiring value.
|
| virtual | ~Semiring ()=default |
| virtual bool | certifying () const |
| | Whether this semiring builds certified exclusive enumerations (see the three hooks below).
|
| virtual bool | independent_literal (const value_type &) const |
| | Whether v is an independent literal for certification purposes: a base Bernoulli variable (or a constant), so that distinct literals have disjoint supports and an AND over them is decomposable.
|
| virtual value_type | certified_world_term (const std::vector< value_type > &, const std::vector< value_type > &) const |
| | Build one complete world term: the conjunction of the present literals and the negations of the missing literals, certified decomposable.
|
| virtual value_type | certified_exclusive_plus (const std::vector< value_type > &) const |
| | Build the disjunction of pairwise-exclusive disjuncts, certified deterministic.
|
Min-max / max-min m-semiring with Datum carrier over a PostgreSQL enum type.
A single class covers both the MinMax (reverse = false, the security shape) and the MaxMin (reverse = true, the fuzzy / trust shape) instantiations: the two are related by order reversal on the same carrier. Bottom and top of the carrier enum are looked up once in the constructor and cached as bottom_datum / top_datum.
Definition at line 76 of file MinMax.h.
| virtual bool semiring::MinMax::absorptive |
( |
| ) |
const |
|
inlineoverridevirtual |
Return true if this semiring is absorptive ( \(\mathbb{1} \oplus a = \mathbb{1}\) for all \(a\)).
When true, the circuit evaluator and HAVING-semantics machinery may exploit the resulting idempotency ( \(a \oplus a = a\), implied by absorptivity) to deduplicate children of plus gates and to short-circuit over the multiplicative identity.
- Returns
false by default; override to return true.
Reimplemented from semiring::Semiring< Datum >.
Definition at line 165 of file MinMax.h.
| virtual bool semiring::MinMax::compatibleWithBooleanRewrite |
( |
| ) |
const |
|
inlineoverridevirtual |
No semiring homomorphism BoolFunc(Y) →+* MinMax exists (the enum-min / enum-max structure cannot model the Boolean-functions semiring), so the safe-query Boolean rewrite is unsound under MinMax / MaxMin.
Inherits the false default from Semiring; this override exists for documentation.
Lean: Provenance.Semirings.TVL.no_hom_from_BoolFunc (provenance-lean/Provenance/Semirings/MinMax.lean).
Reimplemented from semiring::Semiring< Datum >.
Definition at line 179 of file MinMax.h.