pub struct InstanceChoice {
pub value: Term,
pub tier: InstanceTier,
pub priority: i64,
pub considered: Vec<InstanceProbe>,
pub pruned: usize,
}Expand description
A resolved instance together with WHY it won — the audit trail Lean’s instance resolution does not expose.
considered lists, in the exact order they were tried, every candidate the search touched
before settling: (tier, priority, whether it applied). A candidate that applied but lost
(an ambiguous hierarchy diamond) is therefore distinguishable from one that never matched,
which is the distinction that makes an “unexpected instance” bug findable.
Fields§
§value: TermThe instance term, with its metavariables instantiated — exactly what
resolve_instance returns.
tier: InstanceTierWhere the winner came from.
priority: i64Its priority (Lean’s default, 1000, unless declared otherwise). Fallback entries carry no priority of their own — the tier itself is the ranking — and report the default.
considered: Vec<InstanceProbe>Every candidate the search touched, in the order it touched them.
pruned: usizeHow many declared instances the DISCRIMINATION INDEX excluded before any of them was
tried — see Context::instance_search_order_for.
Lean’s getUnify hands back the surviving entries and throws this number away, so
“why was my instance never tried?” has no answer there short of reading a trace log
backwards. Here it is a field: considered.len() + pruned is the whole database.
Trait Implementations§
Source§impl Clone for InstanceChoice
impl Clone for InstanceChoice
Source§fn clone(&self) -> InstanceChoice
fn clone(&self) -> InstanceChoice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more