Debian Codegraph @

pretyping/tacred.mli

raw symbols SCIP
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 Names
12 open Environ
13 open Evd
14 open EConstr
15 open Reductionops
16 open Pattern
17 open Locus
18 open Ltac_pretype
19
20 (** Here the semantics is completely unclear.
21 What does "Hint Unfold t" means when "t" is a parameter?
22 Does the user mean "Unfold X.t" or does she mean "Unfold y"
23 where X.t is later on instantiated with y? I choose the first
24 interpretation (i.e. an evaluable reference is never expanded). *)
25 val subst_evaluable_reference :
26 Mod_subst.substitution -> Evaluable.t -> Evaluable.t
27
28 type reduction_tactic_error =
29 InvalidAbstraction of env * evar_map * constr * (env * Type_errors.type_error)
30
31 type 'a change = NoChange | Changed of 'a
32 type change_function = env -> evar_map -> constr -> (evar_map * constr) change
33
34 exception ReductionTacticError of reduction_tactic_error
35
36 (** {6 Reduction functions associated to tactics. } *)
37
38 (** Evaluable global reference *)
39
40 val is_evaluable : Environ.env -> Evd.evar_map -> Evaluable.t -> bool
41
42 exception NotEvaluableRef of GlobRef.t
43 val error_not_evaluable : ?loc:Loc.t -> GlobRef.t -> 'a
44
45 val evaluable_of_global_reference :
46 Environ.env -> GlobRef.t -> Evaluable.t
47 (** Fails on opaque constants and variables
48 (both those without bodies and those marked Opaque in the conversion oracle). *)
49
50 val soft_evaluable_of_global_reference :
51 ?loc:Loc.t -> GlobRef.t -> Evaluable.t
52 (** Succeeds for any constant or variable even if marked opaque or otherwise not evaluable. *)
53
54 val global_of_evaluable_reference :
55 Evaluable.t -> GlobRef.t
56
57 (** Red (returns None if nothing reducible) *)
58 val red_product : env -> evar_map -> constr -> constr option
59
60 (** Simpl *)
61 val simpl : reduction_function
62
63 (** Simpl only at the head *)
64 val whd_simpl : reduction_function
65
66 (** Hnf: like whd_simpl but force delta-reduction of constants that do
67 not immediately hide a non reducible fix or cofix *)
68 val hnf_constr : reduction_function
69
70 (** Variant of the above that does not perform nf-βι *)
71 val hnf_constr0 : reduction_function
72
73 (** Unfold *)
74 val unfoldn :
75 (occurrences * Evaluable.t) list -> reduction_function
76
77 (** Fold *)
78 val fold_commands : constr list -> reduction_function
79
80 (** Pattern *)
81 val pattern_occs : (occurrences * constr) list -> change_function
82
83 (** Rem: Lazy strategies are defined in Reduction *)
84
85 (** Call by value strategy (uses Closures) *)
86 val cbv_norm_flags : RedFlags.reds -> strong:bool -> reduction_function
87 val cbv_beta : reduction_function
88 val cbv_betaiota : reduction_function
89 val cbv_betadeltaiota : reduction_function
90 val whd_compute : reduction_function
91 val compute : reduction_function (** = [cbv_betadeltaiota] *)
92
93 (** [reduce_to_atomic_ind env sigma t] puts [t] in the form [t'=(I args)]
94 with [I] an inductive definition;
95 returns [I] and [t'] or fails with a user error *)
96 val reduce_to_atomic_ind : env -> evar_map -> types -> (inductive * EInstance.t) * types
97
98 (** [reduce_to_quantified_ind env sigma t] puts [t] in the form
99 [t'=(x1:A1)..(xn:An)(I args)] with [I] an inductive definition;
100 returns [I] and [t'] or fails with a user error *)
101 val reduce_to_quantified_ind : env -> evar_map -> types -> (inductive * EInstance.t) * types
102
103 (** Same as {!reduce_to_quantified_ind} but more efficient because it does not
104 return the normalized type. *)
105 val eval_to_quantified_ind : env -> evar_map -> types -> (inductive * EInstance.t)
106
107 (** [reduce_to_quantified_ref env sigma ref t] try to put [t] in the form
108 [t'=(x1:A1)..(xn:An)(ref args)]. When this is not possible, if [allow_failure]
109 is specified, [t] is unfolded until the point where this impossibility is plainly
110 visible. Otherwise, it fails with user error. *)
111 val reduce_to_quantified_ref :
112 ?allow_failure:bool -> env -> evar_map -> GlobRef.t -> types -> types
113
114 val reduce_to_atomic_ref :
115 ?allow_failure:bool -> env -> evar_map -> GlobRef.t -> types -> types
116
117 val find_hnf_rectype :
118 env -> evar_map -> types -> (inductive * EInstance.t) * constr list
119
120 val contextually : bool -> occurrences * constr_pattern ->
121 (patvar_map -> reduction_function) -> reduction_function
122
123 val e_contextually : bool -> occurrences * constr_pattern ->
124 (patvar_map -> change_function) -> change_function
125
126 (** Errors if the inductive is not allowed for pattern-matching. **)
127 val check_privacy : env -> inductive -> unit