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

drop support for Coq 8.10

parent 78b6bc41
No related branches found
No related tags found
1 merge request!342drop support for Coq 8.10
...@@ -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"
...@@ -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}%"]
......
...@@ -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.
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