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

Function simul_subst_shift

crates/kernel/src/subst.rs:1176–1186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1174 let mut env = InternTable::<Anon>::new();
1175 let v0 = AE::var(0, ());
1176 // lift(Var(0), shift=1, cutoff=0) → Var(1)
1177 let result = lift(&mut env, &v0, 1, 0);
1178 assert_eq!(result, AE::var(1, ()));
1179 // lift(Var(0), shift=1, cutoff=1) → Var(0) (below cutoff)
1180 let result2 = lift(&mut env, &v0, 1, 1);
1181 assert!(result2.ptr_eq(&v0));
1182 }
1183
1184 #[test]
1185 fn lift_zero_shift() {
1186 let mut env = InternTable::<Anon>::new();
1187 let v0 = AE::var(0, ());
1188 let result = lift(&mut env, &v0, 0, 0);
1189 assert!(result.ptr_eq(&v0));

Callers

nothing calls this directly

Calls 4

simul_substFunction · 0.85
varFunction · 0.70
natFunction · 0.70
mk_addrFunction · 0.70

Tested by

no test coverage detected