// @generated by uor-crate from uor-ontology — do not edit manually
//! `resolver/` namespace — Type resolution strategies implementing the partition map Π : T_n → Part(R_n). Resolvers transform type declarations into ring partitions..
//!
//! Space: Bridge
use crate::enums::ComplexityClass;
use crate::enums::MetricAxis;
use crate::enums::WittLevel;
use crate::HostTypes;
/// A strategy for resolving a type declaration into a partition of the ring. The kernel dispatches to a specific resolver based on the type's structure.
/// Disjoint with: ResolutionState, RefinementSuggestion.
pub trait Resolver<H: HostTypes> {
/// Associated type for `TypeDefinition`.
type TypeDefinition: crate::user::type_::TypeDefinition<H>;
/// The type of input this resolver accepts.
fn input_type(&self) -> &Self::TypeDefinition;
/// Associated type for `Partition`.
type Partition: crate::bridge::partition::Partition<H>;
/// The type of output this resolver produces. For all UOR resolvers, the output is a partition:Partition.
fn output_type(&self) -> &Self::Partition;
/// Associated type for `TermExpression`.
type TermExpression: crate::kernel::schema::TermExpression<H>;
/// A human-readable description of the resolution strategy this resolver implements.
fn strategy(&self) -> &Self::TermExpression;
/// Associated type for `ResolutionState`.
type ResolutionState: ResolutionState<H>;
/// The current resolution state of this resolver.
fn resolution_state(&self) -> &Self::ResolutionState;
/// The computational complexity class of this resolver. Replaces the string-valued resolver:complexity property.
fn has_complexity_class(&self) -> ComplexityClass;
/// Associated type for `DispatchTable`.
type DispatchTable: crate::kernel::predicate::DispatchTable<H>;
/// The dispatch table governing resolver selection for this resolver class.
fn dispatch_table(&self) -> &Self::DispatchTable;
/// Associated type for `TypePredicate`.
type TypePredicate: crate::kernel::predicate::TypePredicate<H>;
/// The predicate that selects this specific resolver. When the predicate evaluates to true on an input type, this resolver is chosen.
fn resolver_predicate(&self) -> &Self::TypePredicate;
}
/// Resolves types by factoring the ring under dihedral group action. Identifies orbits under D_{2^n} to determine irreducibility boundaries.
pub trait DihedralFactorizationResolver<H: HostTypes>: Resolver<H> {}
/// Resolves types by computing canonical forms via term rewriting. Applies the critical identity and normalization rules to reduce terms to unique canonical representatives.
pub trait CanonicalFormResolver<H: HostTypes>: Resolver<H> {}
/// Resolves types by direct evaluation: applies operations to enumerate ring elements and classify them as irreducible, reducible, unit, or exterior.
pub trait EvaluationResolver<H: HostTypes>: Resolver<H> {}
/// The current state of an iterative resolution: tracks how many iterations have been performed, whether the resolution is complete, and the current site deficit.
/// Disjoint with: Resolver, RefinementSuggestion.
pub trait ResolutionState<H: HostTypes> {
/// Whether this resolution is complete: all sites are pinned and the partition is fully determined.
fn is_complete(&self) -> bool;
/// The number of refinement iterations performed so far.
fn iteration_count(&self) -> u64;
/// Associated type for `FreeRank`.
type FreeRank: crate::bridge::partition::FreeRank<H>;
/// The site budget showing the remaining unpinned sites. When all sites are pinned, the deficit is zero and resolution is complete.
fn site_deficit(&self) -> &Self::FreeRank;
/// Associated type for `RefinementSuggestion`.
type RefinementSuggestion: RefinementSuggestion<H>;
/// A refinement suggestion for advancing this resolution.
fn suggestion(&self) -> &[Self::RefinementSuggestion];
/// The rate at which sites are being pinned per iteration. A higher rate indicates faster convergence toward a complete resolution.
fn convergence_rate(&self) -> H::Decimal;
/// Associated type for `CechNerve`.
type CechNerve: CechNerve<H>;
/// The constraint nerve associated with this resolution state.
fn cech_nerve(&self) -> &Self::CechNerve;
/// The residual Shannon entropy of the resolution state: S = freeRank × ln 2. Measures remaining uncertainty.
fn residual_entropy(&self) -> H::Decimal;
/// Whether all Betti numbers of the constraint nerve are zero, indicating no topological obstructions to resolution.
fn topologically_complete(&self) -> bool;
/// The Euler characteristic χ(N(C)) of the active constraint nerve at this resolution state. IT_7d requires this value to equal n (the quantum level) for resolution to be complete. Cached here to avoid recomputing the full ψ pipeline on each iteration check.
fn nerve_euler_characteristic(&self) -> i64;
/// Associated type for `Jacobian`.
type Jacobian: crate::bridge::observable::Jacobian<H>;
/// The Jacobian observable guiding constraint selection at this resolution state (DC_10).
fn guiding_jacobian(&self) -> &Self::Jacobian;
}
/// A suggestion from the resolver for how to refine an incomplete resolution: which metric axis to explore, which class to narrow to, and which sites to target.
/// Disjoint with: Resolver, ResolutionState.
pub trait RefinementSuggestion<H: HostTypes> {
/// The metric axis this suggestion recommends exploring.
fn suggested_axis(&self) -> MetricAxis;
/// The constraint class this suggestion recommends applying.
fn suggested_class(&self) -> &H::HostString;
/// Associated type for `SiteIndex`.
type SiteIndex: crate::bridge::partition::SiteIndex<H>;
/// The site coordinates this suggestion targets for pinning.
fn target_sites(&self) -> &[Self::SiteIndex];
}
/// The simplicial complex whose vertices are constraints and where a k-simplex exists iff the corresponding k+1 constraints have nonempty intersection. The nerve's topology governs resolution convergence: trivial homology ↔ smooth convergence, non-trivial homology ↔ potential stalls.
pub trait CechNerve<H: HostTypes>:
crate::bridge::homology::SimplicialComplex<H> + crate::bridge::homology::KanComplex<H>
{
}
/// A specialisation of Resolver driving the completeness certification loop. Accepts a CompletenessCandidate, runs the ψ-pipeline (reading nerveEulerCharacteristic from ResolutionState), and either issues a CompletenessCertificate or produces a RefinementSuggestion.
pub trait CompletenessResolver<H: HostTypes>: Resolver<H> {
/// Associated type for `CompletenessCandidate`.
type CompletenessCandidate: crate::user::type_::CompletenessCandidate<H>;
/// The CompletenessCandidate this resolver is certifying.
fn completeness_target(&self) -> &Self::CompletenessCandidate;
}
/// A Resolver parameterised by quantum level. The same resolver strategy runs at any quantum level n ≥ 1 by substituting the appropriate R_n ring.
pub trait WittLevelResolver<H: HostTypes>: Resolver<H> {
/// The quantum level this resolver instance is configured for.
fn quantum_level(&self) -> WittLevel;
}
/// A Resolver that maintains a BindingAccumulator across multiple RelationQuery evaluations. The top-level resolver for multi-turn Prism deployments.
pub trait SessionResolver<H: HostTypes>: Resolver<H> {
/// Associated type for `BindingAccumulator`.
type BindingAccumulator: crate::user::state::BindingAccumulator<H>;
/// The BindingAccumulator this session resolver maintains across multiple RelationQuery evaluations.
fn session_accumulator(&self) -> &Self::BindingAccumulator;
/// Associated type for `ExecutionPolicy`.
type ExecutionPolicy: ExecutionPolicy<H>;
/// The ordering strategy this resolver applies to pending queries. Defaults to FifoPolicy if unset.
fn execution_policy(&self) -> &Self::ExecutionPolicy;
}
/// A Resolver that runs the ψ-pipeline in inverse mode. Accepts a TypeSynthesisGoal and returns a TypeSynthesisResult. Internally maintains a ConstraintSearchState tracking which constraint combinations have been explored and which Betti profiles they realise.
pub trait TypeSynthesisResolver<H: HostTypes>: Resolver<H> {
/// Associated type for `TypeSynthesisGoal`.
type TypeSynthesisGoal: crate::user::type_::TypeSynthesisGoal<H>;
/// The goal this type synthesis resolver is working to achieve.
fn synthesis_goal(&self) -> &Self::TypeSynthesisGoal;
}
/// Internal resolver state tracking the boundary of explored constraint combinations during synthesis. Carries exploredCount, currentCandidate, and a link to the best SynthesisSignature achieved so far.
pub trait ConstraintSearchState<H: HostTypes> {
/// Number of constraint combinations evaluated so far during synthesis.
fn explored_count(&self) -> u64;
/// Associated type for `ConstrainedType`.
type ConstrainedType: crate::user::type_::ConstrainedType<H>;
/// The type candidate currently being evaluated during synthesis.
fn current_candidate(&self) -> &Self::ConstrainedType;
}
/// A Resolver that determines whether a CompleteType T at Q_n lifts to a CompleteType at Q_{n+1} without re-running the full ψ-pipeline from scratch. It computes the SpectralSequencePage sequence, reads the LiftObstruction, and either confirms the lift or returns a LiftRefinementSuggestion.
pub trait IncrementalCompletenessResolver<H: HostTypes>: Resolver<H> {
/// Associated type for `WittLift`.
type WittLift: crate::user::type_::WittLift<H>;
/// The WittLift this incremental completeness resolver is evaluating.
fn lift_target(&self) -> &Self::WittLift;
}
/// A RefinementSuggestion produced when a WittLift has a non-trivial LiftObstruction. Specialises RefinementSuggestion with liftSitePosition (the new bit position n+1) and obstructionClass.
pub trait LiftRefinementSuggestion<H: HostTypes>: RefinementSuggestion<H> {
/// The new site position at Q_{n+1} that the lift refinement suggestion targets.
fn lift_site_position(&self) -> &Self::SiteIndex;
/// Associated type for `LiftObstructionClass`.
type LiftObstructionClass: crate::bridge::observable::LiftObstructionClass<H>;
/// The obstruction class this lift refinement suggestion is designed to kill.
fn obstruction_class(&self) -> &Self::LiftObstructionClass;
}
/// A Resolver that computes the HolonomyGroup of a ConstrainedType by enumerating closed paths in the constraint nerve and accumulating DihedralElement values. Outputs a MonodromyClass and classifies the type as FlatType or TwistedType.
pub trait MonodromyResolver<H: HostTypes>: Resolver<H> {
/// Associated type for `ConstrainedType`.
type ConstrainedType: crate::user::type_::ConstrainedType<H>;
/// The type whose holonomy this monodromy resolver is computing.
fn monodromy_target(&self) -> &Self::ConstrainedType;
/// Associated type for `HolonomyGroup`.
type HolonomyGroup: crate::bridge::observable::HolonomyGroup<H>;
/// The HolonomyGroup produced by this monodromy resolver run.
fn holonomy_result(&self) -> &Self::HolonomyGroup;
}
/// A resolver that uses the Jacobian matrix to guide constraint selection, implementing DC_10: select the constraint that maximises total curvature reduction.
pub trait JacobianGuidedResolver<H: HostTypes>: Resolver<H> {}
/// A resolver that handles superposed site states, computing amplitudes and determining when superposition collapses to a classical site assignment (Amendment 32).
pub trait SuperpositionResolver<H: HostTypes>: Resolver<H> {
/// The amplitude vector of all branches maintained by this SuperpositionResolver during ψ-pipeline traversal. Encoded as a comma-separated list of decimal amplitudes. Must satisfy Σ|αᵢ|² = 1 (QM_5) after normalization.
fn amplitude_vector(&self) -> H::Decimal;
}
/// A resolver that exploits accumulated session bindings at full saturation (σ = 1) to provide O(1) resolution via direct coordinate reads (SC_5).
pub trait GroundingAwareResolver<H: HostTypes>: Resolver<H> {
/// Whether this resolver used the saturation shortcut (SC_5) to bypass the ψ-pipeline and return a direct coordinate read.
fn used_grounding(&self) -> bool;
}
/// A resolver that validates whether a ComputationTrace satisfies the dual geodesic condition (AR_1-ordered and DC_10-selected). Produces GeodesicViolation individuals on failure.
pub trait GeodesicValidator<H: HostTypes>: Resolver<H> {
/// Associated type for `GeodesicTrace`.
type GeodesicTrace: crate::bridge::trace::GeodesicTrace<H>;
/// The GeodesicTrace being validated by this GeodesicValidator.
fn validate_geodesic(&self) -> &Self::GeodesicTrace;
}
/// A resolver that handles projective collapse of SuperposedSiteState components. Issues MeasurementCertificate upon successful collapse with QM_1 verification.
pub trait MeasurementResolver<H: HostTypes>: Resolver<H> {
/// The amplitude of the SuperposedSiteState prior to projective collapse by this MeasurementResolver.
fn collapse_amplitude(&self) -> H::Decimal;
/// The site index that was collapsed (pinned to a classical value) by the projective measurement.
fn collapsed_site(&self) -> u64;
/// The classical value obtained from the projective collapse. Either 0 or 1 for a single-site measurement.
fn measurement_outcome(&self) -> u64;
/// The full vector of all branch amplitudes before projective collapse. Recorded by the MeasurementResolver to enable Born rule verification (QM_5): P(outcome k) = |α_k|².
fn prior_amplitude_vector(&self) -> H::Decimal;
}
/// A Resolver that constructs a LiftChain from liftSourceLevel to an arbitrary liftTargetLevel Q_k by iterating IncrementalCompletenessResolver step by step.
pub trait TowerCompletenessResolver<H: HostTypes>: Resolver<H> {
/// The level at which the tower starts.
fn tower_source_level(&self) -> WittLevel;
/// The level to which the tower is being built.
fn tower_target_level(&self) -> WittLevel;
/// Associated type for `LiftChain`.
type LiftChain: crate::user::type_::LiftChain<H>;
/// The LiftChain under construction.
fn current_chain(&self) -> &Self::LiftChain;
/// Associated type for `IncrementalCompletenessResolver`.
type IncrementalCompletenessResolver: IncrementalCompletenessResolver<H>;
/// The IncrementalCompletenessResolver used for each single-step lift.
fn tower_step_resolver(&self) -> &Self::IncrementalCompletenessResolver;
}
/// A Resolver whose dispatch is governed by a new predicate:InhabitanceDispatchTable. Returns either a cert:InhabitanceCertificate (verified true with witness) or a proof:InhabitanceImpossibilityWitness (verified false with contradiction proof). Inherits the dual-output termination discipline from resolver:TypeSynthesisResolver.
pub trait InhabitanceResolver<H: HostTypes>: Resolver<H> {}
/// A Resolver target that decides carrier non-emptiness on ConstrainedType instances whose constraint nerve contains only disjunctions of width ≤ 2, via classical 2-SAT in O(n+m). Dispatch rule 1 of the InhabitanceDispatchTable.
pub trait TwoSatDecider<H: HostTypes>: Resolver<H> {}
/// A Resolver target that decides carrier non-emptiness on ConstrainedType instances whose disjunctions each contain at most one positive literal, via classical Horn-SAT unit propagation in O(n+m). Dispatch rule 2 of the InhabitanceDispatchTable.
pub trait HornSatDecider<H: HostTypes>: Resolver<H> {}
/// A Resolver target for the catch-all default dispatch rule. Returns the residual-hard verdict without promising a polynomial bound; the verdict is well-formed but the cost identity is unbounded. Dispatch rule 3 of the InhabitanceDispatchTable ensuring total coverage (reduction:DispatchMiss is unreachable for this table).
pub trait ResidualVerdictResolver<H: HostTypes>: Resolver<H> {}
/// A Resolver target that decides the cost-optimal Toom-Cook splitting factor R for a Datum\<L\> × Datum\<L\> multiplication at a given call-site context (stack budget linear:stackBudgetBytes, const-eval regime). The decision procedure is a pure derivation over a closed-form Landauer cost function grounded in op:OA_5: for each admissible R, the cost is (2R - 1) · (N/R)² · 64 · ln 2 nats (R > 1) or N² · 64 · ln 2 nats (R = 1). The resolver picks the cost-minimum R subject to stack-budget and const-eval constraints and returns a cert:MultiplicationCertificate recording the choice.
pub trait MultiplicationResolver<H: HostTypes>: Resolver<H> {}
/// An ontology fact recording that a resolver:Resolver subclass produces a specific cert:Certificate subclass on success and a specific proof:ImpossibilityWitness subclass on failure. The v0.2.1 Rust codegen reads CertifyMapping individuals to emit foundation::Certify trait impls for each resolver class, keeping the mapping data-driven rather than hand-tabulated in source.
pub trait CertifyMapping<H: HostTypes> {
/// The resolver:Resolver subclass this CertifyMapping describes.
fn for_resolver(&self) -> &H::HostString;
/// The cert:Certificate (or proof:ComputationCertificate) subclass this resolver produces on success.
fn produces_certificate(&self) -> &H::HostString;
/// The proof:ImpossibilityWitness subclass this resolver produces on failure.
fn produces_witness(&self) -> &H::HostString;
}
/// A strategy class that defines how a SessionResolver orders pending RelationQuery instances for dispatch. The policy reads the targetSite.freeRank of each pending query and applies an ordering function.
/// Disjoint with: Resolver, ResolutionState, RefinementSuggestion.
pub trait ExecutionPolicy<H: HostTypes> {}
/// A resolver that runs the extended ψ-pipeline (ψ_7–ψ_9) to compute the full homotopy type of a CechNerve. Returns HomotopyGroup observables and PostnikovTruncation records.
pub trait HomotopyResolver<H: HostTypes>: Resolver<H> {
/// Associated type for `CechNerve`.
type CechNerve: CechNerve<H>;
/// The CechNerve whose homotopy type this resolver computes.
fn homotopy_target(&self) -> &Self::CechNerve;
/// Associated type for `HomotopyGroup`.
type HomotopyGroup: crate::bridge::observable::HomotopyGroup<H>;
/// A HomotopyGroup observable produced by this resolver.
fn homotopy_result(&self) -> &[Self::HomotopyGroup];
}
/// A resolver that computes the local structure of the moduli space at a given CompleteType: constructs the DeformationComplex, determines the HolonomyStratum, and computes tangent/obstruction dimensions.
pub trait ModuliResolver<H: HostTypes>: Resolver<H> {
/// Associated type for `CompleteType`.
type CompleteType: crate::user::type_::CompleteType<H>;
/// The CompleteType whose local moduli structure this resolver computes.
fn moduli_target(&self) -> &Self::CompleteType;
/// Associated type for `DeformationComplex`.
type DeformationComplex: crate::bridge::homology::DeformationComplex<H>;
/// The DeformationComplex constructed by this resolver.
fn moduli_deformation(&self) -> &Self::DeformationComplex;
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `Resolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullResolver<H> = NullResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `DihedralFactorizationResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullDihedralFactorizationResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullDihedralFactorizationResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullDihedralFactorizationResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullDihedralFactorizationResolver<H> = NullDihedralFactorizationResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullDihedralFactorizationResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> DihedralFactorizationResolver<H> for NullDihedralFactorizationResolver<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `CanonicalFormResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullCanonicalFormResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullCanonicalFormResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullCanonicalFormResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullCanonicalFormResolver<H> = NullCanonicalFormResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullCanonicalFormResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> CanonicalFormResolver<H> for NullCanonicalFormResolver<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `EvaluationResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullEvaluationResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullEvaluationResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullEvaluationResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullEvaluationResolver<H> = NullEvaluationResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullEvaluationResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> EvaluationResolver<H> for NullEvaluationResolver<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `ResolutionState<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullResolutionState<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullResolutionState<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullResolutionState<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullResolutionState<H> = NullResolutionState {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ResolutionState<H> for NullResolutionState<H> {
fn is_complete(&self) -> bool {
false
}
fn iteration_count(&self) -> u64 {
0
}
type FreeRank = crate::bridge::partition::NullFreeRank<H>;
fn site_deficit(&self) -> &Self::FreeRank {
&<crate::bridge::partition::NullFreeRank<H>>::ABSENT
}
type RefinementSuggestion = NullRefinementSuggestion<H>;
fn suggestion(&self) -> &[Self::RefinementSuggestion] {
&[]
}
fn convergence_rate(&self) -> H::Decimal {
H::EMPTY_DECIMAL
}
type CechNerve = NullCechNerve<H>;
fn cech_nerve(&self) -> &Self::CechNerve {
&<NullCechNerve<H>>::ABSENT
}
fn residual_entropy(&self) -> H::Decimal {
H::EMPTY_DECIMAL
}
fn topologically_complete(&self) -> bool {
false
}
fn nerve_euler_characteristic(&self) -> i64 {
0
}
type Jacobian = crate::bridge::observable::NullJacobian<H>;
fn guiding_jacobian(&self) -> &Self::Jacobian {
&<crate::bridge::observable::NullJacobian<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `RefinementSuggestion<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullRefinementSuggestion<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullRefinementSuggestion<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullRefinementSuggestion<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullRefinementSuggestion<H> = NullRefinementSuggestion {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> RefinementSuggestion<H> for NullRefinementSuggestion<H> {
fn suggested_axis(&self) -> MetricAxis {
<MetricAxis>::default()
}
fn suggested_class(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type SiteIndex = crate::bridge::partition::NullSiteIndex<H>;
fn target_sites(&self) -> &[Self::SiteIndex] {
&[]
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `CechNerve<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullCechNerve<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullCechNerve<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullCechNerve<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullCechNerve<H> = NullCechNerve {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> crate::bridge::homology::SimplicialComplex<H> for NullCechNerve<H> {
type Simplex = crate::bridge::homology::NullSimplex<H>;
fn has_simplex(&self) -> &[Self::Simplex] {
&[]
}
fn max_dimension(&self) -> i64 {
0
}
fn euler_characteristic(&self) -> i64 {
0
}
fn simplicial_vertex_count(&self) -> u64 {
0
}
}
impl<H: HostTypes> crate::bridge::homology::KanComplex<H> for NullCechNerve<H> {
type HornFiller = crate::bridge::homology::NullHornFiller<H>;
fn kan_witness(&self) -> &[Self::HornFiller] {
&[]
}
}
impl<H: HostTypes> CechNerve<H> for NullCechNerve<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `CompletenessResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullCompletenessResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullCompletenessResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullCompletenessResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullCompletenessResolver<H> = NullCompletenessResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullCompletenessResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> CompletenessResolver<H> for NullCompletenessResolver<H> {
type CompletenessCandidate = crate::user::type_::NullCompletenessCandidate<H>;
fn completeness_target(&self) -> &Self::CompletenessCandidate {
&<crate::user::type_::NullCompletenessCandidate<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `WittLevelResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullWittLevelResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullWittLevelResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullWittLevelResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullWittLevelResolver<H> = NullWittLevelResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullWittLevelResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> WittLevelResolver<H> for NullWittLevelResolver<H> {
fn quantum_level(&self) -> WittLevel {
<WittLevel>::default()
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `SessionResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullSessionResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullSessionResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullSessionResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullSessionResolver<H> = NullSessionResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullSessionResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> SessionResolver<H> for NullSessionResolver<H> {
type BindingAccumulator = crate::user::state::NullBindingAccumulator<H>;
fn session_accumulator(&self) -> &Self::BindingAccumulator {
&<crate::user::state::NullBindingAccumulator<H>>::ABSENT
}
type ExecutionPolicy = NullExecutionPolicy<H>;
fn execution_policy(&self) -> &Self::ExecutionPolicy {
&<NullExecutionPolicy<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `TypeSynthesisResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullTypeSynthesisResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullTypeSynthesisResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullTypeSynthesisResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullTypeSynthesisResolver<H> = NullTypeSynthesisResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullTypeSynthesisResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> TypeSynthesisResolver<H> for NullTypeSynthesisResolver<H> {
type TypeSynthesisGoal = crate::user::type_::NullTypeSynthesisGoal<H>;
fn synthesis_goal(&self) -> &Self::TypeSynthesisGoal {
&<crate::user::type_::NullTypeSynthesisGoal<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `ConstraintSearchState<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullConstraintSearchState<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullConstraintSearchState<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullConstraintSearchState<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullConstraintSearchState<H> = NullConstraintSearchState {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ConstraintSearchState<H> for NullConstraintSearchState<H> {
fn explored_count(&self) -> u64 {
0
}
type ConstrainedType = crate::user::type_::NullConstrainedType<H>;
fn current_candidate(&self) -> &Self::ConstrainedType {
&<crate::user::type_::NullConstrainedType<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `IncrementalCompletenessResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullIncrementalCompletenessResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullIncrementalCompletenessResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullIncrementalCompletenessResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullIncrementalCompletenessResolver<H> =
NullIncrementalCompletenessResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullIncrementalCompletenessResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> IncrementalCompletenessResolver<H> for NullIncrementalCompletenessResolver<H> {
type WittLift = crate::user::type_::NullWittLift<H>;
fn lift_target(&self) -> &Self::WittLift {
&<crate::user::type_::NullWittLift<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `LiftRefinementSuggestion<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullLiftRefinementSuggestion<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullLiftRefinementSuggestion<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullLiftRefinementSuggestion<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullLiftRefinementSuggestion<H> = NullLiftRefinementSuggestion {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> RefinementSuggestion<H> for NullLiftRefinementSuggestion<H> {
fn suggested_axis(&self) -> MetricAxis {
<MetricAxis>::default()
}
fn suggested_class(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type SiteIndex = crate::bridge::partition::NullSiteIndex<H>;
fn target_sites(&self) -> &[Self::SiteIndex] {
&[]
}
}
impl<H: HostTypes> LiftRefinementSuggestion<H> for NullLiftRefinementSuggestion<H> {
fn lift_site_position(&self) -> &Self::SiteIndex {
&<crate::bridge::partition::NullSiteIndex<H>>::ABSENT
}
type LiftObstructionClass = crate::bridge::observable::NullLiftObstructionClass<H>;
fn obstruction_class(&self) -> &Self::LiftObstructionClass {
&<crate::bridge::observable::NullLiftObstructionClass<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `MonodromyResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullMonodromyResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullMonodromyResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullMonodromyResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullMonodromyResolver<H> = NullMonodromyResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullMonodromyResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> MonodromyResolver<H> for NullMonodromyResolver<H> {
type ConstrainedType = crate::user::type_::NullConstrainedType<H>;
fn monodromy_target(&self) -> &Self::ConstrainedType {
&<crate::user::type_::NullConstrainedType<H>>::ABSENT
}
type HolonomyGroup = crate::bridge::observable::NullHolonomyGroup<H>;
fn holonomy_result(&self) -> &Self::HolonomyGroup {
&<crate::bridge::observable::NullHolonomyGroup<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `JacobianGuidedResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullJacobianGuidedResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullJacobianGuidedResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullJacobianGuidedResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullJacobianGuidedResolver<H> = NullJacobianGuidedResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullJacobianGuidedResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> JacobianGuidedResolver<H> for NullJacobianGuidedResolver<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `SuperpositionResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullSuperpositionResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullSuperpositionResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullSuperpositionResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullSuperpositionResolver<H> = NullSuperpositionResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullSuperpositionResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> SuperpositionResolver<H> for NullSuperpositionResolver<H> {
fn amplitude_vector(&self) -> H::Decimal {
H::EMPTY_DECIMAL
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `GroundingAwareResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullGroundingAwareResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullGroundingAwareResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullGroundingAwareResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullGroundingAwareResolver<H> = NullGroundingAwareResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullGroundingAwareResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> GroundingAwareResolver<H> for NullGroundingAwareResolver<H> {
fn used_grounding(&self) -> bool {
false
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `GeodesicValidator<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullGeodesicValidator<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullGeodesicValidator<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullGeodesicValidator<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullGeodesicValidator<H> = NullGeodesicValidator {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullGeodesicValidator<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> GeodesicValidator<H> for NullGeodesicValidator<H> {
type GeodesicTrace = crate::bridge::trace::NullGeodesicTrace<H>;
fn validate_geodesic(&self) -> &Self::GeodesicTrace {
&<crate::bridge::trace::NullGeodesicTrace<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `MeasurementResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullMeasurementResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullMeasurementResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullMeasurementResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullMeasurementResolver<H> = NullMeasurementResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullMeasurementResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> MeasurementResolver<H> for NullMeasurementResolver<H> {
fn collapse_amplitude(&self) -> H::Decimal {
H::EMPTY_DECIMAL
}
fn collapsed_site(&self) -> u64 {
0
}
fn measurement_outcome(&self) -> u64 {
0
}
fn prior_amplitude_vector(&self) -> H::Decimal {
H::EMPTY_DECIMAL
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `TowerCompletenessResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullTowerCompletenessResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullTowerCompletenessResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullTowerCompletenessResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullTowerCompletenessResolver<H> = NullTowerCompletenessResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullTowerCompletenessResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> TowerCompletenessResolver<H> for NullTowerCompletenessResolver<H> {
fn tower_source_level(&self) -> WittLevel {
<WittLevel>::default()
}
fn tower_target_level(&self) -> WittLevel {
<WittLevel>::default()
}
type LiftChain = crate::user::type_::NullLiftChain<H>;
fn current_chain(&self) -> &Self::LiftChain {
&<crate::user::type_::NullLiftChain<H>>::ABSENT
}
type IncrementalCompletenessResolver = NullIncrementalCompletenessResolver<H>;
fn tower_step_resolver(&self) -> &Self::IncrementalCompletenessResolver {
&<NullIncrementalCompletenessResolver<H>>::ABSENT
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `InhabitanceResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullInhabitanceResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullInhabitanceResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullInhabitanceResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullInhabitanceResolver<H> = NullInhabitanceResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullInhabitanceResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> InhabitanceResolver<H> for NullInhabitanceResolver<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `TwoSatDecider<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullTwoSatDecider<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullTwoSatDecider<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullTwoSatDecider<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullTwoSatDecider<H> = NullTwoSatDecider {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullTwoSatDecider<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> TwoSatDecider<H> for NullTwoSatDecider<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `HornSatDecider<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullHornSatDecider<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullHornSatDecider<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullHornSatDecider<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullHornSatDecider<H> = NullHornSatDecider {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullHornSatDecider<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> HornSatDecider<H> for NullHornSatDecider<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `ResidualVerdictResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullResidualVerdictResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullResidualVerdictResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullResidualVerdictResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullResidualVerdictResolver<H> = NullResidualVerdictResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullResidualVerdictResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> ResidualVerdictResolver<H> for NullResidualVerdictResolver<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `MultiplicationResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullMultiplicationResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullMultiplicationResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullMultiplicationResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullMultiplicationResolver<H> = NullMultiplicationResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullMultiplicationResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> MultiplicationResolver<H> for NullMultiplicationResolver<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `CertifyMapping<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullCertifyMapping<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullCertifyMapping<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullCertifyMapping<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullCertifyMapping<H> = NullCertifyMapping {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> CertifyMapping<H> for NullCertifyMapping<H> {
fn for_resolver(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn produces_certificate(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn produces_witness(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `ExecutionPolicy<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullExecutionPolicy<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullExecutionPolicy<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullExecutionPolicy<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullExecutionPolicy<H> = NullExecutionPolicy {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> ExecutionPolicy<H> for NullExecutionPolicy<H> {}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `HomotopyResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullHomotopyResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullHomotopyResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullHomotopyResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullHomotopyResolver<H> = NullHomotopyResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullHomotopyResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> HomotopyResolver<H> for NullHomotopyResolver<H> {
type CechNerve = NullCechNerve<H>;
fn homotopy_target(&self) -> &Self::CechNerve {
&<NullCechNerve<H>>::ABSENT
}
type HomotopyGroup = crate::bridge::observable::NullHomotopyGroup<H>;
fn homotopy_result(&self) -> &[Self::HomotopyGroup] {
&[]
}
}
/// Phase 2 (orphan-closure) — resolver-absent default impl of `ModuliResolver<H>`.
/// Every accessor returns `H::EMPTY_*` sentinels (for scalar / host-typed
/// returns) or a `'static`-lifetime reference to a sibling `Null*`'s `ABSENT`
/// const (for trait-typed returns). Downstream provides concrete impls;
/// this stub closes the ontology-derived trait orphan.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct NullModuliResolver<H: HostTypes> {
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Default for NullModuliResolver<H> {
fn default() -> Self {
Self {
_phantom: core::marker::PhantomData,
}
}
}
impl<H: HostTypes> NullModuliResolver<H> {
/// Absent-value sentinel. `&Self::ABSENT` gives every trait-typed accessor a `'static`-lifetime reference target.
pub const ABSENT: NullModuliResolver<H> = NullModuliResolver {
_phantom: core::marker::PhantomData,
};
}
impl<H: HostTypes> Resolver<H> for NullModuliResolver<H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<H: HostTypes> ModuliResolver<H> for NullModuliResolver<H> {
type CompleteType = crate::user::type_::NullCompleteType<H>;
fn moduli_target(&self) -> &Self::CompleteType {
&<crate::user::type_::NullCompleteType<H>>::ABSENT
}
type DeformationComplex = crate::bridge::homology::NullDeformationComplex<H>;
fn moduli_deformation(&self) -> &Self::DeformationComplex {
&<crate::bridge::homology::NullDeformationComplex<H>>::ABSENT
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `Resolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct ResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ResolverHandle<H> {}
impl<H: HostTypes> Clone for ResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `Resolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait ResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: ResolverHandle<H>) -> Option<ResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `Resolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ResolverRecord<H: HostTypes> {
pub input_type_handle: crate::user::type_::TypeDefinitionHandle<H>,
pub strategy_handle: crate::kernel::schema::TermExpressionHandle<H>,
pub resolution_state_handle: ResolutionStateHandle<H>,
pub has_complexity_class: ComplexityClass,
pub dispatch_table_handle: crate::kernel::predicate::DispatchTableHandle<H>,
pub resolver_predicate_handle: crate::kernel::predicate::TypePredicateHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `Resolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedResolver<'r, R: ResolverResolver<H>, H: HostTypes> {
handle: ResolverHandle<H>,
resolver: &'r R,
record: Option<ResolverRecord<H>>,
}
impl<'r, R: ResolverResolver<H>, H: HostTypes> ResolvedResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: ResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> ResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ResolverResolver<H>, H: HostTypes> Resolver<H> for ResolvedResolver<'r, R, H> {
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
match &self.record {
Some(r) => r.has_complexity_class,
None => <ComplexityClass>::default(),
}
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: ResolverResolver<H>, H: HostTypes> ResolvedResolver<'r, R, H> {
/// Promote the `input_type` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_input_type<'r2, R2: crate::user::type_::TypeDefinitionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::user::type_::ResolvedTypeDefinition<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::type_::ResolvedTypeDefinition::new(
record.input_type_handle,
r,
))
}
/// Promote the `strategy` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_strategy<'r2, R2: crate::kernel::schema::TermExpressionResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::schema::ResolvedTermExpression<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::schema::ResolvedTermExpression::new(
record.strategy_handle,
r,
))
}
/// Promote the `resolution_state` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_resolution_state<'r2, R2: ResolutionStateResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedResolutionState<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedResolutionState::new(
record.resolution_state_handle,
r,
))
}
/// Promote the `dispatch_table` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_dispatch_table<'r2, R2: crate::kernel::predicate::DispatchTableResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::predicate::ResolvedDispatchTable<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::predicate::ResolvedDispatchTable::new(
record.dispatch_table_handle,
r,
))
}
/// Promote the `resolver_predicate` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_resolver_predicate<
'r2,
R2: crate::kernel::predicate::TypePredicateResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::kernel::predicate::ResolvedTypePredicate<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::kernel::predicate::ResolvedTypePredicate::new(
record.resolver_predicate_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `DihedralFactorizationResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct DihedralFactorizationResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for DihedralFactorizationResolverHandle<H> {}
impl<H: HostTypes> Clone for DihedralFactorizationResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for DihedralFactorizationResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for DihedralFactorizationResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for DihedralFactorizationResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> DihedralFactorizationResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `DihedralFactorizationResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait DihedralFactorizationResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: DihedralFactorizationResolverHandle<H>,
) -> Option<DihedralFactorizationResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `DihedralFactorizationResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct DihedralFactorizationResolverRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `DihedralFactorizationResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedDihedralFactorizationResolver<
'r,
R: DihedralFactorizationResolverResolver<H>,
H: HostTypes,
> {
handle: DihedralFactorizationResolverHandle<H>,
resolver: &'r R,
record: Option<DihedralFactorizationResolverRecord<H>>,
}
impl<'r, R: DihedralFactorizationResolverResolver<H>, H: HostTypes>
ResolvedDihedralFactorizationResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: DihedralFactorizationResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> DihedralFactorizationResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&DihedralFactorizationResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: DihedralFactorizationResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedDihedralFactorizationResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: DihedralFactorizationResolverResolver<H>, H: HostTypes> DihedralFactorizationResolver<H>
for ResolvedDihedralFactorizationResolver<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `CanonicalFormResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct CanonicalFormResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for CanonicalFormResolverHandle<H> {}
impl<H: HostTypes> Clone for CanonicalFormResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for CanonicalFormResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for CanonicalFormResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for CanonicalFormResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> CanonicalFormResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `CanonicalFormResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait CanonicalFormResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: CanonicalFormResolverHandle<H>,
) -> Option<CanonicalFormResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `CanonicalFormResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct CanonicalFormResolverRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `CanonicalFormResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedCanonicalFormResolver<'r, R: CanonicalFormResolverResolver<H>, H: HostTypes> {
handle: CanonicalFormResolverHandle<H>,
resolver: &'r R,
record: Option<CanonicalFormResolverRecord<H>>,
}
impl<'r, R: CanonicalFormResolverResolver<H>, H: HostTypes>
ResolvedCanonicalFormResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: CanonicalFormResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> CanonicalFormResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&CanonicalFormResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: CanonicalFormResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedCanonicalFormResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: CanonicalFormResolverResolver<H>, H: HostTypes> CanonicalFormResolver<H>
for ResolvedCanonicalFormResolver<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `EvaluationResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct EvaluationResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for EvaluationResolverHandle<H> {}
impl<H: HostTypes> Clone for EvaluationResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for EvaluationResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for EvaluationResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for EvaluationResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> EvaluationResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `EvaluationResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait EvaluationResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: EvaluationResolverHandle<H>) -> Option<EvaluationResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `EvaluationResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct EvaluationResolverRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `EvaluationResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedEvaluationResolver<'r, R: EvaluationResolverResolver<H>, H: HostTypes> {
handle: EvaluationResolverHandle<H>,
resolver: &'r R,
record: Option<EvaluationResolverRecord<H>>,
}
impl<'r, R: EvaluationResolverResolver<H>, H: HostTypes> ResolvedEvaluationResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: EvaluationResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> EvaluationResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&EvaluationResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: EvaluationResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedEvaluationResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: EvaluationResolverResolver<H>, H: HostTypes> EvaluationResolver<H>
for ResolvedEvaluationResolver<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `ResolutionState<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct ResolutionStateHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ResolutionStateHandle<H> {}
impl<H: HostTypes> Clone for ResolutionStateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ResolutionStateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ResolutionStateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ResolutionStateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ResolutionStateHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `ResolutionState<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait ResolutionStateResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: ResolutionStateHandle<H>) -> Option<ResolutionStateRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `ResolutionState<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ResolutionStateRecord<H: HostTypes> {
pub is_complete: bool,
pub iteration_count: u64,
pub site_deficit_handle: crate::bridge::partition::FreeRankHandle<H>,
pub convergence_rate: H::Decimal,
pub cech_nerve_handle: CechNerveHandle<H>,
pub residual_entropy: H::Decimal,
pub topologically_complete: bool,
pub nerve_euler_characteristic: i64,
pub guiding_jacobian_handle: crate::bridge::observable::JacobianHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `ResolutionState<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedResolutionState<'r, R: ResolutionStateResolver<H>, H: HostTypes> {
handle: ResolutionStateHandle<H>,
resolver: &'r R,
record: Option<ResolutionStateRecord<H>>,
}
impl<'r, R: ResolutionStateResolver<H>, H: HostTypes> ResolvedResolutionState<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: ResolutionStateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> ResolutionStateHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ResolutionStateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ResolutionStateResolver<H>, H: HostTypes> ResolutionState<H>
for ResolvedResolutionState<'r, R, H>
{
fn is_complete(&self) -> bool {
match &self.record {
Some(r) => r.is_complete,
None => false,
}
}
fn iteration_count(&self) -> u64 {
match &self.record {
Some(r) => r.iteration_count,
None => 0,
}
}
type FreeRank = crate::bridge::partition::NullFreeRank<H>;
fn site_deficit(&self) -> &Self::FreeRank {
&<crate::bridge::partition::NullFreeRank<H>>::ABSENT
}
type RefinementSuggestion = NullRefinementSuggestion<H>;
fn suggestion(&self) -> &[Self::RefinementSuggestion] {
&[]
}
fn convergence_rate(&self) -> H::Decimal {
match &self.record {
Some(r) => r.convergence_rate,
None => H::EMPTY_DECIMAL,
}
}
type CechNerve = NullCechNerve<H>;
fn cech_nerve(&self) -> &Self::CechNerve {
&<NullCechNerve<H>>::ABSENT
}
fn residual_entropy(&self) -> H::Decimal {
match &self.record {
Some(r) => r.residual_entropy,
None => H::EMPTY_DECIMAL,
}
}
fn topologically_complete(&self) -> bool {
match &self.record {
Some(r) => r.topologically_complete,
None => false,
}
}
fn nerve_euler_characteristic(&self) -> i64 {
match &self.record {
Some(r) => r.nerve_euler_characteristic,
None => 0,
}
}
type Jacobian = crate::bridge::observable::NullJacobian<H>;
fn guiding_jacobian(&self) -> &Self::Jacobian {
&<crate::bridge::observable::NullJacobian<H>>::ABSENT
}
}
impl<'r, R: ResolutionStateResolver<H>, H: HostTypes> ResolvedResolutionState<'r, R, H> {
/// Promote the `site_deficit` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_site_deficit<'r2, R2: crate::bridge::partition::FreeRankResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::bridge::partition::ResolvedFreeRank<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::bridge::partition::ResolvedFreeRank::new(
record.site_deficit_handle,
r,
))
}
/// Promote the `cech_nerve` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_cech_nerve<'r2, R2: CechNerveResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedCechNerve<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedCechNerve::new(record.cech_nerve_handle, r))
}
/// Promote the `guiding_jacobian` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_guiding_jacobian<'r2, R2: crate::bridge::observable::JacobianResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::bridge::observable::ResolvedJacobian<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::bridge::observable::ResolvedJacobian::new(
record.guiding_jacobian_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `RefinementSuggestion<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct RefinementSuggestionHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for RefinementSuggestionHandle<H> {}
impl<H: HostTypes> Clone for RefinementSuggestionHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for RefinementSuggestionHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for RefinementSuggestionHandle<H> {}
impl<H: HostTypes> core::hash::Hash for RefinementSuggestionHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> RefinementSuggestionHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `RefinementSuggestion<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait RefinementSuggestionResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: RefinementSuggestionHandle<H>,
) -> Option<RefinementSuggestionRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `RefinementSuggestion<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct RefinementSuggestionRecord<H: HostTypes> {
pub suggested_axis: MetricAxis,
pub suggested_class: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `RefinementSuggestion<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedRefinementSuggestion<'r, R: RefinementSuggestionResolver<H>, H: HostTypes> {
handle: RefinementSuggestionHandle<H>,
resolver: &'r R,
record: Option<RefinementSuggestionRecord<H>>,
}
impl<'r, R: RefinementSuggestionResolver<H>, H: HostTypes> ResolvedRefinementSuggestion<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: RefinementSuggestionHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> RefinementSuggestionHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&RefinementSuggestionRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: RefinementSuggestionResolver<H>, H: HostTypes> RefinementSuggestion<H>
for ResolvedRefinementSuggestion<'r, R, H>
{
fn suggested_axis(&self) -> MetricAxis {
match &self.record {
Some(r) => r.suggested_axis,
None => <MetricAxis>::default(),
}
}
fn suggested_class(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type SiteIndex = crate::bridge::partition::NullSiteIndex<H>;
fn target_sites(&self) -> &[Self::SiteIndex] {
&[]
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `CechNerve<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct CechNerveHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for CechNerveHandle<H> {}
impl<H: HostTypes> Clone for CechNerveHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for CechNerveHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for CechNerveHandle<H> {}
impl<H: HostTypes> core::hash::Hash for CechNerveHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> CechNerveHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `CechNerve<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait CechNerveResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: CechNerveHandle<H>) -> Option<CechNerveRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `CechNerve<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct CechNerveRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `CechNerve<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedCechNerve<'r, R: CechNerveResolver<H>, H: HostTypes> {
handle: CechNerveHandle<H>,
resolver: &'r R,
record: Option<CechNerveRecord<H>>,
}
impl<'r, R: CechNerveResolver<H>, H: HostTypes> ResolvedCechNerve<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: CechNerveHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> CechNerveHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&CechNerveRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: CechNerveResolver<H>, H: HostTypes> crate::bridge::homology::SimplicialComplex<H>
for ResolvedCechNerve<'r, R, H>
{
type Simplex = crate::bridge::homology::NullSimplex<H>;
fn has_simplex(&self) -> &[Self::Simplex] {
&[]
}
fn max_dimension(&self) -> i64 {
0
}
fn euler_characteristic(&self) -> i64 {
0
}
fn simplicial_vertex_count(&self) -> u64 {
0
}
}
impl<'r, R: CechNerveResolver<H>, H: HostTypes> crate::bridge::homology::KanComplex<H>
for ResolvedCechNerve<'r, R, H>
{
type HornFiller = crate::bridge::homology::NullHornFiller<H>;
fn kan_witness(&self) -> &[Self::HornFiller] {
&[]
}
}
impl<'r, R: CechNerveResolver<H>, H: HostTypes> CechNerve<H> for ResolvedCechNerve<'r, R, H> {}
/// Phase 8 (orphan-closure) — content-addressed handle for `CompletenessResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct CompletenessResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for CompletenessResolverHandle<H> {}
impl<H: HostTypes> Clone for CompletenessResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for CompletenessResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for CompletenessResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for CompletenessResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> CompletenessResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `CompletenessResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait CompletenessResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: CompletenessResolverHandle<H>,
) -> Option<CompletenessResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `CompletenessResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct CompletenessResolverRecord<H: HostTypes> {
pub completeness_target_handle: crate::user::type_::CompletenessCandidateHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `CompletenessResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedCompletenessResolver<'r, R: CompletenessResolverResolver<H>, H: HostTypes> {
handle: CompletenessResolverHandle<H>,
resolver: &'r R,
record: Option<CompletenessResolverRecord<H>>,
}
impl<'r, R: CompletenessResolverResolver<H>, H: HostTypes> ResolvedCompletenessResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: CompletenessResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> CompletenessResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&CompletenessResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: CompletenessResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedCompletenessResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: CompletenessResolverResolver<H>, H: HostTypes> CompletenessResolver<H>
for ResolvedCompletenessResolver<'r, R, H>
{
type CompletenessCandidate = crate::user::type_::NullCompletenessCandidate<H>;
fn completeness_target(&self) -> &Self::CompletenessCandidate {
&<crate::user::type_::NullCompletenessCandidate<H>>::ABSENT
}
}
impl<'r, R: CompletenessResolverResolver<H>, H: HostTypes> ResolvedCompletenessResolver<'r, R, H> {
/// Promote the `completeness_target` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_completeness_target<
'r2,
R2: crate::user::type_::CompletenessCandidateResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::user::type_::ResolvedCompletenessCandidate<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::type_::ResolvedCompletenessCandidate::new(
record.completeness_target_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `WittLevelResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct WittLevelResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for WittLevelResolverHandle<H> {}
impl<H: HostTypes> Clone for WittLevelResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for WittLevelResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for WittLevelResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for WittLevelResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> WittLevelResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `WittLevelResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait WittLevelResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: WittLevelResolverHandle<H>) -> Option<WittLevelResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `WittLevelResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct WittLevelResolverRecord<H: HostTypes> {
pub quantum_level: WittLevel,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `WittLevelResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedWittLevelResolver<'r, R: WittLevelResolverResolver<H>, H: HostTypes> {
handle: WittLevelResolverHandle<H>,
resolver: &'r R,
record: Option<WittLevelResolverRecord<H>>,
}
impl<'r, R: WittLevelResolverResolver<H>, H: HostTypes> ResolvedWittLevelResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: WittLevelResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> WittLevelResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&WittLevelResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: WittLevelResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedWittLevelResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: WittLevelResolverResolver<H>, H: HostTypes> WittLevelResolver<H>
for ResolvedWittLevelResolver<'r, R, H>
{
fn quantum_level(&self) -> WittLevel {
match &self.record {
Some(r) => r.quantum_level,
None => <WittLevel>::default(),
}
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `SessionResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct SessionResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for SessionResolverHandle<H> {}
impl<H: HostTypes> Clone for SessionResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for SessionResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for SessionResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for SessionResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> SessionResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `SessionResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait SessionResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: SessionResolverHandle<H>) -> Option<SessionResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `SessionResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct SessionResolverRecord<H: HostTypes> {
pub session_accumulator_handle: crate::user::state::BindingAccumulatorHandle<H>,
pub execution_policy_handle: ExecutionPolicyHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `SessionResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedSessionResolver<'r, R: SessionResolverResolver<H>, H: HostTypes> {
handle: SessionResolverHandle<H>,
resolver: &'r R,
record: Option<SessionResolverRecord<H>>,
}
impl<'r, R: SessionResolverResolver<H>, H: HostTypes> ResolvedSessionResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: SessionResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> SessionResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&SessionResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: SessionResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedSessionResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: SessionResolverResolver<H>, H: HostTypes> SessionResolver<H>
for ResolvedSessionResolver<'r, R, H>
{
type BindingAccumulator = crate::user::state::NullBindingAccumulator<H>;
fn session_accumulator(&self) -> &Self::BindingAccumulator {
&<crate::user::state::NullBindingAccumulator<H>>::ABSENT
}
type ExecutionPolicy = NullExecutionPolicy<H>;
fn execution_policy(&self) -> &Self::ExecutionPolicy {
&<NullExecutionPolicy<H>>::ABSENT
}
}
impl<'r, R: SessionResolverResolver<H>, H: HostTypes> ResolvedSessionResolver<'r, R, H> {
/// Promote the `session_accumulator` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_session_accumulator<
'r2,
R2: crate::user::state::BindingAccumulatorResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::user::state::ResolvedBindingAccumulator<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::state::ResolvedBindingAccumulator::new(
record.session_accumulator_handle,
r,
))
}
/// Promote the `execution_policy` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_execution_policy<'r2, R2: ExecutionPolicyResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedExecutionPolicy<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedExecutionPolicy::new(
record.execution_policy_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `TypeSynthesisResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct TypeSynthesisResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for TypeSynthesisResolverHandle<H> {}
impl<H: HostTypes> Clone for TypeSynthesisResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for TypeSynthesisResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for TypeSynthesisResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for TypeSynthesisResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> TypeSynthesisResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `TypeSynthesisResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait TypeSynthesisResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: TypeSynthesisResolverHandle<H>,
) -> Option<TypeSynthesisResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `TypeSynthesisResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct TypeSynthesisResolverRecord<H: HostTypes> {
pub synthesis_goal_handle: crate::user::type_::TypeSynthesisGoalHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `TypeSynthesisResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedTypeSynthesisResolver<'r, R: TypeSynthesisResolverResolver<H>, H: HostTypes> {
handle: TypeSynthesisResolverHandle<H>,
resolver: &'r R,
record: Option<TypeSynthesisResolverRecord<H>>,
}
impl<'r, R: TypeSynthesisResolverResolver<H>, H: HostTypes>
ResolvedTypeSynthesisResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: TypeSynthesisResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> TypeSynthesisResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&TypeSynthesisResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: TypeSynthesisResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedTypeSynthesisResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: TypeSynthesisResolverResolver<H>, H: HostTypes> TypeSynthesisResolver<H>
for ResolvedTypeSynthesisResolver<'r, R, H>
{
type TypeSynthesisGoal = crate::user::type_::NullTypeSynthesisGoal<H>;
fn synthesis_goal(&self) -> &Self::TypeSynthesisGoal {
&<crate::user::type_::NullTypeSynthesisGoal<H>>::ABSENT
}
}
impl<'r, R: TypeSynthesisResolverResolver<H>, H: HostTypes>
ResolvedTypeSynthesisResolver<'r, R, H>
{
/// Promote the `synthesis_goal` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_synthesis_goal<'r2, R2: crate::user::type_::TypeSynthesisGoalResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::user::type_::ResolvedTypeSynthesisGoal<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::type_::ResolvedTypeSynthesisGoal::new(
record.synthesis_goal_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `ConstraintSearchState<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct ConstraintSearchStateHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ConstraintSearchStateHandle<H> {}
impl<H: HostTypes> Clone for ConstraintSearchStateHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ConstraintSearchStateHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ConstraintSearchStateHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ConstraintSearchStateHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ConstraintSearchStateHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `ConstraintSearchState<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait ConstraintSearchStateResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: ConstraintSearchStateHandle<H>,
) -> Option<ConstraintSearchStateRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `ConstraintSearchState<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ConstraintSearchStateRecord<H: HostTypes> {
pub explored_count: u64,
pub current_candidate_handle: crate::user::type_::ConstrainedTypeHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `ConstraintSearchState<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedConstraintSearchState<'r, R: ConstraintSearchStateResolver<H>, H: HostTypes> {
handle: ConstraintSearchStateHandle<H>,
resolver: &'r R,
record: Option<ConstraintSearchStateRecord<H>>,
}
impl<'r, R: ConstraintSearchStateResolver<H>, H: HostTypes>
ResolvedConstraintSearchState<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: ConstraintSearchStateHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> ConstraintSearchStateHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ConstraintSearchStateRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ConstraintSearchStateResolver<H>, H: HostTypes> ConstraintSearchState<H>
for ResolvedConstraintSearchState<'r, R, H>
{
fn explored_count(&self) -> u64 {
match &self.record {
Some(r) => r.explored_count,
None => 0,
}
}
type ConstrainedType = crate::user::type_::NullConstrainedType<H>;
fn current_candidate(&self) -> &Self::ConstrainedType {
&<crate::user::type_::NullConstrainedType<H>>::ABSENT
}
}
impl<'r, R: ConstraintSearchStateResolver<H>, H: HostTypes>
ResolvedConstraintSearchState<'r, R, H>
{
/// Promote the `current_candidate` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_current_candidate<'r2, R2: crate::user::type_::ConstrainedTypeResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::user::type_::ResolvedConstrainedType<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::type_::ResolvedConstrainedType::new(
record.current_candidate_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `IncrementalCompletenessResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct IncrementalCompletenessResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for IncrementalCompletenessResolverHandle<H> {}
impl<H: HostTypes> Clone for IncrementalCompletenessResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for IncrementalCompletenessResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for IncrementalCompletenessResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for IncrementalCompletenessResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> IncrementalCompletenessResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `IncrementalCompletenessResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait IncrementalCompletenessResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: IncrementalCompletenessResolverHandle<H>,
) -> Option<IncrementalCompletenessResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `IncrementalCompletenessResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct IncrementalCompletenessResolverRecord<H: HostTypes> {
pub lift_target_handle: crate::user::type_::WittLiftHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `IncrementalCompletenessResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedIncrementalCompletenessResolver<
'r,
R: IncrementalCompletenessResolverResolver<H>,
H: HostTypes,
> {
handle: IncrementalCompletenessResolverHandle<H>,
resolver: &'r R,
record: Option<IncrementalCompletenessResolverRecord<H>>,
}
impl<'r, R: IncrementalCompletenessResolverResolver<H>, H: HostTypes>
ResolvedIncrementalCompletenessResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: IncrementalCompletenessResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> IncrementalCompletenessResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&IncrementalCompletenessResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: IncrementalCompletenessResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedIncrementalCompletenessResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: IncrementalCompletenessResolverResolver<H>, H: HostTypes>
IncrementalCompletenessResolver<H> for ResolvedIncrementalCompletenessResolver<'r, R, H>
{
type WittLift = crate::user::type_::NullWittLift<H>;
fn lift_target(&self) -> &Self::WittLift {
&<crate::user::type_::NullWittLift<H>>::ABSENT
}
}
impl<'r, R: IncrementalCompletenessResolverResolver<H>, H: HostTypes>
ResolvedIncrementalCompletenessResolver<'r, R, H>
{
/// Promote the `lift_target` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_lift_target<'r2, R2: crate::user::type_::WittLiftResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::user::type_::ResolvedWittLift<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::type_::ResolvedWittLift::new(
record.lift_target_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `LiftRefinementSuggestion<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct LiftRefinementSuggestionHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for LiftRefinementSuggestionHandle<H> {}
impl<H: HostTypes> Clone for LiftRefinementSuggestionHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for LiftRefinementSuggestionHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for LiftRefinementSuggestionHandle<H> {}
impl<H: HostTypes> core::hash::Hash for LiftRefinementSuggestionHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> LiftRefinementSuggestionHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `LiftRefinementSuggestion<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait LiftRefinementSuggestionResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: LiftRefinementSuggestionHandle<H>,
) -> Option<LiftRefinementSuggestionRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `LiftRefinementSuggestion<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct LiftRefinementSuggestionRecord<H: HostTypes> {
pub lift_site_position_handle: crate::bridge::partition::SiteIndexHandle<H>,
pub obstruction_class_handle: crate::bridge::observable::LiftObstructionClassHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `LiftRefinementSuggestion<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedLiftRefinementSuggestion<
'r,
R: LiftRefinementSuggestionResolver<H>,
H: HostTypes,
> {
handle: LiftRefinementSuggestionHandle<H>,
resolver: &'r R,
record: Option<LiftRefinementSuggestionRecord<H>>,
}
impl<'r, R: LiftRefinementSuggestionResolver<H>, H: HostTypes>
ResolvedLiftRefinementSuggestion<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: LiftRefinementSuggestionHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> LiftRefinementSuggestionHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&LiftRefinementSuggestionRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: LiftRefinementSuggestionResolver<H>, H: HostTypes> RefinementSuggestion<H>
for ResolvedLiftRefinementSuggestion<'r, R, H>
{
fn suggested_axis(&self) -> MetricAxis {
<MetricAxis>::default()
}
fn suggested_class(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
type SiteIndex = crate::bridge::partition::NullSiteIndex<H>;
fn target_sites(&self) -> &[Self::SiteIndex] {
&[]
}
}
impl<'r, R: LiftRefinementSuggestionResolver<H>, H: HostTypes> LiftRefinementSuggestion<H>
for ResolvedLiftRefinementSuggestion<'r, R, H>
{
fn lift_site_position(&self) -> &Self::SiteIndex {
&<crate::bridge::partition::NullSiteIndex<H>>::ABSENT
}
type LiftObstructionClass = crate::bridge::observable::NullLiftObstructionClass<H>;
fn obstruction_class(&self) -> &Self::LiftObstructionClass {
&<crate::bridge::observable::NullLiftObstructionClass<H>>::ABSENT
}
}
impl<'r, R: LiftRefinementSuggestionResolver<H>, H: HostTypes>
ResolvedLiftRefinementSuggestion<'r, R, H>
{
/// Promote the `lift_site_position` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_lift_site_position<'r2, R2: crate::bridge::partition::SiteIndexResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::bridge::partition::ResolvedSiteIndex<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::bridge::partition::ResolvedSiteIndex::new(
record.lift_site_position_handle,
r,
))
}
/// Promote the `obstruction_class` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_obstruction_class<
'r2,
R2: crate::bridge::observable::LiftObstructionClassResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::bridge::observable::ResolvedLiftObstructionClass<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(
crate::bridge::observable::ResolvedLiftObstructionClass::new(
record.obstruction_class_handle,
r,
),
)
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `MonodromyResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct MonodromyResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for MonodromyResolverHandle<H> {}
impl<H: HostTypes> Clone for MonodromyResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for MonodromyResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for MonodromyResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for MonodromyResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> MonodromyResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `MonodromyResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait MonodromyResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: MonodromyResolverHandle<H>) -> Option<MonodromyResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `MonodromyResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct MonodromyResolverRecord<H: HostTypes> {
pub monodromy_target_handle: crate::user::type_::ConstrainedTypeHandle<H>,
pub holonomy_result_handle: crate::bridge::observable::HolonomyGroupHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `MonodromyResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedMonodromyResolver<'r, R: MonodromyResolverResolver<H>, H: HostTypes> {
handle: MonodromyResolverHandle<H>,
resolver: &'r R,
record: Option<MonodromyResolverRecord<H>>,
}
impl<'r, R: MonodromyResolverResolver<H>, H: HostTypes> ResolvedMonodromyResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: MonodromyResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> MonodromyResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&MonodromyResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: MonodromyResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedMonodromyResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: MonodromyResolverResolver<H>, H: HostTypes> MonodromyResolver<H>
for ResolvedMonodromyResolver<'r, R, H>
{
type ConstrainedType = crate::user::type_::NullConstrainedType<H>;
fn monodromy_target(&self) -> &Self::ConstrainedType {
&<crate::user::type_::NullConstrainedType<H>>::ABSENT
}
type HolonomyGroup = crate::bridge::observable::NullHolonomyGroup<H>;
fn holonomy_result(&self) -> &Self::HolonomyGroup {
&<crate::bridge::observable::NullHolonomyGroup<H>>::ABSENT
}
}
impl<'r, R: MonodromyResolverResolver<H>, H: HostTypes> ResolvedMonodromyResolver<'r, R, H> {
/// Promote the `monodromy_target` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_monodromy_target<'r2, R2: crate::user::type_::ConstrainedTypeResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::user::type_::ResolvedConstrainedType<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::type_::ResolvedConstrainedType::new(
record.monodromy_target_handle,
r,
))
}
/// Promote the `holonomy_result` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_holonomy_result<'r2, R2: crate::bridge::observable::HolonomyGroupResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::bridge::observable::ResolvedHolonomyGroup<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::bridge::observable::ResolvedHolonomyGroup::new(
record.holonomy_result_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `JacobianGuidedResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct JacobianGuidedResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for JacobianGuidedResolverHandle<H> {}
impl<H: HostTypes> Clone for JacobianGuidedResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for JacobianGuidedResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for JacobianGuidedResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for JacobianGuidedResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> JacobianGuidedResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `JacobianGuidedResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait JacobianGuidedResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: JacobianGuidedResolverHandle<H>,
) -> Option<JacobianGuidedResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `JacobianGuidedResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct JacobianGuidedResolverRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `JacobianGuidedResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedJacobianGuidedResolver<'r, R: JacobianGuidedResolverResolver<H>, H: HostTypes> {
handle: JacobianGuidedResolverHandle<H>,
resolver: &'r R,
record: Option<JacobianGuidedResolverRecord<H>>,
}
impl<'r, R: JacobianGuidedResolverResolver<H>, H: HostTypes>
ResolvedJacobianGuidedResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: JacobianGuidedResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> JacobianGuidedResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&JacobianGuidedResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: JacobianGuidedResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedJacobianGuidedResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: JacobianGuidedResolverResolver<H>, H: HostTypes> JacobianGuidedResolver<H>
for ResolvedJacobianGuidedResolver<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `SuperpositionResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct SuperpositionResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for SuperpositionResolverHandle<H> {}
impl<H: HostTypes> Clone for SuperpositionResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for SuperpositionResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for SuperpositionResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for SuperpositionResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> SuperpositionResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `SuperpositionResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait SuperpositionResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: SuperpositionResolverHandle<H>,
) -> Option<SuperpositionResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `SuperpositionResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct SuperpositionResolverRecord<H: HostTypes> {
pub amplitude_vector: H::Decimal,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `SuperpositionResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedSuperpositionResolver<'r, R: SuperpositionResolverResolver<H>, H: HostTypes> {
handle: SuperpositionResolverHandle<H>,
resolver: &'r R,
record: Option<SuperpositionResolverRecord<H>>,
}
impl<'r, R: SuperpositionResolverResolver<H>, H: HostTypes>
ResolvedSuperpositionResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: SuperpositionResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> SuperpositionResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&SuperpositionResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: SuperpositionResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedSuperpositionResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: SuperpositionResolverResolver<H>, H: HostTypes> SuperpositionResolver<H>
for ResolvedSuperpositionResolver<'r, R, H>
{
fn amplitude_vector(&self) -> H::Decimal {
match &self.record {
Some(r) => r.amplitude_vector,
None => H::EMPTY_DECIMAL,
}
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `GroundingAwareResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct GroundingAwareResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for GroundingAwareResolverHandle<H> {}
impl<H: HostTypes> Clone for GroundingAwareResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for GroundingAwareResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for GroundingAwareResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for GroundingAwareResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> GroundingAwareResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `GroundingAwareResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait GroundingAwareResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: GroundingAwareResolverHandle<H>,
) -> Option<GroundingAwareResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `GroundingAwareResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct GroundingAwareResolverRecord<H: HostTypes> {
pub used_grounding: bool,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `GroundingAwareResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedGroundingAwareResolver<'r, R: GroundingAwareResolverResolver<H>, H: HostTypes> {
handle: GroundingAwareResolverHandle<H>,
resolver: &'r R,
record: Option<GroundingAwareResolverRecord<H>>,
}
impl<'r, R: GroundingAwareResolverResolver<H>, H: HostTypes>
ResolvedGroundingAwareResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: GroundingAwareResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> GroundingAwareResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&GroundingAwareResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: GroundingAwareResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedGroundingAwareResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: GroundingAwareResolverResolver<H>, H: HostTypes> GroundingAwareResolver<H>
for ResolvedGroundingAwareResolver<'r, R, H>
{
fn used_grounding(&self) -> bool {
match &self.record {
Some(r) => r.used_grounding,
None => false,
}
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `GeodesicValidator<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct GeodesicValidatorHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for GeodesicValidatorHandle<H> {}
impl<H: HostTypes> Clone for GeodesicValidatorHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for GeodesicValidatorHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for GeodesicValidatorHandle<H> {}
impl<H: HostTypes> core::hash::Hash for GeodesicValidatorHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> GeodesicValidatorHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `GeodesicValidator<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait GeodesicValidatorResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: GeodesicValidatorHandle<H>) -> Option<GeodesicValidatorRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `GeodesicValidator<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct GeodesicValidatorRecord<H: HostTypes> {
pub validate_geodesic_handle: crate::bridge::trace::GeodesicTraceHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `GeodesicValidator<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedGeodesicValidator<'r, R: GeodesicValidatorResolver<H>, H: HostTypes> {
handle: GeodesicValidatorHandle<H>,
resolver: &'r R,
record: Option<GeodesicValidatorRecord<H>>,
}
impl<'r, R: GeodesicValidatorResolver<H>, H: HostTypes> ResolvedGeodesicValidator<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: GeodesicValidatorHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> GeodesicValidatorHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&GeodesicValidatorRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: GeodesicValidatorResolver<H>, H: HostTypes> Resolver<H>
for ResolvedGeodesicValidator<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: GeodesicValidatorResolver<H>, H: HostTypes> GeodesicValidator<H>
for ResolvedGeodesicValidator<'r, R, H>
{
type GeodesicTrace = crate::bridge::trace::NullGeodesicTrace<H>;
fn validate_geodesic(&self) -> &Self::GeodesicTrace {
&<crate::bridge::trace::NullGeodesicTrace<H>>::ABSENT
}
}
impl<'r, R: GeodesicValidatorResolver<H>, H: HostTypes> ResolvedGeodesicValidator<'r, R, H> {
/// Promote the `validate_geodesic` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_validate_geodesic<'r2, R2: crate::bridge::trace::GeodesicTraceResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::bridge::trace::ResolvedGeodesicTrace<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::bridge::trace::ResolvedGeodesicTrace::new(
record.validate_geodesic_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `MeasurementResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct MeasurementResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for MeasurementResolverHandle<H> {}
impl<H: HostTypes> Clone for MeasurementResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for MeasurementResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for MeasurementResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for MeasurementResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> MeasurementResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `MeasurementResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait MeasurementResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: MeasurementResolverHandle<H>)
-> Option<MeasurementResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `MeasurementResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct MeasurementResolverRecord<H: HostTypes> {
pub collapse_amplitude: H::Decimal,
pub collapsed_site: u64,
pub measurement_outcome: u64,
pub prior_amplitude_vector: H::Decimal,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `MeasurementResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedMeasurementResolver<'r, R: MeasurementResolverResolver<H>, H: HostTypes> {
handle: MeasurementResolverHandle<H>,
resolver: &'r R,
record: Option<MeasurementResolverRecord<H>>,
}
impl<'r, R: MeasurementResolverResolver<H>, H: HostTypes> ResolvedMeasurementResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: MeasurementResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> MeasurementResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&MeasurementResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: MeasurementResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedMeasurementResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: MeasurementResolverResolver<H>, H: HostTypes> MeasurementResolver<H>
for ResolvedMeasurementResolver<'r, R, H>
{
fn collapse_amplitude(&self) -> H::Decimal {
match &self.record {
Some(r) => r.collapse_amplitude,
None => H::EMPTY_DECIMAL,
}
}
fn collapsed_site(&self) -> u64 {
match &self.record {
Some(r) => r.collapsed_site,
None => 0,
}
}
fn measurement_outcome(&self) -> u64 {
match &self.record {
Some(r) => r.measurement_outcome,
None => 0,
}
}
fn prior_amplitude_vector(&self) -> H::Decimal {
match &self.record {
Some(r) => r.prior_amplitude_vector,
None => H::EMPTY_DECIMAL,
}
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `TowerCompletenessResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct TowerCompletenessResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for TowerCompletenessResolverHandle<H> {}
impl<H: HostTypes> Clone for TowerCompletenessResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for TowerCompletenessResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for TowerCompletenessResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for TowerCompletenessResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> TowerCompletenessResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `TowerCompletenessResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait TowerCompletenessResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: TowerCompletenessResolverHandle<H>,
) -> Option<TowerCompletenessResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `TowerCompletenessResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct TowerCompletenessResolverRecord<H: HostTypes> {
pub tower_source_level: WittLevel,
pub tower_target_level: WittLevel,
pub current_chain_handle: crate::user::type_::LiftChainHandle<H>,
pub tower_step_resolver_handle: IncrementalCompletenessResolverHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `TowerCompletenessResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedTowerCompletenessResolver<
'r,
R: TowerCompletenessResolverResolver<H>,
H: HostTypes,
> {
handle: TowerCompletenessResolverHandle<H>,
resolver: &'r R,
record: Option<TowerCompletenessResolverRecord<H>>,
}
impl<'r, R: TowerCompletenessResolverResolver<H>, H: HostTypes>
ResolvedTowerCompletenessResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: TowerCompletenessResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> TowerCompletenessResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&TowerCompletenessResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: TowerCompletenessResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedTowerCompletenessResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: TowerCompletenessResolverResolver<H>, H: HostTypes> TowerCompletenessResolver<H>
for ResolvedTowerCompletenessResolver<'r, R, H>
{
fn tower_source_level(&self) -> WittLevel {
match &self.record {
Some(r) => r.tower_source_level,
None => <WittLevel>::default(),
}
}
fn tower_target_level(&self) -> WittLevel {
match &self.record {
Some(r) => r.tower_target_level,
None => <WittLevel>::default(),
}
}
type LiftChain = crate::user::type_::NullLiftChain<H>;
fn current_chain(&self) -> &Self::LiftChain {
&<crate::user::type_::NullLiftChain<H>>::ABSENT
}
type IncrementalCompletenessResolver = NullIncrementalCompletenessResolver<H>;
fn tower_step_resolver(&self) -> &Self::IncrementalCompletenessResolver {
&<NullIncrementalCompletenessResolver<H>>::ABSENT
}
}
impl<'r, R: TowerCompletenessResolverResolver<H>, H: HostTypes>
ResolvedTowerCompletenessResolver<'r, R, H>
{
/// Promote the `current_chain` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_current_chain<'r2, R2: crate::user::type_::LiftChainResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::user::type_::ResolvedLiftChain<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::type_::ResolvedLiftChain::new(
record.current_chain_handle,
r,
))
}
/// Promote the `tower_step_resolver` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_tower_step_resolver<'r2, R2: IncrementalCompletenessResolverResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedIncrementalCompletenessResolver<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedIncrementalCompletenessResolver::new(
record.tower_step_resolver_handle,
r,
))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `InhabitanceResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct InhabitanceResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for InhabitanceResolverHandle<H> {}
impl<H: HostTypes> Clone for InhabitanceResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for InhabitanceResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for InhabitanceResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for InhabitanceResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> InhabitanceResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `InhabitanceResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait InhabitanceResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: InhabitanceResolverHandle<H>)
-> Option<InhabitanceResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `InhabitanceResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct InhabitanceResolverRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `InhabitanceResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedInhabitanceResolver<'r, R: InhabitanceResolverResolver<H>, H: HostTypes> {
handle: InhabitanceResolverHandle<H>,
resolver: &'r R,
record: Option<InhabitanceResolverRecord<H>>,
}
impl<'r, R: InhabitanceResolverResolver<H>, H: HostTypes> ResolvedInhabitanceResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: InhabitanceResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> InhabitanceResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&InhabitanceResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: InhabitanceResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedInhabitanceResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: InhabitanceResolverResolver<H>, H: HostTypes> InhabitanceResolver<H>
for ResolvedInhabitanceResolver<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `TwoSatDecider<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct TwoSatDeciderHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for TwoSatDeciderHandle<H> {}
impl<H: HostTypes> Clone for TwoSatDeciderHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for TwoSatDeciderHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for TwoSatDeciderHandle<H> {}
impl<H: HostTypes> core::hash::Hash for TwoSatDeciderHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> TwoSatDeciderHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `TwoSatDecider<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait TwoSatDeciderResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: TwoSatDeciderHandle<H>) -> Option<TwoSatDeciderRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `TwoSatDecider<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct TwoSatDeciderRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `TwoSatDecider<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedTwoSatDecider<'r, R: TwoSatDeciderResolver<H>, H: HostTypes> {
handle: TwoSatDeciderHandle<H>,
resolver: &'r R,
record: Option<TwoSatDeciderRecord<H>>,
}
impl<'r, R: TwoSatDeciderResolver<H>, H: HostTypes> ResolvedTwoSatDecider<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: TwoSatDeciderHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> TwoSatDeciderHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&TwoSatDeciderRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: TwoSatDeciderResolver<H>, H: HostTypes> Resolver<H>
for ResolvedTwoSatDecider<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: TwoSatDeciderResolver<H>, H: HostTypes> TwoSatDecider<H>
for ResolvedTwoSatDecider<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `HornSatDecider<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct HornSatDeciderHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for HornSatDeciderHandle<H> {}
impl<H: HostTypes> Clone for HornSatDeciderHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for HornSatDeciderHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for HornSatDeciderHandle<H> {}
impl<H: HostTypes> core::hash::Hash for HornSatDeciderHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> HornSatDeciderHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `HornSatDecider<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait HornSatDeciderResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: HornSatDeciderHandle<H>) -> Option<HornSatDeciderRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `HornSatDecider<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct HornSatDeciderRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `HornSatDecider<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedHornSatDecider<'r, R: HornSatDeciderResolver<H>, H: HostTypes> {
handle: HornSatDeciderHandle<H>,
resolver: &'r R,
record: Option<HornSatDeciderRecord<H>>,
}
impl<'r, R: HornSatDeciderResolver<H>, H: HostTypes> ResolvedHornSatDecider<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: HornSatDeciderHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> HornSatDeciderHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&HornSatDeciderRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: HornSatDeciderResolver<H>, H: HostTypes> Resolver<H>
for ResolvedHornSatDecider<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: HornSatDeciderResolver<H>, H: HostTypes> HornSatDecider<H>
for ResolvedHornSatDecider<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `ResidualVerdictResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct ResidualVerdictResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ResidualVerdictResolverHandle<H> {}
impl<H: HostTypes> Clone for ResidualVerdictResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ResidualVerdictResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ResidualVerdictResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ResidualVerdictResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ResidualVerdictResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `ResidualVerdictResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait ResidualVerdictResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: ResidualVerdictResolverHandle<H>,
) -> Option<ResidualVerdictResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `ResidualVerdictResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ResidualVerdictResolverRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `ResidualVerdictResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedResidualVerdictResolver<'r, R: ResidualVerdictResolverResolver<H>, H: HostTypes>
{
handle: ResidualVerdictResolverHandle<H>,
resolver: &'r R,
record: Option<ResidualVerdictResolverRecord<H>>,
}
impl<'r, R: ResidualVerdictResolverResolver<H>, H: HostTypes>
ResolvedResidualVerdictResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: ResidualVerdictResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> ResidualVerdictResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ResidualVerdictResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ResidualVerdictResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedResidualVerdictResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: ResidualVerdictResolverResolver<H>, H: HostTypes> ResidualVerdictResolver<H>
for ResolvedResidualVerdictResolver<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `MultiplicationResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct MultiplicationResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for MultiplicationResolverHandle<H> {}
impl<H: HostTypes> Clone for MultiplicationResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for MultiplicationResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for MultiplicationResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for MultiplicationResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> MultiplicationResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `MultiplicationResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait MultiplicationResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(
&self,
handle: MultiplicationResolverHandle<H>,
) -> Option<MultiplicationResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `MultiplicationResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct MultiplicationResolverRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `MultiplicationResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedMultiplicationResolver<'r, R: MultiplicationResolverResolver<H>, H: HostTypes> {
handle: MultiplicationResolverHandle<H>,
resolver: &'r R,
record: Option<MultiplicationResolverRecord<H>>,
}
impl<'r, R: MultiplicationResolverResolver<H>, H: HostTypes>
ResolvedMultiplicationResolver<'r, R, H>
{
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: MultiplicationResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> MultiplicationResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&MultiplicationResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: MultiplicationResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedMultiplicationResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: MultiplicationResolverResolver<H>, H: HostTypes> MultiplicationResolver<H>
for ResolvedMultiplicationResolver<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `CertifyMapping<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct CertifyMappingHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for CertifyMappingHandle<H> {}
impl<H: HostTypes> Clone for CertifyMappingHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for CertifyMappingHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for CertifyMappingHandle<H> {}
impl<H: HostTypes> core::hash::Hash for CertifyMappingHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> CertifyMappingHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `CertifyMapping<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait CertifyMappingResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: CertifyMappingHandle<H>) -> Option<CertifyMappingRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `CertifyMapping<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct CertifyMappingRecord<H: HostTypes> {
pub for_resolver: &'static H::HostString,
pub produces_certificate: &'static H::HostString,
pub produces_witness: &'static H::HostString,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `CertifyMapping<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedCertifyMapping<'r, R: CertifyMappingResolver<H>, H: HostTypes> {
handle: CertifyMappingHandle<H>,
resolver: &'r R,
record: Option<CertifyMappingRecord<H>>,
}
impl<'r, R: CertifyMappingResolver<H>, H: HostTypes> ResolvedCertifyMapping<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: CertifyMappingHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> CertifyMappingHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&CertifyMappingRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: CertifyMappingResolver<H>, H: HostTypes> CertifyMapping<H>
for ResolvedCertifyMapping<'r, R, H>
{
fn for_resolver(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn produces_certificate(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
fn produces_witness(&self) -> &H::HostString {
H::EMPTY_HOST_STRING
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `ExecutionPolicy<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct ExecutionPolicyHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ExecutionPolicyHandle<H> {}
impl<H: HostTypes> Clone for ExecutionPolicyHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ExecutionPolicyHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ExecutionPolicyHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ExecutionPolicyHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ExecutionPolicyHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `ExecutionPolicy<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait ExecutionPolicyResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: ExecutionPolicyHandle<H>) -> Option<ExecutionPolicyRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `ExecutionPolicy<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ExecutionPolicyRecord<H: HostTypes> {
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `ExecutionPolicy<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedExecutionPolicy<'r, R: ExecutionPolicyResolver<H>, H: HostTypes> {
handle: ExecutionPolicyHandle<H>,
resolver: &'r R,
record: Option<ExecutionPolicyRecord<H>>,
}
impl<'r, R: ExecutionPolicyResolver<H>, H: HostTypes> ResolvedExecutionPolicy<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: ExecutionPolicyHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> ExecutionPolicyHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ExecutionPolicyRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ExecutionPolicyResolver<H>, H: HostTypes> ExecutionPolicy<H>
for ResolvedExecutionPolicy<'r, R, H>
{
}
/// Phase 8 (orphan-closure) — content-addressed handle for `HomotopyResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct HomotopyResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for HomotopyResolverHandle<H> {}
impl<H: HostTypes> Clone for HomotopyResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for HomotopyResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for HomotopyResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for HomotopyResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> HomotopyResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `HomotopyResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait HomotopyResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: HomotopyResolverHandle<H>) -> Option<HomotopyResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `HomotopyResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct HomotopyResolverRecord<H: HostTypes> {
pub homotopy_target_handle: CechNerveHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `HomotopyResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedHomotopyResolver<'r, R: HomotopyResolverResolver<H>, H: HostTypes> {
handle: HomotopyResolverHandle<H>,
resolver: &'r R,
record: Option<HomotopyResolverRecord<H>>,
}
impl<'r, R: HomotopyResolverResolver<H>, H: HostTypes> ResolvedHomotopyResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: HomotopyResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> HomotopyResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&HomotopyResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: HomotopyResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedHomotopyResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: HomotopyResolverResolver<H>, H: HostTypes> HomotopyResolver<H>
for ResolvedHomotopyResolver<'r, R, H>
{
type CechNerve = NullCechNerve<H>;
fn homotopy_target(&self) -> &Self::CechNerve {
&<NullCechNerve<H>>::ABSENT
}
type HomotopyGroup = crate::bridge::observable::NullHomotopyGroup<H>;
fn homotopy_result(&self) -> &[Self::HomotopyGroup] {
&[]
}
}
impl<'r, R: HomotopyResolverResolver<H>, H: HostTypes> ResolvedHomotopyResolver<'r, R, H> {
/// Promote the `homotopy_target` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_homotopy_target<'r2, R2: CechNerveResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<ResolvedCechNerve<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(ResolvedCechNerve::new(record.homotopy_target_handle, r))
}
}
/// Phase 8 (orphan-closure) — content-addressed handle for `ModuliResolver<H>`.
///
/// Pairs a [`crate::enforcement::ContentFingerprint`] with a phantom
/// `H` so type-state checks can't mix handles across `HostTypes` impls.
#[derive(Debug)]
pub struct ModuliResolverHandle<H: HostTypes> {
/// Content fingerprint identifying the resolved record.
pub fingerprint: crate::enforcement::ContentFingerprint,
_phantom: core::marker::PhantomData<H>,
}
impl<H: HostTypes> Copy for ModuliResolverHandle<H> {}
impl<H: HostTypes> Clone for ModuliResolverHandle<H> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<H: HostTypes> PartialEq for ModuliResolverHandle<H> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.fingerprint == other.fingerprint
}
}
impl<H: HostTypes> Eq for ModuliResolverHandle<H> {}
impl<H: HostTypes> core::hash::Hash for ModuliResolverHandle<H> {
#[inline]
fn hash<S: core::hash::Hasher>(&self, state: &mut S) {
self.fingerprint.hash(state);
}
}
impl<H: HostTypes> ModuliResolverHandle<H> {
/// Construct a handle from its content fingerprint.
#[inline]
#[must_use]
pub const fn new(fingerprint: crate::enforcement::ContentFingerprint) -> Self {
Self {
fingerprint,
_phantom: core::marker::PhantomData,
}
}
}
/// Phase 8 (orphan-closure) — resolver trait for `ModuliResolver<H>`.
///
/// Hosts implement this trait to map a handle into a typed record.
/// The default Null stub does not implement this trait — it carries
/// no record. Resolution is the responsibility of the host pipeline.
pub trait ModuliResolverResolver<H: HostTypes> {
/// Resolve a handle into its record. Returns `None` when the
/// handle does not correspond to known content.
fn resolve(&self, handle: ModuliResolverHandle<H>) -> Option<ModuliResolverRecord<H>>;
}
/// Phase 8 (orphan-closure) — typed record for `ModuliResolver<H>`.
///
/// Carries a field per functional accessor of the trait. Object
/// fields hold `{Range}Handle<H>`; iterate via the Resolved wrapper
/// chain-resolver methods.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct ModuliResolverRecord<H: HostTypes> {
pub moduli_target_handle: crate::user::type_::CompleteTypeHandle<H>,
pub moduli_deformation_handle: crate::bridge::homology::DeformationComplexHandle<H>,
#[doc(hidden)]
pub _phantom: core::marker::PhantomData<H>,
}
/// Phase 8 (orphan-closure) — content-addressed wrapper for `ModuliResolver<H>`.
///
/// Caches the resolver's lookup at construction. Accessors return
/// the cached record's fields when present, falling back to the
/// `Null{Class}<H>` absent sentinels when the resolver returned
/// `None`. Object accessors always return absent sentinels — use
/// the `resolve_{m}` chain methods to descend into sub-records.
pub struct ResolvedModuliResolver<'r, R: ModuliResolverResolver<H>, H: HostTypes> {
handle: ModuliResolverHandle<H>,
resolver: &'r R,
record: Option<ModuliResolverRecord<H>>,
}
impl<'r, R: ModuliResolverResolver<H>, H: HostTypes> ResolvedModuliResolver<'r, R, H> {
/// Construct the wrapper, eagerly resolving the handle.
#[inline]
pub fn new(handle: ModuliResolverHandle<H>, resolver: &'r R) -> Self {
let record = resolver.resolve(handle);
Self {
handle,
resolver,
record,
}
}
/// The handle this wrapper resolves.
#[inline]
#[must_use]
pub const fn handle(&self) -> ModuliResolverHandle<H> {
self.handle
}
/// The resolver supplied at construction.
#[inline]
#[must_use]
pub const fn resolver(&self) -> &'r R {
self.resolver
}
/// The cached record, or `None` when the resolver returned `None`.
#[inline]
#[must_use]
pub const fn record(&self) -> Option<&ModuliResolverRecord<H>> {
self.record.as_ref()
}
}
impl<'r, R: ModuliResolverResolver<H>, H: HostTypes> Resolver<H>
for ResolvedModuliResolver<'r, R, H>
{
type TypeDefinition = crate::user::type_::NullTypeDefinition<H>;
fn input_type(&self) -> &Self::TypeDefinition {
&<crate::user::type_::NullTypeDefinition<H>>::ABSENT
}
type Partition = crate::enforcement::NullPartition<H>;
fn output_type(&self) -> &Self::Partition {
&<crate::enforcement::NullPartition<H>>::ABSENT
}
type TermExpression = crate::kernel::schema::NullTermExpression<H>;
fn strategy(&self) -> &Self::TermExpression {
&<crate::kernel::schema::NullTermExpression<H>>::ABSENT
}
type ResolutionState = NullResolutionState<H>;
fn resolution_state(&self) -> &Self::ResolutionState {
&<NullResolutionState<H>>::ABSENT
}
fn has_complexity_class(&self) -> ComplexityClass {
<ComplexityClass>::default()
}
type DispatchTable = crate::kernel::predicate::NullDispatchTable<H>;
fn dispatch_table(&self) -> &Self::DispatchTable {
&<crate::kernel::predicate::NullDispatchTable<H>>::ABSENT
}
type TypePredicate = crate::kernel::predicate::NullTypePredicate<H>;
fn resolver_predicate(&self) -> &Self::TypePredicate {
&<crate::kernel::predicate::NullTypePredicate<H>>::ABSENT
}
}
impl<'r, R: ModuliResolverResolver<H>, H: HostTypes> ModuliResolver<H>
for ResolvedModuliResolver<'r, R, H>
{
type CompleteType = crate::user::type_::NullCompleteType<H>;
fn moduli_target(&self) -> &Self::CompleteType {
&<crate::user::type_::NullCompleteType<H>>::ABSENT
}
type DeformationComplex = crate::bridge::homology::NullDeformationComplex<H>;
fn moduli_deformation(&self) -> &Self::DeformationComplex {
&<crate::bridge::homology::NullDeformationComplex<H>>::ABSENT
}
}
impl<'r, R: ModuliResolverResolver<H>, H: HostTypes> ResolvedModuliResolver<'r, R, H> {
/// Promote the `moduli_target` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_moduli_target<'r2, R2: crate::user::type_::CompleteTypeResolver<H>>(
&self,
r: &'r2 R2,
) -> Option<crate::user::type_::ResolvedCompleteType<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::user::type_::ResolvedCompleteType::new(
record.moduli_target_handle,
r,
))
}
/// Promote the `moduli_deformation` handle on the cached record into a
/// resolved wrapper, given a resolver for the range class.
/// Returns `None` if no record was resolved at construction.
#[inline]
pub fn resolve_moduli_deformation<
'r2,
R2: crate::bridge::homology::DeformationComplexResolver<H>,
>(
&self,
r: &'r2 R2,
) -> Option<crate::bridge::homology::ResolvedDeformationComplex<'r2, R2, H>> {
let record = self.record.as_ref()?;
Some(crate::bridge::homology::ResolvedDeformationComplex::new(
record.moduli_deformation_handle,
r,
))
}
}
/// O(1) complexity — the resolver runs in constant time regardless of ring size.
pub mod constant_time {}
/// O(log n) complexity — the resolver runs in logarithmic time in the quantum level.
pub mod logarithmic_time {}
/// O(n) complexity — the resolver runs in time linear in the quantum level.
pub mod linear_time {}
/// O(2^n) complexity — the resolver runs in time exponential in the quantum level.
pub mod exponential_time {}
/// Process queries in arrival order. The implicit pre-Amendment 48 behavior.
pub mod fifo_policy {}
/// Process the query with the smallest targetSite.freeRank first. Favors cheapest resolutions, accelerating early grounding gain.
pub mod min_free_count_first {}
/// Process the query with the largest targetSite.freeRank first. Favors hardest resolutions, maximizing information gain per step.
pub mod max_free_count_first {}
/// Process queries whose targetSite is disjoint from all other pending queries' site sets first. Minimizes contention when operating against a SharedContext.
pub mod disjoint_first {}
/// TowerCompletenessResolver produces LiftChainCertificate on success and ImpossibilityWitness on failure.
pub mod tower_certify_mapping {
/// `forResolver` -> `TowerCompletenessResolver`
pub const FOR_RESOLVER: &str = "https://uor.foundation/resolver/TowerCompletenessResolver";
/// `producesCertificate` -> `LiftChainCertificate`
pub const PRODUCES_CERTIFICATE: &str = "https://uor.foundation/cert/LiftChainCertificate";
/// `producesWitness` -> `ImpossibilityWitness`
pub const PRODUCES_WITNESS: &str = "https://uor.foundation/proof/ImpossibilityWitness";
}
/// IncrementalCompletenessResolver produces LiftChainCertificate (single-step) on success and ImpossibilityWitness on failure.
pub mod incremental_certify_mapping {
/// `forResolver` -> `IncrementalCompletenessResolver`
pub const FOR_RESOLVER: &str =
"https://uor.foundation/resolver/IncrementalCompletenessResolver";
/// `producesCertificate` -> `LiftChainCertificate`
pub const PRODUCES_CERTIFICATE: &str = "https://uor.foundation/cert/LiftChainCertificate";
/// `producesWitness` -> `ImpossibilityWitness`
pub const PRODUCES_WITNESS: &str = "https://uor.foundation/proof/ImpossibilityWitness";
}
/// GroundingAwareResolver produces GroundingCertificate on success and ImpossibilityWitness on failure.
pub mod grounding_aware_certify_mapping {
/// `forResolver` -> `GroundingAwareResolver`
pub const FOR_RESOLVER: &str = "https://uor.foundation/resolver/GroundingAwareResolver";
/// `producesCertificate` -> `GroundingCertificate`
pub const PRODUCES_CERTIFICATE: &str = "https://uor.foundation/cert/GroundingCertificate";
/// `producesWitness` -> `ImpossibilityWitness`
pub const PRODUCES_WITNESS: &str = "https://uor.foundation/proof/ImpossibilityWitness";
}
/// InhabitanceResolver produces InhabitanceCertificate on success and InhabitanceImpossibilityWitness on failure.
pub mod inhabitance_certify_mapping {
/// `forResolver` -> `InhabitanceResolver`
pub const FOR_RESOLVER: &str = "https://uor.foundation/resolver/InhabitanceResolver";
/// `producesCertificate` -> `InhabitanceCertificate`
pub const PRODUCES_CERTIFICATE: &str = "https://uor.foundation/cert/InhabitanceCertificate";
/// `producesWitness` -> `InhabitanceImpossibilityWitness`
pub const PRODUCES_WITNESS: &str =
"https://uor.foundation/proof/InhabitanceImpossibilityWitness";
}
/// MultiplicationResolver produces MultiplicationCertificate on success and ImpossibilityWitness on failure. The resolver is total over admissible call-site contexts (stack_budget_bytes > 0), so failure is unreachable for well-formed inputs.
pub mod multiplication_certify_mapping {
/// `forResolver` -> `MultiplicationResolver`
pub const FOR_RESOLVER: &str = "https://uor.foundation/resolver/MultiplicationResolver";
/// `producesCertificate` -> `MultiplicationCertificate`
pub const PRODUCES_CERTIFICATE: &str = "https://uor.foundation/cert/MultiplicationCertificate";
/// `producesWitness` -> `ImpossibilityWitness`
pub const PRODUCES_WITNESS: &str = "https://uor.foundation/proof/ImpossibilityWitness";
}