GithubHelp home page GithubHelp logo

Universe polymorphism edits about hs-to-coq HOT 8 OPEN

lastland avatar lastland commented on September 3, 2024 2
Universe polymorphism edits

from hs-to-coq.

Comments (8)

antalsz avatar antalsz commented on September 3, 2024 2

Sounds like a good plan. I'd recommend polymorphic Mod.val and either cumulative Mod.val or polymorphic cumulative Mod.val to be consistent with the current set of edits. We'll probably need to add a new map from names to their polymorphism status, and then monitor that flag that when translating. (Are polymorphism and cumulativity independent? That probably affects the design.) This should be decently straightforward to add, although it will necessitate modifying the Coq AST to include the Polymorphic and Cumulative tags. I need to focus on my dissertation instead of implementing this, though.

from hs-to-coq.

lastland avatar lastland commented on September 3, 2024 1

In some scenarios, we may also want to use a single edit to make everything in a module universe polymorphic. And in those scenarios, we may also want edits that can make a few definitions monomorphic.

BTW, the first use case can now be simulated by adding Set Universe Polymorphism in a preamble, but edits should look better and we still need the monomorphic flag.

from hs-to-coq.

antalsz avatar antalsz commented on September 3, 2024

Actually, another thought: should we always enable universe polymorphism and/or cumulativity? What would be the ramifications of that? (With Universe Polymorphism. and/or Set Polymorphic Inductive Cumulativity.)

from hs-to-coq.

lastland avatar lastland commented on September 3, 2024

Actually, another thought: should we always enable universe polymorphism and/or cumulativity? What would be the ramifications of that?

That is a good question. I have been trying to modify base to make it more polymorphic to see what would happen. At this moment, it seems to me that making everything polymorphic does not work very well (or at least requires more manual intervention), but I have not fully understood why yet. In particular, I am now running into a problem with a Program Fixpoint with a measure. The proof obligations can be solved via lia but Qed fails because Coq somehow runs into a branch that asserts False. :(

from hs-to-coq.

lastland avatar lastland commented on September 3, 2024

Sounds like a good plan. I'd recommend polymorphic Mod.val and either cumulative Mod.val or polymorphic cumulative Mod.val to be consistent with the current set of edits. We'll probably need to add a new map from names to their polymorphism status, and then monitor that flag that when translating. (Are polymorphism and cumulativity independent? That probably affects the design.) This should be decently straightforward to add, although it will necessitate modifying the Coq AST to include the Polymorphic and Cumulative tags.

Good suggestions! Thanks!

from hs-to-coq.

antalsz avatar antalsz commented on September 3, 2024

Ah, good point about the preamble. We could also switch to default polymorphic/edits for monomorphism, but it seems like there's no reason to do that – polymorphism seems to be less necessary.

from hs-to-coq.

lastland avatar lastland commented on September 3, 2024

At this moment, it seems to me that making everything polymorphic does not work very well (or at least requires more manual intervention), but I have not fully understood why yet.

And my plan is to try to understand this part better :)

from hs-to-coq.

lastland avatar lastland commented on September 3, 2024

I have just found another term called "template universe polymorphic". It happened when you define something with explicit universe levels but without the keyword "Polymorphic" in front of the definition. This might also be something we want. In this case, it looks like the edits of declaring something to be polymorphic and the edits of annotating universe levels should be separate edits that can be used together.

I have not found much information about "template universe polymorphic", except for this documentation: https://github.com/coq/coq/blob/master/dev/doc/universes.md
(The term is not in Coq doc. And I do not recall seeing it in their paper 😞 )

from hs-to-coq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.