Commit Graph

76 Commits

Author SHA1 Message Date
Eric Mertens
4ca062966e
Initial implementation of :check-docstrings (#1682)
* Update all commands to track their results

* Implement REPL :check-docstrings command

This command checks that all of the unlabeled and "repl" labeled
codeblocks in docstrings can successfully evaluate as REPL commands.

Cryptol will now indicate exit failure if any of REPL commands fail,
making it possible to use in automated testing.

:check-docstrings internal implementation is set up to track results
of subcommands in support for integration into a remote server API
endpoint.

* Implement :focus

* Add some :check-docstring test cases

* Update changelog

* Update CrashCourse.tex now that more commands are checked

* Require repl and convert \r\n to \n in lexer
2024-07-18 15:44:16 -07:00
David Holland
facc682fe8
Fix some typos I noticed in the Programming Cryptol book. (#1631)
- p-1 bits in an IEEE float refers to the significand, not the
  mantissa, at least according to the latest preferred terminology,
  which aims to keep the word "mantissa" for the full mantissa
  including the units bit;
- reciprocal rather than reciprocol;
- the example in 1.23 had the wrong module declarations; also insert a
  separator word between the verbatim blocks so they can be told
  apart.
2024-02-23 08:16:07 -05:00
Ryan Scott
01d8c1d32f Repair ProgrammingCryptol test 2024-02-01 18:55:56 -05:00
Ryan Scott
56cf1a373d Repair ProgrammingCryptol test 2024-02-01 18:22:34 -05:00
Iavor Diatchki
11c0efe1d8 Fixup line numbers in docs and update CHANGES 2022-11-21 10:24:56 -08:00
Iavor Diatchki
fcd5578ee6 Fix documentation 2022-02-23 14:39:20 -08:00
Brian Huffman
869deb1354 Update expected test output.
Some error messages changed due to the new definition in Cryptol.cry.
2021-09-10 20:08:43 -07:00
Brian Huffman
b9f97e7790 Update expected output for check-docs. 2021-09-02 20:30:55 -07:00
Rob Dockins
e742d24a14 Update documentation 2021-08-06 15:04:38 -07:00
Rob Dockins
4d5d66ff27 update docs again 2021-06-30 16:51:54 -07:00
Rob Dockins
0778fd8ff2 Update "ProgrammingCryptol"
Minor output changes in the exercises are required.
2021-06-30 10:05:39 -07:00
Rob Dockins
cc8822f736 Update reference implementation and documentation 2021-04-13 10:27:17 -07:00
Rob Dockins
eb9d3e900d Update book exercise output 2021-03-02 17:18:36 -08:00
Rob Dockins
6b784b11ec Typo
Fixes #1039
2021-02-17 16:13:04 -08:00
Rob Dockins
301c74cb8f Docs typos 2021-01-12 17:00:24 -08:00
Rob Dockins
600f43b5f0 Update the Programming Cryptol book with documentation about newtypes. 2021-01-12 11:19:53 -08:00
Ben Selfridge
7489dbd52e
Doc fixes (#1016)
* Updates all the examples in CrashCourse.tex up to the functions section

This adds more REPL annotations for the exercise checker in the Programming
Cryptol book. There is still more work needed to support many of the examples in
the functions section (and presumably the rest of the book as well), so I think
this is a logical stopping point for now until we add a feature that lets you
write out a file and load it into the repl.

* Updates ProgrammingCryptol.pdf wrt recent changes
2021-01-11 14:52:21 -08:00
Ben Selfridge
f45389b8cd Adds "replPrompt" command 2020-12-12 08:47:21 -08:00
Ben Selfridge
5c18b35523 Brings CrashCourse.tex up-to-date with respect to recent changes
Both in this branch and in master (which I'd previously missed).
2020-12-10 17:12:50 -08:00
Ben Selfridge
c78424334e Adds repl annotations for more of CrashCourse.tex 2020-12-09 16:15:17 -08:00
Ben Selfridge
861e9e9651
Feature/docs checking (#976)
* Adds a stub executable to cabal file for checking docs

* [WIP] Adds check-exercises executable

A program that checks that the exercises in Programming Cryptol actual work when
executed against an Cryptol REPL. Instead of using \begin{Verbatim}, we use
\begin{REPL} in both the exercise and the answer, which is rendered the same but
gets checked by this program.

This is a WIP -- we still need to do a number of things, including (but not
limited to):

* Move the "REPL" macro out of CrashCourse.tex and into some including latex
  file
* Change many of the "Verbatim"s into "REPL"s to test if this approach works in
  general

* Several updates

* Moves REPL command definitions into main latex file

* Generalizes repl commands

* Several improvements:

* documentation of CheckExercises.hs
* factoring out addReplData, addReplin, addReplout, nextLine functions
* took the IO out of P monad (shouldn't have been there)
* worked on annotating repls for many exercises/examples in crash course

* Adds a README for check-exercises

* Uses cryptol's -e option to detect errors

* updates ProgrammingCryptol.pdf

* Fixes main function

After changing to use the -e option to detect errors, I used cabal v2-exec which
apparently does not rebuild anything, but I thought it did. This just fixes the
code so it builds again.
2020-11-20 16:53:36 -08:00
Brian Huffman
754c6ac59b Remove errant comma in exercise solution in the book. 2020-10-13 11:08:12 -07:00
Brian Huffman
33d6ae77b7 Fix description of lg2 in exercise answer in the book.
This is one of the errors mentioned in issue #931.
2020-10-13 11:06:52 -07:00
Rob Dockins
6b9a9f1294 Fix book typos 2020-09-29 21:50:30 -07:00
Rob Dockins
9822d5fd9a Update documentation and reference interpreter 2020-09-29 14:55:05 -07:00
Brian Huffman
c938793107 Replace usage of zipWith (^) with (^) in a book example.
Fixes #803.
2020-09-23 11:15:59 -07:00
Brian Huffman
f6d9f4b0e9 Fix mixed-up solutions to book exercises about any and all.
This fixes an issue mentioned in a comment to #887.
2020-09-23 11:15:59 -07:00
Brian Huffman
6676702f7f Fix wrong inferred type for twoPlusXY in book exercise.
Fixes #887.
2020-09-23 11:15:59 -07:00
Brian Huffman
206cb5ef44 Switch toInteger to fromZ in book example.
Fixes #873.
2020-09-23 11:15:59 -07:00
Brian Huffman
c4299a148b Add missing ']' in book example.
Fixes #880.
2020-09-23 11:15:59 -07:00
Iavor Diatchki
39acf61ee5 Update documentation with info about floats + fractional literals 2020-07-14 15:36:37 -07:00
Brett Boston
0e35995ee4 Document element type constraints for enumerations 2020-07-08 10:13:55 -07:00
weaversa
d4b4d5fe2f
wording fix 2020-07-05 14:54:34 -04:00
Brett Boston
a87684aad4 Clarify that each file can only contain a single module 2020-06-30 19:10:33 -07:00
robdockins
87d5edab00
Documentation updates (#779)
* Add docstrings for all prelude functions and fix minor style issues.

Fixes #771

* Update `CryptolPrims` documentation

* Minor updates to the prelude

* Update CHANGES

* Updates to the cryptol book and CryptolPrims

* Fix several additional docstrings

* Specify and document properties of signed bitvector division.

Fixes #677

* Fixup test

* typos and style

* Regenerate PDFs
2020-06-30 10:58:25 -07:00
Rob Dockins
542debdb67 Documentation tweaks 2020-05-27 14:21:17 -07:00
Rob Dockins
2cb904ec46 Update documentation 2020-05-15 15:28:44 -07:00
Brian Huffman
030349f6de Fix outdated usage of value-level function width in Cryptol book.
It is now called `length` and has a generalized type.

Cf. #549.
2019-06-20 10:47:40 -07:00
Brian Huffman
6b53cd0c2f Fix typo in documentation. 2019-02-28 10:46:41 -08:00
Aaron Tomb
b111e78a30 Minor fixes to Programming in Cryptol 2018-07-27 16:09:50 -07:00
Brian Huffman
34e6a18efe Fix Cryptol output in exercise solution in the book. 2018-07-27 13:18:03 -07:00
Brian Huffman
891b7fe914 Update exercises in chapter 1 of the book. 2018-07-20 15:48:10 -07:00
Brian Huffman
6201415c66 Remove index entries and text about non-existent :i, :p commands. 2018-07-20 08:28:35 -07:00
Brian Huffman
dd2c4b6507 Introduce command for more uniform exercise references in the book. 2018-07-19 18:25:55 -07:00
Brian Huffman
10f43b4279 Switch Cryptol book exercises to use split instead of groupBy. 2018-07-19 16:46:48 -07:00
Brian Huffman
8892759a93 More edits to Cryptol book, rewrite type synonym section. 2018-07-17 10:52:21 -07:00
Brian Huffman
0d074ce231 Many updates to Programming Cryptol book (work in progress). 2018-07-16 09:48:39 -07:00
Brian Huffman
5f795d4644 Restrict output number base to 2, 8, 10 and 16.
The output bases now match the possible input bases for
numeric literals.

Fixes #179.
2018-07-12 09:57:41 -07:00
Brian Huffman
7c1de9c133 Add short section to Cryptol book about type Integer.
Fixes #468.
2018-05-24 13:04:10 -07:00
Aaron Tomb
99f3fdbf37 Merge Cryptol/Extras.cry with Cryptol.cry
Closes #427.
2018-05-23 15:55:05 -07:00