()
| 1462 | let result = cheap_beta_reduce(&mut env, &app); |
| 1463 | assert_eq!(result, arg); |
| 1464 | } |
| 1465 | |
| 1466 | #[test] |
| 1467 | fn cheap_beta_nested_bvar_picks_outer_arg() { |
| 1468 | // (λa b. a) x y → x (a is Var(1) under both binders) |
| 1469 | let mut env = InternTable::<Anon>::new(); |
| 1470 | let nat = AE::cnst(KId::new(mk_addr("Nat"), ()), Box::new([])); |
| 1471 | let v1 = AE::var(1, ()); // refers to outermost lambda |
| 1472 | // λa:Nat. λb:Nat. a |
| 1473 | let inner_lam = AE::lam((), (), nat.clone(), v1); |
| 1474 | let outer_lam = AE::lam((), (), nat, inner_lam); |
| 1475 | let x = AE::nat(Nat::from(7u64), mk_addr("x")); |
| 1476 | let y = AE::nat(Nat::from(8u64), mk_addr("y")); |
| 1477 | let app = AE::app(AE::app(outer_lam, x.clone()), y); |
| 1478 | let result = cheap_beta_reduce(&mut env, &app); |
| 1479 | assert_eq!(result, x); |
nothing calls this directly
no test coverage detected