I'd just like to flag up that this project is in need of more active maintenance (e.g., a co-maintainer): https://github.com/coq-community/HighSchoolGeometry
It formalizes geometry at the level of French high school. It has a companion paper in French, and many Coq constant names are in French. Would be nice if there was some larger "Coq math library for teaching" project it could be integrated into (and Coq-community would be happy to host such a project)
I'd be glad to give some time to community projects, and that one sounds maybe not above my head, plus I can speak/write French, though it's quite rusty. But, if I can ask you: 1) I am not sure about the "scope" of these projects, would I even be eligible? and, 2) I have looked at that project on GitHub and see no issues and no todo's, could you give an idea of the kind of work involved (eventually, for the competences needed and the amount of effort one should anticipate)? Thanks.
@Julio Di Egidio for this project, the effort could have the following range, depending on your preference:
For the "minimal" version, I'd say about an hour per month could suffice. A more ambitious approach could take an hour per week or more. Maintainers can decide what they will put in.
Since there is already a nominal maintainer for the High School Geometry project, any radical changes to code are best to discuss first with that maintainer. But basic maintenance doesn't really need much communication/coordination.
here is a quick writeup of what I consider Coq project maintainers can/should do: https://github.com/coq-community/manifesto/issues/3#issuecomment-1824028792
Thanks very much Karl: in terms of availability, I could even go for the more "ambitious" involvement, the problem is so far I have not even tried once to compile Coq from source, nor I am an expert in that side of things, so it could take me some time to be sufficiently autonomous: IOW, I might very well need some guidance/help to get started. -- That said, if you or the maintainer think that could be acceptable, please feel free to get in touch with me directly (here via PM, or maybe on GitHub, or even my email if you have it).
the usual process is simply that we invite a new maintainer to be a member of the Coq-community organization on GitHub, and that they then get administrator privileges for the repository they maintain.
the current nominal maintainer of the HighSchoolGeometry repo is @Laurent Théry, I don't think he minds having a co-maintainer, but I ping here as courtesy
OK, I think it will take me several days to set my things up (I need a virtual machine, thinking Ubuntu, and I need to try and compile the whole thing: and I will certainly have some issues I would ask for help here on Zulip), but I can confirm my availability and willingness to at least try.
for this project, we don't really have much of a rush in development. I recently did some small updates so it should work with recent Coq.
to get started, I recommend creating a new branch in the repo and then a pull request against master
based on that branch with a small change such as that described here: https://github.com/coq-community/HighSchoolGeometry/issues/10
CI will check that the change works with several Coq versions.
Hi Karl, I am still in the process of installing Ubuntu, I just cannot use directly my PC.
Then I will try and follow your indications: of course I might botch some conventions, but the changes here look minimal so no problem if I have to redo/repack the whole thing up to the PR.
Anyway, I will keep you posted (here): most probably I will have some questions.
[I have few questions about how to proceed here: should I rather ask these questions on the Issues page?]
I have made the requested changes and it all compiles fine. Few questions to proceed:
1) There are exactly these three files that reference the stdlib:
and the Requires at the moment are in the form of a plain Require Export XYZ.
I have already verified that these all work with From Coq Require Export XYZ.
So, should I change those too while I am at it?
2) I am going to use:
Would that be OK? -- If you confirm, I am going to finish, then push, then I'll think about the PR...
Sorry for so many question, first-timer. Thank you.
cc: @Karl Palmskog
for any files referencing Stdlib, best practice is to replace with From Coq Require Export XYZ
when it says Require Export XYZ
. This is because Stdlib is expected to become its own standalone library in the future.
I recommend using a simple short branch name such as q-compilation
. Commit messages can be longer and more descriptive.
OK, perfect, will proceed accordingly. Thank you.
@Karl Palmskog Changes just pushed. I will look tomorrow into creating the PR...
but I think you get the URL to create the PR from the push message, right? It's basically one click to create a PR.
I have pushed from the command line, and I closed it meanwhile: but I don't remember any message.
I was thinking about doing the PR directly on GitHub...
You can just go to the following URL and click the button to open the PR: https://github.com/coq-community/HighSchoolGeometry/pull/new/q-compilation
This way, CI will run for the changes
OK, doing it...
It's not yet attached to the issue, right? Should I proceed anyway?
typically, after pushing a GitHub branch, one gets a command-line message like this:
remote: Create a pull request for 'my-branch' on GitHub by visiting:
remote: https://github.com/example/fork/pull/new/my-branch
you can add a string Closes #10
in the comment to the PR, and the issue will be linked
OK, done: it's working now...
It's done. Should I push merge? :) In fact, I am not terribly familiar with what happens past that point: please feel free to take over.
There is also deleting the branch: would you like me to do that as well (though tomorrow at this point)?
since it passed CI, fine by me to merge. We usually delete branches after they have been merged into master
there will be a button to delete the branch in the GitHub pull request page after the merge button has been pushed
OK great, and thanks for your guidance: I will do the merge now, then I will have to close for the day: will take it up tomorrow...
I am seeing it...
OK, deleted also the branch: all done!
followup issue: https://github.com/coq-community/HighSchoolGeometry/issues/12
OK, I should be able to do it this afternoon. I will search for "Qed" or "Defined" to catch them all...
one possible alternative way is to search for the "theorem" keywords: Theorem
, Lemma
, Corollary
, Example
(https://coq.inria.fr/doc/V8.18.0/refman/language/core/definitions.html#grammar-token-thm_token). Then you scan to the end of that sentence (indicated by .
) and insert a newline and Proof.
by itself on a separate line.
In Definitions as well, that's why Qed and Defined seem the ones that get them all...
it's not as obvious to use Proof.
in Definition
/Fixpoint
, because that will hide the body of the definition with some documentation generators
I have a longstanding Coq change idea I hope to get in to Coq 8.20: adding Body.
as a synonym to Proof.
. This will allow documentation generators to distinguish "proof scripts" from "function bodies"
I should think about it: one "strange" thing about Coq is that most of these words are synonyms, which on a side makes perfect sense due Curry-Howard, but the proliferation of keywords/vernacular I find potentially more confusing than anything else (and then one has to establish internal conventions and so on)... it's certainly not a trivial balance to strike.
well, you have to distinguish between the surface language (vernacular) and the term language. A lot of things in the surface language don't have any effect on the terms, but are rather where maintainers can enforce different conventions for maintainability/readability
Andrej Bauer has this nice breakdown:
anatomy.png
A lot of things in the surface language don't have any effect on the terms
That is the opposite of what one usually strives for in a programming language, or even in a domain specific one: for example a principle is "one and only one way to write anything"...
In Andrej's terms, we lose "exact"...
for historical reasons Definition
is not a full synonym of Theorem
/Lemma
, but in the future, the meaning will likely be exactly the same
but one consequence of Curry-Howard is that Prop
being interpreted as propositions in the usual logic sense is just a convention, and people can just as well choose between Set
/Type
/Prop
depending on their requirements/needs for impredicativity, extraction, universe handling, etc.
I don't think we loose "exactness" by having Theorem
and Definition
as synonyms. It's a help for the reader of the code on what the writer intended, with the understanding that both writer and reader knows that the term is the same regardless
one analogy is that many syntactically different Java programs will have the same meaning due to them being mapped to the same JVM bytecode by the compiler. I don't think Java becomes inexact because of this
Even in Java you do not have 5 keywords that are all synonym to "class" for example...
The problem not only is with the reading/learning the language, the problem is also maintenance and doing e.g. searches across files...
but search in Coq often needs to be done at term level anyway. For example, Z.add_comm
doesn't exist in the source, it's generated by functors/modules
Searches across files, Karl...
sure, but I'm saying that "files" is usually not even the right abstraction level to perform search
Code maintenance proper is a dirty business having to do with text files. Anyway, as I said, just my immediate thoughts.
Search in Coq needs to be done on ASTs but it can't today.
I personally agree with Julio, OTOH math prose has the same "feature" and nobody really objects there.
I'd say search can't be conveniently done on ASTs today. There are various tools that can extract/juggle ASTs, but none of them are integrated into regular Coq workflows/tools
right, arguably many of the most important results in applied math are viewed by pure mathematicians as "just lemmas"
I suspect the lemma/theorem distinction belongs purely in comments... Agda has no such keyword and I don't think I've ever seen Agda users wish for it?
But for now, the subtle differences between "synonyms" are a much bigger annoyance.
but Agda doesn't even have proof scripts... do they even call their term bodies "proofs"?
Quanta notwithstanding, Coq has been meant for both math "proofs" and computer science "verification" since the beginning
People definitely write proofs in Agda; the syntax is inspired more by Haskell than by OCaml.
but there is no Prop
sort, right? So it's more "types in lieu of propositions" than "propositions as types"
Some would say that "propositions as types" is closer to Agda than Coq — conjunctions are literally products, etc.
If you care about propositions, ask the HoTT and Cubical Agda folks, but that doesn't really matter for syntactic PL proofs
Say, for the POPLmark challenge.
Code maintenance proper is a dirty business having to do with text files
I have easily fixed the one Lemma with an occurrence of "Defined", as for "Qed" I get 1153 occurrences in 69 file. And I suppose it is going right now to be easier for me to just go through the files one by one, it is not so many files anyway... (I am in fact in the process of doing it.)
But, in a more general perspective, would there be a way here to write say a shell script that parses the files and inserts "Proof.\n" where needed (by searching for "Qed." then scanning back to any of "Theorem" or "Lemma", etc.)?
I'd recommend using something like sed
or awk
to do the replacement. It will likely be hard to get all of them (all occurrences of missing Proof.
) working at once. If you write a script, we have no obvious repo to put it in, but you could make it a GitHub Gist and link it here: https://github.com/coq-community/manifesto/issues/3
Indeed in this case even a regex might do the trick, assuming there is nothing but basic syntax in these file... and that's indeed the other side of the coin, making sure it's working and catching all it needs. On 69 files I am going to be faster doing it by hand anyway... But for the general case I think leveraging serapi or something similar would be the only way to reliably parse .v files, right?
yes, accessing Coq's parser via something like SerAPI is the only reliable way to find beginning of proof mode
OK, thanks, makes sense.
Meanwhile I am going through the changes and I am finding myself uniformizing end of files adding a new line where it's missing (some files have it, some don't): is that OK or you'd rather prefer that I do not touch that?
the general convention is that files end with newline, many editors enforce this. Fine by me to do those changes at the same time as other changes
@Karl Palmskog I have just created the PR, it's now being checked.
Sorry, I have botched the Issue reference, should have been #12, I wrote #11: I hope that can be fixed later, I don't want to risk to interrupt what it's doing...
OK, all verified successfully and fixed the link to the issue (GitHub seems to have picked it up fine).
I will be waiting for your confirmation before merging...
@Julio Di Egidio I think there will be a lot of overhead if you ping me here. I think you can use GitHub's "request review" feature for a new PR if my review is important. Clearly, this change is really "either it works or it doesn't" so I don't think my approval is needed for a merge here
OK, thank you, I wasn't sure how to go about that: I will proceed with merging this one then.
this is basically all there is to maintenance of most Coq projects: we do PRs with well-scoped changes, mostly to ensure CI passes before merge to master
/main
I will do some more small suggestions as issues in the next few days, but I think you've got the hang of most basics now, so feel free to work on them whenever convenient
Yes, indeed it's all pretty smooth. Looking forward to my next assignment(s). :)
For now, have a good rest of the week-end.
Last updated: Oct 13 2024 at 01:02 UTC