![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Interval-union m-semiring with Datum carrier, parameterised by a multirange type OID.
More...
#include "IntervalUnion.h"


Public Member Functions | |
| IntervalUnion (Oid multirange_oid) | |
| 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 |
A semiring homomorphism BoolFunc(Y) →+* IntervalUnion exists (map each variable to a fixed nonempty interval), so the safe-query Boolean rewrite preserves evaluation results. | |
| Datum | parse_leaf (const char *str) const |
| Parse a multirange text literal to a Datum. | |
| Public Member Functions inherited from semiring::Semiring< 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. | |
Private Member Functions | |
| void | ensureCache () const |
Private Attributes | |
| Oid | in_func |
| Oid | typioparam |
| Datum | cached_zero = 0 |
| Datum | cached_one = 0 |
| bool | cached = false |
Additional Inherited Members | |
| Public Types inherited from semiring::Semiring< Datum > | |
| typedef Datum | value_type |
| The carrier type of this semiring. | |
Interval-union m-semiring with Datum carrier, parameterised by a multirange type OID.
Each gate evaluates to a multirange Datum allocated in the current memory context. The class caches the input-function OIDs in its constructor and the zero/one Datum values lazily on first use, so that operations dispatch cheaply during circuit traversal.
Definition at line 69 of file IntervalUnion.h.
|
inlineexplicit |
Definition at line 94 of file IntervalUnion.h.
|
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.
false by default; override to return true. Reimplemented from semiring::Semiring< Datum >.
Definition at line 128 of file IntervalUnion.h.
|
inlineoverridevirtual |
A semiring homomorphism BoolFunc(Y) →+* IntervalUnion exists (map each variable to a fixed nonempty interval), so the safe-query Boolean rewrite preserves evaluation results.
Lean: Provenance.Semirings.IntervalUnion.homomorphism_from_BoolFunc (provenance-lean/Provenance/Semirings/IntervalUnion.lean).
Reimplemented from semiring::Semiring< Datum >.
Definition at line 139 of file IntervalUnion.h.
|
inlineoverridevirtual |
Apply the \(\delta\) operator.
| x | Input value. |
Implements semiring::Semiring< Datum >.
Definition at line 124 of file IntervalUnion.h.
|
inlineprivate |
|
inlineoverridevirtual |
Apply the monus (m-semiring difference) operation.
| x | Minuend. |
| y | Subtrahend. |
Implements semiring::Semiring< Datum >.
Definition at line 120 of file IntervalUnion.h.
|
inlineoverridevirtual |
Return the multiplicative identity \(\mathbb{1}\).
Implements semiring::Semiring< Datum >.
Definition at line 102 of file IntervalUnion.h.


|
inline |
Parse a multirange text literal to a Datum.
Used by pec_multirange() to build the input mapping; exposed here so the parser can share the cached in_func / typioparam.
Definition at line 149 of file IntervalUnion.h.
|
inlineoverridevirtual |
Apply the additive operation to a list of values.
| v | Ordered list of operands (empty list should return zero()). |
Implements semiring::Semiring< Datum >.
Definition at line 106 of file IntervalUnion.h.

|
inlineoverridevirtual |
Apply the multiplicative operation to a list of values.
| v | Ordered list of operands (empty list should return one()). |
Implements semiring::Semiring< Datum >.
Definition at line 113 of file IntervalUnion.h.

|
inlineoverridevirtual |
Return the additive identity \(\mathbb{0}\).
Implements semiring::Semiring< Datum >.
Definition at line 98 of file IntervalUnion.h.


|
mutableprivate |
Definition at line 81 of file IntervalUnion.h.
|
mutableprivate |
Definition at line 80 of file IntervalUnion.h.
|
mutableprivate |
Definition at line 79 of file IntervalUnion.h.
|
private |
Definition at line 71 of file IntervalUnion.h.
|
private |
Definition at line 72 of file IntervalUnion.h.