Push a let-bound variable (type + value). WHNF will zeta-reduce references to this variable by substituting the value (lean4lean withExtendedLetCtx).
(&mut self, ty: KExpr<M>, val: KExpr<M>)
| 459 | self.let_vals.push(None); |
| 460 | } |
| 461 | |
| 462 | /// Push a let-bound variable (type + value). WHNF will zeta-reduce references |
| 463 | /// to this variable by substituting the value (lean4lean withExtendedLetCtx). |
| 464 | pub fn push_let(&mut self, ty: KExpr<M>, val: KExpr<M>) { |
| 465 | let ty = self.env.intern.intern_expr(ty); |
| 466 | let val = self.env.intern.intern_expr(val); |
| 467 | let mut h = blake3::Hasher::new(); |
| 468 | h.update(b"ctx.let"); |
| 469 | h.update(&ty.addr().to_le_bytes()); |
| 470 | h.update(&val.addr().to_le_bytes()); |
| 471 | h.update(self.ctx_id.as_bytes()); |
| 472 | self.ctx_id_stack.push(self.ctx_id); |
| 473 | self.ctx_id = h.finalize(); |
| 474 | self.ctx.push(ty); |
| 475 | self.let_vals.push(Some(val)); |