22#ifndef PROVSQL_RANGE_CHECK_H
23#define PROVSQL_RANGE_CHECK_H
62std::pair<double, double>
64 std::optional<gate_t> event_root = std::nullopt);
86std::optional<std::pair<double, double>>
136std::optional<TruncatedSingleRv>
138 std::optional<gate_t> event_root);
160 std::optional<gate_t> event_root);
219 std::shared_ptr<ClosedFormShape>
left;
220 std::shared_ptr<ClosedFormShape>
right;
236std::optional<ClosedFormShape>
238 std::optional<gate_t> event_root);
gate_t
Strongly-typed gate identifier.
Semiring-agnostic in-memory provenance circuit.
Continuous random-variable helpers (distribution parsing, moments).
In-memory provenance circuit with semiring-generic evaluation.
std::pair< double, double > compute_support(const GenericCircuit &gc, gate_t root, std::optional< gate_t > event_root)
Compute the [lo, hi] support interval of a scalar sub-circuit rooted at root.
std::optional< ClosedFormShape > matchClosedFormDistribution(const GenericCircuit &gc, gate_t root, std::optional< gate_t > event_root)
Detect any of the closed-form shapes supported by rv_analytical_curves.
unsigned runRangeCheck(GenericCircuit &gc)
Run the support-based pruning pass over gc.
bool eventIsProvablyInfeasible(const GenericCircuit &gc, gate_t root, std::optional< gate_t > event_root)
True iff the conditioning event is provably infeasible for a bare gate_rv root.
std::optional< std::pair< double, double > > collectRvConstraints(const GenericCircuit &gc, gate_t event_root, gate_t target_rv)
Walk event_root collecting rv op c constraints on target_rv.
std::optional< TruncatedSingleRv > matchTruncatedSingleRv(const GenericCircuit &gc, gate_t root, std::optional< gate_t > event_root)
Detect a closed-form, optionally-truncated single-RV shape.
std::variant< TruncatedSingleRv, DiracShape, CategoricalShape, BernoulliMixtureShape > ClosedFormShape
One of the closed-form shapes the analytical-curves payload can render: bare RV (continuous PDF/CDF),...
Bernoulli mixture (gate_mixture with the [p_token, x_token, y_token] shape).
std::shared_ptr< ClosedFormShape > right
std::shared_ptr< ClosedFormShape > left
Categorical distribution over a finite outcome set.
std::vector< std::pair< double, double > > outcomes
(value, mass) pairs
Point mass at a finite scalar value (a gate_value root, or an as_random(c) leaf surfaced as a gate_va...
Parsed distribution spec (kind + up to two parameters).
Detection result for a closed-form, optionally-truncated single-RV shape.
double lo
Lower bound (-INF if unbounded).
DistributionSpec spec
Parsed kind + parameters.
double hi
Upper bound (+INF if unbounded).
bool truncated
True iff the bounds came from a non-trivial event_root.