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
,clear
admit
,give_up
easy
,now
,assumption
,trivial
try
lia
,nia
left
,right
,exists
,constructor
reflexivity
,symmetry
,transitivity
,congruence
absurd
,contradiction
,exfalso
exact
,apply
,refine
simpl
,red
,cbv
rewrite
,subst
assert ... as
,enough
pose proof ... as
remember ... as
change ... with
generalize
specialize
auto
eintros
,evar
,eauto
,erefine
,eassumption
,eenough
,instantiate