()
| 201 | /// Tests that 1 + 1 reduces to 2 via Church numeral reduction. |
| 202 | #[test] |
| 203 | fn good_peano2() { |
| 204 | let env = peano_env(); |
| 205 | let ty = npi( |
| 206 | "t", |
| 207 | pi(cnst("PN", &[]), sort0()), |
| 208 | npi( |
| 209 | "v", |
| 210 | npi("n", cnst("PN", &[]), app(var(1), var(0))), |
| 211 | app(var(1), cnst("PN.lit2", &[])), |
| 212 | ), |
| 213 | ); |
| 214 | // Value uses add lit1 lit1 instead of lit2 |
| 215 | let one_plus_one = |
| 216 | app(app(cnst("PN.add", &[]), cnst("PN.lit1", &[])), cnst("PN.lit1", &[])); |
| 217 | let val = nlam( |
| 218 | "t", |
| 219 | pi(cnst("PN", &[]), sort0()), |
| 220 | nlam( |
| 221 | "v", |
| 222 | npi("n", cnst("PN", &[]), app(var(1), var(0))), |
| 223 | app(var(0), one_plus_one), |
| 224 | ), |
| 225 | ); |
| 226 | let mut env2 = env; |
| 227 | let (id, c) = mk_thm("peano2", 0, vec![], ty, val); |
| 228 | env2.insert(id.clone(), c); |
| 229 | check_accepts(&mut env2, &id); |
| 230 | } |
| 231 | |
| 232 | /// peano3 : ∀ (t : PN → Prop) (v : (n : PN) → t n), t PN.lit4 := fun t v => v (PN.mul PN.lit2 PN.lit2) |
| 233 | /// Tests that 2 * 2 reduces to 4 via Church numeral reduction. |
nothing calls this directly
no test coverage detected