mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-11-30 23:45:23 +03:00
Merge pull request #806 from GaloisInc/elem-type-constraints-docs
Document element type constraints for enumerations
This commit is contained in:
commit
58e83a0686
BIN
docs/Cryptol.pdf
BIN
docs/Cryptol.pdf
Binary file not shown.
Binary file not shown.
@ -446,12 +446,14 @@ constructs guarantee that enumeration elements are distinct.
|
||||
Explore various ways of constructing enumerations in Cryptol, by
|
||||
using the following expressions:
|
||||
\begin{Verbatim}
|
||||
[1 .. 10] // increment with step 1
|
||||
[1, 3 .. 10] // increment with step 2 (= 3-1)
|
||||
[10, 9 .. 1] // decrement with step 1 (= 10-9)
|
||||
[10, 9 .. 20] // decrement with step 1 (= 10-9)
|
||||
[10, 7 .. 1] // decrement with step 3 (= 10-7)
|
||||
[10, 11 .. 1] // increment with step 1
|
||||
[1 .. 10] // increment with step 1
|
||||
[1, 3 .. 10] // increment with step 2 (= 3-1)
|
||||
[10, 9 .. 1] // decrement with step 1 (= 10-9)
|
||||
[10, 9 .. 20] // decrement with step 1 (= 10-9)
|
||||
[10, 7 .. 1] // decrement with step 3 (= 10-7)
|
||||
[10, 11 .. 1] // increment with step 1
|
||||
[1 .. 10 : [8]] // increment 8-bit words with step 1
|
||||
[1, 3 .. 10 : [16]] // increment 16-bit words with step 2 (= 3-1)
|
||||
\end{Verbatim}
|
||||
\end{Exercise}
|
||||
\begin{Answer}\ansref{ex:seq:3}
|
||||
|
@ -225,6 +225,7 @@ This section provides an overview of the Cryptol's expression syntax.
|
||||
if x
|
||||
then y
|
||||
else z : Bit // the type annotation is on `z`, not the whole `if`
|
||||
[1..9 : [8]] // specify that elements in `[1..9]` have type `[8]`
|
||||
|
||||
|
||||
**Local Declarations**
|
||||
|
BIN
docs/Syntax.pdf
BIN
docs/Syntax.pdf
Binary file not shown.
Loading…
Reference in New Issue
Block a user