| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | open Constr |
| 12 | open Environ |
| 13 | open CClosure |
| 14 | |
| 15 | (*********************************************************************** |
| 16 | s Reduction functions *) |
| 17 | |
| 18 | (** None of these functions do eta reduction *) |
| 19 | |
| 20 | val whd_all : ?evars:evar_handler -> env -> constr -> constr |
| 21 | |
| 22 | (************************************************************************) |
| 23 | |
| 24 | (** Builds an application node, reducing beta redexes it may produce. *) |
| 25 | val beta_applist : constr -> constr list -> constr |
| 26 | |
| 27 | (** Builds an application node, reducing beta redexes it may produce. *) |
| 28 | val beta_appvect : constr -> constr array -> constr |
| 29 | |
| 30 | (** Builds an application node, reducing beta redexe it may produce. *) |
| 31 | val beta_app : constr -> constr -> constr |
| 32 | |
| 33 | (** Pseudo-reduction rule Prod(x,A,B) a --> B[x\a] *) |
| 34 | val hnf_prod_applist : ?evars:evar_handler -> env -> types -> constr list -> types |
| 35 | |
| 36 | (** In [hnf_prod_applist_decls n c args], [c] is supposed to (whd-)reduce to |
| 37 | the form [∀Γ.t] with [Γ] of length [n] and possibly with let-ins; it |
| 38 | returns [t] with the assumptions of [Γ] instantiated by [args] and |
| 39 | the local definitions of [Γ] expanded. *) |
| 40 | val hnf_prod_applist_decls : ?evars:evar_handler -> env -> int -> types -> constr list -> types |
| 41 | |
| 42 | (** Compatibility alias for Term.lambda_appvect_decls *) |
| 43 | val betazeta_appvect : int -> constr -> constr array -> constr |
| 44 | |
| 45 | (*********************************************************************** |
| 46 | s Recognizing products and arities modulo reduction *) |
| 47 | |
| 48 | val whd_decompose_prod : ?evars:evar_handler -> env -> types -> Constr.rel_context * types |
| 49 | val whd_decompose_prod_decls : ?evars:evar_handler -> env -> types -> Constr.rel_context * types |
| 50 | val whd_decompose_lambda : ?evars:evar_handler -> env -> constr -> Constr.rel_context * constr |
| 51 | val whd_decompose_lambda_decls : ?evars:evar_handler -> env -> constr -> Constr.rel_context * constr |
| 52 | |
| 53 | (** This is typically the function to use to extract the context of a |
| 54 | Fix not already in normal form up to and including the decreasing |
| 55 | argument, counting as many lambda's as given by the decreasing |
| 56 | index + 1 *) |
| 57 | val whd_decompose_lambda_n_assum : ?evars:evar_handler -> env -> int -> constr -> Constr.rel_context * constr |
| 58 | |
| 59 | exception NotArity |
| 60 | |
| 61 | val dest_arity : ?evars:evar_handler -> env -> types -> Term.arity (* raises NotArity if not an arity *) |
| 62 | val is_arity : ?evars:evar_handler -> env -> types -> bool |
| 63 | |
| 64 | val eta_expand : ?evars:evar_handler -> env -> constr -> types -> constr |