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

Method ensure_sort

crates/kernel/src/tc.rs:643–653  ·  view source on GitHub ↗

WHNF, then ensure it's a Sort. Returns the universe level.

(&mut self, e: &KExpr<M>)

Source from the content-addressed store, hash-verified

641 }
642
643 // -----------------------------------------------------------------------
644 // Universe helpers
645 // -----------------------------------------------------------------------
646
647 /// WHNF, then ensure it's a Sort. Returns the universe level.
648 pub fn ensure_sort(&mut self, e: &KExpr<M>) -> Result<KUniv<M>, TcError<M>> {
649 // Fast path: already a Sort, skip WHNF + tick.
650 if let ExprData::Sort(u, _) = e.data() {
651 return Ok(u.clone());
652 }
653 let w = self.whnf(e)?;
654 match w.data() {
655 ExprData::Sort(u, _) => Ok(u.clone()),
656 _ => Err(TcError::TypeExpected),

Callers 10

get_levelMethod · 0.80
check_const_memberMethod · 0.80
check_inductive_blockMethod · 0.80
check_field_universesMethod · 0.80
is_large_eliminatorMethod · 0.80
check_recursor_blockMethod · 0.80
inferMethod · 0.80
infer_projMethod · 0.80
inductive_app_is_propMethod · 0.80

Calls 3

whnfMethod · 0.80
dataMethod · 0.45
cloneMethod · 0.45

Tested by 1