pub struct Provenance {
pub pir: PirGraph,
pub leaf_probs: BTreeMap<LeafId, f64>,
pub choice_probs: BTreeMap<ChoiceVarId, (f64, f64)>,
pub queries: Vec<GroundAtom>,
pub evidence: Vec<(GroundAtom, bool)>,
pub leaf_atoms: BTreeMap<LeafId, GroundAtom>,
pub choice_sources: BTreeMap<ChoiceVarId, ChoiceSource>,
pub aggregate_lifting: Vec<AggregateLiftReport>,
/* private fields */
}Expand description
Provenance extraction result: PIR graph plus per-tuple formulas and weight metadata.
Fields§
§pir: PirGraphProbabilistic intermediate-representation graph.
leaf_probs: BTreeMap<LeafId, f64>Bernoulli probability assigned to each independent leaf.
choice_probs: BTreeMap<ChoiceVarId, (f64, f64)>False and true branch probabilities for each choice variable.
queries: Vec<GroundAtom>Ground probabilistic queries in source order.
evidence: Vec<(GroundAtom, bool)>Ground evidence atoms paired with their asserted truth values.
leaf_atoms: BTreeMap<LeafId, GroundAtom>Source-facing atom represented by each independent leaf.
choice_sources: BTreeMap<ChoiceVarId, ChoiceSource>Annotated-disjunction metadata for each choice variable.
aggregate_lifting: Vec<AggregateLiftReport>Aggregate-lifting decisions made during extraction.
Implementations§
Source§impl Provenance
impl Provenance
Sourcepub fn query_formula(
&self,
predicate: &str,
args: &[Value],
) -> Option<PirNodeId>
pub fn query_formula( &self, predicate: &str, args: &[Value], ) -> Option<PirNodeId>
Returns the provenance formula for a ground query after schema canonicalization.
Sourcepub fn leaf_atom(&self, leaf: LeafId) -> Option<&GroundAtom>
pub fn leaf_atom(&self, leaf: LeafId) -> Option<&GroundAtom>
Returns the source-facing atom represented by leaf.
Sourcepub fn choice_source(&self, var: ChoiceVarId) -> Option<&ChoiceSource>
pub fn choice_source(&self, var: ChoiceVarId) -> Option<&ChoiceSource>
Returns annotated-disjunction metadata for var.
Sourcepub fn atoms_with_formulas(
&self,
) -> impl Iterator<Item = (&GroundAtom, PirNodeId)> + '_
pub fn atoms_with_formulas( &self, ) -> impl Iterator<Item = (&GroundAtom, PirNodeId)> + '_
Iterate over canonical semantic tuple keys and their provenance formulas.
Unlike source-facing query, evidence, leaf, and choice metadata, these keys describe execution identity. Schema-equivalent quoted and bare symbol spellings therefore share one key, and derived tuples may have no unique source spelling.