Commit Graph

1332 Commits

Author SHA1 Message Date
Iavor S. Diatchki
d1abac0cec Update design; handle numeric type parameters in type checking SMT 2017-09-21 14:57:53 -07:00
Iavor Diatchki
f7e1a941e2 checkpoint 2017-09-21 09:28:01 -07:00
Iavor Diatchki
c3882a79b5 Named instantiations 2017-09-19 14:47:40 -07:00
Iavor Diatchki
9f2a2ac3a4 Incomplete example of using 'abstract' types. 2017-09-19 14:28:08 -07:00
Iavor Diatchki
9d0092cfd9 Typos and language fixes 2017-09-19 10:32:08 -07:00
Iavor Diatchki
dd46e174e0 Another iteration of the design. 2017-09-19 10:25:17 -07:00
Iavor Diatchki
4bbf2fbb5a Some notes no how the design might work. 2017-09-18 15:04:08 -07:00
Iavor Diatchki
b5196dfb44 Remove warnings, moudule is safe 2017-09-15 16:05:26 -07:00
Iavor Diatchki
f3a3b1cbd0 Start on implementing abstract types/constants (module parameters) 2017-09-15 16:05:16 -07:00
Aaron Tomb
c05281d390 Fix spurious failures due to lazy I/O
Regression test check31 was failing somewhat unpredictably due to the
use of lazy I/O when loading the Z3 prelude for the type checker. Using
the `strict` package seems to fix it.
2017-09-13 15:31:43 -07:00
Eric Mertens
28bc4f81de Work around happy bug by adding type signature on ipat 2017-09-11 10:36:59 -07:00
Eric Mertens
bf571569fa Add upper bound on happy
A bug introduced in happy-1.19.6 causes incorrect type signatures
to be generated in the parser source file which lead to type
checker errors
2017-09-11 10:20:22 -07:00
robdockins
bbcd39d400 Merge pull request #439 from GaloisInc/signed-arith
Add operations for signed arithmetic, and carry condition testing.
2017-08-17 10:27:18 -07:00
Robert Dockins
8333b81c16 Update CryptolPrims documentation 2017-08-16 18:26:40 -07:00
Robert Dockins
9550d1b8dd Update syntax documentation 2017-08-16 18:22:49 -07:00
Robert Dockins
ef047d3a19 Fix test breakage due to new operations in the Cryptol prelude. 2017-08-16 17:37:24 -07:00
Robert Dockins
cefc67a149 Implement signed division and remainder as methods of the Arith class.
Clarify the documentation that division is "round toward 0" division.
2017-08-16 17:34:22 -07:00
Robert Dockins
6a30560fc0 Implement the nested lexicographic order for signed comparisons.
This commit reorganizes how lexicographic comparisons are done in
the concrete simulator to reuse the same combinator from the symbolic
simulator.  This makes it more straightforward to implement the new
signed comparison.
2017-08-16 13:58:44 -07:00
Robert Dockins
86d28bc01e Merge remote-tracking branch 'origin' into signed-arith 2017-08-16 11:30:27 -07:00
Iavor Diatchki
b3f605d9f4 Pretty print with a bit more space, so we can see what's going on. 2017-08-15 10:52:32 -07:00
Iavor S. Diatchki
ca2136fab9 Merge pull request #440 from sliverdragon37/master
Adds the :ast and :extract-coq commands for printing out a parseable AST
2017-08-15 10:25:08 -07:00
Eric Mullen
05b8f0f3c1 more polished 2017-08-14 15:45:37 -07:00
Eric Mullen
505e565bbe performed all suggested changes except new module for ShowAST 2017-08-14 13:28:09 -07:00
Robert Dockins
987e4a0c3b Implement the type-level support required for the new SignedCmp class.
This class will represent types that can be meaningfully compared for
signed bitvector equality.  It lifts the comparison operations on
nonempty bitvectors through tuples, records and finite sequences via
lexicographic order.
2017-08-07 12:37:46 -07:00
Robert Dockins
a6d29c73c7 Merge remote-tracking branch 'origin' into signed-arith 2017-08-07 11:55:48 -07:00
Aaron Tomb
e40b15cc5d Fix type signatures in MiniLock SCrypt example 2017-08-07 08:37:20 -07:00
Robert Dockins
2b9e5a2421 Add signed and unsigned bitvector extensions 2017-08-04 17:04:29 -07:00
Robert Dockins
9a3b64e088 Fix the definition of the signed borrow function 2017-08-04 17:03:23 -07:00
Robert Dockins
e3dd83066e Rename signed bitvector operations to put the $ at the end 2017-08-04 17:02:10 -07:00
Robert Dockins
b1a821217e Merge remote-tracking branch 'origin/master' into signed-arith 2017-08-03 13:28:51 -07:00
Robert Dockins
4d974fefac Fix bugs in the signed right shift operation.
However, see the following SBV issue that currently affects
Cryptol behavior when computing signed right shifts with
symbolic index amounts:
https://github.com/LeventErkok/sbv/issues/323
2017-08-03 13:26:03 -07:00
Brian Huffman
1e453436b2 Fix grammatical errors in manuals 2017-08-02 19:46:26 -07:00
Brian Huffman
c5f34e1c51 Fix typos in Haddock strings 2017-08-02 19:46:03 -07:00
Robert Dockins
a68b835d51 Add operations for signed arithmetic, and carry condition testing. 2017-08-02 16:39:07 -07:00
Robert Dockins
08b334fce5 Rename LargeBitsVal into BitsVal
It is now the only unpack bitsequence representation, so no need to
distinguish it as being "large".
2017-08-01 16:26:24 -07:00
Robert Dockins
d4b70a039a Remove the Data.Sequence-based representation of unpacked bitsequences.
It appears to have negligable or negative performance advantages over
the representation on sequence maps.  Deleting the additional representation
removes a lot of code paths, and makes things somewhat simpler.
2017-08-01 16:04:25 -07:00
Robert Dockins
dcc143e3f4 Back out workaround for issue #375. 2017-08-01 15:08:04 -07:00
Robert Dockins
771d07f920 Implement new "large" bitsequence representation.
When bitsequences cannot be packed as words, they have been
represented using an explicit sequence datastructure containing
thunks for the individual bits.  However, for finite, but very large,
bitsequences this was consuming unacceptable amounts of memory.

When bitvector lengths cross an arbitrarily-designated threshold
(currently 2^16 bits) we instead use a sparse representation based
on SeqMap, similar to the representation used for other finite and
infinite sequence types.
2017-08-01 14:49:52 -07:00
Robert Dockins
063e3ba898 Update test suite to track typo fix 2017-07-31 14:39:01 -07:00
Robert Dockins
b564b21b31 Typo in error message 2017-07-31 10:04:52 -07:00
Robert Dockins
0b9c186132 Make 'random' compute on concrete inputs in the symbolic evaluator.
This patch does not add a warning when using 'random' in symbolic expressions.
We currently don't have any organized mechanism for generating warnings during
evaluation, and the value of emitting such a warning is debatable.

Fixes #364
2017-07-27 15:45:37 -07:00
Aaron Tomb
520ff9183a Build on Travis with GHC 8.2.1
Builds with 8.0.2 were timing out, and maybe this will help.
2017-07-27 12:08:05 -07:00
Robert Dockins
2fb706a44c Make sure EvalErrors are propigated to the REPL error handler.
This keeps runtime evaluation errors from killing the Cryptol process.
2017-07-26 18:05:30 -07:00
Robert Dockins
dba3d2f7d8 Avoid using partial indexing operations.
Instead raise evaluation errors when indexing into finite sequences
with invalid indices.
2017-07-26 18:04:38 -07:00
Robert Dockins
36dcd49803 Update the test suite now that issue #116 is fixed. 2017-07-26 15:31:36 -07:00
Robert Dockins
399a2e47d5 Add additional thunking in logical and arithemetic primitive operations.
This prevents a loss of desirable sharing in the interpreter, and turns
recursive algorithms with potential sharing from exponential-time to linear
time.  It appears to have little impact on other algorithms.

Fixes #432
2017-07-26 15:30:36 -07:00
Aaron Tomb
901a1d16ad Remove references to cryptol-server from README 2017-07-24 16:22:00 -07:00
Aaron Tomb
010540c4b4 Comment out cryptol-server from Cabal file 2017-07-24 15:26:49 -07:00
Aaron Tomb
69e49d4245 Bump version to 2.5.0 2017-07-24 09:16:40 -07:00
Aaron Tomb
de80a9c2f5 Update copyright dates in Cabal file 2017-07-24 09:01:34 -07:00