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

Function bool_env

crates/kernel/src/tutorial/reduction.rs:268–388  ·  view source on GitHub ↗

Build Bool environment with working recursor rules.

()

Source from the content-addressed store, hash-verified

266
267 /// Build Bool environment with working recursor rules.
268 fn bool_env() -> KEnv<Meta> {
269 let mut env = KEnv::<Meta>::new();
270 let n = "Bool";
271 let block_id = mk_id(n);
272 let false_id = mk_id("Bool.false");
273 let true_id = mk_id("Bool.true");
274 let rec_id = mk_id("Bool.rec");
275
276 // Bool : Type
277 env.insert(
278 block_id.clone(),
279 KConst::Indc {
280 name: mk_name(n),
281 level_params: vec![],
282 lvls: 0,
283 params: 0,
284 indices: 0,
285 is_unsafe: false,
286 block: block_id.clone(),
287 member_idx: 0,
288 ty: sort1(),
289 ctors: vec![false_id.clone(), true_id.clone()],
290 lean_all: vec![block_id.clone()],
291 },
292 );
293
294 // Bool.false : Bool
295 env.insert(
296 false_id.clone(),
297 KConst::Ctor {
298 name: mk_name("Bool.false"),
299 level_params: vec![],
300 is_unsafe: false,
301 lvls: 0,
302 induct: block_id.clone(),
303 cidx: 0,
304 params: 0,
305 fields: 0,
306 ty: cnst(n, &[]),
307 },
308 );
309
310 // Bool.true : Bool
311 env.insert(
312 true_id.clone(),
313 KConst::Ctor {
314 name: mk_name("Bool.true"),
315 level_params: vec![],
316 is_unsafe: false,
317 lvls: 0,
318 induct: block_id.clone(),
319 cidx: 1,
320 params: 0,
321 fields: 0,
322 ty: cnst(n, &[]),
323 },
324 );
325

Callers 3

good_bool_rec_reductionFunction · 0.70
rtree_envFunction · 0.70

Calls 15

sortFunction · 0.85
ipiFunction · 0.85
npiFunction · 0.85
nlamFunction · 0.85
add_eq_axiomsFunction · 0.85
mk_idFunction · 0.50
mk_nameFunction · 0.50
sort1Function · 0.50
cnstFunction · 0.50
piFunction · 0.50
paramFunction · 0.50
appFunction · 0.50

Tested by 2

good_bool_rec_reductionFunction · 0.56