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

Method intern_univ

crates/kernel/src/env.rs:102–108  ·  view source on GitHub ↗

Intern a universe: if one with the same hash exists, return the existing Arc (ensuring pointer uniqueness). Otherwise insert and return.

(&mut self, u: KUniv<M>)

Source from the content-addressed store, hash-verified

100 /// short-circuit on members, and use it to detect non-canonical
101 /// children that must be canonicalized before the shallow key is
102 /// meaningful.
103 pub(crate) canon_exprs: FxHashSet<Addr>,
104 pub(crate) canon_univs: FxHashSet<Addr>,
105 /// Scratch buffer for `subst` / `simul_subst` per-call memoization,
106 /// keyed by `(addr, depth)`. Cleared on entry. Owned here so the
107 /// allocation persists across calls.
108 pub(crate) subst_scratch: FxHashMap<(Addr, u64), KExpr<M>>,
109 /// Scratch buffer for `lift` per-call memoization, keyed by
110 /// `(addr, cutoff)`. Cleared on entry. Separate from `subst_scratch`
111 /// because `lift` is invoked from inside `subst_cached`, and the two

Callers 2

intern_univ_dedupFunction · 0.45
intern_univ_differentFunction · 0.45

Calls 4

entryMethod · 0.80
addrMethod · 0.45
getMethod · 0.45
cloneMethod · 0.45

Tested by 2

intern_univ_dedupFunction · 0.36
intern_univ_differentFunction · 0.36