Skip to content

Commit 2aa4f93

Browse files
committed
Fix deprecations from rocq master
1 parent 88839a0 commit 2aa4f93

16 files changed

Lines changed: 74 additions & 48 deletions

examples/AlmostFull.v

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -684,16 +684,16 @@ Section SCT.
684684
intros n k'' g b f. intros H.
685685
intros gz [x rx] y.
686686
specialize (H (x, rx) y rx y). simpl.
687-
rewrite H. clear H.
687+
rw H. clear H.
688688
split.
689689
+ intros [xlt relr].
690-
intros f'. depelim f'. rewrite gz. apply xlt. apply relr.
690+
intros f'. depelim f'. rw gz. apply xlt. apply relr.
691691
+ intros Hf. split.
692-
specialize (Hf fz). rewrite gz in Hf. apply Hf.
692+
specialize (Hf fz). rw gz in Hf. apply Hf.
693693
intros f'. apply Hf.
694694
+ intros n k'' g gf x y.
695695
split. intros [].
696-
intros f. specialize (f fz). now rewrite gf in f.
696+
intros f. specialize (f fz). now rw gf in f.
697697
Qed.
698698

699699
Lemma graph_relation_spec {k : nat} (G : graph k) :
@@ -706,7 +706,7 @@ Section SCT.
706706
| None => False
707707
end).
708708
Proof.
709-
unfold graph_relation. intros x y. now rewrite k_related_spec.
709+
unfold graph_relation. intros x y. now rw k_related_spec.
710710
Qed.
711711

712712
Definition approximates {k} (G : graph k) (R : relation (k_tuple_type k)) :=
@@ -732,13 +732,13 @@ Section SCT.
732732
approximates (G0 ⋅ G1) (compose_rel R0 R1).
733733
Proof.
734734
unfold approximates. intros ag0 ag1.
735-
intros x z [y [Hxy Hyz]]. rewrite graph_relation_spec.
735+
intros x z [y [Hxy Hyz]]. rw graph_relation_spec.
736736
intros f. specialize (ag0 _ _ Hxy). specialize (ag1 _ _ Hyz).
737737
rewrite -> graph_relation_spec in ag0, ag1. specialize (ag0 f).
738-
funelim (graph_compose G0 G1 f). now rewrite Heq in ag0.
739-
rewrite Heq0 in ag0. specialize (ag1 arg1). rewrite Heq in ag1.
738+
funelim (graph_compose G0 G1 f). now rw Heq in ag0.
739+
rw Heq0 in ag0. specialize (ag1 arg1). rw Heq in ag1.
740740
destruct weight, weight'; simpl; try lia.
741-
specialize (ag1 arg1). now rewrite Heq in ag1.
741+
specialize (ag1 arg1). now rw Heq in ag1.
742742
Qed.
743743

744744
Equations fin_union {A n} (f : fin n -> relation A) : relation A :=
@@ -752,10 +752,10 @@ Section SCT.
752752
intros [k _]. depelim k.
753753
split. intros [Hfz|Hfs].
754754
now exists fz.
755-
specialize (H x y x y). rewrite -> H in Hfs.
755+
specialize (H x y x y). rw H in Hfs.
756756
destruct Hfs. now exists (fs x0).
757757
intros [k Hk]. depelim k. now left. right.
758-
rewrite (H x y). now exists k.
758+
rw (H x y). now exists k.
759759
Qed.
760760

761761
Equations fin_all k (p : fin k -> bool) : bool :=
@@ -770,7 +770,7 @@ Section SCT.
770770
destruct (p fz) eqn:pfz. simpl. specialize (IHk (fun f => p (fs f))).
771771
simpl in IHk. destruct IHk; constructor. intros f; depelim f; auto.
772772
intro Hf. apply n. intros f'. apply Hf.
773-
simpl. constructor. intros H. specialize (H fz). rewrite pfz in H. discriminate.
773+
simpl. constructor. intros H. specialize (H fz). rw pfz in H. discriminate.
774774
Qed.
775775

776776
Definition graph_eq {k} (g g' : graph k) : bool :=
@@ -813,7 +813,7 @@ Section SCT.
813813
forall x y, list_union (rs ++ rs') x y <-> list_union rs x y \/ list_union rs' x y.
814814
Proof.
815815
induction rs; intros; simpl; simp list_union; intuition.
816-
rewrite -> IHrs in H0. intuition.
816+
rw IHrs in H0. intuition.
817817
Qed.
818818

819819
Equations map_k_tuple k (p : k_tuple_type k) (f : fin k -> nat) : k_tuple_type k :=
@@ -878,7 +878,7 @@ Section SCT.
878878
intuition.
879879
+ revert H. clear -inS inScomp Ingi.
880880
induction famgi. simpl. intros [].
881-
simpl. rewrite in_app_iff in_map_iff.
881+
simpl. rw in_app_iff in_map_iff.
882882
intros [[x [<- Inx]]| Ing]. apply inScomp. intuition auto.
883883
apply Ingi. constructor. auto.
884884
apply IHfamgi; auto. intros.
@@ -958,9 +958,9 @@ Section SCT.
958958
Proof.
959959
induction k. unfold TI_graph. do 2 red in G. intros f; depelim f.
960960
intros f. depelim f. simp TI_graph graph_compose.
961-
destruct (G fz) as [[weight d]|]; simpl; try easy. now rewrite orb_false_r.
961+
destruct (G fz) as [[weight d]|]; simpl; try easy. now rw orb_false_r.
962962
simp TI_graph graph_compose.
963-
destruct (G (fs f)) as [[weight d]|]; simpl; trivial. now rewrite orb_false_r.
963+
destruct (G (fs f)) as [[weight d]|]; simpl; trivial. now rw orb_false_r.
964964
Qed.
965965

966966
Definition TI k : relation (k_tuple_type k) := graph_relation (TI_graph k).
@@ -977,10 +977,10 @@ Section SCT.
977977
intros Hg. pose proof Hg. rewrite -> graph_relation_spec in H.
978978
intros. pose (H fz). simpl in y0. intuition.
979979
assert (graph_relation (TI_graph k) rx ry).
980-
rewrite graph_relation_spec. intros. clear y0. specialize (H (fs f)). simpl in H.
980+
rw graph_relation_spec. intros. clear y0. specialize (H (fs f)). simpl in H.
981981
unfold TI_graph. destruct k. depelim f. auto.
982982
do 2 red in IHk. simpl in IHk. rewrite <- IHk. apply H0.
983-
+ intros [Hle Hi]. unfold TI. rewrite graph_relation_spec.
983+
+ intros [Hle Hi]. unfold TI. rw graph_relation_spec.
984984
intros. depelim f. simpl. auto. simpl.
985985
do 2 red in IHk. simpl in IHk. rewrite <- IHk in Hi.
986986
red in Hi. rewrite -> graph_relation_spec in Hi.
@@ -990,7 +990,7 @@ Section SCT.
990990

991991
#[global] Instance TI_AlmostFull k : AlmostFull (TI k).
992992
Proof.
993-
rewrite TI_intersection_equiv.
993+
rw TI_intersection_equiv.
994994
induction k. simpl. red. red. exists ZT. simpl. intros. exact I.
995995
simpl. apply af_interesection.
996996
apply (AlmostFull_MR Nat.le). apply almost_full_le.
@@ -1012,11 +1012,11 @@ Section SCT.
10121012
exists x. intuition. }
10131013
pose (compose_approximates G (TI_graph k) T (TI k)).
10141014
forward a; auto. forward a; auto. unfold TI. red. intuition.
1015-
rewrite TI_compose' in a.
1015+
rw TI_compose' in a.
10161016
apply (approximates_power n) in a.
10171017
specialize (a x x). specialize (a H0).
10181018
rewrite -> graph_relation_spec in a. specialize (a f).
1019-
rewrite eqpow in a. lia.
1019+
rw eqpow in a. lia.
10201020
Qed.
10211021

10221022
Theorem size_change_termination {k} (n : nat)
@@ -1146,7 +1146,7 @@ Section SCT.
11461146
Lemma existsb_spec {A} (p : A -> bool) l : reflect (exists x, In x l /\ p x = true) (existsb p l).
11471147
Proof.
11481148
destruct existsb eqn:Heq. constructor. now apply existsb_exists in Heq.
1149-
constructor. intro. apply existsb_exists in H. rewrite Heq in H; discriminate.
1149+
constructor. intro. apply existsb_exists in H. rw Heq in H; discriminate.
11501150
Qed.
11511151
Lemma eqb_refl {A} `{E:Eq A} (a : A) : eqb a a = true.
11521152
Proof. destruct (eqb_spec a a); intuition. Qed.
@@ -1227,7 +1227,7 @@ Section SCT.
12271227
+ intros * H l Haux.
12281228
(* forward H. red. intuition.
12291229
specialize (H l Haux). apply H. auto with datatypes.
1230-
rewrite app_nil_r. red. intuition. intuition.
1230+
rw app_nil_r. red. intuition. intuition.
12311231
+ intros * n * tracc l' [= <-]. simpl. split. intuition.
12321232
intros inclgs incltrgs becacc.
12331233
intuition. red. intuition. red.
@@ -1373,6 +1373,7 @@ Equations T_graphs (f : fin 2) : graph 2 :=
13731373
T_graphs (fs fz) := T_graph_r.
13741374

13751375
Definition gnlex : (nat * nat) -> nat.
1376+
Proof.
13761377
assert (sct:=size_change_termination 2 T_rel T_graphs). forward sct.
13771378
intros f; depelim f. apply approximates_T_l. depelim f. apply approximates_T_r. depelim f.
13781379
specialize (sct T_trans_clos). forward sct. apply (compute_transitive_closure_spec 10). reflexivity.
@@ -1402,17 +1403,18 @@ Print Assumptions gnlex. *)
14021403
(* Eval native_compute in gnlex (4, 3). *)
14031404

14041405
Lemma gnlex_0_l y : gnlex (0, y) = 1.
1405-
Admitted.
1406+
Proof. Admitted.
14061407

14071408
Lemma gnlex_0_r x : gnlex (x, 0) = 1.
1408-
Admitted.
1409+
Proof. Admitted.
14091410

14101411

14111412
Lemma gnlex_S x y : gnlex (S x, S y) = gnlex (S y, y) + gnlex (S y, x).
1412-
Admitted.
1413+
Proof. Admitted.
14131414

14141415
Lemma gnlex_S_test x y : exists foo, gnlex (S x, S y) = foo.
1415-
eexists. rewrite gnlex_S. destruct y. rewrite gnlex_0_r.
1416-
destruct x. rewrite gnlex_0_r. reflexivity.
1417-
rewrite gnlex_S. rewrite gnlex_0_r. destruct x. admit. rewrite gnlex_S.
1416+
Proof.
1417+
eexists. rw gnlex_S. destruct y. rw gnlex_0_r.
1418+
destruct x. rw gnlex_0_r. reflexivity.
1419+
rw gnlex_S. rw gnlex_0_r. destruct x. admit. rw gnlex_S.
14181420
Admitted.

examples/HoTT_light.v

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,21 @@ Notation "p ..1" := (pr1_path p) (at level 1).
196196

197197
Definition pr2_path {A} `{P : A -> Type} {u v : sigma P} (p : u = v)
198198
: p..1 # u.2 = v.2.
199-
destruct p. apply 1.
200-
Defined.
199+
Proof. destruct p. apply 1. Defined.
201200

202201
Notation "p ..2" := (pr2_path p) (at level 1).
203202

204203
Definition eta_path_sigma_uncurried {A} `{P : A -> Type} {u v : sigma P}
205204
(p : u = v) : path_sigma_uncurried _ _ (p..1, p..2) = p.
206-
destruct p. apply 1.
207-
Defined.
205+
Proof. destruct p. apply 1. Defined.
208206

209207
Definition eta_path_sigma A `{P : A -> Type} {u v : sigma P} (p : u = v)
210208
: path_sigma _ _ (p..1) (p..2) = p
211209
:= eta_path_sigma_uncurried p.
212210

213211
Definition path_sigma_equiv {A : Type} (P : A -> Type) (u v : sigma P):
214212
IsEquiv (path_sigma_uncurried u v).
213+
Proof.
215214
unshelve refine (BuildIsEquiv _ _ _).
216215
- exact (fun r => (r..1, r..2)).
217216
- intro. apply eta_path_sigma_uncurried.
@@ -409,6 +408,7 @@ Defined.
409408

410409
Definition transport_inv A {P : A -> Type} (x y :A) (e : x = y) (u:P x) v:
411410
u = e^ # v -> e # u = v.
411+
Proof.
412412
destruct e. exact id.
413413
Defined.
414414

@@ -458,6 +458,7 @@ Definition path_contr {A} {H:Contr A} (x y : A) : x = y
458458
:= concat (id_sym (@contr _ H x)) (@contr _ H y).
459459

460460
Definition path2_contr {A} {H:Contr A} {x y : A} (p q : x = y) : p = q.
461+
Proof.
461462
assert (K : forall (r : x = y), r = path_contr x y).
462463
intro r; destruct r; symmetry; now apply concat_Vp.
463464
apply (transitivity (y:=path_contr x y)).

examples/ordinals.v

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@ From Stdlib Require Import Eqdep_dec.
33
From Stdlib Require Import Peano_dec.
44
From Stdlib Require Import List.
55
From Stdlib Require Import Recdef.
6-
6+
Set Warnings "-missing-proof-command".
77
(**
88
Arithmétique
99
*)
1010

1111
(* Sur la soustraction (entière) *)
1212
Lemma minus_Sn_n : forall (n:nat), (minus (S n) n) = (S 0).
13+
Proof.
1314
induction n; auto.
1415
Qed.
1516

1617
Lemma lt_S_r : forall (n1 n2:nat),
1718
(lt n1 n2) -> exists (n:nat), n2 = (S n).
19+
Proof.
1820
destruct n2.
1921
intro. exfalso. apply (Nat.nlt_0_r n1). assumption.
2022
intro. exists n2. trivial.
2123
Qed.
2224

2325
Lemma minus_lt_S : forall (n1 n2:nat),
2426
(lt n1 n2) -> exists (n:nat), (minus n2 n1) = (S n).
27+
Proof.
2528
intros. elim (lt_S_r n1 n2 H). intros n H1. rewrite H1.
2629
exists (minus n n1). rewrite Nat.sub_succ_l.
2730
trivial.
@@ -30,12 +33,14 @@ Qed.
3033

3134
(* Sur l'ordre strict 'lt' *)
3235
Lemma lt_1_0 : forall (n:nat), (lt n 1) -> (n=0).
36+
Proof.
3337
destruct n.
3438
auto.
3539
intro. inversion H. exfalso. apply (Nat.nle_succ_0 (S n)). assumption.
3640
Qed.
3741

3842
Lemma lt_S_case : forall (m n:nat), (lt m (S n)) -> (lt m n) \/ (m=n).
43+
Proof.
3944
intros m n. generalize m. induction n.
4045
intros. rewrite (lt_1_0 m0 H). tauto.
4146
destruct m0.
@@ -44,13 +49,15 @@ intros m n. generalize m. induction n.
4449
Qed.
4550

4651
Lemma not_lt_Sn_n : forall (n:nat), not (lt (S n) n).
52+
Proof.
4753
induction n.
4854
auto with arith.
4955
intro. auto with arith.
5056
Qed.
5157

5258
(* Sur l'ordre large 'le' *)
5359
Lemma not_le_Sn_n : forall (n:nat), not (le (S n) n).
60+
Proof.
5461
induction n.
5562
auto with arith.
5663
intro. auto with arith.
@@ -59,6 +66,7 @@ Qed.
5966
(* Cas sur les entiers *)
6067
Lemma nat_compare_case : forall (n1 n2:nat),
6168
(lt n1 n2) \/ (n1=n2) \/ (lt n2 n1).
69+
Proof.
6270
induction n1.
6371
destruct n2.
6472
tauto.
@@ -878,6 +886,7 @@ Qed.
878886

879887
Lemma rlex_nat3_4 : forall (x y z m : nat),
880888
(rlex_nat3 (S x, y, m) (S x, S y, z)).
889+
Proof.
881890
unfold rlex_nat3. unfold make_mwlt. destruct y.
882891
intros. simpl. apply wlt_wlt.
883892
auto with arith.

examples/polynomials.v

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,16 +850,20 @@ Ltac bool_tauto_with f :=
850850
(** Examples *)
851851

852852
Goal forall a b, andb a b = andb b a.
853+
Proof.
853854
bool_tauto_with @correctness_heyting.
854855
Qed.
855856
Goal forall a b, andb (negb a) (negb b) = negb (orb a b).
857+
Proof.
856858
bool_tauto_with @correctness_heyting.
857859
Qed.
858860
Goal forall a b, orb (negb a) (negb b) = negb (andb a b).
861+
Proof.
859862
bool_tauto_with @correctness_heyting.
860863
Qed.
861864

862865
Example neg_involutive: forall a, orb (negb a) a = true.
866+
Proof.
863867
Fail bool_tauto_with @correctness_heyting.
864868
bool_tauto_with @correctness_classical.
865869
Qed.

src/ederive.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ module StringSet = Set.Make(StringOrd)
4242
(** We keep a table of which derives have been performed yet for a given global reference. *)
4343
type derive_instance = (string * Names.GlobRef.t)
4444

45-
type derive_instance_map = StringSet.t Names.GlobRef.Map.t
45+
type derive_instance_map = StringSet.t Names.GlobRef.Map_env.t
4646

47-
let derived_instances : derive_instance_map ref = Summary.ref Names.GlobRef.Map.empty ~name:"derived-instances"
47+
let derived_instances : derive_instance_map ref = Summary.ref Names.GlobRef.Map_env.empty ~name:"derived-instances"
4848

4949
let cache_instance (derive, gr) =
5050
let grderives =
51-
match Names.GlobRef.Map.find_opt gr !derived_instances with
51+
match Names.GlobRef.Map_env.find_opt gr !derived_instances with
5252
| Some s -> s
5353
| None -> StringSet.empty
5454
in
55-
derived_instances := Names.GlobRef.Map.add gr (StringSet.add derive grderives) !derived_instances
55+
derived_instances := Names.GlobRef.Map_env.add gr (StringSet.add derive grderives) !derived_instances
5656

5757
let subst_instance (subst, (derive, gr)) =
5858
(derive, fst (Globnames.subst_global subst gr))
@@ -75,7 +75,7 @@ let register_instance decl =
7575

7676
let check_derive s gr =
7777
try
78-
let grds = Names.GlobRef.Map.find gr !derived_instances in
78+
let grds = Names.GlobRef.Map_env.find gr !derived_instances in
7979
StringSet.mem s grds
8080
with Not_found -> false
8181

src/equations.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ let define_unfolding_eq ~pm env evd (flags : flags) p unfp prog prog' ei hook =
4040
user_obls = Id.Set.union prog.program_split_info.user_obls info'.user_obls } in
4141
let () = inline_helpers info in
4242
let funf_cst = match info'.term_id with GlobRef.ConstRef c -> c | _ -> assert false in
43-
let () = if PolyFlags.univ_poly flags.poly then evd := Evd.from_ctx info'.term_ustate in
43+
let () = if PolyFlags.univ_poly flags.poly then evd := Evd.from_ustate info'.term_ustate in
4444
let funfc = e_new_global evd info'.term_id in
4545
let unfold_eq_id = add_suffix (program_id unfp) "_eq" in
4646
let hook_eqs _ pm =
@@ -197,7 +197,7 @@ let define_by_eqs ~pm ~poly ~program_mode ~obligations ~tactic ~open_proof opts
197197
let hook ~pm i p info =
198198
let () = inline_helpers info in
199199
let f_cst = match info.term_id with GlobRef.ConstRef c -> c | _ -> assert false in
200-
let () = evd := Evd.from_ctx info.term_ustate in
200+
let () = evd := Evd.from_ustate info.term_ustate in
201201
let compiled_info = { program_cst = f_cst;
202202
program_split_info = info } in
203203
progs.(i) <- Some (p, compiled_info);

src/equations_common.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ let make_definition ?(check = true) ?opaque ?(poly=PolyFlags.default) evm ?types
286286
| Some typ -> Vars.universes_of_constr typ
287287
in
288288
let used = Univ.Level.Set.union used used' in
289-
let evm = Evd.restrict_universe_context evm used in
289+
let evm = Evd.restrict_ustate evm used in
290290
let univs = Evd.univ_entry ~poly evm in
291291
evm0, evm, Declare.definition_entry ~univs ?types:typ body
292292

src/g_equations.mlg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,9 @@ END
499499
TACTIC EXTEND is_secvar
500500
| [ "is_secvar" constr(x) ] ->
501501
{ enter (fun gl ->
502+
let env = Proofview.Goal.env gl in
502503
match kind (Proofview.Goal.sigma gl) x with
503-
| Var id when Termops.is_section_variable (Global.env ()) id -> Proofview.tclUNIT ()
504+
| Var id when Termops.is_section_variable_env env id -> Proofview.tclUNIT ()
504505
| _ -> Tacticals.tclFAIL (str "Not a section variable or hypothesis")) }
505506
END
506507

0 commit comments

Comments
 (0)