Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] A style guide for Coq

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] A style guide for Coq


Chronological Thread 
  • From: Erik Martin-Dorel <e.mdorel AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] A style guide for Coq
  • Date: Thu, 2 Dec 2021 00:32:27 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=e.mdorel AT gmail.com; spf=Pass smtp.mailfrom=e.mdorel AT gmail.com; spf=None smtp.helo=postmaster AT mail-pj1-f54.google.com
  • Ironport-data: A9a23:30qpMa6w7l608zJo0Uc0VwxRtF7GchMFZxGqfqrLsXjdYENShTEHxzccWmnUaPvbNGakft8nbYvj/RkBvpWEzYNqTVYd+CA2RRqmi+KVXIXDdh+Y0wC6d5CYEho/t63yUjRxRSwNZie0SiyFb/6x8hGQ6YnSHuClUbScY3gqLeNZYH5JZSxLy7ZRbrFA2oDR7zOl4bsekuWHULOX82Yc3lE8t8pvnChSUMHa41v0iLCRicdj5zcyn1FNZH4WyDrYw3HQGuG4FcbiLwrPIS3Qw4/Xw/stIovNfrfTd0QLRvvKP1HLhCcKHaelhRdGq2o51aNT2Pg0Mx8GzWXU2YoolpMQ6fRcSi9xVkHIsOlbVhVfCSx6FaJD8b7DZ3O4tKR/ymWZLCK1nqwxZK0xFdRAprwf7Xt13fcfMXUGag2Jr/mnxaqyDOhqnMUqasfxVL7zEFl0lWSDS6kyGMWbBf3ev4oAmm1h15laRqOGIZcNNm9GcjDrZjljOnM2AbQChsOWh1zrKmUN8QnR/b5fD3P7yQVw1P31MoOQdIHWA8pSmUmcqyTN+GGRP/3TD/THoRLtz55mrrWnceLHtIMu+HmQ8/drhBiLxDVWBkBKE1S8pva9hwi1XNc3x4k8ksYxhfBayaBpZoCVs96ETLqssRsVWt4WGOo/gO1I4rSB+B6XXwDoURYYAOHLd6YKqfgC2VqAntevDjtq2FFQYRpx6Z/Mx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6Qum9ewAeciPgcUQ2eX4/6z1KH78U32QbVKkv02krTCv5zAJMQboba1AwpP3YY59xa/DjGm3M0FknkANlJKZhaHg5LuO1HUL/D1C+q0jVe0kDpz2fzKIrnsDo/OI3XDirvtY6tx5k9GxAczwt1S4Y9fBKsbL/LpQEDxscTVDh8nPAywxObqENB92ZkfWWKLG6OZKKHSvUKR6uIhI+SBa5UZuDn6K/gi6P7uiWE2lUUBcqmu2JsbcHG4HvJ4LEWFeXfgnMsNHGMQsgc9TOHmkkOOXSNSanqoX68x6Sk3CIe8AofCQoCtjqaB3CC+HpBOeG9KEFWMHmrvd4WeRfgMbDmfIsBkkjMeVLihT5Ut2g2ptA//07ZnNPbb+jUEtZL/09h4//HclRYr9TBtE8ud13yNQHpvk2MTRz422bh/rlZnxleC16h4mf1YGsZJ6/NHSAdpfaLbmud9EpX5Xh/LVtaPUlevBNu8Ugs8VtYg/9hbblx8GJOnhwrf3izvD7gPmrijCZovt6bN2H63INxymFjc06x0okMnQYNqPHe6h6g62w/JCoqBx0jfkqqtb6kY9CHI/WaHi2GJuRcLA0ZLTazZUCVHNQPtptPj6xaeHtdG6JwiOwpFjNaAc+5EN4GvglJBS/Puft/ZZjDp849fLRmNz7KIKoHtfjdEtM04IEcBmgEXu32BMFpmbho=

Hello,

Le mer. 1 déc. 2021 à 22:58, Timothy Carstens <intoverflow AT gmail.com> a écrit :
Do you have an opinion on how to style Coq code/projects?

[…]

* Do you know of any other good Coq style guides or similar resources?

I'd say a must-read is Mathematical-Components' style guide; AFAIK the corresponding reference URL is this one:

* Do you have any other relevant thoughts/comments/suggestions that you'd like to share?

Generally speaking the naming convention (for functions and lemmas) seems paramount for proof-assistant developments,
so I guess it should always be a key component of any proof-assistant style guide.

I can mention some articles on this very issue, focusing on automatically learning and suggesting lemma names:

- Deep Generation of Coq Lemma Names Using Elaborated Terms
  [Nie, Palmskog, Li, Gligoric: IJCAR 2020], https://doi.org/10.1007/978-3-030-51054-1_6

And an earlier article, focusing on HOL Light developments:

- What’s in a Theorem Name?

Best regards,

Erik

Kindly yours,
-t

Why adopt a style guide?

Everyone who interacts with code is impacted by code style. This clearly includes the project’s contributors, but it also includes other interested parties such as users and upstream maintainers. In other words, style is relevant to many different roles and personas engaged in many different use cases.

A style is “good” if it has a net-positive impact on those use cases.

Good style does not arise by accident; rather, it is engineered by carefully considering how different idioms & practices impact different use cases.

This is a lot of work to get right. Therefore, many projects adopt a style guide - either in full, or as a starting point for their own style.


What does a good style guide look like?



How does this relate to Requirements on the Use of Coq in the Context of Common Criteria Evaluations?

Requirements on the Use of Coq in the Context of Common Criteria Evaluations is a requirements document published by ANSSI and INRIA. While most projects are unlikely to be used in a Common Criteria Evaluation, the guidance offered by this document is valuable in other contexts as well.

With respect to coding style, the document says:

    There is no well-established coding style for Coq development. The present document does not attempt to fill this gap, but rather to identify and discourage known bad practices.

This style guide aims to fill this gap.

--



Archive powered by MHonArc 2.6.19+.

Top of Page