-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from sertel/mathcomp.2.1.0
Mathcomp 2.1.0 support
- Loading branch information
Showing
35 changed files
with
475 additions
and
333 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,52 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = github:nixos/nixpkgs; | ||
flake-utils.url = github:numtide/flake-utils; | ||
}; | ||
outputs = { self, nixpkgs, flake-utils }: | ||
let | ||
mkDrv = { stdenv, which, coqPackages, coq } : | ||
let | ||
extructures' = coqPackages.extructures.override { version = "0.4.0"; }; | ||
in | ||
stdenv.mkDerivation { | ||
pname = "ssprove"; | ||
version = "0.0.1"; | ||
src = ./.; | ||
nativeBuildInputs = [ which coq.ocamlPackages.findlib ] ++ | ||
(with coqPackages; [ | ||
equations | ||
mathcomp-analysis | ||
mathcomp-ssreflect | ||
deriving | ||
]) | ||
++ [extructures']; | ||
buildInputs = [ coq ]; | ||
}; | ||
in { inherit mkDrv; } // | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in | ||
rec { | ||
devShell = | ||
let | ||
args = { | ||
inherit (pkgs) stdenv which; | ||
coq = pkgs.coq_8_18; | ||
coqPackages = pkgs.coqPackages_8_18.overrideScope | ||
(self: super: { | ||
mathcomp = super.mathcomp.override { version = "2.1.0"; }; | ||
mathcomp-analysis = super.mathcomp-analysis.override { version = "1.0.0"; }; | ||
}); | ||
}; | ||
ssprove' = mkDrv args; | ||
in | ||
pkgs.mkShell { | ||
packages = | ||
(with pkgs; [ coq gnumake ]) | ||
++ | ||
(with ssprove'; nativeBuildInputs); | ||
}; | ||
}); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Set Warnings "-ambiguous-paths,-notation-overridden,-notation-incompatible-format". | ||
From mathcomp Require Import ssreflect ssrbool ssrnat choice fintype. | ||
Set Warnings "ambiguous-paths,notation-overridden,notation-incompatible-format". | ||
|
||
From extructures Require Import ord fmap. | ||
From Crypt Require Import Prelude. | ||
|
||
From HB Require Import structures. | ||
|
||
|
||
(** | ||
Note for any of these types it would also be okay to write the cast, e.g., [(nat:choiceType)%type], | ||
directly in the term. | ||
This (backward-compatibility) file just made porting to mathcomp 2.1.0 easier. | ||
Just delete as soon as all references to the below casts are gone from the code base. | ||
*) | ||
|
||
Definition unit_choiceType : choiceType := Datatypes.unit. | ||
Definition nat_choiceType : choiceType := nat. | ||
Definition bool_choiceType : choiceType := bool. | ||
Definition prod_choiceType (A B: choiceType) : choiceType := prod A B. | ||
Definition fmap_choiceType (A: ordType) (B: choiceType) : choiceType := {fmap A -> B}. | ||
Definition option_choiceType (A: choiceType) : choiceType := option A. | ||
Definition fin_choiceType (p: positive) : choiceType := ordinal p.(pos). | ||
Definition sum_choiceType (A B: choiceType) : choiceType := (A + B)%type. | ||
|
||
Definition unit_ordType: ordType := Datatypes.unit. | ||
Definition nat_ordType: ordType := nat. | ||
Definition bool_ordType: ordType := bool. | ||
Definition prod_ordType (A B: ordType) : ordType := prod A B. | ||
Definition fmap_ordType (A B: ordType) : ordType := {fmap A -> B}. | ||
Definition option_ordType (A: ordType) : ordType := option A. | ||
Definition fin_ordType (p: positive) : ordType := ordinal p.(pos). | ||
Definition sum_ordType (A B: ordType) : ordType := (A + B)%type. | ||
|
||
|
||
Definition prod_finType (A B: finType) : finType := prod A B. |
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
Oops, something went wrong.