fn check_positivity1(
        &self,
        parent_ind_type : ExprPtr<'l>,
        parent_ind_const : ExprPtr<'l>,
        cnstr_type_cursor : ExprPtr<'l>,
        ctx : &mut Live<'l, 'e>
    ) {

        let cnstr_type_cursor = cnstr_type_cursor.whnf(&mut ctx.as_tc(Some(self.uparams), None));

        match cnstr_type_cursor.read(ctx) {
            _ if !cnstr_type_cursor.has_ind_occ(self.ind_names, ctx) => (),
            Pi { b_type, .. } if b_type.has_ind_occ(self.ind_names, ctx) => panic!("non-positive occurrence!"),
            Pi { b_name, b_type, b_style, body, .. } => {
                let local = <ExprPtr>::new_local(b_name, b_type, b_style, ctx);
                let body = body.inst1(local, ctx);
                self.check_positivity1(parent_ind_type, parent_ind_const, body, ctx)
            },
            // assertion-like
            _ => assert!(self.is_valid_ind_app(parent_ind_type, parent_ind_const, cnstr_type_cursor, ctx))
        }
    }
// This is only ONE of the binders from the constructor's telescope,
// AFTER the block params have been removed. These are essentially
// the "extra arguments" to the constructor.
// When we match here on Pi { x, y }, `x` is the left hand side
// of a function argument to an inductive constructor.
// We need to search `y` to prevent non-positive occurrences like
// | mk (f : A -> A -> thing A) : thing A
This is only ONE of the binders from the constructor's telescope,
AFTER the block params have been removed. These are essentially
the "extra arguments" to the constructor.
When we match here on Pi { x, y }, `x` is the left hand side
of a function argument to an inductive constructor.
We need to search `y` to prevent non-positive occurrences like
| mk (f : A -> A -> thing A) : thing A
This is only ONE of the binders from the constructor ' s telescope AFTER the block params have been removed . These are essentially the " extra arguments " to the constructor . When we match here on Pi { x y } ` x ` is the left hand side of a function argument to an inductive constructor . We need to search ` y ` to prevent non - positive occurrences like | mk ( f : A - > A - > thing A ) : thing A
fn check_positivity1(
        &self,
        parent_ind_type : ExprPtr<'l>,
        parent_ind_const : ExprPtr<'l>,
        cnstr_type_cursor : ExprPtr<'l>,
        ctx : &mut Live<'l, 'e>
    ) {
        let cnstr_type_cursor = cnstr_type_cursor.whnf(&mut ctx.as_tc(Some(self.uparams), None));
        match cnstr_type_cursor.read(ctx) {
            _ if !cnstr_type_cursor.has_ind_occ(self.ind_names, ctx) => (),
            Pi { b_type, .. } if b_type.has_ind_occ(self.ind_names, ctx) => panic!("non-positive occurrence!"),
            Pi { b_name, b_type, b_style, body, .. } => {
                let local = <ExprPtr>::new_local(b_name, b_type, b_style, ctx);
                let body = body.inst1(local, ctx);
                self.check_positivity1(parent_ind_type, parent_ind_const, body, ctx)
            },
            // assertion-like
            _ => assert!(self.is_valid_ind_app(parent_ind_type, parent_ind_const, cnstr_type_cursor, ctx))
        }
    }
fn check_positivity1 ( & self , parent_ind_type : ExprPtr < ' l > , parent_ind_const : ExprPtr < ' l > , cnstr_type_cursor : ExprPtr < ' l > , ctx : & mut Live < ' l , ' e > ) { let cnstr_type_cursor = cnstr_type_cursor . whnf ( & mut ctx . as_tc ( Some ( self . uparams ) , None ) ) ; match cnstr_type_cursor . read ( ctx ) { _ if ! cnstr_type_cursor . has_ind_occ ( self . ind_names , ctx ) => ( ) , Pi { b_type , .. } if b_type . has_ind_occ ( self . ind_names , ctx ) => panic ! ( " " ) , Pi { b_name , b_type , b_style , body , .. } => { let local = < ExprPtr > :: new_local ( b_name , b_type , b_style , ctx ) ; let body = body . inst1 ( local , ctx ) ; self . check_positivity1 ( parent_ind_type , parent_ind_const , body , ctx ) } , // assertion-like _ => assert ! ( self is_valid_ind_app ( parent_ind_type parent_ind_const cnstr_type_cursor ctx ) ) } }
This is only ONE of the binders from the constructor's telescope,
AFTER the block params have been removed.
This is only ONE of the binders from the constructor ' s telescope AFTER the block params have been removed .
&self
parent_ind_type
ExprPtr<'l>
parent_ind_const
ExprPtr<'l>
cnstr_type_cursor
ExprPtr<'l>
ctx
&mut Live<'l, 'e>
&self
parent_ind_type
ExprPtr<'l>
parent_ind_const
ExprPtr<'l>
cnstr_type_cursor
ExprPtr<'l>
ctx
&mut Live<'l, 'e>