Comments (8)
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.
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.
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.
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.
Sounds like a good plan. I'd recommend
polymorphic Mod.val
and eithercumulative Mod.val
orpolymorphic 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 thePolymorphic
andCumulative
tags.
Good suggestions! Thanks!
from hs-to-coq.
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.
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.
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)
- `rename value` does not respect `rename module`
- Use `Equations` instead of `Program Fixpoint` for termination HOT 4
- The float_let tactic breaks with Coq 8.10.2
- Generate Rewrite Tactics for Unfolding Definitions HOT 2
- Redefine does not work on default type class methods
- Edit files without trailing line breaks parser
- Cannot find a physical path bound to logical path matching suffix GHC. HOT 20
- CI breaks because of the wc example
- Coqc doesn't recognise !! operator
- What is the meaning of GHC.Err.patternFailure? HOT 3
- GHC flags taken into account too late
- Rename our provided modules from `GHC.…` to `HsToCoq.…` or similar
- Rename type doesn't affect signature when used with "in" HOT 1
- Don't include Makefile generated by Coq
- Qualify modules under base HOT 1
- Code duplication in mutually recursive functions
- Pattern synonyms HOT 1
- Skip types from a skipped module
- Derived Ord instances do a weird substitution HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hs-to-coq.