()
| 233 | /// Tests that 2 * 2 reduces to 4 via Church numeral reduction. |
| 234 | #[test] |
| 235 | fn good_peano3() { |
| 236 | let env = peano_env(); |
| 237 | let ty = npi( |
| 238 | "t", |
| 239 | pi(cnst("PN", &[]), sort0()), |
| 240 | npi( |
| 241 | "v", |
| 242 | npi("n", cnst("PN", &[]), app(var(1), var(0))), |
| 243 | app(var(1), cnst("PN.lit4", &[])), |
| 244 | ), |
| 245 | ); |
| 246 | let two_times_two = |
| 247 | app(app(cnst("PN.mul", &[]), cnst("PN.lit2", &[])), cnst("PN.lit2", &[])); |
| 248 | let val = nlam( |
| 249 | "t", |
| 250 | pi(cnst("PN", &[]), sort0()), |
| 251 | nlam( |
| 252 | "v", |
| 253 | npi("n", cnst("PN", &[]), app(var(1), var(0))), |
| 254 | app(var(0), two_times_two), |
| 255 | ), |
| 256 | ); |
| 257 | let mut env2 = env; |
| 258 | let (id, c) = mk_thm("peano3", 0, vec![], ty, val); |
| 259 | env2.insert(id.clone(), c); |
| 260 | check_accepts(&mut env2, &id); |
| 261 | } |
| 262 | |
| 263 | // ========================================================================== |
| 264 | // Batch 13: Bool inductive + recursor reduction (Tutorial.lean 206, 693) |
nothing calls this directly
no test coverage detected