Style Guide for Coq¶
Published by applied.fm.
Note
This is a work in progress! We welcome feedback and pull requests. Find us on GitHub.
About¶
- Principles
- Roles & personas
- Use cases
- Desired outcomes
- Mitigate bike-shedding & reduce cognitive load
- Style is enforcable by a linter
- Find & replace work as expected
- Separate things are separate; dependencies are easy to trace
- Project is robust against changes to the Coq engine
- Project is minimally impacted by changes in upstream components
- Upstream maintainers are not punished for offering to help
- Project changes have minimal impact on downstream users
- FAQ
Code Style¶
- Formatting
- Naming conventions
- Scope management
- Definitions
- Types
- Ltac
- Goal & context management
- Destruct patterns
- Defining custom tactics
Tactic Notation- Guidance on specific tactics
intros,revert,rename,clearadmit,give_upeasy,now,assumption,trivialtrylia,nialeft,right,exists,constructorreflexivity,symmetry,transitivity,congruenceabsurd,contradiction,exfalsoexact,apply,refinesimpl,red,cbvrewrite,substassert ... as,enoughpose proof ... asremember ... aschange ... withgeneralizespecializeautoeintros,evar,eauto,erefine,eassumption,eenough,instantiate