Skip to content
Snippets Groups Projects
Commit ea36eb94 authored by Ralf Jung's avatar Ralf Jung
Browse files

Merge branch 'ralf/drop-8.10' into 'master'

drop support for Coq 8.10

See merge request !342
parents 78b6bc41 e7613555
No related branches found
No related tags found
1 merge request!342drop support for Coq 8.10
Pipeline #58316 passed
...@@ -77,14 +77,8 @@ build-coq.8.12.2: ...@@ -77,14 +77,8 @@ build-coq.8.12.2:
DENY_WARNINGS: "1" DENY_WARNINGS: "1"
build-coq.8.11.2: build-coq.8.11.2:
<<: *template
variables:
OPAM_PINS: "coq version 8.11.2"
DENY_WARNINGS: "1"
build-coq.8.10.2:
<<: *template <<: *template
<<: *branches_and_mr <<: *branches_and_mr
variables: variables:
OPAM_PINS: "coq version 8.10.2" OPAM_PINS: "coq version 8.11.2"
DENY_WARNINGS: "1" DENY_WARNINGS: "1"
...@@ -3,6 +3,8 @@ API-breaking change is listed. ...@@ -3,6 +3,8 @@ API-breaking change is listed.
## std++ master ## std++ master
Coq 8.10 is no longer supported by this release.
- Add `list.zip_with_take_both` and `list.zip_with_take_both'` - Add `list.zip_with_take_both` and `list.zip_with_take_both'`
- Specialize `list.zip_with_take_{l,r}`, add generalized lemmas `list.zip_with_take_{l,r}'` - Specialize `list.zip_with_take_{l,r}`, add generalized lemmas `list.zip_with_take_{l,r}'`
- Add `bool_to_Z` that converts true to 1 and false to 0. (by Michael Sammler) - Add `bool_to_Z` that converts true to 1 and false to 0. (by Michael Sammler)
......
...@@ -45,7 +45,7 @@ Notably: ...@@ -45,7 +45,7 @@ Notably:
This version is known to compile with: This version is known to compile with:
- Coq version 8.10.2 / 8.11.2 / 8.12.2 / 8.13.2 / 8.14.1 - Coq version 8.11.2 / 8.12.2 / 8.13.2 / 8.14.1
## Installing via opam ## Installing via opam
......
...@@ -33,7 +33,7 @@ tags: [ ...@@ -33,7 +33,7 @@ tags: [
] ]
depends: [ depends: [
"coq" { (>= "8.10.2" & < "8.15~") | (= "dev") } "coq" { (>= "8.11" & < "8.15~") | (= "dev") }
] ]
build: [make "-j%{jobs}%"] build: [make "-j%{jobs}%"]
......
...@@ -18,3 +18,5 @@ ...@@ -18,3 +18,5 @@
Hγ : γ1 x Hγ : γ1 x
============================ ============================
γ1 x ∨ γ2 x γ1 x ∨ γ2 x
[TEST x y : nat, x = y]
: Prop
...@@ -31,3 +31,13 @@ Proof. ...@@ -31,3 +31,13 @@ Proof.
Qed. Qed.
End tests. End tests.
End accessor. End accessor.
(* Type inference for tele_app-based notation.
(Relies on [&] bidirectionality hint of tele_app.) *)
Definition test {TT : tele} (t : TT Prop) : Prop :=
.. x, t x t x.
Notation "'[TEST' x .. z , P ']'" :=
(test (TT:=(TeleS (fun x => .. (TeleS (fun z => TeleO)) ..)))
(tele_app (λ x, .. (λ z, P) ..)))
(x binder, z binder).
Check [TEST (x y : nat), x = y].
...@@ -321,12 +321,11 @@ Section Z_little_endian. ...@@ -321,12 +321,11 @@ Section Z_little_endian.
rewrite orb_false_l. f_equal. lia. rewrite orb_false_l. f_equal. lia.
Qed. Qed.
(* TODO: replace the calls to [nia] by [lia] after dropping support for Coq 8.10.2. *)
Lemma little_endian_to_Z_to_little_endian m n z: Lemma little_endian_to_Z_to_little_endian m n z:
0 n 0 m 0 n 0 m
little_endian_to_Z n (Z_to_little_endian m n z) = z `mod` 2 ^ (m * n). little_endian_to_Z n (Z_to_little_endian m n z) = z `mod` 2 ^ (m * n).
Proof. Proof.
intros ? Hm. rewrite <-Z.land_ones by nia. intros ? Hm. rewrite <-Z.land_ones by lia.
revert z. revert z.
induction m as [|m ? IH|] using (Z_succ_pred_induction 0); intros z; [..|lia]. induction m as [|m ? IH|] using (Z_succ_pred_induction 0); intros z; [..|lia].
{ Z.bitwise. by rewrite andb_false_r. } { Z.bitwise. by rewrite andb_false_r. }
...@@ -335,10 +334,10 @@ Section Z_little_endian. ...@@ -335,10 +334,10 @@ Section Z_little_endian.
rewrite Z.land_spec, Z.lor_spec, Z.shiftl_spec, !Z.land_spec by lia. rewrite Z.land_spec, Z.lor_spec, Z.shiftl_spec, !Z.land_spec by lia.
rewrite (Z_ones_spec n z') by lia. case_bool_decide. rewrite (Z_ones_spec n z') by lia. case_bool_decide.
- rewrite andb_true_r, (Z.testbit_neg_r _ (z' - n)), orb_false_r by lia. simpl. - rewrite andb_true_r, (Z.testbit_neg_r _ (z' - n)), orb_false_r by lia. simpl.
by rewrite Z_ones_spec, bool_decide_true, andb_true_r by nia. by rewrite Z_ones_spec, bool_decide_true, andb_true_r by lia.
- rewrite andb_false_r, orb_false_l. - rewrite andb_false_r, orb_false_l.
rewrite Z.shiftr_spec by lia. f_equal; [f_equal; lia|]. rewrite Z.shiftr_spec by lia. f_equal; [f_equal; lia|].
rewrite !Z_ones_spec by nia. apply bool_decide_iff. lia. rewrite !Z_ones_spec by lia. apply bool_decide_iff. lia.
Qed. Qed.
Lemma Z_to_little_endian_length m n z : Lemma Z_to_little_endian_length m n z :
...@@ -368,11 +367,11 @@ Section Z_little_endian. ...@@ -368,11 +367,11 @@ Section Z_little_endian.
0 little_endian_to_Z n bs < 2 ^ (Z.of_nat (length bs) * n). 0 little_endian_to_Z n bs < 2 ^ (Z.of_nat (length bs) * n).
Proof. Proof.
intros ?. induction 1 as [|b bs Hb ? IH]; [done|]; simpl. intros ?. induction 1 as [|b bs Hb ? IH]; [done|]; simpl.
apply Z_bounded_iff_bits_nonneg'; [nia|..]. apply Z_bounded_iff_bits_nonneg'; [lia|..].
{ apply Z.lor_nonneg. split; [lia|]. apply Z.shiftl_nonneg. lia. } { apply Z.lor_nonneg. split; [lia|]. apply Z.shiftl_nonneg. lia. }
intros z' ?. rewrite Z.lor_spec. intros z' ?. rewrite Z.lor_spec.
rewrite Z_bounded_iff_bits_nonneg' in Hb by lia. rewrite Z_bounded_iff_bits_nonneg' in Hb by lia.
rewrite Hb, orb_false_l, Z.shiftl_spec by nia. rewrite Hb, orb_false_l, Z.shiftl_spec by lia.
apply (Z_bounded_iff_bits_nonneg' (Z.of_nat (length bs) * n)); nia. apply (Z_bounded_iff_bits_nonneg' (Z.of_nat (length bs) * n)); lia.
Qed. Qed.
End Z_little_endian. End Z_little_endian.
...@@ -45,7 +45,9 @@ Definition tele_app {TT : tele} {T} (f : TT -t> T) : tele_arg TT → T := ...@@ -45,7 +45,9 @@ Definition tele_app {TT : tele} {T} (f : TT -t> T) : tele_arg TT → T :=
| TargO => λ t : T, t | TargO => λ t : T, t
| TargS x a => λ f, rec a (f x) | TargS x a => λ f, rec a (f x)
end) TT a f. end) TT a f.
Global Arguments tele_app {!_ _} _ !_ /. (* The bidirectionality hint [&] simplifies defining tele_app-based notation
such as the atomic updates and atomic triples in Iris. *)
Global Arguments tele_app {!_ _} & _ !_ /.
Coercion tele_arg : tele >-> Sortclass. Coercion tele_arg : tele >-> Sortclass.
(* This is a local coercion because otherwise, the "λ.." notation stops working. *) (* This is a local coercion because otherwise, the "λ.." notation stops working. *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment