-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,155 additions
and
987 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
-R src nbits | ||
src/Compatibility.v | ||
src/AuxLemmas.v | ||
src/NBitsDef.v | ||
src/NBitsOp.v | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
|
||
SWITCHES=" \ | ||
ocaml4.08.1-coq8.11.0-ssr1.10.0 \ | ||
ocaml4.11.2-coq8.12.2-ssr1.11.0 \ | ||
ocaml4.12.1-coq8.13.2-ssr1.12.0 \ | ||
ocaml4.13.1-coq8.14.1-ssr1.13.0 \ | ||
ocaml4.14.0-coq8.15.2-ssr1.14.0 \ | ||
" | ||
|
||
BUILD_DIR=_build | ||
|
||
if [[ "$1" == "clean" ]]; then | ||
rm -rf ${BUILD_DIR} | ||
exit | ||
fi | ||
|
||
CURRENT=`opam switch show` | ||
|
||
for s in ${SWITCHES}; do | ||
echo "Building with ${s}" | ||
|
||
echo -n " * Running 'opam switch' " | ||
opam switch ${s} &> /dev/null | ||
status=$? | ||
if [[ ${status} == 0 ]]; then | ||
echo "[DONE]" | ||
else | ||
echo "[FAIL]" | ||
continue | ||
fi | ||
eval $(opam env) | ||
|
||
echo -n " * Copying files " | ||
mkdir -p ${BUILD_DIR}/${s} | ||
tar -c --exclude ${BUILD_DIR} --exclude "*.vo" --exclude "*.vok" --exclude "*.vos" --exclude "*.glob" * | tar -x --keep-newer-files -C ${BUILD_DIR}/${s} &> /dev/null | ||
echo "[DONE]" | ||
|
||
echo -n " * Building Coq code " | ||
make -C ${BUILD_DIR}/${s} all >${BUILD_DIR}/${s}.log 2>&1 | ||
status=$? | ||
if [[ $status == 0 ]]; then | ||
echo "[DONE]" | ||
echo -n " * Building OCaml code " | ||
pushd ${BUILD_DIR}/${s}/src/ocaml &> /dev/null | ||
dune build &> /dev/null | ||
status=$? | ||
if [[ $status == 0 ]]; then | ||
echo "[DONE]" | ||
else | ||
echo "[FAIL]" | ||
fi | ||
popd &> /dev/null | ||
else | ||
echo "[FAIL]" | ||
fi | ||
done | ||
|
||
echo | ||
echo "See the following log files for compilation details." | ||
for s in ${SWITCHES}; do | ||
echo " * ${BUILD_DIR}/${s}.log" | ||
done | ||
|
||
opam switch ${CURRENT} | ||
eval $(opam env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
From Coq Require Import ZArith. | ||
From mathcomp Require Import ssreflect. | ||
|
||
(* | ||
* Before Coq 8.14, this lemma is: | ||
* Lemma Z_div_nz_opp_full : forall a b:Z, a mod b <> 0 -> (-a)/b = -(a/b)-1. | ||
*) | ||
Lemma Z_div_nz_opp_full (a b : Z) : | ||
b <> 0%Z -> (a mod b)%Z <> 0%Z -> (- a / b)%Z = (- (a / b) - 1)%Z. | ||
Proof. move=> *; by apply: Z_div_nz_opp_full. Qed. | ||
|
||
(* | ||
* Before Coq 8.14, this lemma is: | ||
* Lemma Z_div_nz_opp_r : forall a b:Z, a mod b <> 0 -> a/(-b) = -(a/b)-1. | ||
*) | ||
Lemma Z_div_nz_opp_r (a b : Z): | ||
b <> 0%Z -> (a mod b)%Z <> 0%Z -> (a / - b)%Z = (- (a / b) - 1)%Z. | ||
Proof. move=> *; by apply: Z_div_nz_opp_r. Qed. | ||
|
||
(* | ||
* After Coq 8.14, this lemma (in the module Z2N) is: | ||
* Lemma inj_mod n m : 0<=n -> 0<=m -> Z.to_N (n mod m) = ((Z.to_N n) mod (Z.to_N m))%N. | ||
*) | ||
Lemma Z2N_inj_mod (n m : Z) : | ||
(0<=n)%Z -> (0<m)%Z -> Z.to_N (n mod m) = ((Z.to_N n) mod (Z.to_N m))%N. | ||
Proof. | ||
move=> H0n H0m. move: (Z.lt_le_incl _ _ H0m) => H0m'. | ||
by apply: Z2N.inj_mod. | ||
Qed. |
Oops, something went wrong.