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

Function negative_self_function_env

crates/kernel/src/inductive.rs:6615–6658  ·  view source on GitHub ↗
(is_unsafe: bool)

Source from the content-addressed store, hash-verified

6613 induct: mk_id("List"),
6614 cidx: 0,
6615 params: 1,
6616 fields: 0,
6617 ty: nil_ty,
6618 },
6619 );
6620 let cons_ty = pi(
6621 AE::sort(param(0)),
6622 pi(
6623 var(0),
6624 pi(
6625 app(cnst("List", &[param(0)]), var(1)),
6626 app(cnst("List", &[param(0)]), var(2)),
6627 ),
6628 ),
6629 );
6630 env.insert(
6631 mk_id("List.cons"),
6632 KConst::Ctor {
6633 name: (),
6634 level_params: (),
6635 is_unsafe: false,
6636 lvls: 1,
6637 induct: mk_id("List"),
6638 cidx: 1,
6639 params: 1,
6640 fields: 2,
6641 ty: cons_ty,
6642 },
6643 );
6644
6645 env.blocks.insert(
6646 block,
6647 vec![mk_id("PTree"), mk_id("PTree.leaf"), mk_id("PTree.node")],
6648 );
6649 env.blocks.insert(
6650 mk_id("List"),
6651 vec![mk_id("List"), mk_id("List.nil"), mk_id("List.cons")],
6652 );
6653 env
6654 }
6655
6656 #[test]
6657 fn poly_nested_flat_block() {
6658 let mut env = poly_nested_env();
6659 let mut tc = TypeChecker::new(&mut env);
6660 // Check inductive first (consumes fuel for validation)
6661 tc.check_const(&mk_id("PTree")).unwrap();

Calls 7

bool_envFunction · 0.70
mk_idFunction · 0.70
sort1Function · 0.70
piFunction · 0.70
cnstFunction · 0.70
insertMethod · 0.45
cloneMethod · 0.45