Skip to content

Commit 88845b8

Browse files
committed
Fixes for Coq 8.17+rc1 version
1 parent 018c13a commit 88845b8

22 files changed

+58
-69
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- 8.13
99
- 8.12
1010
- 8.11
11+
- 8.17
1112

1213
pull_request: # On all pull-request changes
1314
release: # At release time
@@ -21,10 +22,10 @@ jobs:
2122
strategy:
2223
matrix:
2324
coq_version:
24-
- 'dev'
25+
- '8.17'
2526
ocaml_version:
2627
- '4.09-flambda'
27-
target: [ local, hott, dune ]
28+
target: [ local ] # dune, hott left out for now waiting for HoTT package
2829
fail-fast: false
2930

3031
steps:

coq-equations.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
opam-version: "2.0"
2-
version: "dev"
2+
version: "8.17.dev"
33
authors: [ "Matthieu Sozeau <matthieu.sozeau@inria.fr>" "Cyprien Mangin <cyprien.mangin@m4x.org>" ]
44
dev-repo: "git+https://github.com/mattam82/Coq-Equations.git"
55
maintainer: "matthieu.sozeau@inria.fr"
@@ -31,7 +31,7 @@ run-test: [
3131
[make "test-suite"]
3232
]
3333
depends: [
34-
"coq" {= "dev"}
34+
"coq" { >= "8.17~" & < "8.18" }
3535
"ocamlfind" {build}
3636
]
3737
#depopts: [

src/covering.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type int_data = {
3030
flags : flags;
3131
program_mode : bool;
3232
intenv : Constrintern.internalization_env;
33-
notations : Vernacexpr.notation_declaration list
33+
notations : Vernacexpr.decl_notation list
3434
}
3535

3636
exception Conflict
@@ -782,7 +782,7 @@ let interp_arity env evd ~poly ~is_rec ~with_evars notations (((loc,i),udecl,rec
782782
let program_sort =
783783
let u = Retyping.get_sort_of env !evd program_orig_type in
784784
let sigma, sortl, sortu = nonalgebraic_universe_level_of_universe env !evd u in
785-
evd := sigma; ESorts.kind sigma sortu
785+
evd := sigma; sortu
786786
in
787787
let program_implicits = Impargs.compute_implicits_with_manual env !evd program_orig_type false impls in
788788
let () = evd := Evd.minimize_universes !evd in
@@ -1509,7 +1509,7 @@ and interp_clause env evars p data prev clauses' path (ctx,pats,ctx' as prob)
15091509
str "And clauses: " ++ pr_preclauses env !evars cls')
15101510
| Some (clauses, s) ->
15111511
let () = check_unused_clauses env !evars clauses in
1512-
let term, _ = term_of_tree env evars (ESorts.make p.program_sort) s in
1512+
let term, _ = term_of_tree env evars p.program_sort s in
15131513
let info =
15141514
{ refined_obj = (idref, cconstr, cty);
15151515
refined_rettyp = ty;
@@ -1531,7 +1531,7 @@ and interp_clause env evars p data prev clauses' path (ctx,pats,ctx' as prob)
15311531

15321532
and interp_wheres env0 ctx evars path data s lets
15331533
(ctx, envctx, liftn, subst)
1534-
(w : (pre_prototype * pre_equation list) list * Vernacexpr.notation_declaration list) =
1534+
(w : (pre_prototype * pre_equation list) list * Vernacexpr.decl_notation list) =
15351535
let notations = snd w in
15361536
let aux (data,lets,nlets,coverings,env)
15371537
(((loc,id),udecl,nested,b,t,reca),clauses as eqs) =

src/covering.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type int_data = {
7575
flags : flags;
7676
program_mode : bool;
7777
intenv : Constrintern.internalization_env;
78-
notations : Vernacexpr.notation_declaration list
78+
notations : Vernacexpr.decl_notation list
7979
}
8080

8181
val add_wfrec_implicits : Syntax.rec_type ->
@@ -246,7 +246,7 @@ val interp_arity : Environ.env ->
246246
poly:bool ->
247247
is_rec:bool ->
248248
with_evars:bool ->
249-
Vernacexpr.notation_declaration list ->
249+
Vernacexpr.decl_notation list ->
250250
pre_equation Syntax.where_clause ->
251251
program_info
252252

src/depelim.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ let dependent_elim_tac ?patterns id : unit Proofview.tactic =
457457
let program_orig_type = it_mkProd_or_LetIn ty ctx in
458458
let p = Syntax.{program_loc = default_loc;
459459
program_id = Names.Id.of_string "dummy";
460-
program_orig_type; program_sort = (ESorts.kind sigma sort);
460+
program_orig_type; program_sort = sort;
461461
program_impls = [];
462462
program_implicits = [];
463463
program_rec = None;

src/eqdec.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ let inductive_info sigma ((mind, _ as ind),u) =
6161
let arities = arities_of_constructors env (from_peuniverses sigma induct) in
6262
let constrs =
6363
Array.map (fun ty ->
64-
let _, rest = decompose_prod_n_decls sigma nparams (EConstr.of_constr ty) in
64+
let _, rest = decompose_prod_n_assum sigma nparams (EConstr.of_constr ty) in
6565
let constrty = Vars.substl subst rest in
66-
decompose_prod_decls sigma constrty)
66+
decompose_prod_assum sigma constrty)
6767
arities
6868
in
6969
let case c pred brs =

src/equations.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ val define_by_eqs
1919
-> open_proof:bool
2020
-> Syntax.equation_options
2121
-> Syntax.pre_equations
22-
-> Vernacexpr.notation_declaration list
22+
-> Vernacexpr.decl_notation list
2323
-> Declare.OblState.t * Declare.Proof.t option
2424

2525
val define_principles :
@@ -34,15 +34,15 @@ val equations :
3434
poly:bool -> program_mode:bool -> ?tactic:Libnames.qualid ->
3535
Syntax.equation_options ->
3636
Syntax.pre_equations ->
37-
Vernacexpr.notation_declaration list ->
37+
Vernacexpr.decl_notation list ->
3838
Declare.OblState.t
3939

4040
val equations_interactive :
4141
pm:Declare.OblState.t ->
4242
poly:bool -> program_mode:bool -> ?tactic:Libnames.qualid ->
4343
Syntax.equation_options ->
4444
Syntax.pre_equations ->
45-
Vernacexpr.notation_declaration list ->
45+
Vernacexpr.decl_notation list ->
4646
Declare.OblState.t * Declare.Proof.t
4747

4848
val solve_equations_goal :

src/equations_common.ml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ let equations_derive_eliminator = ref true
4242

4343
let _ = Goptions.declare_bool_option {
4444
Goptions.optdepr = true;
45-
Goptions.optstage = Interp;
4645
Goptions.optkey = ["Equations"; "WithK"];
4746
Goptions.optread = (fun () -> false);
4847
Goptions.optwrite = (fun b ->
@@ -55,47 +54,41 @@ let _ = Goptions.declare_bool_option {
5554

5655
let _ = Goptions.declare_bool_option {
5756
Goptions.optdepr = true;
58-
Goptions.optstage = Interp;
5957
Goptions.optkey = ["Equations"; "WithKDec"];
6058
Goptions.optread = (fun () -> !simplify_withUIP);
6159
Goptions.optwrite = (fun b -> simplify_withUIP := b)
6260
}
6361

6462
let _ = Goptions.declare_bool_option {
6563
Goptions.optdepr = false;
66-
Goptions.optstage = Interp;
6764
Goptions.optkey = ["Equations"; "With"; "UIP"];
6865
Goptions.optread = (fun () -> !simplify_withUIP);
6966
Goptions.optwrite = (fun b -> simplify_withUIP := b)
7067
}
7168

7269
let _ = Goptions.declare_bool_option {
7370
Goptions.optdepr = false;
74-
Goptions.optstage = Interp;
7571
Goptions.optkey = ["Equations"; "Transparent"];
7672
Goptions.optread = (fun () -> !equations_transparent);
7773
Goptions.optwrite = (fun b -> equations_transparent := b)
7874
}
7975

8076
let _ = Goptions.declare_bool_option {
8177
Goptions.optdepr = false;
82-
Goptions.optstage = Interp;
8378
Goptions.optkey = ["Equations"; "With"; "Funext"];
8479
Goptions.optread = (fun () -> !equations_with_funext);
8580
Goptions.optwrite = (fun b -> equations_with_funext := b)
8681
}
8782

8883
let _ = Goptions.declare_bool_option {
8984
Goptions.optdepr = false;
90-
Goptions.optstage = Interp;
9185
Goptions.optkey = ["Equations"; "Derive"; "Equations"];
9286
Goptions.optread = (fun () -> !equations_derive_equations);
9387
Goptions.optwrite = (fun b -> equations_derive_equations := b)
9488
}
9589

9690
let _ = Goptions.declare_bool_option {
9791
Goptions.optdepr = false;
98-
Goptions.optstage = Interp;
9992
Goptions.optkey = ["Equations"; "Derive"; "Eliminator"];
10093
Goptions.optread = (fun () -> !equations_derive_eliminator);
10194
Goptions.optwrite = (fun b -> equations_derive_eliminator := b)
@@ -107,7 +100,6 @@ let debug = ref false
107100

108101
let _ = Goptions.declare_bool_option {
109102
Goptions.optdepr = false;
110-
Goptions.optstage = Interp;
111103
Goptions.optkey = ["Equations"; "Debug"];
112104
Goptions.optread = (fun () -> !debug);
113105
Goptions.optwrite = (fun b -> debug := b)
@@ -1076,19 +1068,19 @@ let evd_comb1 f evd x =
10761068
(* Universe related functions *)
10771069

10781070
let nonalgebraic_universe_level_of_universe env sigma u =
1079-
match ESorts.kind sigma u with
1071+
match u with
10801072
| Sorts.Set | Sorts.Prop | Sorts.SProp ->
10811073
sigma, Univ.Level.set, u
1082-
| Sorts.Type u0 | Sorts.QSort (_, u0) ->
1074+
| Sorts.Type u0 ->
10831075
match Univ.Universe.level u0 with
10841076
| Some l ->
10851077
(match Evd.universe_rigidity sigma l with
10861078
| Evd.UnivFlexible true ->
1087-
Evd.make_nonalgebraic_variable sigma l, l, ESorts.make @@ Sorts.sort_of_univ @@ Univ.Universe.make l
1079+
Evd.make_nonalgebraic_variable sigma l, l, Sorts.sort_of_univ @@ Univ.Universe.make l
10881080
| _ -> sigma, l, u)
10891081
| None ->
10901082
let sigma, l = Evd.new_univ_level_variable Evd.univ_flexible sigma in
1091-
let ul = ESorts.make @@ Sorts.sort_of_univ @@ Univ.Universe.make l in
1083+
let ul = Sorts.sort_of_univ @@ Univ.Universe.make l in
10921084
let sigma = Evd.set_leq_sort env sigma u ul in
10931085
sigma, l, ul
10941086

src/equations_common.mli

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ val new_evar : Environ.env ->
400400
val new_type_evar : Environ.env ->
401401
Evd.evar_map ->
402402
?src:Evar_kinds.t Loc.located -> Evd.rigid ->
403-
Evd.evar_map * (constr * ESorts.t)
403+
Evd.evar_map * (constr * Sorts.t)
404404

405405
val empty_hint_info : 'a Typeclasses.hint_info_gen
406406

@@ -442,10 +442,10 @@ val splay_prod_n_assum : env -> Evd.evar_map -> int -> types -> rel_context * ty
442442

443443
(* Universes *)
444444
val nonalgebraic_universe_level_of_universe :
445-
Environ.env -> Evd.evar_map -> ESorts.t -> Evd.evar_map * Univ.Level.t * ESorts.t
445+
Environ.env -> Evd.evar_map -> Sorts.t -> Evd.evar_map * Univ.Level.t * Sorts.t
446446
val instance_of :
447447
Environ.env ->
448448
Evd.evar_map ->
449449
?argu:EConstr.EInstance.t ->
450-
ESorts.t ->
451-
Evd.evar_map * EConstr.EInstance.t * ESorts.t
450+
Sorts.t ->
451+
Evd.evar_map * EConstr.EInstance.t * Sorts.t

src/g_equations.mlg

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ let deppat_elim : Constrexpr.constr_expr list Pcoq.Entry.t =
199199
let _ = Pptactic.declare_extra_genarg_pprule wit_deppat_elim
200200
pr_raw_deppat_elim pr_glob_deppat_elim pr_deppat_elim
201201

202-
type equations_argtype = (pre_equations * Vernacexpr.notation_declaration list) Genarg.uniform_genarg_type
202+
type equations_argtype = (pre_equations * Vernacexpr.decl_notation list) Genarg.uniform_genarg_type
203203

204204
let wit_equations : equations_argtype =
205205
Genarg.create_arg "equations"
@@ -209,7 +209,7 @@ let pr_raw_equations _env _sigma _ _ _ l = mt ()
209209
let pr_glob_equations _env _sigma _ _ _ l = mt ()
210210
let pr_equations _env _sigma _ _ _ l = mt ()
211211

212-
let equations : (pre_equations * Vernacexpr.notation_declaration list) Pcoq.Entry.t =
212+
let equations : (pre_equations * Vernacexpr.decl_notation list) Pcoq.Entry.t =
213213
Pcoq.create_generic_entry2 "equations" (Genarg.rawwit wit_equations)
214214

215215
let _ = Pptactic.declare_extra_genarg_pprule wit_equations
@@ -332,8 +332,8 @@ GRAMMAR EXTEND Gram
332332
[ [ ntn = ne_lstring; ":="; c = constr;
333333
modl = G_vernac.syntax_modifiers;
334334
scopt = OPT [ ":"; sc = IDENT -> { sc } ] -> {
335-
Inr { Vernacexpr.ntn_decl_string = ntn; ntn_decl_interp = c;
336-
ntn_decl_modifiers = modl; ntn_decl_scope = scopt } }
335+
Inr { Vernacexpr.decl_ntn_string = ntn; decl_ntn_interp = c;
336+
decl_ntn_modifiers = modl; decl_ntn_scope = scopt } }
337337
| p = proto -> { Inl (p (Some Syntax.Nested)) } ] ]
338338
;
339339

@@ -357,8 +357,8 @@ GRAMMAR EXTEND Gram
357357
[ [ ntn = ne_lstring; ":="; c = constr;
358358
modl = G_vernac.syntax_modifiers;
359359
scopt = OPT [ ":"; sc = IDENT -> { sc } ] -> {
360-
Inr { Vernacexpr.ntn_decl_string = ntn; ntn_decl_interp = c;
361-
ntn_decl_modifiers = modl; ntn_decl_scope = scopt } }
360+
Inr { Vernacexpr.decl_ntn_string = ntn; decl_ntn_interp = c;
361+
decl_ntn_modifiers = modl; decl_ntn_scope = scopt } }
362362
| p = proto -> { Inl (p (Some Syntax.Mutual)) } ] ]
363363
;
364364
local_where:

0 commit comments

Comments
 (0)