ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
provsql::EvalContext Struct Reference

Per-evaluation circuit state threaded to a method's evaluate(). More...

Collaboration diagram for provsql::EvalContext:

Public Member Functions

void ensureMultivaluedRewritten ()
void ensureDnfShape () const
void ensureTreewidthProxy () const
double featureCost (Feature f) const
 Heuristic acquisition cost of f, in the same work units as a method's estimatedCost (so the chooser can compare "run this method" against "acquire this feature").
bool hasFeature (Feature f) const
void acquireFeature (Feature f)

Public Attributes

GenericCircuitgc
gate_t gc_root
pg_uuid_t token
BooleanCircuitc
gate_t gate
std::unordered_map< gate_t, gate_t > * gc_to_bc
bool inv_free_cert
const std::string & args
bool explicitly_named
 invoked via byName (vs the default chain)
size_t n_inputs = 0
 input count N (O(1) cost feature)
size_t circuit_size = 0
 gate count S, the circuit-size parameter (O(1))
double cost_budget = std::numeric_limits<double>::infinity()
 Speculative-execution budget: the estimated cost (in the chooser's ms-ish units) of the next-cheapest admissible method.
bool multivalued_rewritten = false
std::string actual_method
bool dnf_computed_ = false
bool dnf_ok_ = false
std::size_t dnf_num_clauses_ = 0
bool tw_computed_ = false
unsigned tw_proxy_ = 0
unsigned tw_max_degree_ = 0

Detailed Description

Per-evaluation circuit state threaded to a method's evaluate().

The Boolean view c is built once in probability_evaluate_internal; methods that need the multivalued rewrite trigger it (idempotently) through this context, so the rewrite fires exactly for the methods that need it.

Definition at line 890 of file probability_evaluate.cpp.

Member Function Documentation

◆ acquireFeature()

void provsql::EvalContext::acquireFeature ( Feature f)
inline

Definition at line 977 of file probability_evaluate.cpp.

Here is the call graph for this function:

◆ ensureDnfShape()

void provsql::EvalContext::ensureDnfShape ( ) const
inline

Definition at line 931 of file probability_evaluate.cpp.

Here is the caller graph for this function:

◆ ensureMultivaluedRewritten()

void provsql::EvalContext::ensureMultivaluedRewritten ( )
inline

Definition at line 916 of file probability_evaluate.cpp.

Here is the caller graph for this function:

◆ ensureTreewidthProxy()

void provsql::EvalContext::ensureTreewidthProxy ( ) const
inline

Definition at line 945 of file probability_evaluate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ featureCost()

double provsql::EvalContext::featureCost ( Feature f) const
inline

Heuristic acquisition cost of f, in the same work units as a method's estimatedCost (so the chooser can compare "run this method" against "acquire this feature").

Definition at line 959 of file probability_evaluate.cpp.

◆ hasFeature()

bool provsql::EvalContext::hasFeature ( Feature f) const
inline

Definition at line 969 of file probability_evaluate.cpp.

Member Data Documentation

◆ actual_method

std::string provsql::EvalContext::actual_method

Definition at line 914 of file probability_evaluate.cpp.

◆ args

const std::string& provsql::EvalContext::args

Definition at line 902 of file probability_evaluate.cpp.

◆ c

BooleanCircuit& provsql::EvalContext::c

Definition at line 898 of file probability_evaluate.cpp.

◆ circuit_size

size_t provsql::EvalContext::circuit_size = 0

gate count S, the circuit-size parameter (O(1))

Definition at line 905 of file probability_evaluate.cpp.

◆ cost_budget

double provsql::EvalContext::cost_budget = std::numeric_limits<double>::infinity()

Speculative-execution budget: the estimated cost (in the chooser's ms-ish units) of the next-cheapest admissible method.

A budget-aware method (currently the d-tree) runs until its own work exceeds this and then throws, so the chooser drops it and escalates – bounding wasted work at ~the cost of the safe fallback. Infinity = no budget (the method is the last resort, or budgeting is off).

Definition at line 912 of file probability_evaluate.cpp.

◆ dnf_computed_

bool provsql::EvalContext::dnf_computed_ = false
mutable

Definition at line 927 of file probability_evaluate.cpp.

◆ dnf_num_clauses_

std::size_t provsql::EvalContext::dnf_num_clauses_ = 0
mutable

Definition at line 929 of file probability_evaluate.cpp.

◆ dnf_ok_

bool provsql::EvalContext::dnf_ok_ = false
mutable

Definition at line 928 of file probability_evaluate.cpp.

◆ explicitly_named

bool provsql::EvalContext::explicitly_named

invoked via byName (vs the default chain)

Definition at line 903 of file probability_evaluate.cpp.

◆ gate

gate_t provsql::EvalContext::gate

Definition at line 899 of file probability_evaluate.cpp.

◆ gc

GenericCircuit* provsql::EvalContext::gc

Definition at line 895 of file probability_evaluate.cpp.

◆ gc_root

gate_t provsql::EvalContext::gc_root

Definition at line 896 of file probability_evaluate.cpp.

◆ gc_to_bc

std::unordered_map<gate_t, gate_t>* provsql::EvalContext::gc_to_bc

Definition at line 900 of file probability_evaluate.cpp.

◆ inv_free_cert

bool provsql::EvalContext::inv_free_cert

Definition at line 901 of file probability_evaluate.cpp.

◆ multivalued_rewritten

bool provsql::EvalContext::multivalued_rewritten = false

Definition at line 913 of file probability_evaluate.cpp.

◆ n_inputs

size_t provsql::EvalContext::n_inputs = 0

input count N (O(1) cost feature)

Definition at line 904 of file probability_evaluate.cpp.

◆ token

pg_uuid_t provsql::EvalContext::token

Definition at line 897 of file probability_evaluate.cpp.

◆ tw_computed_

bool provsql::EvalContext::tw_computed_ = false
mutable

Definition at line 941 of file probability_evaluate.cpp.

◆ tw_max_degree_

unsigned provsql::EvalContext::tw_max_degree_ = 0
mutable

Definition at line 943 of file probability_evaluate.cpp.

◆ tw_proxy_

unsigned provsql::EvalContext::tw_proxy_ = 0
mutable

Definition at line 942 of file probability_evaluate.cpp.


The documentation for this struct was generated from the following file: