ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
semiring::Why Class Reference

Why-provenance semiring. More...

#include "Why.h"

Inheritance diagram for semiring::Why:
Collaboration diagram for semiring::Why:

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.
 
virtual 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.
 
- Public Member Functions inherited from semiring::Semiring< why_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 ( \(a \oplus a = a\)).
 

Additional Inherited Members

- Public Types inherited from semiring::Semiring< why_provenance_t >
typedef why_provenance_t value_type
 The carrier type of this semiring.
 

Detailed Description

Why-provenance semiring.

Each gate evaluates to a why_provenance_t (set of witness sets).

Definition at line 47 of file Why.h.

Member Function Documentation

◆ delta()

value_type semiring::Why::delta ( value_type  x) const
inlineoverridevirtual

Apply the \(\delta\) operator.

Parameters
xInput value.
Returns
\(\delta(x)\).

Implements semiring::Semiring< why_provenance_t >.

Definition at line 95 of file Why.h.

Here is the call graph for this function:

◆ monus()

virtual value_type semiring::Why::monus ( value_type  x,
value_type  y 
) const
inlineoverridevirtual

Apply the monus (m-semiring difference) operation.

Parameters
xMinuend.
ySubtrahend.
Returns
\(x \ominus y\).

Implements semiring::Semiring< why_provenance_t >.

Definition at line 88 of file Why.h.

◆ one()

value_type semiring::Why::one ( ) const
inlineoverridevirtual

Return the multiplicative identity \(\mathbb{1}\).

Returns
The one element of the semiring.

Implements semiring::Semiring< why_provenance_t >.

Definition at line 55 of file Why.h.

Here is the caller graph for this function:

◆ plus()

value_type semiring::Why::plus ( const std::vector< value_type > &  v) const
inlineoverridevirtual

Apply the additive operation to a list of values.

Parameters
vOrdered list of operands (empty list should return zero()).
Returns
\(v_0 \oplus v_1 \oplus \cdots\).

Implements semiring::Semiring< why_provenance_t >.

Definition at line 60 of file Why.h.

◆ times()

value_type semiring::Why::times ( const std::vector< value_type > &  v) const
inlineoverridevirtual

Apply the multiplicative operation to a list of values.

Parameters
vOrdered list of operands (empty list should return one()).
Returns
\(v_0 \otimes v_1 \otimes \cdots\).

Implements semiring::Semiring< why_provenance_t >.

Definition at line 69 of file Why.h.

Here is the call graph for this function:

◆ zero()

value_type semiring::Why::zero ( ) const
inlineoverridevirtual

Return the additive identity \(\mathbb{0}\).

Returns
The zero element of the semiring.

Implements semiring::Semiring< why_provenance_t >.

Definition at line 50 of file Why.h.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: