fact: Definition mkFixMatch (f x : ident) (t1 t2 : Ast.term) (pred : Ast.predicate term) (cases : nat -> list term -> 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 (Ast.tFix [BasicAst.mkdef Ast.term (naNamed f) (tProd naAnon t1 t2) (tLambda (naNamed x) t1 (tCase (mk_case_info ind params Relevant) pred (tRel 0) body)) 0] 0).
imports: Ascii String Undecidability.L(Util.L_facts) MetaCoq(Template.All Template.Checker) Undecidability.Shared.Libs.PSL.Base MetaCoq.Utils.bytestring