Skip to content

Commit 1198e33

Browse files
Updated style guide according to discussion in #1133
1 parent c8cae98 commit 1198e33

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

notes/style-guide.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -350,19 +350,21 @@ word within a compound word is capitalized except for the first word.
350350

351351
#### Functions and relations over specific datatypes
352352

353-
* When defining a new relation over a datatype
354-
(e.g. `Data.List.Relation.Binary.Pointwise`)
355-
it is often common to define how to introduce and eliminate that
356-
relation over various simple functions (e.g. `map`) over that datatype:
353+
* When defining a new relation `P` over a datatype `X` in `Data.X.Relation` module
354+
it is often common to define how to introduce and eliminate that relation
355+
with respect to various functions. Suppose you have a function `f`, then
356+
- `f⁺` is a lemma of the form `Precondition -> P(f)`
357+
- `f⁻` is a lemma of the form `P(f) -> Postcondition`
358+
The logic behind the name is that ⁺ makes f appear in the conclusion while
359+
makes it disappear from the hypothesis.
360+
361+
For example in `Data.List.Relation.Binary.Pointwise` we have `map⁺` to show
362+
how the `map` function may be introduced and `map⁻` to show how it may be
363+
eliminated:
357364
```agda
358-
map⁺ : Pointwise (λ a b → R (f a) (g b)) as bs →
359-
Pointwise R (map f as) (map g bs)
360-
361-
map⁻ : Pointwise R (map f as) (map g bs) →
362-
Pointwise (λ a b → R (f a) (g b)) as bs
365+
map⁺ : Pointwise (λ a b → R (f a) (g b)) as bs → Pointwise R (map f as) (map g bs)
366+
map⁻ : Pointwise R (map f as) (map g bs) → Pointwise (λ a b → R (f a) (g b)) as bs
363367
```
364-
Such elimination and introduction proofs are called the name of the
365-
function superscripted with either a `+` or `-` accordingly.
366368

367369
#### Keywords
368370

0 commit comments

Comments
 (0)