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

Method truncate

crates/kernel/src/lctx.rs:117–122  ·  view source on GitHub ↗

Truncate the context to the given length, dropping any declarations pushed since. The dropped fvars become unresolvable via [`Self::find`].

(&mut self, len: usize)

Source from the content-addressed store, hash-verified

115 /// Truncate the context to the given length, dropping any declarations
116 /// pushed since. The dropped fvars become unresolvable via [`Self::find`].
117 pub fn truncate(&mut self, len: usize) {
118 while self.decls.len() > len {
119 let (id, _) = self.decls.pop().expect("len > 0 by loop guard");
120 self.index.remove(&id);
121 }
122 }
123
124 /// Iterate decls in insertion order.
125 pub fn iter(&self) -> impl Iterator<Item = (FVarId, &LocalDecl<M>)> {

Callers 15

executeMethod · 0.80
populate_rowMethod · 0.80
restoreMethod · 0.80
decompile_inductiveFunction · 0.80
lctx_push_find_truncateFunction · 0.80
count_forallsMethod · 0.80
quick_def_eqMethod · 0.80
is_def_eq_whnfMethod · 0.80
build_flat_blockMethod · 0.80
try_detect_nestedMethod · 0.80
check_param_agreementMethod · 0.80

Calls 1

lenMethod · 0.45

Tested by 1

lctx_push_find_truncateFunction · 0.64