pub fn check_cnstr1(
        &self,
        parent_ind_type : ExprPtr<'l>,
        parent_ind_const : ExprPtr<'l>,
        cnstr_type_cursor : ExprPtr<'l>,
        rem_params : ExprsPtr<'l>,
        ctx : &mut Live<'l, 'e>
    ) {
        match (cnstr_type_cursor.read(ctx), rem_params.read(ctx)) {
            (Pi { b_type, body, .. }, Cons(hd, tl)) => {
                let param_type = hd.local_type_infal(ctx);
                b_type.assert_def_eq(param_type, &mut ctx.as_tc(Some(self.uparams), None));
                let body = body.inst1(hd, ctx);

                self.check_cnstr1(parent_ind_type, parent_ind_const, body, tl, ctx)
            },
            (Pi { b_name, b_type, b_style, body, .. }, Nil) => {
                
                // assertion that b_type is a well formed inhabitant of something.
                let s = b_type.ensure_type(&mut ctx.as_tc(Some(self.uparams), None));

                if !(self.block_codom().is_zero(ctx) || s.leq(self.block_codom(), ctx)) {
                    panic!("Constructor argument was too large for the corresponding inductive type!")
                }

                if self.is_unsafe {
                    self.check_positivity_is_unsafe();
                } else {
                    self.check_positivity1(parent_ind_type, parent_ind_const, b_type, ctx)
                }

                let local = <ExprPtr>::new_local(b_name, b_type, b_style, ctx);
                let body_prime = body.inst1(local, ctx);
                self.check_cnstr1(parent_ind_type, parent_ind_const, body_prime, rem_params, ctx);

            },
            _ => {
                assert!(self.is_valid_ind_app(parent_ind_type, parent_ind_const, cnstr_type_cursor, ctx))
            }
        }
    }
// This always begins with the full type/param list
This always begins with the full type/param list
This always begins with the full type / param list
pub fn check_cnstr1(
        &self,
        parent_ind_type : ExprPtr<'l>,
        parent_ind_const : ExprPtr<'l>,
        cnstr_type_cursor : ExprPtr<'l>,
        rem_params : ExprsPtr<'l>,
        ctx : &mut Live<'l, 'e>
    ) {
        match (cnstr_type_cursor.read(ctx), rem_params.read(ctx)) {
            (Pi { b_type, body, .. }, Cons(hd, tl)) => {
                let param_type = hd.local_type_infal(ctx);
                b_type.assert_def_eq(param_type, &mut ctx.as_tc(Some(self.uparams), None));
                let body = body.inst1(hd, ctx);
                self.check_cnstr1(parent_ind_type, parent_ind_const, body, tl, ctx)
            },
            (Pi { b_name, b_type, b_style, body, .. }, Nil) => {
                // assertion that b_type is a well formed inhabitant of something.
                let s = b_type.ensure_type(&mut ctx.as_tc(Some(self.uparams), None));
                if !(self.block_codom().is_zero(ctx) || s.leq(self.block_codom(), ctx)) {
                    panic!("Constructor argument was too large for the corresponding inductive type!")
                }
                if self.is_unsafe {
                    self.check_positivity_is_unsafe();
                } else {
                    self.check_positivity1(parent_ind_type, parent_ind_const, b_type, ctx)
                }
                let local = <ExprPtr>::new_local(b_name, b_type, b_style, ctx);
                let body_prime = body.inst1(local, ctx);
                self.check_cnstr1(parent_ind_type, parent_ind_const, body_prime, rem_params, ctx);
            },
            _ => {
                assert!(self.is_valid_ind_app(parent_ind_type, parent_ind_const, cnstr_type_cursor, ctx))
            }
        }
    }
pub fn check_cnstr1 ( & self , parent_ind_type : ExprPtr < ' l > , parent_ind_const : ExprPtr < ' l > , cnstr_type_cursor : ExprPtr < ' l > , rem_params : ExprsPtr < ' l > , ctx : & mut Live < ' l , ' e > ) { match ( cnstr_type_cursor . read ( ctx ) , rem_params . read ( ctx ) ) { ( Pi { b_type , body , .. } , Cons ( hd , tl ) ) => { let param_type = hd . local_type_infal ( ctx ) ; b_type . assert_def_eq ( param_type , & mut ctx . as_tc ( Some ( self . uparams ) , None ) ) ; let body = body . inst1 ( hd , ctx ) ; self . check_cnstr1 ( parent_ind_type , parent_ind_const , body , tl , ctx ) } , ( Pi { b_name , b_type , b_style , body , .. } , Nil ) => { // assertion that b_type is a well formed inhabitant of something. let s = b_type . ensure_type ( & mut ctx . as_tc ( Some ( self . uparams ) , None ) ) ; if ! ( self . block_codom ( ) . is_zero ( ctx ) || s . leq ( self . block_codom ( ) , ctx ) ) { panic ! ( " " ) } if self . is_unsafe { self . check_positivity_is_unsafe ( ) ; } else { self . check_positivity1 ( parent_ind_type , parent_ind_const , b_type , ctx ) } let local = < ExprPtr > :: new_local ( b_name , b_type , b_style , ctx ) ; let body_prime = body . inst1 ( local , ctx ) ; self . check_cnstr1 ( parent_ind_type , parent_ind_const , body_prime , rem_params , ctx ) ; } , _ => { assert ! ( self is_valid_ind_app ( parent_ind_type parent_ind_const cnstr_type_cursor ctx ) ) } } }
This always begins with the full type/param list
This always begins with the full type / param list
&self
parent_ind_type
ExprPtr<'l>
parent_ind_const
ExprPtr<'l>
cnstr_type_cursor
ExprPtr<'l>
rem_params
ExprsPtr<'l>
ctx
&mut Live<'l, 'e>
&self
parent_ind_type
ExprPtr<'l>
parent_ind_const
ExprPtr<'l>
cnstr_type_cursor
ExprPtr<'l>
rem_params
ExprsPtr<'l>
ctx
&mut Live<'l, 'e>