-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
New language request: Coq #22
Comments
Welcome 🌻
If it compiles it runs, but that doesn't say anything about whether the program has the desired functionality. Is there a way to provide a specification? All of the exercise implementations in Exercism rely on unit tests as the specification. |
In our case the spec could look like a type (quite literally) for which the person who does the exercise just needs to fill in the program. Here's the example of an exercise we're getting inspiration from: https://www.cis.upenn.edu/~bcpierce/sf/current/Basics.html#lab38 Would this work? |
Another idea is to use modules. We can provide Module interface with list of things to prove/implement. User will provide module implementation. The unit test will instantiate the module. |
I think so. /cc @jtigger @parkerl Would you help think about this? @ErikSchierboom I'd be curious to hear your thoughts as well. |
Here is what I have in mind:
My current thinking is to use module types to enforce the interface. I started to experimenting with few sample problems using this approach. Here is my current code: https://github.com/vzaliva/coq-exercism-examples All comments are welcome. It would be interesting to try more complex exercise which will require more tests. |
Is using modules a standard practice when developing Coq? If so, that seems like a reasonable approach. We should strive to use a setup that is comfortable to Coq users, something they are familiar with. I've looked at your example code, but the test file is basically just importing another file? Wouldn't it make more sense to just have the basic interface (and its types) defined in the test file? Note that I haven't actually written any Coq, ever :) I must say I'm quite excited by this potential new track! My thesis used another theorem prover (PVS) to verify software properties. |
Yes, modules are pretty standard... In my example, the test is just an import, but in more complex cases after importing it might do some additional checks. I will try to come up with an example. Not sure how do you mean to put an interface in the test file. Now my approach closely mirrors how it is done for OCaml track: module, solution, test (3 files). Note to self: we need to add timeout as part of unit testing automation. Sometimes proofs take very long time. |
Maybe that's where my confusion comes from, as most language tracks only use two files:
Consider the
This seems to me a more natural way of organizing things than having 3 files, but maybe it does make sense for Coq. |
Sure, we can do something like this. I just looked at OCaml so my proposal was inspired by it :) How do other languages deal with additional types and functions provided? Do they put it in stub implementation file? |
It sounds like there's some consensus that this can work, and some ideas for how to make it work. I'm going to set up the track for you.
|
Alrighty, the repo is ready for you. The launch checklist is here: http://github.com/exercism/xcoq/issues/1 I'd suggest that you summarize the discussion about how to define the tests that happened above into a new issue in the new repository. If you find things that are odd or confusing, holler. You can find other track maintainers in the chat room at https://gitter.im/exercism/dev (probably other rooms, too). Welcome ❤️ ❤️ ❤️ |
The work to launch this track was never completed, and there has been no activity on the track for a long time. If someone wants to actively build and launch this track, please open an issue in https://forum.exercism.org/c/exercism/building-exercism/125 to discuss it. |
What programming language should we add?
Coq
What is the official website for the language?
https://coq.inria.fr/
Is this a language that comes in many variants? If so, which variant should we support?
The official coq 8.6 is good.
Is there a testing framework available for the language?
If it compiles — it works :)
Who will be leading the effort to launch the track?
me (@proger) and @vzaliva
<3
The text was updated successfully, but these errors were encountered: