@@ -56,8 +56,7 @@ that can be used to prove simple properties of Idris programs.
56
56
57
57
== Enumerated Types
58
58
59
- \color{red}
60
- -- TODO: Edit the following.
59
+ \todo[inline]{Edit the following.}
61
60
62
61
One unusual aspect of Coq is that its set of built-in features is _extremely_
63
62
small, For example , instead of providing the usual palette of atomic data types
@@ -165,9 +164,7 @@ First, we can evaluate an expression involving `nextWeekday` in a REPL.
165
164
-- Tuesday : Day
166
165
```
167
166
168
- \color{red}
169
- -- TODO: Mention other editors? Discuss idris -mode?
170
- \color{black}
167
+ \todo[inline]{Mention other editors? Discuss idris -mode?}
171
168
172
169
We show Idris's responses in comments , but, if you have a computer handy , this
173
170
would be an excellent moment to fire up the Idris interpreter under your
@@ -190,8 +187,7 @@ Having made the assertion, we can also ask Idris to verify it, like this:
190
187
191
188
> testNextWeekday = Refl
192
189
193
- \color{red}
194
- -- TODO: Edit this
190
+ \todo[inline]{Edit this }
195
191
196
192
The details are not important for now (we'll come back to them in a bit ), but
197
193
essentially this can be read as "The assertion we've just made can be proved by
@@ -205,8 +201,7 @@ point on the name (`testNextWeekday`) in the type signature and then call
205
201
\mintinline[]{elisp}{idris-proof-search} (\mintinline[]{elisp}{M-RET p }) with
206
202
the point on the resultant hole to have Idris solve the proof for you .)
207
203
208
- \color{red}
209
- -- TODO: verify the "main uses " claim.
204
+ \todo[inline]{Verify the "main uses " claim.}
210
205
211
206
Third, we can ask Idris to _generate_ , from our definition, a program in some
212
207
other, more conventional , programming (C, Javascript and Node are bundled with
@@ -278,8 +273,7 @@ truth table -- for the `orb` function:
278
273
> testOrb4 : (orb True True) = True
279
274
> testOrb4 = Refl
280
275
281
- \color{red}
282
- -- TODO: Edit this
276
+ \todo[inline]{Edit this .}
283
277
284
278
We can also introduce some familiar syntax for the boolean operations we have
285
279
just defined . The `syntax` command defines a new symbolic notation for an
@@ -362,8 +356,7 @@ For example, the type of `negb True` is `Bool`.
362
356
-- negb True : Bool
363
357
```
364
358
365
- \color{red}
366
- -- TODO: Confirm the "function types " wording.
359
+ \todo[inline]{Confirm the "function types " wording.}
367
360
368
361
Functions like `negb` itself are also data values, just like `True` and `False`.
369
362
Their types are called _function types_ , and they are written with arrows .
@@ -383,8 +376,7 @@ output of type `Bool`."
383
376
384
377
== Modules
385
378
386
- \color{red}
387
- -- TODO: Flesh this out and discuss namespaces
379
+ \todo[inline]{Flesh this out and discuss namespaces }
388
380
389
381
Idris provides a _module system_, to aid in organizing large developments .
390
382
\color{black}
@@ -551,8 +543,7 @@ minus n Z = n
551
543
minus (S k ) (S j ) = minus k j
552
544
```
553
545
554
- \color{red}
555
- -- TODO: Verify this .
546
+ \todo[inline]{Verify this .}
556
547
557
548
The `_` in the first line is a _wilcard pattern_ . Writing `_` in a pattern is
558
549
the same as writing some variable that doesn't get used on the right-hand side .
@@ -775,9 +766,13 @@ will be useful for making some larger argument, use holes to delay defining them
775
766
for the moment, and continue working on the main argument until we are sure it
776
767
makes sense ; then we can go back and fill in the proofs we skipped .
777
768
778
- > -- TODO: Decide whether or not to discuss `postulate`.
779
- > -- Be careful , though: every time you say `postulate` you are leaving a door open
780
- > -- for total nonsense to enter Idris's nice, rigorous, formally checked world!
769
+ \todo[inline]{
770
+ Decide whether or not to discuss `postulate`.
771
+ ```idris
772
+ -- Be careful , though: every time you say `postulate` you are leaving a door open
773
+ -- for total nonsense to enter Idris's nice, rigorous, formally checked world!
774
+ ```
775
+ }
781
776
782
777
We can also use the `rewrite` tactic with a previously proved theorem instead of
783
778
a hypothesis from the context. If the statement of the previously proved theorem
@@ -827,9 +822,7 @@ that, again, `beq_nat (n + 1) 0` will yield `False`.
827
822
To tell Idris to consider, separately, the cases where `n = Z` and
828
823
where `n = S k `, simply case split on `n`.
829
824
830
- \color{red}
831
- -- TODO: mention case splitting interactively in Emacs , Atom, etc.
832
- \color{black}
825
+ \todo[inline]{Mention case splitting interactively in Emacs , Atom, etc.}
833
826
834
827
> plus_1_neq_0 : (n : Nat) -> beq_nat (n + 1) 0 = False
835
828
> plus_1_neq_0 Z = Refl
@@ -910,9 +903,7 @@ $\square$
910
903
$\square$
911
904
912
905
913
- \color{red}
914
- -- TODO: discuss associativity
915
- \color{black}
906
+ \todo[inline]{Discuss associativity .}
916
907
917
908
918
909
== Structural Recursion (Optional)
@@ -938,13 +929,9 @@ all inputs. However, because Idris's "decreasing analysis" is not very
938
929
sophisticated, it is sometimes necessary to write functions in slightly
939
930
unnatural ways .
940
931
941
- \color{red}
942
- -- TODO: verify the previous claims
943
- \color{black}
932
+ \todo[inline]{Verify the previous claims .}
944
933
945
- \color{red}
946
- -- TODO: Add decreasing exercise
947
- \color{black}
934
+ \todo[inline]{Add decreasing exercise.}
948
935
949
936
950
937
== More Exercises
0 commit comments