![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Provenance evaluation helpers for HAVING-clause circuits. More...
#include <string>#include <unordered_map>#include "GenericCircuit.hpp"#include "BooleanCircuit.h"#include "semiring/BoolExpr.h"#include "semiring/Why.h"

Go to the source code of this file.
Functions | |
| void | provsql_try_having_formula (GenericCircuit &c, gate_t g, std::unordered_map< gate_t, std::string > &mapping) |
Evaluate the HAVING sub-circuit at g over the Formula semiring. | |
| void | provsql_try_having_counting (GenericCircuit &c, gate_t g, std::unordered_map< gate_t, unsigned > &mapping) |
Evaluate the HAVING sub-circuit at g over the Counting semiring. | |
| void | provsql_try_having_why (GenericCircuit &c, gate_t g, std::unordered_map< gate_t, semiring::why_provenance_t > &mapping) |
Evaluate the HAVING sub-circuit at g over the Why-provenance semiring. | |
| void | provsql_try_having_boolexpr (GenericCircuit &c, semiring::BoolExpr &be, gate_t g, std::unordered_map< gate_t, gate_t > &mapping) |
Evaluate the HAVING sub-circuit at g over the BoolExpr semiring. | |
| void | provsql_try_having_boolean (GenericCircuit &c, gate_t g, std::unordered_map< gate_t, bool > &mapping) |
Evaluate the HAVING sub-circuit at g over the Boolean semiring. | |
Provenance evaluation helpers 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.
This header declares one evaluation helper per semiring variant. Each function evaluates the HAVING sub-circuit rooted at gate g over the appropriate semiring, writing results into mapping. On successful evaluation, mapping is populated with entries for input gates reachable from g. If the HAVING gate type is incompatible with the requested semiring the function is a no-op.
Definition in file having_semantics.hpp.
| void provsql_try_having_boolean | ( | GenericCircuit & | c, |
| gate_t | g, | ||
| std::unordered_map< gate_t, bool > & | mapping | ||
| ) |
Evaluate the HAVING sub-circuit at g over the Boolean semiring.
| c | The generic circuit containing gate g. |
| g | Root gate of the HAVING sub-circuit. |
| mapping | Map from input gates to their Boolean values; populated on successful evaluation. |
Definition at line 363 of file having_semantics.cpp.

| void provsql_try_having_boolexpr | ( | GenericCircuit & | c, |
| semiring::BoolExpr & | be, | ||
| gate_t | g, | ||
| std::unordered_map< gate_t, gate_t > & | mapping | ||
| ) |
Evaluate the HAVING sub-circuit at g over the BoolExpr semiring.
| c | The generic circuit containing gate g. |
| be | The BoolExpr semiring instance (shared circuit). |
| g | Root gate of the HAVING sub-circuit. |
| mapping | Map from input gates to their gate_t values in be; populated on successful evaluation. |
Definition at line 354 of file having_semantics.cpp.

| void provsql_try_having_counting | ( | GenericCircuit & | c, |
| gate_t | g, | ||
| std::unordered_map< gate_t, unsigned > & | mapping | ||
| ) |
Evaluate the HAVING sub-circuit at g over the Counting semiring.
| c | The generic circuit containing gate g. |
| g | Root gate of the HAVING sub-circuit. |
| mapping | Map from input gates to their count values; populated on successful evaluation. |
Definition at line 338 of file having_semantics.cpp.

| void provsql_try_having_formula | ( | GenericCircuit & | c, |
| gate_t | g, | ||
| std::unordered_map< gate_t, std::string > & | mapping | ||
| ) |
Evaluate the HAVING sub-circuit at g over the Formula semiring.
| c | The generic circuit containing gate g. |
| g | Root gate of the HAVING sub-circuit. |
| mapping | Map from input gates to their formula string values; populated on successful evaluation. |
Definition at line 330 of file having_semantics.cpp.

| void provsql_try_having_why | ( | GenericCircuit & | c, |
| gate_t | g, | ||
| std::unordered_map< gate_t, semiring::why_provenance_t > & | mapping | ||
| ) |
Evaluate the HAVING sub-circuit at g over the Why-provenance semiring.
| c | The generic circuit containing gate g. |
| g | Root gate of the HAVING sub-circuit. |
| mapping | Map from input gates to their why-provenance values; populated on successful evaluation. |
Definition at line 346 of file having_semantics.cpp.
