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

Function test_env

crates/kernel/src/infer.rs:637–669  ·  view source on GitHub ↗

Env with: Nat (axiom), id (definition)

()

Source from the content-addressed store, hash-verified

635
636 /// Env with: Nat (axiom), id (definition)
637 fn test_env() -> KEnv<Anon> {
638 let mut env = KEnv::new();
639 // Nat : Sort 1
640 env.insert(
641 mk_id("Nat"),
642 KConst::Axio {
643 name: (),
644 level_params: (),
645 is_unsafe: false,
646 lvls: 0,
647 ty: sort1(),
648 },
649 );
650 // id : Sort 0 → Sort 0 := λ x. x
651 let id_ty = AE::all((), (), sort0(), sort0());
652 let id_val = AE::lam((), (), sort0(), AE::var(0, ()));
653 env.insert(
654 mk_id("id"),
655 KConst::Defn {
656 name: (),
657 level_params: (),
658 kind: DefKind::Definition,
659 safety: DefinitionSafety::Safe,
660 hints: ReducibilityHints::Abbrev,
661 lvls: 0,
662 ty: id_ty,
663 val: id_val,
664 lean_all: (),
665 block: mk_id("id"),
666 },
667 );
668 env
669 }
670
671 #[test]
672 fn infer_sort() {

Callers 15

infer_sortFunction · 0.70
infer_varFunction · 0.70
infer_constFunction · 0.70
infer_lamFunction · 0.70
infer_appFunction · 0.70
infer_allFunction · 0.70
infer_nat_litFunction · 0.70
infer_cacheFunction · 0.70

Calls 6

mk_idFunction · 0.70
sort1Function · 0.70
sort0Function · 0.70
lamFunction · 0.70
varFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected