fact: Definition apply_params_to_constructors (ind_applied : dyn) (i : Ind_dyn) : M (mlist dyn) := let '(mkInd_dyn _ nparams _ l) := i in rev_params <- (mfix3 go (ind_dyn : _) (acc : _) (n : nat) : M (mlist dyn) := match n with | 0 => M.ret acc | S n => dcase ind_dyn as ind in M.decompose_app'' (S:=fun _ _ => mlist dyn) ind (fun A B f a => go (Dyn f) (Dyn a :m: acc) n ) end ) ind_applied mnil (N.to_nat nparams); let apply_rev_params := ( mfix2 go (params : mlist dyn) (c : _) : M (dyn) := match params with | [m:] => M.ret c | p :m: params => dcase p as P, p in mmatch c with | [? C c] @Dyn (forall p:P, C p) c =u> go params (Dyn (c p)) end end ) in M.map (apply_rev_params rev_params) l.
imports: Strings.String ssrmatching.ssrmatching Mtac2(Logic Datatypes List Utils Logic Sorts MTeleMatch) Strings.String NArith.BinNat NArith.BinNatDef