Skip to content

Commit 3c2a1df

Browse files
authored
1 parent cf4acee commit 3c2a1df

File tree

89 files changed

+688
-697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+688
-697
lines changed

Bedrock/Word.v

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ Require Export Fiat.Common.Coq__8_4__8_5__Compat.
22
(** Fixed precision machine words *)
33

44
Require Import Coq.Arith.Arith
5-
Coq.Arith.Div2
65
Coq.NArith.NArith
76
Coq.Bool.Bool
87
Coq.ZArith.ZArith.

src/ADTRefinement/FixedPoint.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Require Export Fiat.Common.Coq__8_4__8_5__Compat.
22
Require Import Fiat.ADT Fiat.ADTNotation.
33
Require Export Fiat.Computation.FixComp.
4+
Require Import Coq.ZArith.ZArith.
5+
Require Import Coq.Arith.PeanoNat.
46

57
Import LeastFixedPointFun.
68

@@ -113,9 +115,8 @@ Lemma length_wf' : forall A len l,
113115
Proof.
114116
induction len; simpl; intros;
115117
constructor; intros.
116-
contradiction (NPeano.Nat.nlt_0_r _ H).
118+
contradiction (Nat.nlt_0_r _ H).
117119
apply IHlen.
118-
Require Import Coq.ZArith.ZArith.
119120
omega.
120121
Qed.
121122

src/CertifiedExtraction/Extraction/External/Lists.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Require Export Bedrock.Platform.Facade.examples.QsADTs.
55
Lemma CompileEmpty_helper {A}:
66
forall (lst : list A) (w : W),
77
Programming.propToWord (lst = @nil A) w ->
8-
ret (bool2w (EqNat.beq_nat (Datatypes.length lst) 0)) ↝ w.
8+
ret (bool2w (Nat.eqb (Datatypes.length lst) 0)) ↝ w.
99
Proof.
1010
unfold Programming.propToWord, IF_then_else in *.
1111
destruct lst; simpl in *; destruct 1; repeat cleanup; try discriminate; fiat_t.
@@ -15,7 +15,7 @@ Hint Resolve CompileEmpty_helper : call_helpers_db.
1515

1616
Lemma ListEmpty_helper :
1717
forall {A} (seq: list A),
18-
(EqNat.beq_nat (Datatypes.length seq) 0) = match seq with
18+
(Nat.eqb (Datatypes.length seq) 0) = match seq with
1919
| nil => true
2020
| _ :: _ => false
2121
end.

src/CertifiedExtraction/Extraction/QueryStructures/CallRules/TupleList.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Module ADTListCompilation
123123
GLabelMap.MapsTo fpointer (Axiomatic Empty) env ->
124124
{{ tenv }}
125125
Call vtest fpointer (vlst :: nil)
126-
{{ [[`vtest ->> (bool2w (EqNat.beq_nat (Datatypes.length lst) 0)) as _]] :: (DropName vtest tenv) }} ∪ {{ ext }} // env.
126+
{{ [[`vtest ->> (bool2w (Nat.eqb (Datatypes.length lst) 0)) as _]] :: (DropName vtest tenv) }} ∪ {{ ext }} // env.
127127
Proof.
128128
repeat (SameValues_Facade_t_step || facade_cleanup_call || LiftPropertyToTelescope_t || PreconditionSet_t || injections).
129129

@@ -144,7 +144,7 @@ Module ADTListCompilation
144144
GLabelMap.MapsTo fpointer (Axiomatic Empty) env ->
145145
{{ tenv }}
146146
Call vtest fpointer (vlst :: nil)
147-
{{ [[`vtest ->> (bool2w (EqNat.beq_nat (Datatypes.length (rev lst)) 0)) as _]] :: tenv }} ∪ {{ ext }} // env.
147+
{{ [[`vtest ->> (bool2w (Nat.eqb (Datatypes.length (rev lst)) 0)) as _]] :: tenv }} ∪ {{ ext }} // env.
148148
Proof.
149149
intros.
150150
setoid_rewrite rev_length.

src/CertifiedExtraction/Extraction/QueryStructures/QueryStructures.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Ltac _compile_length :=
154154
match_ProgOk
155155
ltac:(fun prog pre post ext env =>
156156
match constr:((pre, post)) with
157-
| (?pre, Cons ?k (ret (bool2w (EqNat.beq_nat (Datatypes.length (rev ?seq)) 0))) (fun _ => ?pre')) =>
157+
| (?pre, Cons ?k (ret (bool2w (Nat.eqb (Datatypes.length (rev ?seq)) 0))) (fun _ => ?pre')) =>
158158
let vlst := find_fast (wrap (FacadeWrapper := WrapInstance (H := QS_WrapFiatWTupleList)) seq) ext in
159159
match vlst with
160160
| Some ?vlst => eapply (WTupleListCompilation.CompileEmpty_spec (idx := 3) (vlst := vlst))

src/Common.v

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Require Import Coq.Lists.List.
2-
Require Import Coq.Numbers.Natural.Peano.NPeano.
32
Require Import Coq.ZArith.ZArith Coq.Lists.SetoidList.
43
Require Export Coq.Setoids.Setoid Coq.Classes.RelationClasses
54
Coq.Program.Program Coq.Classes.Morphisms.
@@ -1330,7 +1329,7 @@ Definition path_prod' {A B} {x x' : A} {y y' : B}
13301329

13311330
Lemma lt_irrefl' {n m} (H : n = m) : ~n < m.
13321331
Proof.
1333-
subst; apply Lt.lt_irrefl.
1332+
subst; apply Nat.lt_irrefl.
13341333
Qed.
13351334

13361335
Lemma or_not_l {A B} (H : A \/ B) (H' : ~A) : B.
@@ -1627,7 +1626,7 @@ Module opt.
16271626
Definition snd {A B} := Eval compute in @snd A B.
16281627
Definition andb := Eval compute in andb.
16291628
Definition orb := Eval compute in orb.
1630-
Definition beq_nat := Eval compute in EqNat.beq_nat.
1629+
Definition beq_nat := Eval compute in Nat.eqb.
16311630

16321631
Module Export Notations.
16331632
Delimit Scope opt_bool_scope with opt_bool.
@@ -1641,7 +1640,7 @@ Module opt2.
16411640
Definition snd {A B} := Eval compute in @snd A B.
16421641
Definition andb := Eval compute in andb.
16431642
Definition orb := Eval compute in orb.
1644-
Definition beq_nat := Eval compute in EqNat.beq_nat.
1643+
Definition beq_nat := Eval compute in Nat.eqb.
16451644
Definition leb := Eval compute in Compare_dec.leb.
16461645

16471646
Module Export Notations.

src/Common/BoundedLookup.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Section BoundedIndex.
141141

142142
Fixpoint fin_beq {m n} (p : Fin.t m) (q : Fin.t n) :=
143143
match p, q with
144-
| @Fin.F1 m', @Fin.F1 n' => EqNat.beq_nat m' n'
144+
| @Fin.F1 m', @Fin.F1 n' => Nat.eqb m' n'
145145
| Fin.FS _ _, Fin.F1 _ => false
146146
| Fin.F1 _, Fin.FS _ _ => false
147147
| Fin.FS _ p', Fin.FS _ q' => fin_beq p' q'
@@ -153,7 +153,7 @@ Section BoundedIndex.
153153
Proof.
154154
intros; pattern n, p, q; eapply Fin.rect2; simpl;
155155
intuition; try (congruence || discriminate).
156-
- symmetry; eapply beq_nat_refl.
156+
- eapply Nat.eqb_refl.
157157
- eauto using Fin.FS_inj.
158158
Qed.
159159

src/Common/Enumerable.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Section enum.
2020

2121
Definition enumerate_fun_beq (enumerate : list A) (f g : A -> B)
2222
: bool
23-
:= EqNat.beq_nat (List.length (List.filter (fun x => negb (beq (f x) (g x))) enumerate)) 0.
23+
:= Nat.eqb (List.length (List.filter (fun x => negb (beq (f x) (g x))) enumerate)) 0.
2424

2525
Definition enumerate_fun_bl_in
2626
(bl : forall x y, beq x y = true -> x = y)
@@ -29,7 +29,7 @@ Section enum.
2929
Proof.
3030
unfold enumerate_fun_beq.
3131
intros H x H'.
32-
apply EqNat.beq_nat_true in H.
32+
apply Nat.eqb_eq in H.
3333
apply bl.
3434
destruct (beq (f x) (g x)) eqn:Heq; [ reflexivity | exfalso ].
3535
apply Bool.negb_true_iff in Heq.

src/Common/Equality.v

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Require Import Coq.Lists.List Coq.Lists.SetoidList.
22
Require Import Coq.Bool.Bool.
3+
Require Import Coq.Arith.PeanoNat.
34
Require Import Coq.Strings.Ascii.
45
Require Import Coq.Strings.String.
56
Require Import Coq.Logic.Eqdep_dec.
@@ -379,10 +380,10 @@ Definition internal_prod_dec_lb {A B} eq_A eq_B A_lb B_lb x y
379380
H
380381
(surjective_pairing _))).
381382

382-
Global Instance nat_BoolDecR : BoolDecR nat := EqNat.beq_nat.
383-
Global Instance nat_BoolDec_bl : BoolDec_bl (@eq nat) := @EqNat.beq_nat_true.
383+
Global Instance nat_BoolDecR : BoolDecR nat := Nat.eqb.
384+
Global Instance nat_BoolDec_bl : BoolDec_bl (@eq nat) := fun n m => (proj1 (Nat.eqb_eq n m)).
384385
Global Instance nat_BoolDec_lb : BoolDec_lb (@eq nat) :=
385-
fun x y => proj2 (@EqNat.beq_nat_true_iff x y).
386+
fun x y => proj2 (@Nat.eqb_eq x y).
386387

387388
Lemma unit_bl {x y} : unit_beq x y = true -> x = y.
388389
Proof. apply internal_unit_dec_bl. Qed.

src/Common/FixedPoints.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Section fixedpoints.
6262
| _ => omega
6363
| [ H : forall a, _ -> _ = _ |- _ ] => rewrite H by omega
6464
| [ H : _ < _ |- _ ] => hnf in H
65-
| [ H : S _ <= S _ |- _ ] => apply Le.le_S_n in H
65+
| [ H : S _ <= S _ |- _ ] => apply Nat.succ_le_mono in H
6666
| [ H : sizeof ?x <= ?y, H' : ?y <= sizeof (step ?x) |- _ ]
6767
=> let H'' := fresh in
6868
assert (H'' : sizeof (step x) <= sizeof x) by apply step_monotonic;
@@ -95,7 +95,7 @@ Section listpair.
9595
Lemma step_monotonic lss : sizeof_pair (step lss) <= sizeof_pair lss.
9696
Proof.
9797
unfold step, sizeof_pair; simpl;
98-
apply Plus.plus_le_compat;
98+
apply Nat.add_le_mono;
9999
apply length_filter.
100100
Qed.
101101

0 commit comments

Comments
 (0)