pub struct ExecutionPlan {Show 15 fields
pub spec_name: String,
pub commentary: Option<String>,
pub data: IndexMap<DataPath, DataDefinition>,
pub normal_forms: Vec<NormalForm>,
pub rules: IndexMap<RulePath, ExecutableRule>,
pub data_reference_order: Vec<DataPath>,
pub meta: IndexMap<String, Value>,
pub resolved_types: ResolvedSpecTypes,
pub signature_index: SignatureIndex,
pub effective: EffectiveDate,
pub effective_from: Option<DateTimeValue>,
pub effective_to: Option<DateTimeValue>,
pub start_line: usize,
pub source_type: Option<SourceType>,
pub input_key_index: IndexMap<String, DataPath>,
/* private fields */
}Expand description
A complete execution plan ready for the evaluator
Contains drift-free normal-form equations in a table, named rule roots, and all data. Self-contained structure - no spec lookups required during evaluation.
A plan is immutable once stored. A committed plan is reused only when its own spec’s
bytes are still the spec set’s Arc (kept while the version’s bytes are unchanged),
its version’s boundaries (show-cache fields such as effective_to) and the
slices its edges resolve to are unchanged, and every one of those slices is reused.
Fields§
§spec_name: StringMain spec name
commentary: Option<String>Optional commentary from the """...""" block in the spec source.
data: IndexMap<DataPath, DataDefinition>This spec’s own data slots in definition order, every path local. A uses
import is one DataDefinition::Import slot holding its row over the
template plan; spec-written list rows live in their [RowStore].
normal_forms: Vec<NormalForm>Dense table of interned NormalForm cells — the expanded shared graph.
Index = NormalFormId.
rules: IndexMap<RulePath, ExecutableRule>This spec’s own rules → root of that rule in Self::normal_forms.
Insertion order is planning topo order (deps before consumers).
data_reference_order: Vec<DataPath>Data→data DataDefinition::Reference paths in dependency order for
evaluation prepop (chained reference → reference → data). Empty when the
plan has none. Rule-target references are not included.
meta: IndexMap<String, Value>Spec metadata, in declaration order.
resolved_types: ResolvedSpecTypesMain-spec types from planning. ResolvedSpecTypes::unit_index is expression-scope
units (local types plus direct uses imports). Rule-result unit maps use
Self::family_units; Show data inputs stay declared-only.
signature_index: SignatureIndexReverse index: canonical-form unit signature Vec<(unit_name, exponent)> →
(unit_name, owning type). Built from expression-scope units during planning so
cross-type Multiply/Divide arithmetic can deterministically resolve a combined
signature back to a single named unit. Ambiguous signatures (the same key matched
by units in two distinct types) are rejected at planning time.
effective: EffectiveDate§effective_from: Option<DateTimeValue>Declared temporal window [effective_from, effective_to) of the LemmaSpec
version this plan was built from. Filled by [attach_show_cache].
effective_to: Option<DateTimeValue>§start_line: usizeSource start line of the LemmaSpec version this plan was built from.
source_type: Option<SourceType>Source type of the LemmaSpec version this plan was built from.
input_key_index: IndexMap<String, DataPath>Precomputed input_key → DataPath index for [EvaluateData::resolve].
One entry per Self::data slot. Keyed lookups index this map; they do not
walk the data tree.
Implementations§
Source§impl ExecutionPlan
impl ExecutionPlan
Sourcepub fn validated_response_rule_paths(
&self,
rules: Option<&[String]>,
) -> Result<Vec<&RulePath>, Error>
pub fn validated_response_rule_paths( &self, rules: Option<&[String]>, ) -> Result<Vec<&RulePath>, Error>
Validate caller-requested rule names and return resolved RulePaths in
Self::show_rules order, each once.
None means all local rules (this spec’s outputs). Some(&[]) is an error.
Unknown names in Some slice error. Explicit names are this spec’s Show.rules
keys only (empty path).
Sourcepub fn get_rule(&self, name: &str) -> Option<&ExecutableRule>
pub fn get_rule(&self, name: &str) -> Option<&ExecutableRule>
Look up a Show.rules key (RulePath::input_key) among this spec’s local rules.
Sourcepub fn normal_form(&self, id: NormalFormId) -> &NormalForm
pub fn normal_form(&self, id: NormalFormId) -> &NormalForm
Look up a normal-form cell by id.