Skip to main content

ExecutionPlan

Struct ExecutionPlan 

Source
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: String

Main 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: ResolvedSpecTypes

Main-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: SignatureIndex

Reverse 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: usize

Source 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

Source

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).

Source

pub fn get_rule(&self, name: &str) -> Option<&ExecutableRule>

Look up a Show.rules key (RulePath::input_key) among this spec’s local rules.

Source

pub fn normal_form(&self, id: NormalFormId) -> &NormalForm

Look up a normal-form cell by id.

Trait Implementations§

Source§

impl Clone for ExecutionPlan

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExecutionPlan

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.