Commit Graph

1102 Commits

Author SHA1 Message Date
Robert Dockins
cd9ffed00b Update examples to use (/\) instead of (&&) where appropriate,
and to squash other warnings related to the upcomming precedence change.
2016-08-22 18:14:44 -07:00
Robert Dockins
e9c8b6ccd1 Add regression test for bitshift operations 2016-08-22 15:36:16 -07:00
Robert Dockins
fd164aa1f9 Repair the implementation of the shift and rotate operations in the
symbolic simulator.  They were previously calculating incorrect
answers for certain bit sequences.
2016-08-22 14:41:23 -07:00
Robert Dockins
3c270cb5ce Fix a typo in the implementation of the (>>) primitive. This was causing
incorrect cacluations when applied to certain bit sequences.
2016-08-22 14:29:42 -07:00
Robert Dockins
12bbfb5d7d Make parts of the lexer more strict. This squashes a minor space leak. 2016-08-18 16:05:23 -07:00
Robert Dockins
3becedd910 Update tests to remove spurious failures 2016-08-18 16:05:23 -07:00
Brian Huffman
c5f33ab478 Fix compiler warnings 2016-08-17 11:39:00 -07:00
Brian Huffman
fb9f4e2a56 Make fastTypeOf support tuple/record selectors on lists 2016-08-17 09:53:26 -07:00
Robert Dockins
a774bcca5b Begin issuing warnings whenever the fixity is used to disambiguate
parses involving (&&) and (||) relative to the comparison operators,
or between (&&) and (^).  These operators are scheduled to change
fixity levels. See issue #241.
2016-08-16 16:29:49 -07:00
Robert Dockins
7d8f0e2385 Fix an incorrect error message 2016-08-16 16:24:31 -07:00
Robert Dockins
28d4f1d3fe Modify 'updates' and 'updatesEnd' to take the indices and values
as separate vector arguments, rather than as a single vector
argument of pairs.
2016-08-16 14:36:46 -07:00
Robert Dockins
64267f51ac Add the short-cutting boolean operators (/\), (\/), and (==>)
to the Cryptol prelude.  This is in service of eventually addressing
issue #241.
2016-08-12 17:12:34 -07:00
Robert Dockins
f6f1d84770 Update the Cryptol documentation with the new 'update' primitives 2016-08-12 16:18:11 -07:00
Robert Dockins
af0db1af38 Fix minor typo in the Cryptol prelude that was messing up the
help text for (!!)
2016-08-12 16:13:32 -07:00
Robert Dockins
f746ef0d66 Fix test suite after changes to Cryptol prelude altered output 2016-08-12 12:22:58 -07:00
Robert Dockins
dae3ab11b1 Change the representation and caching of sequences for better performance.
There are two major changes in this patch.  The first is that sequence maps
now have special representations for point updates, of the sort produced by
the 'update' and 'updateEnd' primtives.  These updates are stored in a
finite map, rather than as a functional-update thunk using lambdas; this
reduces memory usage and improves time efficecy of sequences defined by
sequences of updates.

The second change is that the caching policy for sequences is changed
to retain all previously-calculated values.  This is a change from the
previous LRU policy, which retained only a small finite number of previous
values.  Benchmarking showed that unbounded memoization was better for
performance in essentially all cases over both an LRU and an adaptive
caching strategy.  The potential downside is that we may retain values
longer than necessary.  If this becomes a problem, we may need to revisit
this decision.
2016-08-12 12:10:49 -07:00
Robert Dockins
c484a8c253 Implement 'update' primitives for the symbolic simulator 2016-08-12 12:10:49 -07:00
Robert Dockins
785687a67f Add new vector update primitives 'update' and 'updateEnd' which update
vectors at indices starting from the beginning/end of the vector,
respectively.

Included in this patch are implementations of these primitives
for the concrete evaluator.  Symbolic primitives are TODO.
2016-08-12 12:10:48 -07:00
Trevor Elliott
b16a1b8909 Fix name introduction for newtypes
The newtype doesn't introduce two distinct names, but just one that is re-used
at the type and expression level. This is OK, as the two namespaces are
distinct, thus there is no ambiguity.

Fixes #369
2016-08-12 11:44:16 -07:00
Brian Huffman
46793ade99 Rename test "issue289" to "trac289"
Renamed because this test does not correspond
to github issue number 289.
2016-08-10 14:07:11 -04:00
Brian Huffman
d53edee9f1 With :set ascii=on, print quotation marks around strings 2016-08-10 14:02:14 -04:00
Robert Dockins
b5a25f4f47 Fix an issue where literal sequences of bit values were being
incorrectly reversed.
2016-08-10 13:55:54 -04:00
Brian Huffman
0024dd0300 Update test output 2016-08-10 13:49:09 -04:00
Adam C. Foltzer
2f64119440 split benchmark XML into separate files
This will hopefully yield better scale in the graphs on the Jenkins job
2016-08-09 14:05:30 -04:00
Adam C. Foltzer
1a68b4f640 add benchmarks for Extras
There are separate benchmarks for the Extras.cry module and the combined
Prelude + Extras module because the performance characteristics are nonlinear.
2016-08-09 13:47:25 -04:00
Adam C. Foltzer
9ad1ff98c6 fixes #363 2016-08-09 11:42:53 -04:00
Brian Huffman
5b63ea2ad0 Add infix precedence declaration for (%). Fixes #362. 2016-08-09 08:25:26 -07:00
Brian Huffman
a8eccb9db7 Fix some incorrect syntax in Programming Cryptol appendix 2016-08-04 14:36:33 -07:00
Brian Huffman
e868e78601 Update precedence table to match Cryptol prelude 2016-08-04 14:33:41 -07:00
Iavor S. Diatchki
20e90c2194 Merge branch 'master' of github.com:GaloisInc/cryptol 2016-08-04 10:55:51 -07:00
Iavor S. Diatchki
aa0d3ad399 Fixes #361 2016-08-04 10:55:45 -07:00
Brian Huffman
c537b5a1cd Small fixes for "Programming Cryptol" appendices 2016-08-04 10:54:11 -07:00
Brian Huffman
5bca2a5560 Fix lots of wrong types for primitives in appendix B 2016-08-03 16:18:31 -07:00
Brian Huffman
ed1dd212ab More small fixes in Programming Cryptol 2016-08-03 16:04:10 -07:00
Brian Huffman
4cc76e6c8b Small fixes for crash-course chapter of Programming Cryptol
Changes include spelling, grammar, punctuation,
typesetting, and code formatting. A few factual errors
have been fixed, and some Cryptol REPL output has been
updated as well.
2016-08-03 09:54:52 -07:00
Robert Dockins
1528fb524d Comment cleanup 2016-07-25 16:00:07 -07:00
Robert Dockins
2c4bd660ea Clean up VWord/VSeq handling in some of the Cryptol primitives,
and add some missing cases.
2016-07-25 15:58:12 -07:00
Robert Dockins
1c5f786811 Fix an off-by-one error in the implementation of 'split'.
This was causing incorrect computation in examples/MiniLock/prim/Blake2s.cry.
2016-07-25 14:43:17 -07:00
Robert Dockins
2e15d4f443 Increase the size of the garbage collector nursery to 64m.
This greatly increases mutator productivity, and thus provides
significant speedups on some examples.  The tradeoff with
larger nurseries is the potential for long GC pause times.
This is probably acceptable tradeoff for a tool like Cryptol,
despite the potential for unresponsiveness at the REPL.
2016-07-20 15:55:05 -07:00
Iavor S. Diatchki
b1b7b8b599 Merge pull request #356 from thoughtpolice/stdlib-iterate
lib/extras: add iterate
2016-07-18 11:20:47 -07:00
Iavor S. Diatchki
8c36992904 Merge pull request #344 from adrianherrera/enhancement/MISTY1
Crytol spec for MISTY1 cipher
2016-07-18 11:19:53 -07:00
Austin Seipp
e197497059 lib/extras: add iterate
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2016-07-18 09:01:45 +00:00
Robert Dockins
5d1e1948d8 Add test case to demonstrate tracing, as discussed in issue 68.
The new evaluator allows us to have more direct control over
evaluation order, and makes it straightforward to implement tracing
primitives.  There are two new primitives 'trace' and 'traceVal' in the
Cryptol prelude that produce tracing output when evaluated.
Fixes #68
2016-07-13 15:09:56 -07:00
Robert Dockins
e001310299 Add test cases for issue 138. Fixed by new evaluator.
Fixes #138
2016-07-13 15:00:00 -07:00
Robert Dockins
3d68677d42 Add test case for issue #268. Fixed by the evaluator rewrite
Fixes #268
2016-07-13 14:40:44 -07:00
Robert Dockins
869670b2af Add test case for issue #334. This issue is fixed by the evaluator rewrite.
Fixes #334
2016-07-13 14:36:26 -07:00
robdockins
93a1628d53 Merge pull request #338 from robdockins/new-eval
New monadic evaluator, now with fewer nontermination bugs!
2016-07-13 14:27:38 -07:00
Robert Dockins
c60be15873 Add 'trace' and 'traceVal' to the primitive operations lists in the documentation. 2016-07-13 14:21:29 -07:00
Robert Dockins
e0611c250d More explict comments for the 'trace' and 'traceVal' Prelude operations. 2016-07-13 14:16:33 -07:00
Robert Dockins
222c6edd82 Additional haddock improvements 2016-07-13 14:07:45 -07:00