Skip to content

Commit

Permalink
Merge pull request #52 from arnoudvanderleer/CI
Browse files Browse the repository at this point in the history
Make CI work for the coq files
  • Loading branch information
benediktahrens authored Aug 20, 2024
2 parents 40ffe12 + f507d9b commit 47a11d2
Show file tree
Hide file tree
Showing 37 changed files with 349 additions and 254 deletions.
59 changes: 45 additions & 14 deletions .github/workflows/build-schools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,67 @@

name: CI

# Controls when the action will run.
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

schedule:
# Run this workflow at 02:15 UTC every Tuesday to keep the cache from being
# evicted. A typical run with everything cached should take less than 10
# minutes.
- cron: 15 2 * * TUE

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
# Set this to the version of Coq that should be used.
coq-version: 8.19.0
dune-version: 3.8.0
DUNE_CACHE_STORAGE_MODE: copy

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Build Schools
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2


# Install everything needed for building UniMath (and more)
- name: Install build dependencies
run: sudo apt-get install build-essential git ocaml ocaml-nox ocaml-native-compilers camlp5 libgtk2.0 libgtksourceview2.0 liblablgtk-extras-ocaml-dev ocaml-findlib libnum-ocaml-dev emacs

# Change into UniMath directory and build UniMath
- name: Build UniMath and Schools files
run: |
cd $GITHUB_WORKSPACE
time make
# Checkout UniMath into the working directory
- name: Checkout UniMath.
uses: actions/checkout@v3
with:
repository: UniMath/UniMath
clean: false
path: .

# Checkout the current branch into Schools/
- name: Checkout Schools.
uses: actions/checkout@v3
with:
path: Schools

# Ideally we would use docker-coq. A setup currently takes about 7min
# before it starts compiling, with OCaml cached.
- name: Install OCaml.
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ocaml-variants.4.14.0+options,ocaml-option-flambda
dune-cache: true
opam-disable-sandboxing: true

- name: Install Dune
run: opam pin add dune ${{ env.dune-version }}
- name: Install Coq
run: opam pin add coq ${{ env.coq-version }}

# Schools is built using the flags specified in code/dune.
- name: Compile Schools.
run: opam exec -- dune build Schools --display=short --error-reporting=twice
12 changes: 6 additions & 6 deletions 2017-12-Birmingham/Part4_Tactics_UniMath/lecture_tactics.v
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Definition myfirsttruthvalue: bool.
Proof.
(** Now we still have to give the term, but we are in interactive mode. *)
(** If you want to see everything that *involves* booleans, then do *)
Search bool.
(* Search bool. *)
(** If you think there are too many hits and you only want to
find library elements that *yield* booleans, then try *)
SearchPattern bool.
(* SearchPattern bool. *)
(** [true] does not take an argument, and it is already a term we can take as definiens. *)
exact true.
(** [exact] is a tactic which takes the term as argument and informs Coq in the proof mode to
Expand All @@ -62,14 +62,14 @@ Defined.

(** [Defined.] instructs Coq to complete the whole interactive construction of a term,
verify it and to associate it with the given identifer, here [myfirsttruthvalue]. *)
Search bool.
(* Search bool. *)
(** The new definition appears at the beginning of the list. *)
Print myfirsttruthvalue.

(** *** a more compelling example *)
Definition mysecondtruthvalue: bool.
Proof.
Search bool.
(* Search bool. *)
apply negb.
(** applies the function [negb] to obtain the required boolean,
thus the system has to ask for its argument *)
Expand Down Expand Up @@ -101,7 +101,7 @@ Definition andb (b1 b2:bool) : bool := if b1 then b2 else false.

Definition mythirdtruthvalue: bool.
Proof.
Search bool.
(* Search bool. *)
apply andb.
(** [apply andb.] applies the function [andb] to obtain the required boolean,
thus the system has to ask for its TWO arguments, one by one *)
Expand Down Expand Up @@ -404,7 +404,7 @@ We need to help Coq with the argument [b] to [pathscomp0].
*)
apply (pathscomp0 (b := A × (B × (C × D)))).
- (** is this not just associativity with third argument [C × D]? *)
Search (_ × _).
(* Search (_ × _). *)
(** No hope at all for our equation - we can only hope
for weak equivalence. *)
Abort.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Definition myfirsttruthvalue: bool.
Proof.
(** Now we still have to give the term, but we are in interactive mode. *)
(** If you want to see everything that *involves* booleans, then do *)
Search bool.
(* Search bool. *)
(** If you think there are too many hits and you only want to
find library elements that *yield* booleans, then try *)
SearchPattern bool.
(* SearchPattern bool. *)
(** [true] does not take an argument, and it is already a term we can take as definiens. *)
exact true.
(** [exact] is a tactic which takes the term as argument and informs Coq in the proof mode to
Expand All @@ -62,14 +62,14 @@ Defined.

(** [Defined.] instructs Coq to complete the whole interactive construction of a term,
verify it and to associate it with the given identifer, here [myfirsttruthvalue]. *)
Search bool.
(* Search bool. *)
(** The new definition appears at the beginning of the list. *)
Print myfirsttruthvalue.

(** *** a more compelling example *)
Definition mysecondtruthvalue: bool.
Proof.
Search bool.
(* Search bool. *)
apply negb.
(** applies the function [negb] to obtain the required boolean,
thus the system has to ask for its argument *)
Expand Down Expand Up @@ -101,7 +101,7 @@ Definition andb (b1 b2:bool) : bool := if b1 then b2 else false.

Definition mythirdtruthvalue: bool.
Proof.
Search bool.
(* Search bool. *)
apply andb.
(** [apply andb.] applies the function [andb] to obtain the required boolean,
thus the system has to ask for its TWO arguments, one by one *)
Expand Down Expand Up @@ -369,9 +369,9 @@ Print paths.
(** A word of warning for those who read "Coq in a Hurry": [SearchRewrite]
does not find equations w.r.t. this notion, only w.r.t. Coq's built-in
propositional equality. *)
SearchPattern (paths _ _).
(* SearchPattern (paths _ _). *)
(** Among the search results is [pathsinv0l] that has [idpath] in its conclusion. *)
SearchRewrite idpath.
(* SearchRewrite idpath. *)
(** No result! *)

(** *** How to decompose formulas *)
Expand Down Expand Up @@ -504,11 +504,11 @@ We need to help Coq with the argument [b] to [pathscomp0].
*)
apply (pathscomp0 (b := A × (B × (C × D)))).
- (** is this not just associativity with third argument [C × D]? *)
SearchPattern(_ × _).
(* SearchPattern(_ × _). *)
(** No hope at all - we can only hope for weak equivalence. *)
Abort.

SearchPattern(_ ≃ _).
(* SearchPattern(_ ≃ _). *)
Print weqcomp.
Print weqdirprodasstor.
Print weqdirprodasstol.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
Require Import UniMath.MoreFoundations.All.
Require Import UniMath.CategoryTheory.Core.Prelude.
Require Import UniMath.CategoryTheory.Core.Setcategories.
Require Import UniMath.CategoryTheory.categories.HSET.Core.
Require Import UniMath.CategoryTheory.Categories.HSET.Core.
Require Import UniMath.CategoryTheory.DisplayedCats.Isos.
Require Import UniMath.CategoryTheory.DisplayedCats.Univalence.
Require Import UniMath.CategoryTheory.DisplayedCats.Constructions.
Require Import UniMath.CategoryTheory.DisplayedCats.Core.
Require Import UniMath.CategoryTheory.limits.graphs.colimits.
Require Import UniMath.CategoryTheory.limits.graphs.limits.
Require Import UniMath.CategoryTheory.limits.terminal.
Require Import UniMath.CategoryTheory.limits.initial.
Require Import UniMath.CategoryTheory.limits.FinOrdProducts.
Require Import UniMath.CategoryTheory.limits.equalizers.
Require Import UniMath.CategoryTheory.limits.pullbacks.
Require Import UniMath.CategoryTheory.Limits.Graphs.Colimits.
Require Import UniMath.CategoryTheory.Limits.Graphs.Limits.
Require Import UniMath.CategoryTheory.Limits.Terminal.
Require Import UniMath.CategoryTheory.Limits.Initial.
Require Import UniMath.CategoryTheory.Limits.FinOrdProducts.
Require Import UniMath.CategoryTheory.Limits.Equalizers.
Require Import UniMath.CategoryTheory.Limits.Pullbacks.
Require Import UniMath.CategoryTheory.Adjunctions.Core.
Require Import UniMath.CategoryTheory.Monads.Monads.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
Require Import UniMath.MoreFoundations.All.
Require Import UniMath.CategoryTheory.Core.Prelude.
Require Import UniMath.CategoryTheory.Core.Setcategories.
Require Import UniMath.CategoryTheory.categories.HSET.Core.
Require Import UniMath.CategoryTheory.Categories.HSET.Core.
Require Import UniMath.CategoryTheory.DisplayedCats.Isos.
Require Import UniMath.CategoryTheory.DisplayedCats.Univalence.
Require Import UniMath.CategoryTheory.DisplayedCats.Constructions.
Require Import UniMath.CategoryTheory.DisplayedCats.Core.
Require Import UniMath.CategoryTheory.limits.graphs.colimits.
Require Import UniMath.CategoryTheory.limits.graphs.limits.
Require Import UniMath.CategoryTheory.limits.terminal.
Require Import UniMath.CategoryTheory.limits.initial.
Require Import UniMath.CategoryTheory.limits.FinOrdProducts.
Require Import UniMath.CategoryTheory.limits.equalizers.
Require Import UniMath.CategoryTheory.limits.pullbacks.
Require Import UniMath.CategoryTheory.Limits.Graphs.Colimits.
Require Import UniMath.CategoryTheory.Limits.Graphs.Limits.
Require Import UniMath.CategoryTheory.Limits.Terminal.
Require Import UniMath.CategoryTheory.Limits.Initial.
Require Import UniMath.CategoryTheory.Limits.FinOrdProducts.
Require Import UniMath.CategoryTheory.Limits.Equalizers.
Require Import UniMath.CategoryTheory.Limits.Pullbacks.
Require Import UniMath.CategoryTheory.Adjunctions.Core.
Require Import UniMath.CategoryTheory.Monads.Monads.

Expand Down
11 changes: 11 additions & 0 deletions 2017-12-Birmingham/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(include_subdirs qualified)

(coq.theory
(name Birmingham2017)
(flags :standard
-noinit
-indices-matter
-type-in-type
-w -notation-overridden)
(theories UniMath))

Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ in UniMath it is very important to be able to search the library so
that you don't do something someone else has already done. *)

(** To find everything about nat type: *)
Search nat.
(* Search nat. *)

(** To search for all lemmas involving the pattern *)
(* Search _ (_ -> _ -> _). *)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ Definition parity (n : nat) := nat_rect (fun _ => nat) 0 (fun _ b => flip b) n.
notion of image in which we replace ∑ with ∃. *)
Require Import UniMath.Foundations.Propositions.

Definition image {A B : UU} (f : A → B) :
∑ (y : B), ∃ (x : A), f x = y.
Definition image {A B : UU} (f : A → B) : UU
:= ∑ (y : B), ∃ (x : A), f x = y.

(* Prove that the (univalent) image of partiy is equivalent to Bool. *)
Theorem image_parity_equiv_bool :
Expand Down
12 changes: 6 additions & 6 deletions 2019-04-Birmingham/Part4_Tactics_UniMath/lecture_tactics.v
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Definition myfirsttruthvalue: bool.
Proof.
(** Now we still have to give the term, but we are in interactive mode. *)
(** If you want to see everything that *involves* booleans, then do *)
Search bool.
(* Search bool. *)
(** If you only want to find library elements that *yield* booleans, then try *)
SearchPattern bool.
(* SearchPattern bool. *)
(** [true] does not take an argument, and it is already a term we can take as definiens. *)
exact true.
(** [exact] is a tactic which takes the term as argument and informs Coq in the proof mode to
Expand All @@ -62,14 +62,14 @@ Defined.

(** [Defined.] instructs Coq to complete the whole interactive construction of a term,
verify it and to associate it with the given identifer, here [myfirsttruthvalue]. *)
Search bool.
(* Search bool. *)
(** The new definition appears at the beginning of the list. *)
Print myfirsttruthvalue.

(** *** a more compelling example *)
Definition mysecondtruthvalue: bool.
Proof.
Search bool.
(* Search bool. *)
apply negb.
(** applies the function [negb] to obtain the required boolean,
thus the system has to ask for its argument *)
Expand Down Expand Up @@ -102,7 +102,7 @@ Definition andb (b1 b2:bool) : bool := if b1 then b2 else false.

Definition mythirdtruthvalue: bool.
Proof.
Search bool.
(* Search bool. *)
apply andb.
(** [apply andb.] applies the function [andb] to obtain the required boolean,
thus the system has to ask for its TWO arguments, one by one. *)
Expand Down Expand Up @@ -395,7 +395,7 @@ We need to help Coq with the argument [b] to [pathscomp0].
*)
apply (pathscomp0 (b := A × (B × (C × D)))).
- (** is this not just associativity with third argument [C × D]? *)
Search (_ × _).
(* Search (_ × _). *)
(** No hope at all for our equation - we can only hope
for weak equivalence. *)
Abort.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Definition myfirsttruthvalue: bool.
Proof.
(** Now we still have to give the term, but we are in interactive mode. *)
(** If you want to see everything that *involves* booleans, then do *)
Search bool.
(* Search bool. *)
(** If you only want to find library elements that *yield* booleans, then try *)
SearchPattern bool.
(* SearchPattern bool. *)
(** [true] does not take an argument, and it is already a term we can take as definiens. *)
exact true.
(** [exact] is a tactic which takes the term as argument and informs Coq in the proof mode to
Expand All @@ -65,7 +65,7 @@ Defined.
verify it and to associate it with the given identifer, here [myfirsttruthvalue].
This may go wrong for different reasons, including implementation errors of the Coq
system - that will not affect trustworthiness of the library. *)
Search bool.
(* Search bool. *)
(** The new definition appears at the beginning of the list. *)
Print myfirsttruthvalue.
(** [myfirsttruthvalue relies on an unsafe universe hierarchy] is output to indicate
Expand All @@ -74,7 +74,7 @@ Print myfirsttruthvalue.
(** *** a more compelling example *)
Definition mysecondtruthvalue: bool.
Proof.
Search bool.
(* Search bool. *)
apply negb.
(** applies the function [negb] to obtain the required boolean,
thus the system has to ask for its argument *)
Expand Down Expand Up @@ -107,7 +107,7 @@ Definition andb (b1 b2:bool) : bool := if b1 then b2 else false.

Definition mythirdtruthvalue: bool.
Proof.
Search bool.
(* Search bool. *)
apply andb.
(** [apply andb.] applies the function [andb] to obtain the required boolean,
thus the system has to ask for its TWO arguments, one by one. *)
Expand Down Expand Up @@ -360,9 +360,9 @@ Print paths.
(** A word of warning for those who read "Coq in a Hurry": [SearchRewrite]
does not find equations w.r.t. this notion, only w.r.t. Coq's built-in
propositional equality. *)
SearchPattern (paths _ _).
(* SearchPattern (paths _ _). *)
(** Among the search results is [maponpathsinv0] that has [idpath] in its conclusion. *)
SearchRewrite idpath.
(* SearchRewrite idpath. *)
(** No result! *)

(** *** How to decompose formulas *)
Expand Down Expand Up @@ -500,11 +500,11 @@ We need to help Coq with the argument [b] to [pathscomp0].
*)
apply (pathscomp0 (b := A × (B × (C × D)))).
- (** is this not just associativity with third argument [C × D]? *)
SearchPattern(_ × _).
(* SearchPattern(_ × _). *)
(** No hope at all - we can only hope for weak equivalence. *)
Abort.

SearchPattern(_ ≃ _).
(* SearchPattern(_ ≃ _). *)
Print weqcomp.
Print weqdirprodasstor.
Print weqdirprodasstol.
Expand Down
Loading

0 comments on commit 47a11d2

Please sign in to comment.