MetaRocq

Authors:

Yannick Forster

Théo Winterhalter

Files:

Meta-programming using MetaRocq

MetaRocq is a meta-programming framework that reuses the programming language underlying Rocq as meta-programming language.

To follow along, download the MetaRocq prelude next to this file and compile it with rocq compile MetaRocqPrelude.v.

Require Import MetaRocqPrelude.

For this, MetaRocq has a representation of Rocq terms as an inductive type:

Inductive term : Type := tRel : nat -> term | tVar : ident -> term | tEvar : nat -> list term -> term | tSort : sort -> term | tCast : term -> cast_kind -> term -> term | tProd : aname -> term -> term -> term | tLambda : aname -> term -> term -> term | tLetIn : aname -> term -> term -> term -> term | tApp : term -> list term -> term | tConst : kername -> Instance.t -> term | tInd : inductive -> Instance.t -> term | tConstruct : inductive -> nat -> Instance.t -> term | tCase : case_info -> predicate term -> term -> list (branch term) -> term | tProj : projection -> term -> term | tFix : mfixpoint term -> nat -> term | tCoFix : mfixpoint term -> nat -> term | tInt : PrimInt63.int -> term | tFloat : PrimFloat.float -> term | tString : PrimString.string -> term | tArray : Level.t -> list term -> term -> term -> term. Arguments tRel n%_nat_scope Arguments tVar id Arguments tEvar ev%_nat_scope args%_list_scope Arguments tSort s Arguments tCast t kind v Arguments tProd na ty body Arguments tLambda na ty body Arguments tLetIn na def def_ty body Arguments tApp f args%_list_scope Arguments tConst c u Arguments tInd ind u Arguments tConstruct ind idx%_nat_scope u Arguments tCase ci type_info discr branches%_list_scope Arguments tProj proj t Arguments tFix mfix idx%_nat_scope Arguments tCoFix mfix idx%_nat_scope Arguments tInt i Arguments tFloat f Arguments tString s Arguments tArray u arr%_list_scope default type

No need to understand it all, but you can see how the syntax of Rocq is encoded. It is actually almost in one-to-one correspondence with the OCaml implementation.

Quoting

The power of MetaRocq is that it allows you to go back and forth between this term representation and actual Rocq terms.

We talk about quoting for the action going from actual Rocq definitions to their MetaRocq representation.

Below you see how one can quote the identity function on natural numbers. It starts with a tLam and takes as argument a name for the variable, here "x". Then comes the type of the argument which is a complicated reference to the inductive type nat. Finally the body of the function is tRel 0. This means the 0th variable, in other words the last one to have been introduced, which is x here. This is what we call de Bruijn indices. In fact the "x" annotation is just to help printing, but carries no meaning.

tLam "x" (tInd {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} []) (tRel 0) : term

We can then use $unquote to perform the opposite action.

fun (_ : bool) (x : nat) => x : bool -> nat -> nat

As we said, you have to use de Bruijn indices to deal with variables:

Definition tNat :=
  $quote nat.

Definition idNat :=
  $unquote (tLam "x" tNat (tRel 0)).

idNat = fun x : nat => x : nat -> nat Arguments idNat x%_nat_scope

Power function

The usual example of meta-programming is the power function. The idea is that mpow 5 x will reduce to (let p := x * x in p * p) * x.

Note: When performing meta-programming, it's safe to deactivate the guard checker locally.

#[bypass_check(guard)] Fixpoint mpow' (n : nat) : term :=
  match n with
  | 0 => $quote 1
  | 1 => tRel 0
  | 2 => tApp ($quote mult) [ tRel 0 ; tRel 0 ]
  | S n' as n =>
    if n mod 2 =? 0
    then tLet "p" ($quote nat) (mpow' (div n 2)) (tApp ($quote mult) [ tRel 0 ; tRel 0 ])
    else tApp ($quote mult) [ mpow' n' ; tRel 0 ]
  end.

mpow' = fix mpow' (n : nat) : term := match n with | 0 => tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []] | 1 => tRel 0 | 2 => tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "mul") []) [tRel 0; tRel 0] | S (S (S _) as n') => if n mod 2 =? 0 then tLet "p" (tInd {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} []) (mpow' (n / 2)) (tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "mul") []) [tRel 0; tRel 0]) else tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "mul") []) [mpow' n'; tRel 0] end : nat -> term Arguments mpow' n%_nat_scope

See how quoting got expanded at definition time

Definition mpow n :=
  tLam "x" ($quote nat) (mpow' n).

Definition pow3 :=
  $unquote (mpow 3).
pow3 = fun x : nat => x * x * x : nat -> nat Arguments pow3 x%_nat_scope
Definition pow5 := $unquote (mpow 5).
pow5 = fun x : nat => (let p := x * x in p * p) * x : nat -> nat Arguments pow5 x%_nat_scope
Definition pow13 := $unquote (mpow 13).
pow13 = fun x : nat => (let p := let p := x * x * x in p * p in p * p) * x : nat -> nat Arguments pow13 x%_nat_scope

Transforming terms

We can build terms, but of course we can also inspect them to produce new terms. For this we can build functions that match on the syntax and produce new terms (see exercises). We also provide some utility to do it in a shorter way, although it might feel more technically involved, we'll let you judge what you prefer.

We'll write a transformation that duplicates all uses of S inside a term.

Definition double_S :=
  transform (fun t k =>
    match t with
    | tApp s [ n ] =>
      if s == $quote S then tApp s [ k t ]
      else k t
    | _ => k t
    end
  ).

transform takes a function that will tell what to do to the term that deviates from applying the identity function. This function takes as argument a term to inspect t, and a continuation k. Here we do a match on t and look at the only case we find interesting: application of S to some n. If it's not of this form, then we call the continuation on the whole term t so that it does its job of calling our function on the subterms. When it is some S n, we duplicate the S and then we still call the continuation on t. The reason is that the continuation will not call our program on n if we call k n since it will only call our program on its subterms.

Don't worry if this is a bit hard to get your head around. It is for me as well!

Let's still look at what it does.

= 20 : nat
= 24 : nat

To see clearer, let's not reduce *

= 4 * 6 : nat

We see here that this operation is really syntactic, and not semantic.

Exercise: Folding multiply-add with transform

Now that you suffered through the definition of fold_muladd, define it again using transform. transform takes h : tm_handler and transforms t : term into another term. The handler is typically of the form fun t k => ... where t is the subterm to inspect/transform and k is a continuation. Calling k on a subterm (or on t itself) gives control back to transform which will decompose the subterm once, and then call the handler again on the subsequent subterms.

Definition muladd_handler : tm_handler :=
  REPLACE_ME.

Definition fold_muladd_alt :=
  transform muladd_handler.

(* Remove the Fail once muladd_handler is defined. *)
The command has indeed failed with message: inspect_term: cannot recognize (REPLACE_ME (tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "add") []) [tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "mul") []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]]]]) (fun t : term => match t with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev0 args0 => tEvar ev0 ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args0 => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) args) | tSort s => tSort s | tCast t0 kind v => tCast ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind0 v0 => tCast (transform h t3) kind0 (transform h v0) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t3 => tProj proj (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME t0) kind ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind0 v0 => tCast (transform h t3) kind0 (transform h v0) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t3 => tProj proj (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME v) | tProd na ty body => tProd na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME body) | tLambda na ty body => tLambda na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME body) | tLetIn na def0 def_ty body => tLetIn na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME def0) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME def_ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME body) | tApp f args => tApp ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args0 => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f0 args0 => tApp (transform h f0) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f0 => tFloat f0 | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args0 => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f0 args0 => tApp (transform h f0) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f0 => tFloat f0 | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, _, preturn) := p in preturn) |} ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t0 => tProj proj ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind v => tCast (transform h t3) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj0 t3 => tProj proj0 (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME t0) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, dtype, _, _) := a in dtype); dbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, dtype, _, _) := a in dtype); dbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def0 ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME a :: map l0 end) arr) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME def0) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME ty) end)) (maybe you forgot to reduce it?)
The command has indeed failed with message: inspect_term: cannot recognize (REPLACE_ME (tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "add") []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]; tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "add") []) [tApp (tConst (MPfile [ "Nat"; "Init"; "Corelib"], "mul") []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]]]]]) (fun t : term => match t with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev0 args0 => tEvar ev0 ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args0 => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) args) | tSort s => tSort s | tCast t0 kind v => tCast ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind0 v0 => tCast (transform h t3) kind0 (transform h v0) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t3 => tProj proj (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME t0) kind ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind0 v0 => tCast (transform h t3) kind0 (transform h v0) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t3 => tProj proj (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME v) | tProd na ty body => tProd na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME body) | tLambda na ty body => tLambda na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME body) | tLetIn na def0 def_ty body => tLetIn na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME def0) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME def_ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME body) | tApp f args => tApp ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args0 => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f0 args0 => tApp (transform h f0) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f0 => tFloat f0 | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args0 => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f0 args0 => tApp (transform h f0) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f0 => tFloat f0 | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, _, preturn) := p in preturn) |} ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t0 => tProj proj ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind v => tCast (transform h t3) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj0 t3 => tProj proj0 (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME t0) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, dtype, _, _) := a in dtype); dbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, dtype, _, _) := a in dtype); dbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def0 ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME a :: map l0 end) arr) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME def0) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME ty) end)) (maybe you forgot to reduce it?)
The command has indeed failed with message: inspect_term: cannot recognize (REPLACE_ME (tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "add") []) [tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "add") []) [tApp (tConst (MPfile [ "Nat"; "Init"; "Corelib"], "mul") []) [tApp (tConst ( MPfile ["Nat"; "Init"; "Corelib"], "add") []) [tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "mul") []) [ tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]]]]]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]; tApp (tConst ( MPfile ["Nat"; "Init"; "Corelib"], "add") []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]; tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "add") []) [ tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "mul") []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]]]]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]; tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "add") []) [tApp (tConst (MPfile [ "Nat"; "Init"; "Corelib"], "mul") []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [ tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]]]]]) (fun t : term => match t with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev0 args0 => tEvar ev0 ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args0 => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) args) | tSort s => tSort s | tCast t0 kind v => tCast ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind0 v0 => tCast (transform h t3) kind0 (transform h v0) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t3 => tProj proj (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME t0) kind ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind0 v0 => tCast (transform h t3) kind0 (transform h v0) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t3 => tProj proj (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME v) | tProd na ty body => tProd na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME body) | tLambda na ty body => tLambda na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty0 body0 => tProd na0 (transform h ty0) (transform h body0) | tLambda na0 ty0 body0 => tLambda na0 (transform h ty0) (transform h body0) | tLetIn na0 def def_ty body0 => tLetIn na0 (transform h def) (transform h def_ty) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty0 => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty0) end)) REPLACE_ME body) | tLetIn na def0 def_ty body => tLetIn na ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME def0) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME def_ty) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na0 ty body0 => tProd na0 (transform h ty) (transform h body0) | tLambda na0 ty body0 => tLambda na0 (transform h ty) (transform h body0) | tLetIn na0 def def_ty0 body0 => tLetIn na0 (transform h def) (transform h def_ty0) (transform h body0) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME body) | tApp f args => tApp ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args0 => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f0 args0 => tApp (transform h f0) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f0 => tFloat f0 | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args0 => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f0 args0 => tApp (transform h f0) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args0) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f0 => tFloat f0 | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, _, preturn) := p in preturn) |} ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind0 u => tInd ind0 u | tConstruct ind0 idx u => tConstruct ind0 idx u | tCase ind0 p0 discr0 brs0 => tCase ind0 {| puinst := let (puinst, _, _, _) := p0 in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p0 in pparams); pcontext := let (_, _, pcontext, _) := p0 in pcontext; preturn := transform h (let (_, _, _, preturn) := p0 in preturn) |} (transform h discr0) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs0) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t0 => tProj proj ((fix transform (h : term -> (term -> term) -> term) (t1 : term) {struct t1} : term := h t1 (fun t2 : term => match t2 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t3 kind v => tCast (transform h t3) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx u => tConstruct ind idx u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj0 t3 => tProj proj0 (transform h t3) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME t0) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, dtype, _, _) := a in dtype); dbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, dtype, _, _) := a in dtype); dbody := (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty body => tProd na (transform h ty) (transform h body) | tLambda na ty body => tLambda na (transform h ty) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u => tConst c u | tInd ind u => tInd ind u | tConstruct ind idx0 u => tConstruct ind idx0 u | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix0 idx0 => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tCoFix mfix0 idx0 => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix0) idx0 | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def ty => tArray u ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr) (transform h def) (transform h ty) end)) REPLACE_ME (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u arr def0 ty => tArray u ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => (fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map0 (l1 : list (branch term)) : list (branch term) := match l1 with | [] => [] | a0 :: l2 => {| bcontext := let (bcontext, _) := a0 in bcontext; bbody := transform h (let (_, bbody) := a0 in bbody) |} :: map0 l2 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map0 (l1 : list (def term)) : list (def term) := match l1 with | [] => [] | a0 :: l2 => {| dname := let (dname, _, _, _) := a0 in dname; dtype := transform h (let (_, dtype, _, _) := a0 in dtype); dbody := transform h (let (_, _, dbody, _) := a0 in dbody); rarg := let (_, _, _, rarg) := a0 in rarg |} :: map0 l2 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map0 (l1 : list term) : list term := match l1 with | [] => [] | a0 :: l2 => transform h a0 :: map0 l2 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME a :: map l0 end) arr) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME def0) ((fix transform (h : term -> (term -> term) -> term) (t0 : term) {struct t0} : term := h t0 (fun t1 : term => match t1 with | tRel n => tRel n | tVar id => tVar id | tEvar ev args => tEvar ev ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tSort s => tSort s | tCast t2 kind v => tCast (transform h t2) kind (transform h v) | tProd na ty0 body => tProd na (transform h ty0) (transform h body) | tLambda na ty0 body => tLambda na (transform h ty0) (transform h body) | tLetIn na def def_ty body => tLetIn na (transform h def) (transform h def_ty) (transform h body) | tApp f args => tApp (transform h f) ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) args) | tConst c u0 => tConst c u0 | tInd ind u0 => tInd ind u0 | tConstruct ind idx u0 => tConstruct ind idx u0 | tCase ind p discr brs => tCase ind {| puinst := let (puinst, _, _, _) := p in puinst; pparams := (fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) (let (_, pparams, _, _) := p in pparams); pcontext := let (_, _, pcontext, _) := p in pcontext; preturn := transform h (let (_, _, _, preturn) := p in preturn) |} (transform h discr) ((fix map (l : list (branch term)) : list (branch term) := match l with | [] => [] | a :: l0 => {| bcontext := let (bcontext, _) := a in bcontext; bbody := transform h (let (_, bbody) := a in bbody) |} :: map l0 end) brs) | tProj proj t2 => tProj proj (transform h t2) | tFix mfix idx => tFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tCoFix mfix idx => tCoFix ((fix map (l : list (def term)) : list (def term) := match l with | [] => [] | a :: l0 => {| dname := let (dname, _, _, _) := a in dname; dtype := transform h (let (_, dtype, _, _) := a in dtype); dbody := transform h (let (_, _, dbody, _) := a in dbody); rarg := let (_, _, _, rarg) := a in rarg |} :: map l0 end) mfix) idx | tInt i => tInt i | tFloat f => tFloat f | tString s => tString s | tArray u0 arr0 def ty0 => tArray u0 ((fix map (l : list term) : list term := match l with | [] => [] | a :: l0 => transform h a :: map l0 end) arr0) (transform h def) (transform h ty0) end)) REPLACE_ME ty) end)) (maybe you forgot to reduce it?)

If you want, you can also do the same for assumptions by using tm_fold which is similar but implements a fold instead.

Definition assum_fold (env : global_env) : fold_handler (list kername) :=
  REPLACE_ME.

Definition assumptions_alt p : list kername :=
  tm_fold (assum_fold p.1) [] p.2.

= REPLACE_ME (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []) [] (fun (x : list (modpath × string)) (x0 : term) => match x0 with | tEvar _ args => (fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) args x | tCast t _ v => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v0 => Ffix x1 x2 (Ffix x1 x2 x5 t0) v0 | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v0 => Ffix x1 x2 (Ffix x1 x2 x5 t0) v0 | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x t) v | tProd _ ty body | tLambda _ ty body => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty0 body0 | tLambda _ ty0 body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty0) body0 | tLetIn _ def def_ty body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty0 body0 | tLambda _ ty0 body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty0) body0 | tLetIn _ def def_ty body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x ty) body | tLetIn _ def0 def_ty body => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x def0) def_ty) body | tApp f args => (fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f0 args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 (Ffix0 x5 x6 x9 f0) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) args ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args0 => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args0 x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f0 args0 => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args0 (Ffix x1 x2 x5 f0) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x f) | tCase _ type_info discr branches => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info0 discr0 branches0 => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : list (branch term)) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info0 discr0 branches0 => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 match x3 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info0 discr0 branches0 => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) match type_info with | {| pparams := pparams |} => pparams end ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info0 discr0 branches0 => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v => Ffix x1 x2 (Ffix x1 x2 x5 t0) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x t | tFix mfix _ | tCoFix mfix _ => (fix Ffix (x1 : list (def term)) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix0 _ | tCoFix mfix0 _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix0 x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix0 _ | tCoFix mfix0 _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix0 x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 match x3 with | {| dtype := dtype |} => dtype end) match x3 with | {| dbody := dbody |} => dbody end) end) mfix x | tArray _ arr default type => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr0 default0 type0 => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr0 x5) default0) type0 | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr0 default0 type0 => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr0 x5) default0) type0 | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr0 default0 type0 => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr0 x9) default0) type0 | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) arr x) default) type | _ => x end) : list kername
= REPLACE_ME (tConst (MPfile ["lesson4_part3"], "foo_ax") []) [] (fun (x : list (modpath × string)) (x0 : term) => match x0 with | tEvar _ args => (fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) args x | tCast t _ v => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v0 => Ffix x1 x2 (Ffix x1 x2 x5 t0) v0 | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v0 => Ffix x1 x2 (Ffix x1 x2 x5 t0) v0 | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x t) v | tProd _ ty body | tLambda _ ty body => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty0 body0 | tLambda _ ty0 body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty0) body0 | tLetIn _ def def_ty body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty0 body0 | tLambda _ ty0 body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty0) body0 | tLetIn _ def def_ty body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x ty) body | tLetIn _ def0 def_ty body => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x def0) def_ty) body | tApp f args => (fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f0 args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 (Ffix0 x5 x6 x9 f0) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) args ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args0 => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args0 x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f0 args0 => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args0 (Ffix x1 x2 x5 f0) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x f) | tCase _ type_info discr branches => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info0 discr0 branches0 => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : list (branch term)) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info0 discr0 branches0 => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 match x3 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info0 discr0 branches0 => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) match type_info with | {| pparams := pparams |} => pparams end ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info0 discr0 branches0 => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v => Ffix x1 x2 (Ffix x1 x2 x5 t0) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x t | tFix mfix _ | tCoFix mfix _ => (fix Ffix (x1 : list (def term)) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix0 _ | tCoFix mfix0 _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix0 x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix0 _ | tCoFix mfix0 _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix0 x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 match x3 with | {| dtype := dtype |} => dtype end) match x3 with | {| dbody := dbody |} => dbody end) end) mfix x | tArray _ arr default type => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr0 default0 type0 => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr0 x5) default0) type0 | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr0 default0 type0 => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr0 x5) default0) type0 | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr0 default0 type0 => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr0 x9) default0) type0 | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) arr x) default) type | _ => x end) : list kername
= REPLACE_ME (tConst (MPfile ["lesson4_part3"], "bar_ax") []) [] (fun (x : list (modpath × string)) (x0 : term) => match x0 with | tEvar _ args => (fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) args x | tCast t _ v => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v0 => Ffix x1 x2 (Ffix x1 x2 x5 t0) v0 | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v0 => Ffix x1 x2 (Ffix x1 x2 x5 t0) v0 | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x t) v | tProd _ ty body | tLambda _ ty body => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty0 body0 | tLambda _ ty0 body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty0) body0 | tLetIn _ def def_ty body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty0 body0 | tLambda _ ty0 body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty0) body0 | tLetIn _ def def_ty body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x ty) body | tLetIn _ def0 def_ty body => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x def0) def_ty) body | tApp f args => (fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f0 args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 (Ffix0 x5 x6 x9 f0) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) args ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args0 => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args0 x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f0 args0 => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args0 (Ffix x1 x2 x5 f0) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x f) | tCase _ type_info discr branches => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info0 discr0 branches0 => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : list (branch term)) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info0 discr0 branches0 => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 match x3 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info0 discr0 branches0 => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) match type_info with | {| pparams := pparams |} => pparams end ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info0 discr0 branches0 => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v => Ffix x1 x2 (Ffix x1 x2 x5 t0) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x t | tFix mfix _ | tCoFix mfix _ => (fix Ffix (x1 : list (def term)) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix0 _ | tCoFix mfix0 _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix0 x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix0 _ | tCoFix mfix0 _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix0 x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 match x3 with | {| dtype := dtype |} => dtype end) match x3 with | {| dbody := dbody |} => dbody end) end) mfix x | tArray _ arr default type => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr0 default0 type0 => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr0 x5) default0) type0 | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr0 default0 type0 => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr0 x5) default0) type0 | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr0 default0 type0 => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr0 x9) default0) type0 | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) arr x) default) type | _ => x end) : list kername
= REPLACE_ME (tConst (MPdot (MPfile ["lesson4_part3"]) "test", "DNE") []) [] (fun (x : list (modpath × string)) (x0 : term) => match x0 with | tEvar _ args => (fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) args x | tCast t _ v => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v0 => Ffix x1 x2 (Ffix x1 x2 x5 t0) v0 | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v0 => Ffix x1 x2 (Ffix x1 x2 x5 t0) v0 | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x t) v | tProd _ ty body | tLambda _ ty body => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty0 body0 | tLambda _ ty0 body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty0) body0 | tLetIn _ def def_ty body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty0 body0 | tLambda _ ty0 body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty0) body0 | tLetIn _ def def_ty body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x ty) body | tLetIn _ def0 def_ty body => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body0 | tLambda _ ty body0 => Ffix x1 x2 (Ffix x1 x2 x5 ty) body0 | tLetIn _ def def_ty0 body0 => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty0) body0 | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x def0) def_ty) body | tApp f args => (fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f0 args0 => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args0 (Ffix0 x5 x6 x9 f0) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) args ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args0 => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args0 x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f0 args0 => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args0 (Ffix x1 x2 x5 f0) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x f) | tCase _ type_info discr branches => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info0 discr0 branches0 => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : list (branch term)) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info0 discr0 branches0 => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 match x3 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info0 discr0 branches0 => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) match type_info with | {| pparams := pparams |} => pparams end ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info0 discr0 branches0 => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches0 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info0 with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info0 with | {| preturn := preturn |} => preturn end))) discr0 | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t0 _ v => Ffix x1 x2 (Ffix x1 x2 x5 t0) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t0 => Ffix x1 x2 x5 t0 | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr default type => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr x5) default) type | _ => x5 end)) (list (modpath × string)) REPLACE_ME x t | tFix mfix _ | tCoFix mfix _ => (fix Ffix (x1 : list (def term)) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix0 _ | tCoFix mfix0 _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix0 x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix0 _ | tCoFix mfix0 _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix0 x9 | tArray _ arr default type => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr x9) default) type | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 match x3 with | {| dtype := dtype |} => dtype end) match x3 with | {| dbody := dbody |} => dbody end) end) mfix x | tArray _ arr default type => (fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr0 default0 type0 => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr0 x5) default0) type0 | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : Type) (x2 : term -> x1 -> (x1 -> term -> x1) -> x1) (x3 : x1) (x4 : term) {struct x4} : x1 := x2 x4 x3 (fun (x5 : x1) (x6 : term) => match x6 with | tEvar _ args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args x5 | tCast t _ v => Ffix x1 x2 (Ffix x1 x2 x5 t) v | tProd _ ty body | tLambda _ ty body => Ffix x1 x2 (Ffix x1 x2 x5 ty) body | tLetIn _ def def_ty body => Ffix x1 x2 (Ffix x1 x2 (Ffix x1 x2 x5 def) def_ty) body | tApp f args => (fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) args (Ffix x1 x2 x5 f) | tCase _ type_info discr branches => Ffix x1 x2 ((fix Ffix0 (x7 : list (branch term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 match x9 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix x1 x2 x5 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix x1 x2 x5 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix0 (x7 : list (def term)) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 (Ffix x1 x2 x8 match x9 with | {| dtype := dtype |} => dtype end) match x9 with | {| dbody := dbody |} => dbody end) end) mfix x5 | tArray _ arr0 default0 type0 => Ffix x1 x2 (Ffix x1 x2 ((fix Ffix0 (x7 : list term) (x8 : x1) {struct x7} : x1 := match x7 with | [] => x8 | x9 :: x10 => Ffix0 x10 (Ffix x1 x2 x8 x9) end) arr0 x5) default0) type0 | _ => x5 end)) (list (modpath × string)) REPLACE_ME ((fix Ffix (x1 : list term) (x2 : list (modpath × string)) {struct x1} : list (modpath × string) := match x1 with | [] => x2 | x3 :: x4 => Ffix x4 ((fix Ffix0 (x5 : Type) (x6 : term -> x5 -> (x5 -> term -> x5) -> x5) (x7 : x5) (x8 : term) {struct x8} : x5 := x6 x8 x7 (fun (x9 : x5) (x10 : term) => match x10 with | tEvar _ args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args x9 | tCast t _ v => Ffix0 x5 x6 (Ffix0 x5 x6 x9 t) v | tProd _ ty body | tLambda _ ty body => Ffix0 x5 x6 (Ffix0 x5 x6 x9 ty) body | tLetIn _ def def_ty body => Ffix0 x5 x6 (Ffix0 x5 x6 (Ffix0 x5 x6 x9 def) def_ty) body | tApp f args => (fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) args (Ffix0 x5 x6 x9 f) | tCase _ type_info discr branches => Ffix0 x5 x6 ((fix Ffix1 (x11 : list (branch term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 match x13 with | {| bbody := bbody |} => bbody end) end) branches ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) match type_info with | {| pparams := pparams |} => pparams end (Ffix0 x5 x6 x9 match type_info with | {| preturn := preturn |} => preturn end))) discr | tProj _ t => Ffix0 x5 x6 x9 t | tFix mfix _ | tCoFix mfix _ => (fix Ffix1 (x11 : list (def term)) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 (Ffix0 x5 x6 x12 match x13 with | {| dtype := dtype |} => dtype end) match x13 with | {| dbody := dbody |} => dbody end) end) mfix x9 | tArray _ arr0 default0 type0 => Ffix0 x5 x6 (Ffix0 x5 x6 ((fix Ffix1 (x11 : list term) (x12 : x5) {struct x11} : x5 := match x11 with | [] => x12 | x13 :: x14 => Ffix1 x14 (Ffix0 x5 x6 x12 x13) end) arr0 x9) default0) type0 | _ => x9 end)) (list (modpath × string)) REPLACE_ME x2 x3) end) arr x) default) type | _ => x end) : list kername
Exercise: Reification

Write a command reify that turns a Rocq expression of type nat into an expression of the following datatype. Expressions that do not start with + or * are reified as constants.

Inductive arith :=
| aPlus : arith -> arith -> arith
| aTimes : arith -> arith -> arith
| aConst : nat -> arith.

#[bypass_check(guard)] Fixpoint reify (t : term) : term :=
  REPLACE_ME.


4 * (9 + 12) + (3 + 1 * 7) = 2

4 * (9 + 12) + (3 + 1 * 7) = 2
Admitted.
Exercise: Instantiating axioms (advanced)

Write a meta-program that takes a definition potentially using an axiom and a proof of said axiom to produce a new definition, equal to the original one except that uses of the axiom are replaced by the proof.

The axiom to be replaced is going to be given as a kername, like those collected by assumptions. You don't actually have to verify that the constant is indeed an axiom.

Definition instantiate_axiom (ax : kername) (prf : term) : term -> term :=
  REPLACE_ME.

Axiom mystery : nat.

Definition what :=
  mystery * 3.

(* Remove the Fail once instantiate_axiom is defined. *)
The command has indeed failed with message: inspect_term: cannot recognize (REPLACE_ME (tApp (tConst (MPfile ["Nat"; "Init"; "Corelib"], "mul") []) [tConst (MPfile ["lesson4_part3"], "mystery") []; tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tApp (tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 1 []) [tConstruct {| inductive_mind := (MPfile ["Datatypes"; "Init"; "Corelib"], "nat"); inductive_ind := 0 |} 0 []]]]])) (maybe you forgot to reduce it?)
Exercise: Removing axioms (advanced)

A slightly harder version would be to turn a definition using axioms to one assuming these axioms with an implication.

For instance, for the foo_ax defined above which uses funext, we would expect something of the following type: (forall A B (f g : A -> B), (forall x, f x = g x) -> f = g) -> (fun n => n + 0) = (fun n => n)

You can also use a variant of transform called transform_nb which also tracks the number of introduced variables (to know how much to lift by).

Definition unaxiom (p : global_env * term) : term :=
  REPLACE_ME.

(* Remove the Fail once unaxiom is defined. *)
The command has indeed failed with message: inspect_term: cannot recognize REPLACE_ME (maybe you forgot to reduce it?)
Axiom unknown : bool. Axiom random : nat -> nat. Definition test f := if unknown then what else random (f 9).
The command has indeed failed with message: inspect_term: cannot recognize REPLACE_ME (maybe you forgot to reduce it?)