| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
open Names |
| 12 |
open Constr |
| 13 |
open EConstr |
| 14 |
open Univ |
| 15 |
open Evd |
| 16 |
open Environ |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
exception Elimconst |
| 21 |
|
| 22 |
type meta_handler = { meta_value : metavariable -> EConstr.t option } |
| 23 |
|
| 24 |
val debug_RAKAM : CDebug.t |
| 25 |
|
| 26 |
module CredNative : Primred.RedNative with |
| 27 |
type elem = EConstr.t and type args = EConstr.t array and type evd = Evd.evar_map |
| 28 |
and type uinstance = EInstance.t |
| 29 |
|
| 30 |
|
| 31 |
module ReductionBehaviour : sig |
| 32 |
|
| 33 |
type t = NeverUnfold | UnfoldWhen of when_flags | UnfoldWhenNoMatch of when_flags |
| 34 |
and when_flags = { recargs : int list ; nargs : int option } |
| 35 |
|
| 36 |
module Db : sig |
| 37 |
type t |
| 38 |
val get : unit -> t |
| 39 |
val empty : t |
| 40 |
val print : t -> Constant.t -> Pp.t |
| 41 |
val all_never_unfold : t -> Cpred.t |
| 42 |
end |
| 43 |
|
| 44 |
val set : local:bool -> Constant.t -> t option -> unit |
| 45 |
val get_from_db : Db.t -> Constant.t -> t option |
| 46 |
val get : Constant.t -> t option |
| 47 |
val print : Constant.t -> Pp.t |
| 48 |
end |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
type effect_name = string |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
val declare_reduction_effect : effect_name -> |
| 57 |
(Environ.env -> Evd.evar_map -> Constr.constr -> unit) -> unit |
| 58 |
|
| 59 |
|
| 60 |
val set_reduction_effect : Libobject.locality -> Constant.t -> effect_name -> unit |
| 61 |
|
| 62 |
|
| 63 |
val reduction_effect_hook : Environ.env -> Evd.evar_map -> Constant.t -> |
| 64 |
Constr.constr Lazy.t -> unit |
| 65 |
|
| 66 |
module Stack : sig |
| 67 |
type app_node |
| 68 |
|
| 69 |
val pr_app_node : (EConstr.t -> Pp.t) -> app_node -> Pp.t |
| 70 |
|
| 71 |
type case_stk |
| 72 |
|
| 73 |
val mkCaseStk : case_info * EInstance.t * EConstr.t array * EConstr.case_return * EConstr.t pcase_invert * EConstr.case_branch array -> case_stk |
| 74 |
|
| 75 |
type member = |
| 76 |
| App of app_node |
| 77 |
| Case of case_stk |
| 78 |
| Proj of Projection.t * ERelevance.t |
| 79 |
| Fix of EConstr.fixpoint * t |
| 80 |
| Primitive of CPrimitives.t * (Constant.t * EInstance.t) * t * CPrimitives.args_red |
| 81 |
and t = member list |
| 82 |
|
| 83 |
val pr : (EConstr.t -> Pp.t) -> t -> Pp.t |
| 84 |
|
| 85 |
val empty : t |
| 86 |
val is_empty : t -> bool |
| 87 |
|
| 88 |
val compare_shape : t -> t -> bool |
| 89 |
|
| 90 |
exception IncompatibleFold2 |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
val fold2 : ('a -> constr -> constr -> 'a) -> 'a -> t -> t -> 'a |
| 96 |
|
| 97 |
|
| 98 |
val append_app : EConstr.t array -> t -> t |
| 99 |
|
| 100 |
|
| 101 |
val append_app_list : EConstr.t list -> t -> t |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
val strip_app : t -> t * t |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
val strip_n_app : int -> t -> (t * EConstr.t * t) option |
| 110 |
|
| 111 |
|
| 112 |
val decomp_rev : t -> (EConstr.t * t) option |
| 113 |
|
| 114 |
|
| 115 |
val not_purely_applicative : t -> bool |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
val list_of_app_stack : t -> constr list option |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
val args_size : t -> int |
| 124 |
|
| 125 |
|
| 126 |
val zip : evar_map -> constr * t -> constr |
| 127 |
|
| 128 |
val expand_case : env -> evar_map -> case_stk -> |
| 129 |
case_info * EInstance.t * constr array * ((rel_context * constr) * ERelevance.t) * (rel_context * constr) array |
| 130 |
end |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
type reduction_function = env -> evar_map -> constr -> constr |
| 135 |
|
| 136 |
type e_reduction_function = env -> evar_map -> constr -> evar_map * constr |
| 137 |
|
| 138 |
type stack_reduction_function = |
| 139 |
env -> evar_map -> constr -> constr * constr list |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
val clos_norm_flags : RedFlags.reds -> reduction_function |
| 144 |
val clos_whd_flags : RedFlags.reds -> reduction_function |
| 145 |
|
| 146 |
|
| 147 |
val nf_beta : reduction_function |
| 148 |
val nf_betaiota : reduction_function |
| 149 |
val nf_betaiotazeta : reduction_function |
| 150 |
val nf_zeta : reduction_function |
| 151 |
val nf_all : reduction_function |
| 152 |
val nf_evar : evar_map -> constr -> constr |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
val whd_evar : evar_map -> constr -> constr |
| 157 |
val whd_nored : ?metas:meta_handler -> reduction_function |
| 158 |
val whd_beta : reduction_function |
| 159 |
val whd_betaiota : ?metas:meta_handler -> reduction_function |
| 160 |
val whd_betaiotazeta : ?metas:meta_handler -> reduction_function |
| 161 |
val whd_all : ?metas:meta_handler -> reduction_function |
| 162 |
val whd_allnolet : reduction_function |
| 163 |
val whd_betalet : reduction_function |
| 164 |
|
| 165 |
|
| 166 |
val whd_nored_stack : ?metas:meta_handler -> stack_reduction_function |
| 167 |
val whd_beta_stack : ?metas:meta_handler -> stack_reduction_function |
| 168 |
val whd_betaiota_stack : ?metas:meta_handler -> stack_reduction_function |
| 169 |
val whd_betaiotazeta_stack : ?metas:meta_handler -> stack_reduction_function |
| 170 |
val whd_all_stack : ?metas:meta_handler -> stack_reduction_function |
| 171 |
val whd_allnolet_stack : ?metas:meta_handler -> stack_reduction_function |
| 172 |
val whd_betalet_stack : ?metas:meta_handler -> stack_reduction_function |
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
val whd_const : Constant.t -> reduction_function |
| 177 |
val whd_delta_stack : ?metas:meta_handler -> stack_reduction_function |
| 178 |
val whd_delta : reduction_function |
| 179 |
val whd_betadeltazeta_stack : ?metas:meta_handler -> stack_reduction_function |
| 180 |
val whd_betadeltazeta : reduction_function |
| 181 |
val whd_zeta_stack : ?metas:meta_handler -> stack_reduction_function |
| 182 |
val whd_zeta : reduction_function |
| 183 |
|
| 184 |
val shrink_eta : evar_map -> constr -> constr |
| 185 |
|
| 186 |
val whd_stack_gen : RedFlags.reds -> ?metas:meta_handler -> stack_reduction_function |
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
val beta_applist : evar_map -> constr * constr list -> constr |
| 191 |
|
| 192 |
val hnf_prod_app : env -> evar_map -> constr -> constr -> constr |
| 193 |
val hnf_prod_appvect : env -> evar_map -> constr -> constr array -> constr |
| 194 |
val hnf_prod_applist : env -> evar_map -> constr -> constr list -> constr |
| 195 |
val hnf_lam_app : env -> evar_map -> constr -> constr -> constr |
| 196 |
val hnf_lam_appvect : env -> evar_map -> constr -> constr array -> constr |
| 197 |
val hnf_lam_applist : env -> evar_map -> constr -> constr list -> constr |
| 198 |
|
| 199 |
val whd_decompose_prod : env -> evar_map -> types -> (Name.t EConstr.binder_annot * constr) list * types |
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
val whd_decompose_lambda : env -> evar_map -> constr -> (Name.t EConstr.binder_annot * constr) list * constr |
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
val whd_decompose_prod_decls : env -> evar_map -> types -> rel_context * types |
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
val whd_decompose_prod_n : env -> evar_map -> int -> types -> (Name.t EConstr.binder_annot * constr) list * types |
| 212 |
|
| 213 |
|
| 214 |
val whd_decompose_lambda_n : env -> evar_map -> int -> constr -> (Name.t EConstr.binder_annot * constr) list * constr |
| 215 |
|
| 216 |
|
| 217 |
val splay_arity : env -> evar_map -> constr -> (Name.t EConstr.binder_annot * constr) list * ESorts.t |
| 218 |
|
| 219 |
|
| 220 |
val dest_arity : env -> evar_map -> constr -> rel_context * ESorts.t |
| 221 |
|
| 222 |
|
| 223 |
val sort_of_arity : env -> evar_map -> constr -> ESorts.t |
| 224 |
|
| 225 |
|
| 226 |
val whd_decompose_prod_n_assum : env -> evar_map -> int -> types -> rel_context * types |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
val whd_decompose_prod_n_decls : env -> evar_map -> int -> types -> rel_context * types |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
val whd_decompose_lambda_n_assum : env -> evar_map -> int -> constr -> rel_context * constr |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
val reducible_mind_case : evar_map -> constr -> bool |
| 239 |
|
| 240 |
val find_conclusion : env -> evar_map -> constr -> (constr, constr, ESorts.t, EInstance.t, ERelevance.t) kind_of_term |
| 241 |
val is_arity : env -> evar_map -> constr -> bool |
| 242 |
val is_sort : env -> evar_map -> types -> bool |
| 243 |
|
| 244 |
val contract_fix : evar_map -> fixpoint -> constr |
| 245 |
val contract_cofix : evar_map -> cofixpoint -> constr |
| 246 |
|
| 247 |
|
| 248 |
val is_transparent : Environ.env -> Evaluable.t -> bool |
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
type conversion_test = UnivConstraints.t -> UnivConstraints.t |
| 253 |
|
| 254 |
val is_conv : ?reds:TransparentState.t -> env -> evar_map -> constr -> constr -> bool |
| 255 |
val is_conv_leq : ?reds:TransparentState.t -> env -> evar_map -> constr -> constr -> bool |
| 256 |
val is_fconv : ?reds:TransparentState.t -> conv_pb -> env -> evar_map -> constr -> constr -> bool |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
val infer_conv : ?catch_incon:bool -> ?pb:conv_pb -> ?ts:TransparentState.t -> |
| 264 |
env -> evar_map -> constr -> constr -> evar_map option |
| 265 |
|
| 266 |
val infer_conv_ustate : ?catch_incon:bool -> ?pb:conv_pb -> ?ts:TransparentState.t -> |
| 267 |
env -> evar_map -> constr -> constr -> UnivProblem.Set.t option |
| 268 |
|
| 269 |
|
| 270 |
val vm_infer_conv : ?pb:conv_pb -> env -> evar_map -> constr -> constr -> |
| 271 |
evar_map option |
| 272 |
|
| 273 |
val native_infer_conv : ?pb:conv_pb -> env -> evar_map -> constr -> constr -> |
| 274 |
evar_map option |
| 275 |
|
| 276 |
type genconv = { |
| 277 |
genconv : 'a 'err. conv_pb -> l2r:bool -> Evd.evar_map -> TransparentState.t -> |
| 278 |
Environ.env -> ('a, 'err) Conversion.generic_conversion_function |
| 279 |
} |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
val infer_conv_gen : genconv -> |
| 284 |
?catch_incon:bool -> ?pb:conv_pb -> ?ts:TransparentState.t -> env -> |
| 285 |
evar_map -> constr -> constr -> evar_map option |
| 286 |
|
| 287 |
val check_hyps_inclusion : env -> evar_map -> GlobRef.t -> Constr.named_context -> unit |
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
type state = constr * Stack.t |
| 293 |
|
| 294 |
type state_reduction_function = |
| 295 |
env -> evar_map -> state -> state |
| 296 |
|
| 297 |
val pr_state : env -> evar_map -> state -> Pp.t |
| 298 |
|
| 299 |
val whd_nored_state : ?metas:meta_handler -> state_reduction_function |
| 300 |
|
| 301 |
val whd_betaiota_deltazeta_for_iota_state : |
| 302 |
TransparentState.t -> ?metas:meta_handler -> state_reduction_function |
| 303 |
|
| 304 |
exception PatternFailure |
| 305 |
val apply_rules : (rel_context -> state -> state) -> env -> evar_map -> EInstance.t -> |
| 306 |
Declarations.machine_rewrite_rule list -> Stack.t -> econstr * Stack.t |
| 307 |
|
| 308 |
val is_head_evar : env -> evar_map -> constr -> bool |
| 309 |
|
| 310 |
exception AnomalyInConversion of exn |
| 311 |
|
| 312 |
|
| 313 |
val inferred_universes : (UGraph.t * Univ.UnivConstraints.t, Conversion.graph_inconsistency) Conversion.universe_compare |
| 314 |
|
| 315 |
val eta_expand : env -> evar_map -> etypes -> etypes -> etypes |
| 316 |
|
| 317 |
|
| 318 |
val eta_expand_instantiation : env -> evar_map -> constr array -> rel_context -> constr array |