![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Which-provenance (lineage) semiring. More...
#include "Which.h"


Public Member Functions | |
| value_type | zero () const override |
| Return the additive identity \(\mathbb{0}\). | |
| value_type | one () const override |
| Return the multiplicative identity \(\mathbb{1}\). | |
| value_type | plus (const std::vector< value_type > &vec) const override |
| Apply the additive operation to a list of values. | |
| value_type | times (const std::vector< value_type > &vec) const override |
| Apply the multiplicative operation to a list of values. | |
| value_type | monus (value_type x, value_type y) const override |
| Apply the monus (m-semiring difference) operation. | |
| value_type | delta (value_type x) const override |
| Apply the \(\delta\) operator. | |
| virtual bool | compatibleWithBooleanRewrite () const override |
No semiring homomorphism BoolFunc(Y) →+* Which exists, so the safe-query Boolean rewrite is unsound under which-provenance. | |
| value_type | parse_leaf (const char *v) const |
| Parse a leaf value into a which-provenance set. | |
| std::string | to_text (const value_type &prov) const |
| Public Member Functions inherited from semiring::Semiring< which_provenance_t > | |
| 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 | absorptive () const |
Return true if this semiring is absorptive ( \(\mathbb{1} \oplus a = \mathbb{1}\) for all \(a\)). | |
Additional Inherited Members | |
| Public Types inherited from semiring::Semiring< which_provenance_t > | |
| typedef which_provenance_t | value_type |
| The carrier type of this semiring. | |
Which-provenance (lineage) semiring.
Each gate evaluates to a which_provenance_t (set of contributing labels, or \(\bot\)).
|
inlineoverridevirtual |
No semiring homomorphism BoolFunc(Y) →+* Which exists, so the safe-query Boolean rewrite is unsound under which-provenance.
(Lineage tracks the union of contributing labels per derivation; the read-once rewrite collapses alternative derivations to a single shared label set, which is not in general the union produced by the original circuit.) Inherits the false default from Semiring; this override exists for documentation.
Lean: Provenance.Semirings.Which.no_hom_from_BoolFunc (provenance-lean/Provenance/Semirings/Which.lean).
Reimplemented from semiring::Semiring< which_provenance_t >.
|
inlineoverridevirtual |
Apply the \(\delta\) operator.
| x | Input value. |
Implements semiring::Semiring< which_provenance_t >.
|
inlineoverridevirtual |
Apply the monus (m-semiring difference) operation.
| x | Minuend. |
| y | Subtrahend. |
Implements semiring::Semiring< which_provenance_t >.
|
inlineoverridevirtual |
Return the multiplicative identity \(\mathbb{1}\).
Implements semiring::Semiring< which_provenance_t >.
Definition at line 64 of file Which.h.

|
inline |
Parse a leaf value into a which-provenance set.
Accepted input formats (round-trip with to_text):
"⊥" → zero (no derivation)'{'): "Alice" → {Alice} "{}" → one (a derivation requiring no witnesses)"{a,b,c}" → {a,b,c}Labels may contain any character except ',', '{', '}'.
|
inlineoverridevirtual |
Apply the additive operation to a list of values.
| v | Ordered list of operands (empty list should return zero()). |
Implements semiring::Semiring< which_provenance_t >.
|
inlineoverridevirtual |
Apply the multiplicative operation to a list of values.
| v | Ordered list of operands (empty list should return one()). |
Implements semiring::Semiring< which_provenance_t >.
Definition at line 80 of file Which.h.

|
inline |
|
inlineoverridevirtual |
Return the additive identity \(\mathbb{0}\).
Implements semiring::Semiring< which_provenance_t >.