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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coq: Homotopy Type Theory #29653

Merged
merged 1 commit into from Oct 11, 2017
Merged

Coq: Homotopy Type Theory #29653

merged 1 commit into from Oct 11, 2017

Conversation

langston-barrett
Copy link
Contributor

Motivation for this change

I'm writing my undergraduate thesis on Homotopy Type Theory 馃槃 But honestly, users of HoTT are becoming a larger and larger share of Coq users in general.

There's an issue with this package: because HoTT replaces the Coq standard library, it's difficult to use with vanilla coqc, coqtop, and related binaries. It provides its own (hoqc, hoqtop, etc.), but they expect to be in the same directory as the compiled *.vo files or for said files to be at /usr/share/hott. I've simply dropped the *.vo files into bin. I'm also open to symlinking them from a more standard directory.

Another issue is that the current version might not work with older versions of Coq. Is there a way to prevent it from building with e.g. coq_8_4?

You can test the build by running

nix-build -A coqPackages_8_6.HoTT

and then

./result/bin/hoqtop

and typing

Require Import HoTT.Categories.Category

You should get no error message, as opposed to when typing foo and getting

Coq < Require Import foo.
Toplevel input, characters 15-18:
> Require Import foo.
>                ^^^
Error: Unable to locate library foo.
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@vbgl
Copy link
Contributor

vbgl commented Sep 22, 2017

LGTM.

Concerning your issues about old coq versions, a common practice is to throw an error at evaluation time. You may add at the beginning of your package something like the following:

if !stdenv.lib.versionAtLeast coq.coq-version "8.6"
then throw "HoTT requires Coq 8.6"
else

@langston-barrett
Copy link
Contributor Author

@vbgl Thanks for the review! I've added the code you suggested, it seems to work well.

@langston-barrett
Copy link
Contributor Author

Looks like the Travis build encountered a merge conflict, not sure why that would happen when Git reports that there isn't one. Should I rebase onto a more recent master?

@vbgl vbgl merged commit 48a49fc into NixOS:master Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants