Skip to content

Commit

Permalink
Merge pull request #806 from GaloisInc/elem-type-constraints-docs
Browse files Browse the repository at this point in the history
Document element type constraints for enumerations
  • Loading branch information
bboston7 authored Jul 8, 2020
2 parents 088fe96 + 0e35995 commit 58e83a0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
Binary file modified docs/Cryptol.pdf
Binary file not shown.
Binary file modified docs/ProgrammingCryptol.pdf
Binary file not shown.
14 changes: 8 additions & 6 deletions docs/ProgrammingCryptol/crashCourse/CrashCourse.tex
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,14 @@ \subsection{Enumerations}\indEnum
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}
Expand Down
1 change: 1 addition & 0 deletions docs/Syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
Binary file modified docs/Syntax.pdf
Binary file not shown.

0 comments on commit 58e83a0

Please sign in to comment.