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: Arc<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: Arc<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§

§

impl Forget for ExecutionPlan

§

impl Freeze for ExecutionPlan
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<usize>: Freeze, PhantomData<Bucket<DataPath, DataDefinition>>: Freeze, PhantomData<NormalForm>: Freeze, PhantomData<Bucket<RulePath, ExecutableRule>>: Freeze, PhantomData<DataPath>: Freeze, PhantomData<Bucket<String, Value>>: Freeze, *const ArcInner<ResolvedSpecTypes> is !null: Freeze, PhantomData<ArcInner<ResolvedSpecTypes>>: Freeze, *const ArcInner<FamilyUnitCatalog> is !null: Freeze, PhantomData<ArcInner<FamilyUnitCatalog>>: Freeze, PhantomData<Bucket<Vec<SignatureFactor>, (String, Arc<LemmaType>)>>: Freeze, *const ArcInner<PathBuf> is !null: Freeze, PhantomData<ArcInner<PathBuf>>: Freeze, PhantomData<NeededByRules>: Freeze, PhantomData<Bucket<DataPath, ShowDataCache>>: Freeze, PhantomData<Bucket<RulePath, ShowRule>>: Freeze, PhantomData<Bucket<DataPath, Vec<u32>>>: Freeze, PhantomData<Bucket<DataPath, SpecIdentity>>: Freeze, PhantomData<Bucket<DataPath, ReferenceEnd>>: Freeze, PhantomData<Bucket<String, DataPath>>: Freeze, PhantomData<Bucket<String, RulePath>>: Freeze, PhantomData<Bucket<DataPath, NormalFormId>>: Freeze, PhantomData<Bucket<ReferenceTarget, NormalFormId>>: Freeze, *const LeafNode<SpecIdentity, Arc<ExecutionPlan>> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(SpecIdentity, Arc<ExecutionPlan>)>>: Freeze, PhantomData<Bucket<GlobalKey, SpecIdentity>>: Freeze, PhantomData<Bucket<Vec<String>, Vec<Write>>>: Freeze, PhantomData<(Vec<String>, DataPath)>: Freeze, PhantomData<Copy>: Freeze, PhantomData<(Vec<String>, DataPath, Arc<RowStore>)>: Freeze, PhantomData<(DataPath, Arc<RowInstance>)>: Freeze, PhantomData<(usize, ())>: Freeze, *const ArcInner<WritesIndex> is !null: Freeze, PhantomData<ArcInner<WritesIndex>>: Freeze, *const ArcInner<SpecIdentity> is !null: Freeze, PhantomData<ArcInner<SpecIdentity>>: Freeze, *const ArcInner<LemmaSpec> is !null: Freeze, PhantomData<ArcInner<LemmaSpec>>: Freeze, PhantomData<SpecIdentity>: Freeze, *const LeafNode<RulePath, SpecCandidates> is !null: Freeze, PhantomData<Box<(RulePath, SpecCandidates)>>: Freeze, PhantomData<RulePath>: Freeze, PhantomData<Bucket<DataPath, InstanceListSource>>: Freeze, PhantomData<u32>: Freeze, PhantomData<Option<OperationResult>>: Freeze, PhantomData<NormalFormId>: Freeze, PhantomData<Option<RuleIndex>>: Freeze, PhantomData<Vec<ScaleTarget>>: Freeze,

§

impl Move for ExecutionPlan

§

impl RefUnwindSafe for ExecutionPlan

§

impl Send for ExecutionPlan
where RawVecInner: Send, RawTable<usize>: Send, Arc<str>: Send, BoxRaw<TypedLiteral>: Send, Arc<RowInstance>: Send, BoxRaw<InstanceKey>: Send, Arc<[TypedLiteral]>: Send, Arc<RowStore>: Send, Arc<LemmaType>: Send, Arc<KeyIndex>: Send, Arc<PathBuf>: Send, Arc<InstanceFactors>: Send, NodeRef<Owned, SpecIdentity, Arc<RowInstance>, LeafOrInternal>: Send, BoxRaw<(SpecIdentity, Arc<RowInstance>)>: Send, BoxRaw<Value>: Send, Arc<[DispatchKey]>: Send, Arc<SpecIdentity>: Send, Arc<ResolvedSpecTypes>: Send, Arc<FamilyUnitCatalog>: Send, NodeRef<Owned, Dimension, i32, LeafOrInternal>: Send, BoxRaw<(Dimension, i32)>: Send, BoxRaw<ShowExpression>: Send, NodeRef<Owned, SpecIdentity, Arc<ExecutionPlan>, LeafOrInternal>: Send, BoxRaw<(SpecIdentity, Arc<ExecutionPlan>)>: Send, RawTable<(usize, ())>: Send, Arc<WritesIndex>: Send, Arc<LemmaSpec>: Send, NodeRef<Owned, RulePath, SpecCandidates, LeafOrInternal>: Send, BoxRaw<(RulePath, SpecCandidates)>: Send,

§

impl Sync for ExecutionPlan
where RawVecInner: Sync, RawTable<usize>: Sync, Arc<str>: Sync, BoxRaw<TypedLiteral>: Sync, Arc<RowInstance>: Sync, BoxRaw<InstanceKey>: Sync, Arc<[TypedLiteral]>: Sync, Arc<RowStore>: Sync, Arc<LemmaType>: Sync, Arc<KeyIndex>: Sync, Arc<PathBuf>: Sync, Arc<InstanceFactors>: Sync, NodeRef<Owned, SpecIdentity, Arc<RowInstance>, LeafOrInternal>: Sync, BoxRaw<(SpecIdentity, Arc<RowInstance>)>: Sync, BoxRaw<Value>: Sync, Arc<[DispatchKey]>: Sync, Arc<SpecIdentity>: Sync, Arc<ResolvedSpecTypes>: Sync, Arc<FamilyUnitCatalog>: Sync, NodeRef<Owned, Dimension, i32, LeafOrInternal>: Sync, BoxRaw<(Dimension, i32)>: Sync, BoxRaw<ShowExpression>: Sync, NodeRef<Owned, SpecIdentity, Arc<ExecutionPlan>, LeafOrInternal>: Sync, BoxRaw<(SpecIdentity, Arc<ExecutionPlan>)>: Sync, RawTable<(usize, ())>: Sync, Arc<WritesIndex>: Sync, Arc<LemmaSpec>: Sync, NodeRef<Owned, RulePath, SpecCandidates, LeafOrInternal>: Sync, BoxRaw<(RulePath, SpecCandidates)>: Sync,

§

impl Unpin for ExecutionPlan
where *const u8 is !null: Unpin, Arc<str>: Unpin, Box<TypedLiteral>: Unpin, Arc<RowInstance>: Unpin, Box<InstanceKey>: Unpin, Arc<[TypedLiteral]>: Unpin, Arc<RowStore>: Unpin, Arc<LemmaType>: Unpin, Arc<KeyIndex>: Unpin, Arc<PathBuf>: Unpin, Arc<InstanceFactors>: Unpin, *const LeafNode<SpecIdentity, Arc<RowInstance>> is !null: Unpin, Box<(SpecIdentity, Arc<RowInstance>)>: Unpin, Box<Value>: Unpin, Arc<[DispatchKey]>: Unpin, Arc<SpecIdentity>: Unpin, Arc<ResolvedSpecTypes>: Unpin, Arc<FamilyUnitCatalog>: Unpin, *const LeafNode<Dimension, i32> is !null: Unpin, Box<(Dimension, i32)>: Unpin, Box<ShowExpression>: Unpin, *const LeafNode<SpecIdentity, Arc<ExecutionPlan>> is !null: Unpin, Box<(SpecIdentity, Arc<ExecutionPlan>)>: Unpin, Arc<WritesIndex>: Unpin, Arc<LemmaSpec>: Unpin, *const LeafNode<RulePath, SpecCandidates> is !null: Unpin, Box<(RulePath, SpecCandidates)>: Unpin,

§

impl UnsafeUnpin for ExecutionPlan
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, PhantomData<Bucket<DataPath, DataDefinition>>: UnsafeUnpin, PhantomData<NormalForm>: UnsafeUnpin, PhantomData<Bucket<RulePath, ExecutableRule>>: UnsafeUnpin, PhantomData<DataPath>: UnsafeUnpin, PhantomData<Bucket<String, Value>>: UnsafeUnpin, *const ArcInner<ResolvedSpecTypes> is !null: UnsafeUnpin, PhantomData<ArcInner<ResolvedSpecTypes>>: UnsafeUnpin, *const ArcInner<FamilyUnitCatalog> is !null: UnsafeUnpin, PhantomData<ArcInner<FamilyUnitCatalog>>: UnsafeUnpin, PhantomData<Bucket<Vec<SignatureFactor>, (String, Arc<LemmaType>)>>: UnsafeUnpin, *const ArcInner<PathBuf> is !null: UnsafeUnpin, PhantomData<ArcInner<PathBuf>>: UnsafeUnpin, PhantomData<NeededByRules>: UnsafeUnpin, PhantomData<Bucket<DataPath, ShowDataCache>>: UnsafeUnpin, PhantomData<Bucket<RulePath, ShowRule>>: UnsafeUnpin, PhantomData<Bucket<DataPath, Vec<u32>>>: UnsafeUnpin, PhantomData<Bucket<DataPath, SpecIdentity>>: UnsafeUnpin, PhantomData<Bucket<DataPath, ReferenceEnd>>: UnsafeUnpin, PhantomData<Bucket<String, DataPath>>: UnsafeUnpin, PhantomData<Bucket<String, RulePath>>: UnsafeUnpin, PhantomData<Bucket<DataPath, NormalFormId>>: UnsafeUnpin, PhantomData<Bucket<ReferenceTarget, NormalFormId>>: UnsafeUnpin, *const LeafNode<SpecIdentity, Arc<ExecutionPlan>> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(SpecIdentity, Arc<ExecutionPlan>)>>: UnsafeUnpin, PhantomData<Bucket<GlobalKey, SpecIdentity>>: UnsafeUnpin, PhantomData<Bucket<Vec<String>, Vec<Write>>>: UnsafeUnpin, PhantomData<(Vec<String>, DataPath)>: UnsafeUnpin, PhantomData<Copy>: UnsafeUnpin, PhantomData<(Vec<String>, DataPath, Arc<RowStore>)>: UnsafeUnpin, PhantomData<(DataPath, Arc<RowInstance>)>: UnsafeUnpin, PhantomData<(usize, ())>: UnsafeUnpin, *const ArcInner<WritesIndex> is !null: UnsafeUnpin, PhantomData<ArcInner<WritesIndex>>: UnsafeUnpin, *const ArcInner<SpecIdentity> is !null: UnsafeUnpin, PhantomData<ArcInner<SpecIdentity>>: UnsafeUnpin, *const ArcInner<LemmaSpec> is !null: UnsafeUnpin, PhantomData<ArcInner<LemmaSpec>>: UnsafeUnpin, PhantomData<SpecIdentity>: UnsafeUnpin, *const LeafNode<RulePath, SpecCandidates> is !null: UnsafeUnpin, PhantomData<Box<(RulePath, SpecCandidates)>>: UnsafeUnpin, PhantomData<RulePath>: UnsafeUnpin, PhantomData<Bucket<DataPath, InstanceListSource>>: UnsafeUnpin, PhantomData<u32>: UnsafeUnpin, PhantomData<Option<OperationResult>>: UnsafeUnpin, PhantomData<NormalFormId>: UnsafeUnpin, PhantomData<Option<RuleIndex>>: UnsafeUnpin, PhantomData<Vec<ScaleTarget>>: UnsafeUnpin,

§

impl UnwindSafe for ExecutionPlan

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.