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

Method get_result_sort_level

crates/kernel/src/inductive.rs:2090–2119  ·  view source on GitHub ↗

Get the result sort level of a type after peeling `n` foralls.

(
    &mut self,
    ty: &KExpr<M>,
    n: usize,
  )

Source from the content-addressed store, hash-verified

2088 )));
2089 }
2090 match group.concrete_univs.as_deref() {
2091 Some(expected) => {
2092 if expected.len() != us.len()
2093 || !expected.iter().zip(us).all(|(a, b)| univ_eq(a, b))
2094 {
2095 return Err(TcError::Other(
2096 "positivity: recursive occurrence has non-uniform universe arguments"
2097 .into(),
2098 ));
2099 }
2100 },
2101 None => {
2102 for (i, u) in us.iter().enumerate() {
2103 let expected =
2104 KUniv::param(i as u64, M::meta_field(ix_common::env::Name::anon()));
2105 if !univ_eq(u, &expected) {
2106 return Err(TcError::Other(
2107 "positivity: recursive occurrence has non-uniform universe arguments"
2108 .into(),
2109 ));
2110 }
2111 }
2112 },
2113 }
2114
2115 if group.params.len() != n_params {
2116 return Err(TcError::Other(
2117 "positivity: recursive occurrence parameter arity disagrees with its family"
2118 .into(),
2119 ));
2120 }
2121 for (i, (actual, expected)) in
2122 args[..n_params].iter().zip(&group.params).enumerate()

Callers 5

compute_is_large_and_kFunction · 0.80
compute_k_targetMethod · 0.80

Calls 6

whnfMethod · 0.80
open_binder_anonMethod · 0.80
truncateMethod · 0.80
lenMethod · 0.45
cloneMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected