-
Notifications
You must be signed in to change notification settings - Fork 9
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
Stdlib2: get started #14
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Contribution Guide | ||
|
||
This guide describes the styling conventions that are applicable to the | ||
development of this library. | ||
|
||
This file is not comprehensive yet, it contains mistakes and unclear | ||
indications, and some topics may have been overlooked: please consider improving | ||
it. | ||
|
||
## Layout of the file system | ||
|
||
### Naming of files | ||
|
||
## Statements of lemmas, theorems and definitions. | ||
|
||
- Universal quantifications with dependent variable should appear on the left hand side of the colon, until we reach the first non dependent variables. e.g. | ||
`Lemma example x y : x < y -> x >= y = false` | ||
|
||
### Naming of variables | ||
|
||
- Hypothesis should not be named `H`, `H'`,... but have meaningful names. For | ||
example, an hypothesis `n > 0` should be named `n_gt0`. | ||
|
||
### Naming conventions | ||
|
||
To be defined… | ||
|
||
## Proof style | ||
|
||
### General guidelines | ||
|
||
- **A line should have no more than 80 characters**. What a | ||
character is is subject to interpretation. If a line is longer than that, | ||
it should be cut semantically. If there is no way to make a semantic | ||
cut (e.g. the user provides an explicit term that is too long to fit on | ||
one line), then just cut it over several lines to make it readable. | ||
|
||
### White space | ||
|
||
- Operators are surrounded by space, for example `n*m` should be written `n * m`. | ||
|
||
We write | ||
- `move=>` and `move:` (no space between `move` and `=>` or `:`) | ||
- `apply/` and `apply:` (no space between `apply` and `/` or `:`) | ||
- `rewrite /definition` (there is a space between `rewrite` and an unfold) | ||
|
||
### Indentation in proof scripts | ||
|
||
- Lines end with a point `.` and only have `;` inside them. | ||
- Lines that close a goal must start with a terminator (`by` or | ||
`exact`). | ||
- When two subgoals are created, the first subgoal is indented by 2 | ||
spaces, the second is not. Use `last first` to bring the | ||
smallest/less meaningful goal first, and keep the main flow of the | ||
proof unindented. | ||
- When more than two subgoals are created, bullets are used `-` for | ||
the first level, `+` for the second and `*` for the third as in: | ||
``` | ||
tactic. | ||
- tactic. | ||
+ tactic. | ||
* tactic. | ||
* tactic. | ||
* tactic. | ||
+ tactic. | ||
+ tactic. | ||
- tactic | ||
- tactic | ||
``` | ||
|
||
If all the subgoals have the same importance, use bullets for all of | ||
them, however, if one goal is more important than the others | ||
(i.e. is main flow of the proof). Then you might remove the bullet | ||
for this last one and unindent it as in: | ||
``` | ||
tactic. | ||
- tactic. (* secondary subgoal 1 *) | ||
- tactic. (* secondary subgoal 2 *) | ||
tactic. (* third subgoal is the main one *) | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Makefile | ||
Makefile.conf | ||
.coqdeps.d | ||
*.vo | ||
*.glob | ||
.*.aux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-arg -noinit | ||
-arg -w | ||
-arg +non-primitive-record | ||
-R . Stdlib | ||
|
||
abstract.v | ||
bool.v | ||
congr.v | ||
datatypes.v | ||
decimal.v | ||
equality.v | ||
functions.v | ||
lock.v | ||
nat.v | ||
prelude.v | ||
prelude_plugins.v | ||
prop.v | ||
ssreflect.v | ||
matching.v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(************************************************************************) | ||
(* * The Coq Proof Assistant / The Coq Development Team *) | ||
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) | ||
(* <O___,, * (see CREDITS file for the list of authors) *) | ||
(* \VV/ **************************************************************) | ||
(* // * This file is distributed under the terms of the *) | ||
(* * GNU Lesser General Public License Version 2.1 *) | ||
(* * (see LICENSE file for the text of the license) *) | ||
(************************************************************************) | ||
|
||
Require Import prelude ssreflect datatypes equality nat. | ||
|
||
(* Constants for abstract: and [: name ] intro pattern *) | ||
Definition abstract_lock := unit. | ||
Definition abstract_key := tt. | ||
|
||
Definition abstract (statement : Type) (id : nat) (lock : abstract_lock) := | ||
let: tt := lock in statement. | ||
|
||
Notation "<hidden n >" := (abstract _ n _). | ||
Notation "T (* n *)" := (abstract T n abstract_key). | ||
|
||
Register abstract_lock as plugins.ssreflect.abstract_lock. | ||
Register abstract_key as plugins.ssreflect.abstract_key. | ||
Register abstract as plugins.ssreflect.abstract. | ||
|
||
(* To focus non-ssreflect tactics on a subterm, eg vm_compute. *) | ||
(* Usage: *) | ||
(* elim/abstract_context: (pattern) => G defG. *) | ||
(* vm_compute; rewrite {}defG {G}. *) | ||
(* Note that vm_cast are not stored in the proof term *) | ||
(* for reductions occuring in the context, hence *) | ||
(* set here := pattern; vm_compute in (value of here) *) | ||
(* blows up at Qed time. *) | ||
Lemma abstract_context T (P : T -> Type) x : | ||
(forall Q, Q = P -> Q x) -> P x. | ||
Proof. by move=> /(_ P); apply. Qed. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've recently discovered that
rewrite {G}defG
would work here (the same behavior was made consistent in other tactics very recently) so you should update the comment.