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

Function good_peano1

crates/kernel/src/tutorial/reduction.rs:174–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172 /// peano1 : ∀ (t : PN → Prop) (v : (n : PN) → t n), t PN.lit2 := fun t v => v PN.lit2
173 #[test]
174 fn good_peano1() {
175 let env = peano_env();
176 let ty = npi(
177 "t",
178 pi(cnst("PN", &[]), sort0()),
179 npi(
180 "v",
181 npi("n", cnst("PN", &[]), app(var(1), var(0))),
182 app(var(1), cnst("PN.lit2", &[])),
183 ),
184 );
185 let val = nlam(
186 "t",
187 pi(cnst("PN", &[]), sort0()),
188 nlam(
189 "v",
190 npi("n", cnst("PN", &[]), app(var(1), var(0))),
191 app(var(0), cnst("PN.lit2", &[])),
192 ),
193 );
194 let mut env2 = env;
195 let (id, c) = mk_thm("peano1", 0, vec![], ty, val);
196 env2.insert(id.clone(), c);
197 check_accepts(&mut env2, &id);
198 }
199
200 /// peano2 : ∀ (t : PN → Prop) (v : (n : PN) → t n), t PN.lit2 := fun t v => v (PN.add PN.lit1 PN.lit1)
201 /// Tests that 1 + 1 reduces to 2 via Church numeral reduction.

Callers

nothing calls this directly

Calls 12

peano_envFunction · 0.85
npiFunction · 0.85
nlamFunction · 0.85
mk_thmFunction · 0.85
check_acceptsFunction · 0.85
piFunction · 0.50
cnstFunction · 0.50
sort0Function · 0.50
appFunction · 0.50
varFunction · 0.50
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected