Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coq8.18 #19

Merged
merged 8 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/docker-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ jobs:
matrix:
image:
- 'coqorg/coq:dev'
- 'coqorg/coq:8.16'
- 'coqorg/coq:8.15'
- 'coqorg/coq:8.14'
- 'coqorg/coq:8.13'
- 'coqorg/coq:8.12'
- 'coqorg/coq:8.19'
- 'coqorg/coq:8.18'
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/replay-why3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v2
- uses: coq-community/docker-coq-action@v1
with:
custom_image: 'coqorg/coq:8.13'
custom_image: 'coqorg/coq:8.18'
custom_script: |
{{before_install}}
startGroup "Build bertrand dependencies"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Follow the instructions on https://github.com/coq-community/templates to regener
[![Zulip][zulip-shield]][zulip-link]
[![DOI][doi-shield]][doi-link]

[docker-action-shield]: https://github.com/coq-community/bertrand/workflows/Docker%20CI/badge.svg?branch=master
[docker-action-link]: https://github.com/coq-community/bertrand/actions?query=workflow:"Docker%20CI"
[docker-action-shield]: https://github.com/coq-community/bertrand/actions/workflows/docker-action.yml/badge.svg?branch=master
[docker-action-link]: https://github.com/coq-community/bertrand/actions/workflows/docker-action.yml

[contributing-shield]: https://img.shields.io/badge/contributions-welcome-%23f7931e.svg
[contributing-link]: https://github.com/coq-community/manifesto/blob/master/CONTRIBUTING.md
Expand All @@ -37,7 +37,7 @@ an application of the postulate to compute partitions.
- Coq-community maintainer(s):
- Laurent Théry ([**@thery**](https://github.com/thery))
- License: [GNU Lesser General Public License v2.1 or later](LICENSE)
- Compatible Coq versions: Coq 8.12 or later
- Compatible Coq versions: Coq 8.18 or later
- Additional dependencies: none
- Coq namespace: `Bertrand`
- Related publication(s):
Expand Down Expand Up @@ -101,15 +101,15 @@ let part30 = part 15;;
## Replaying the WhyML program correctness proof

To replay the proof of correctness for the WhyML program for computing primes,
first make sure the following packages are installed (in addition to Coq 8.13.2
first make sure the following packages are installed (in addition to Coq 8.18.0
and the proof of Bertrand's postulate):

- [Alt-Ergo 2.4.1](https://alt-ergo.ocamlpro.com)
- [Alt-Ergo 2.5.4](https://alt-ergo.ocamlpro.com)
- [Why3 1.4.1](http://why3.lri.fr) and its Coq library

These packages can be installed via OPAM using the following command:
```
opam install alt-ergo.2.4.1 why3.1.4.1 why3-coq.1.4.1
opam install alt-ergo.2.5.4 why3.1.7.2 why3-coq.1.7.2
```
Then, the proof can be replayed by running
```
Expand Down
2 changes: 1 addition & 1 deletion coq-bertrand.opam
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ an application of the postulate to compute partitions."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {(>= "8.12" & < "8.18~") | (= "dev")}
"coq" {(>= "8.18" & < "8.20~") | (= "dev")}
]

tags: [
Expand Down
8 changes: 4 additions & 4 deletions coq-knuth-prime-whyml.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ build: [
[make "why"]
]
depends: [
"coq" {= "8.13.2"}
"why3" {= "1.4.1"}
"why3-coq" {= "1.4.1"}
"alt-ergo" {= "2.4.1"}
"coq" {= "8.18.0"}
"why3" {= "1.7.2"}
"why3-coq" {= "1.7.2"}
"alt-ergo" {= "2.5.4"}
"coq-bertrand" {= version}
]

Expand Down
17 changes: 7 additions & 10 deletions meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ license:
identifier: LGPL-2.1-or-later

supported_coq_versions:
text: Coq 8.12 or later
opam: '{(>= "8.12" & < "8.18~") | (= "dev")}'
text: Coq 8.18 or later
opam: '{(>= "8.18" & < "8.20~") | (= "dev")}'

tested_coq_opam_versions:
- version: 'dev'
- version: '8.16'
- version: '8.15'
- version: '8.14'
- version: '8.13'
- version: '8.12'
- version: '8.19'
- version: '8.18'

tested_coq_nix_versions:
- coq_version: 'master'
Expand Down Expand Up @@ -95,15 +92,15 @@ documentation: |
## Replaying the WhyML program correctness proof

To replay the proof of correctness for the WhyML program for computing primes,
first make sure the following packages are installed (in addition to Coq 8.13.2
first make sure the following packages are installed (in addition to Coq 8.18.0
and the proof of Bertrand's postulate):

- [Alt-Ergo 2.4.1](https://alt-ergo.ocamlpro.com)
- [Alt-Ergo 2.5.4](https://alt-ergo.ocamlpro.com)
- [Why3 1.4.1](http://why3.lri.fr) and its Coq library

These packages can be installed via OPAM using the following command:
```
opam install alt-ergo.2.4.1 why3.1.4.1 why3-coq.1.4.1
opam install alt-ergo.2.5.4 why3.1.7.2 why3-coq.1.7.2
```
Then, the proof can be replayed by running
```
Expand Down
2 changes: 1 addition & 1 deletion theories/Partition.v
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Laurent.Thery@inria.fr (2002)
*********************************************************************)

From Coq Require Import Div2 Even Wf_nat Arith ArithRing List.
From Coq Require Import Wf_nat Arith ArithRing List.
From Bertrand Require Import Bertrand.

(*** All these theorems are in coq 8.16 *)
Expand Down
26 changes: 22 additions & 4 deletions why/Knuth/Knuth_Knuth_h_5.v → why/Knuth/Knuth_Knuth_h_6.v
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,20 @@ Parameter mixfix_lblsmnrb:
forall {a:Type} {a_WT:WhyType a}, array a -> Numbers.BinNums.Z -> a ->
array a.

Axiom mixfix_lblsmnrb'spec'0 :
forall {a:Type} {a_WT:WhyType a},
forall (a1:array a) (i:Numbers.BinNums.Z) (v:a),
((length (mixfix_lblsmnrb a1 i v)) = (length a1)).

Axiom mixfix_lblsmnrb'spec :
forall {a:Type} {a_WT:WhyType a},
forall (a1:array a) (i:Numbers.BinNums.Z) (v:a),
((length (mixfix_lblsmnrb a1 i v)) = (length a1)) /\
((elts (mixfix_lblsmnrb a1 i v)) = (map.Map.set (elts a1) i v)).

Parameter make:
forall {a:Type} {a_WT:WhyType a}, Numbers.BinNums.Z -> a -> array a.

Axiom make'spec :
Axiom make_spec :
forall {a:Type} {a_WT:WhyType a},
forall (n:Numbers.BinNums.Z) (v:a), (0%Z <= n)%Z ->
(forall (i:Numbers.BinNums.Z), (0%Z <= i)%Z /\ (i < n)%Z ->
Expand Down Expand Up @@ -167,9 +171,20 @@ Axiom H11 : (0%Z <= j1)%Z.

Axiom H12 : (j1 < i)%Z.

Axiom H13 : ~ ((b1 = Init.Datatypes.true) /\ ((mixfix_lbrb a2 j1) <= s)%Z).
Parameter o: Init.Datatypes.bool.

Parameter o1: Numbers.BinNums.Z.

Axiom H13 :
((b1 = Init.Datatypes.true) ->
(o1 = (mixfix_lbrb a2 j1)) /\
((o1 <= s)%Z -> (o = Init.Datatypes.true)) /\
(~ (o1 <= s)%Z -> (o = Init.Datatypes.false))) /\
(~ (b1 = Init.Datatypes.true) -> (o = Init.Datatypes.false)).

Axiom H14 : ~ (o = Init.Datatypes.true).

Axiom H14 : ~ (b1 = Init.Datatypes.true).
Axiom H15 : ~ (b1 = Init.Datatypes.true).

Parameter m1: Numbers.BinNums.Z.

Expand All @@ -193,3 +208,6 @@ assert (H5 : x = Z.to_nat n1); try lia.
apply H1; try lia.
exists (Z.to_nat y); lia.
Qed.



Loading
Loading