ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
having_semantics.hpp File Reference

Provenance evaluation helper for HAVING-clause circuits. More...

#include <vector>
#include "GenericCircuit.hpp"
#include "subset.hpp"
Include dependency graph for having_semantics.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename SemiringT, typename MapT>
void provsql_having (GenericCircuit &c, gate_t g, MapT &mapping, SemiringT S=SemiringT{})
 Rewrite HAVING comparison gates in the circuit by enumerating possible worlds.

Detailed Description

Provenance evaluation helper for HAVING-clause circuits.

When a query includes a HAVING clause, ProvSQL creates a special sub-circuit that encodes the aggregate predicate. Before the main provenance circuit can be evaluated over a semiring, these HAVING sub-circuits must first be evaluated to determine which groups pass the filter.

The single public entry point provsql_having() rewrites HAVING comparison gates in the circuit by enumerating possible worlds, for any compiled semiring. If the HAVING gate type is incompatible with the requested semiring, the function is a no-op.

Definition in file having_semantics.hpp.

Function Documentation

◆ provsql_having()

template<typename SemiringT, typename MapT>
void provsql_having ( GenericCircuit & c,
gate_t g,
MapT & mapping,
SemiringT S = SemiringT{} )

Rewrite HAVING comparison gates in the circuit by enumerating possible worlds.

Template Parameters
SemiringTThe semiring type used for evaluation.
MapTThe provenance mapping type (gate_t → semiring value).
Parameters
cCircuit to rewrite.
gRoot gate of the sub-circuit to inspect.
mappingProvenance mapping updated in place.
SSemiring instance (default-constructed for stateless semirings).

Definition at line 46 of file having_semantics.hpp.

Here is the caller graph for this function: