45 return std::accumulate(v.begin(), v.end(), 0);
48 return std::accumulate(v.begin(), v.end(), 1, std::multiplies<value_type>());
52 return x<=y ? 0 : x-y;
Abstract semiring interface for provenance evaluation.
The counting semiring over unsigned.
virtual value_type zero() const override
Return the additive identity .
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 one() const override
Return the multiplicative identity .
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 operator.
Abstract base class for (m-)semirings.
unsigned value_type
The carrier type of this semiring.