fact: Definition mkMatch (t1 t2 d : Ast.term) (pred : Ast.predicate term) (cases : nat -> list term -> Core.TemplateMonad term) := hs_num <- tmGetOption (split_head_symbol t1) "no head symbol found";; let '(ind, Params) := hs_num in let params := List.length Params in L <- list_constructors ind >>= tmEval hnf ;; body <- monad_map_i (fun i '(n, s, args) => l <- tmArgsOfConstructor ind i ;; l' <- monad_map_i (insert_params FUEL Params) (skipn params l) ;; t <- cases i l' ;; ret (mk_branch (context_to_bcontext args) t)) L ;; ret (tCase (mk_case_info ind params Relevant) pred d body).
imports: Undecidability.L(L Tactics.Computable Tactics.ComputableTactics Tactics.Extract) MetaCoq(Template.All TemplateMonad.Core Template.Ast) List MetaCoq.Utils.bytestring