MCPcopy Create free account
hub / github.com/argumentcomputer/ix / resolve_all

Function resolve_all

crates/kernel/src/ingress.rs:370–388  ·  view source on GitHub ↗

Resolve a list of **Lean-name-hash** addresses to `KId ` pairs whose `addr` is the **projection-content address** under which the corresponding KConst is actually stored in `KEnv`. The callers (`build_mut_ctx`, `ingress_muts_inductive`'s `ctor_ids`, and `lean_all` reconstruction in `ingress_defn` / `ingress_recursor` / `ingress_muts_inductive`) pull addresses out of `ConstantMetaInfo::*::{all,

(
  all_addrs: &[Address],
  names: &FxHashMap<Address, Name>,
  name_to_addr: &FxHashMap<Name, Address>,
)

Source from the content-addressed store, hash-verified

368 fn synth_name(&self) -> Name {
369 let n = self.synth_counter.get();
370 self.synth_counter.set(n + 1);
371 Name::str(Name::anon(), format!("_s{n}"))
372 }
373}
374
375fn resolve_level_params(
376 lvl_addrs: &[Address],
377 names: &FxHashMap<Address, Name>,
378) -> Vec<Name> {
379 lvl_addrs.iter().map(|a| resolve_name(a, names)).collect()
380}
381
382/// Resolve a list of **Lean-name-hash** addresses to `KId<M>` pairs whose
383/// `addr` is the **projection-content address** under which the corresponding
384/// KConst is actually stored in `KEnv`.
385///
386/// The callers (`build_mut_ctx`, `ingress_muts_inductive`'s `ctor_ids`, and
387/// `lean_all` reconstruction in `ingress_defn` / `ingress_recursor` /
388/// `ingress_muts_inductive`) pull addresses out of `ConstantMetaInfo::*::{all,
389/// ctx, ctors}`. Those fields store **name-hash** addresses (they were written
390/// by compile via `compile_name`), but each KConst is stored in `KEnv` under
391/// its **projection** address (the content hash of the `IPrj` / `CPrj` / `RPrj`

Callers 4

build_mut_ctxFunction · 0.85
ingress_defnFunction · 0.85
ingress_recursorFunction · 0.85
ingress_muts_inductiveFunction · 0.85

Calls 3

resolve_nameFunction · 0.85
iterMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected