![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Shared machinery for the closed-form HAVING gate_cmp probability evaluators (Poisson-binomial COUNT, MIN / MAX…).
More...


Go to the source code of this file.
Classes | |
| struct | provsql::AggCmpMatch |
Result of matching a gate_cmp against the canonical HAVING aggregate-comparison shape. More... | |
Namespaces | |
| namespace | provsql |
Functions | |
| bool | provsql::matchAggCmp (GenericCircuit &gc, gate_t cmp, AggCmpMatch &out) |
Try to match cmp against gate_cmp(gate_agg(α, semimod_i(K_i, m_i)*), gate_value(C)). | |
| std::vector< unsigned > | provsql::computeRefCounts (const GenericCircuit &gc) |
| Reference count of every gate as a wire-target across the whole circuit. | |
| double | provsql::contributorProb (const GenericCircuit &gc, gate_t g, const std::vector< unsigned > &ref, bool &ok) |
| Read-once marginal probability of a count/aggregate contributor (the K side of a semimod). | |
Shared machinery for the closed-form HAVING gate_cmp probability evaluators (Poisson-binomial COUNT, MIN / MAX…).
Every closed-form HAVING evaluator that runs as a probability-side pre-pass (see probability_evaluate.cpp) shares three concerns:
gate_cmp(gate_agg(α, semimod_i(K_i, m_i)*), gate_value(C)) in either operand order (matchAggCmp) ;gate_agg children are mutually independent Bernoulli contributors with leaves private to the cmp's subtree, via the reference-count walk (computeRefCounts) ;contributorProb).These were first written for CountCmpEvaluator; they are factored here so the MIN / MAX (and future SUM) evaluators reuse the exact same soundness contract rather than re-deriving it. See CountCmpEvaluator.h for the soundness argument in full.
Definition in file CmpEvaluatorCommon.h.