Skip to content

Commit d17285e

Browse files
committed
Merge branch 'coq-master'
2 parents 87bcdc7 + b753aa4 commit d17285e

File tree

8 files changed

+171
-139
lines changed

8 files changed

+171
-139
lines changed

coq-builtin.elpi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ external pred coq.univ.variable.of-term i:term, o:coq.univ.variable.set.
10151015
% crafts a fresh, appropriate, universe instance and possibly unify that
10161016
% term (of the instance it contains) with another one.
10171017

1018-
% Universes level instance for a universe-polymoprhic constant
1018+
% Universes level instance for a universe-polymorphic constant
10191019
typeabbrev univ-instance (ctype "univ-instance").
10201020

10211021

src/coq_elpi_HOAS.ml

Lines changed: 72 additions & 58 deletions
Large diffs are not rendered by default.

src/coq_elpi_HOAS.mli

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ type hole_mapping =
1919
type uinstanceoption =
2020
| NoInstance
2121
(* the elpi command involved has to generate a fresh instance *)
22-
| ConcreteInstance of Univ.Instance.t
22+
| ConcreteInstance of UVars.Instance.t
2323
(* a concrete instance was provided, the command will use it *)
2424
| VarInstance of (FlexibleData.Elpi.t * RawData.term list * inv_rel_key)
2525
(* a variable was provided, the command will compute the instance to unify with it *)
2626

2727
type universe_decl = (Univ.Level.t list * bool) * (Univ.Constraints.t * bool)
28-
type universe_decl_cumul = ((Univ.Level.t * Univ.Variance.t option) list * bool) * (Univ.Constraints.t * bool)
28+
type universe_decl_cumul = ((Univ.Level.t * UVars.Variance.t option) list * bool) * (Univ.Constraints.t * bool)
2929
type universe_decl_option =
3030
| NotUniversePolymorphic
3131
| Cumulative of universe_decl_cumul
@@ -45,7 +45,7 @@ type options = {
4545
universe_decl : universe_decl_option;
4646
reversible : bool option;
4747
keepunivs : bool option;
48-
redflags : CClosure.RedFlags.reds option;
48+
redflags : RedFlags.reds option;
4949
no_tc: bool option;
5050
}
5151

@@ -114,7 +114,7 @@ val lp2inductive_entry :
114114
State.t * (Entries.mutual_inductive_entry * Univ.ContextSet.t * UnivNames.universe_binders * (bool * record_field_spec list) option * DeclareInd.one_inductive_impls list) * Conversion.extra_goals
115115

116116
val inductive_decl2lp :
117-
depth:int -> empty coq_context -> constraints -> State.t -> (Names.MutInd.t * Univ.Instance.t * (Declarations.mutual_inductive_body * Declarations.one_inductive_body) * (Glob_term.binding_kind list * Glob_term.binding_kind list list)) ->
117+
depth:int -> empty coq_context -> constraints -> State.t -> (Names.MutInd.t * UVars.Instance.t * (Declarations.mutual_inductive_body * Declarations.one_inductive_body) * (Glob_term.binding_kind list * Glob_term.binding_kind list list)) ->
118118
State.t * term * Conversion.extra_goals
119119

120120
val inductive_entry2lp :
@@ -145,7 +145,7 @@ val opt2unspec : 'a option -> 'a Elpi.Builtin.unspec
145145

146146
val in_elpi_gr : depth:int -> State.t -> Names.GlobRef.t -> term
147147
val in_elpi_poly_gr : depth:int -> State.t -> Names.GlobRef.t -> term -> term
148-
val in_elpi_poly_gr_instance : depth:int -> State.t -> Names.GlobRef.t -> Univ.Instance.t -> term
148+
val in_elpi_poly_gr_instance : depth:int -> State.t -> Names.GlobRef.t -> UVars.Instance.t -> term
149149
val in_elpi_flex_sort : term -> term
150150
val in_elpi_sort : depth:int -> state -> Sorts.t -> state * term
151151
val in_elpi_prod : Name.t -> term -> term -> term
@@ -183,10 +183,10 @@ type primitive_value =
183183
| Projection of Projection.t
184184
val primitive_value : primitive_value Conversion.t
185185
val in_elpi_primitive : depth:int -> state -> primitive_value -> state * term
186-
val uinstance : Univ.Instance.t Conversion.t
186+
val uinstance : UVars.Instance.t Conversion.t
187187

188188
val universe_constraint : Univ.univ_constraint Conversion.t
189-
val universe_variance : (Univ.Level.t * Univ.Variance.t option) Conversion.t
189+
val universe_variance : (Univ.Level.t * UVars.Variance.t option) Conversion.t
190190
val universe_decl : universe_decl Conversion.t
191191
val universe_decl_cumul : universe_decl_cumul Conversion.t
192192

@@ -202,10 +202,10 @@ module UnivLevelSet : Elpi.API.Utils.Set.S with type elt = Univ.Level.t
202202

203203
val compute_with_uinstance :
204204
depth:int -> options -> state ->
205-
(state -> 'a -> Univ.Instance.t option -> state * 'c * Univ.Instance.t option) ->
205+
(state -> 'a -> UVars.Instance.t option -> state * 'c * UVars.Instance.t option) ->
206206
'a ->
207-
Univ.Instance.t option ->
208-
state * 'c * Univ.Instance.t option * Conversion.extra_goals
207+
UVars.Instance.t option ->
208+
state * 'c * UVars.Instance.t option * Conversion.extra_goals
209209

210210
(* CData relevant for other modules, e.g the one exposing Coq's API *)
211211
val universe_level_variable : Univ.Level.t Conversion.t
@@ -224,7 +224,7 @@ val name : Name.t Conversion.t
224224

225225
type global_or_pglobal =
226226
| Global of term option
227-
| PGlobal of term option * Univ.Instance.t option
227+
| PGlobal of term option * UVars.Instance.t option
228228
| NotGlobal
229229
| Var
230230
val is_global_or_pglobal : depth:int -> term -> global_or_pglobal
@@ -236,7 +236,7 @@ val in_coq_modpath : depth:int -> term -> Names.ModPath.t
236236
val modpath : Names.ModPath.t Conversion.t
237237
val modtypath : Names.ModPath.t Conversion.t
238238
val module_inline_default : Declaremods.inline Conversion.t
239-
val reduction_flags : CClosure.RedFlags.reds Conversion.t
239+
val reduction_flags : RedFlags.reds Conversion.t
240240

241241
type module_item =
242242
| Module of Names.ModPath.t * module_item list
@@ -255,12 +255,12 @@ type record_field_att =
255255
val record_field_att : record_field_att Conversion.t
256256

257257
val add_constraints : State.t -> UnivProblem.Set.t -> State.t
258-
val mk_global : State.t -> Names.GlobRef.t -> Univ.Instance.t option ->
259-
State.t * EConstr.t * Univ.Instance.t option
260-
val poly_ctx_size_of_gref : Environ.env -> Names.GlobRef.t -> int
258+
val mk_global : State.t -> Names.GlobRef.t -> UVars.Instance.t option ->
259+
State.t * EConstr.t * UVars.Instance.t option
260+
val poly_ctx_size_of_gref : Environ.env -> Names.GlobRef.t -> int * int
261261
val body_of_constant :
262-
State.t -> Names.Constant.t -> Univ.Instance.t option ->
263-
State.t * EConstr.t option * Univ.Instance.t option
262+
State.t -> Names.Constant.t -> UVars.Instance.t option ->
263+
State.t * EConstr.t option * UVars.Instance.t option
264264

265265
val grab_global_env : State.t -> State.t
266266
val grab_global_env_drop_univs_and_sigma : State.t -> State.t
@@ -289,7 +289,7 @@ val solution2evd : Evd.evar_map -> 'a Elpi.API.Data.solution -> Evar.Set.t -> Ev
289289
val show_coq_engine : ?with_univs:bool -> State.t -> string
290290
val show_coq_elpi_engine_mapping : State.t -> string
291291

292-
val type_of_global : state -> GlobRef.t -> Univ.Instance.t option -> state * (EConstr.t * Univ.Instance.t)
292+
val type_of_global : state -> GlobRef.t -> UVars.Instance.t option -> state * (EConstr.t * UVars.Instance.t)
293293
val minimize_universes : state -> state
294294
val new_univ_level_variable : ?flexible:bool -> state -> state * (Univ.Level.t * Univ.Universe.t)
295295
val constraint_eq : Sorts.t -> Sorts.t -> UnivProblem.t

src/coq_elpi_arg_HOAS.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ let raw_record_decl_to_glob glob_sign ({ name; sort; parameters; constructor; fi
283283
let name, space = sep_last_qualid name in
284284
let sort = match sort with
285285
| Some x -> Constrexpr.CSort x
286-
| None -> Constrexpr.(CSort (Glob_term.UAnonymous {rigid=true})) in
286+
| None -> Constrexpr.(CSort (Glob_term.UAnonymous {rigid=UnivRigid})) in
287287
let intern_env, params = intern_global_context glob_sign ~intern_env:Constrintern.empty_internalization_env parameters in
288288
let glob_sign_params = push_glob_ctx params glob_sign in
289289
let params = List.rev params in
@@ -325,7 +325,7 @@ let raw_indt_decl_to_glob glob_sign ({ finiteness; name; parameters; non_uniform
325325
let name = Names.Id.of_string name in
326326
let indexes = match arity with
327327
| Some x -> x
328-
| None -> CAst.make Constrexpr.(CSort (Glob_term.UAnonymous {rigid=true})) in
328+
| None -> CAst.make Constrexpr.(CSort (Glob_term.UAnonymous {rigid=UnivRigid})) in
329329
let intern_env, params = intern_global_context glob_sign ~intern_env:Constrintern.empty_internalization_env parameters in
330330
let nuparams_given, nuparams =
331331
match non_uniform_parameters with
@@ -348,7 +348,7 @@ let raw_indt_decl_to_glob glob_sign ({ finiteness; name; parameters; non_uniform
348348
{ finiteness; name = (space, name); arity; params; nuparams; nuparams_given; constructors; univpoly }
349349
let intern_indt_decl glob_sign (it : raw_indt_decl) = glob_sign, it
350350

351-
let expr_hole = CAst.make @@ Constrexpr.CHole(None,Namegen.IntroAnonymous)
351+
let expr_hole = CAst.make @@ Constrexpr.CHole(None)
352352

353353
let raw_context_decl_to_glob_synterp fields =
354354
let fields = intern_global_context_synterp fields in
@@ -564,7 +564,7 @@ let add_genarg tag pr_raw pr_glob pr_top glob subst interp =
564564
let wit = Genarg.make0 tag in
565565
let tag = Geninterp.Val.create tag in
566566
let () = Genintern.register_intern0 wit glob in
567-
let () = Genintern.register_subst0 wit subst in
567+
let () = Gensubst.register_subst0 wit subst in
568568
let () = Geninterp.register_interp0 wit (interp (fun x -> Ftactic.return @@ Geninterp.Val.Dyn (tag, x))) in
569569
let () = Geninterp.register_val0 wit (Some (Geninterp.Val.Base tag)) in
570570
Ltac_plugin.Pptactic.declare_extra_genarg_pprule wit pr_raw pr_glob pr_top;

0 commit comments

Comments
 (0)