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

[WIP] Adding agda system and agda checking script #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tdelort
Copy link

@tdelort tdelort commented Jun 12, 2020

Changes

Agda.ml script added in src/sttfa/export and src/core/systems.ml, src/sttfa/exporter.ml and utils/export.sh file changed to allow exporting to agda.
Checking script at utils/checking/agda.sh also added.

WIP

It is still a work in progress since the exported files don't type check without --type-in-type which makes agda inconsistent, and -W noMissingDefinitions because symbols And, Not, Or, False, True, ex, equals don't have a definition.
This exporter has only been tested on arith_fermat/ but not on opentheory_stdlib/

@tdelort tdelort changed the title Adding agda system and agda checking script [WIP] Adding agda system and agda checking script Jun 12, 2020
@GuillaumeGen GuillaumeGen added the WIP Work In Progress label Jun 12, 2020
@francoisthire
Copy link
Collaborator

So far, it seems correct. However, it is not clear to me what we want on the long run.

Right now, all the translations from sttfa to * are total functions, with Agda it can't be true. In particular, this means we accept to produce ill-typed Agda files.

What are your plans to overcome the universe issue?

@tdelort
Copy link
Author

tdelort commented Jun 15, 2020

I'll see if I can use Universe Polymorphism to get rid of this problem, first by repairing by hand the files where --type-in-type needs to be used, and then finding a generic way to implement it into agda.ml.

For the -W noMissingDefinition Warning, a quick fix would be to set symbols that need a definition to postulate too. (Parameter as well as Axiom from the ast as postulate).

@tdelort
Copy link
Author

tdelort commented Jul 2, 2020

This new version doesn't work on its own. You need to :

  • Change the Set Levels by hand (for example with those given by Coq Print Sorted Universes. on the Coq version (with Prop changed to Type))
  • Some axioms cannot be set universe polymorphic or Agda will not be able to infer the level. But they are used on many levels. I used Lift from the Agda stdlib to fix these problems by hand.

Set levels can't be left to _ since Agda won't be able to infer the level with this version.

One version that works is to use {-# OPTIONS --cumulativity #-} and getting the Level of the universes from Coq. To avoid cumulativity, one could instead use Lift from the Agda stdlib.

I linked files that type-check using this translation and these rules to this comment.
some_files_that_type_check.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants