Commit Graph

194 Commits

Author SHA1 Message Date
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
Levent Erkok
5857477ab2 Modifications to make cryptol compile with SBV 7.0
Also, bumped up the version to 2.4.1
2017-07-18 10:25:00 -07:00
Aaron Tomb
d76f21f89e Update benchmarks to find Prelude and CryptolTC.z3
Since they don’t run in the normal REPL environment, they need to know
about where to find the Prelude and CryptolTC.z3 more directly.
2017-03-21 12:31:04 -07:00
Iavor S. Diatchki
41131fe7ed Redo the export to SMT story in a much simpler way. 2017-02-16 16:46:38 -08:00
Iavor S. Diatchki
3c15d086d1 Merge branch 'master' into wip/solver 2017-02-08 16:24:46 -08:00
Iavor S. Diatchki
710355176a More rules and things; external solver disabled; we can at least load ChaCha 2017-02-08 15:08:50 -08:00
Brian Huffman
140ab21f11 Add new unoptimized reference interpreter; use in REPL with ":eval <expr>" 2017-02-03 09:02:25 -08:00
Iavor S. Diatchki
f3db823f3e Checkpoint: (broken, but builds) 2017-02-01 11:43:01 -08:00
Iavor S. Diatchki
b788079244 More aggressive goal simplification. 2017-01-31 14:12:53 -08:00
Iavor S. Diatchki
12bb2c30c8 Merge branch 'master' into wip/solver 2017-01-31 10:15:49 -08:00
Iavor S. Diatchki
ee1c8c796b Switch to using the official sbv release. 2017-01-31 10:04:34 -08:00
Iavor S. Diatchki
baa19ce362 Checkpoint. 2017-01-30 18:14:10 -08:00
Iavor S. Diatchki
c3ce33f5a6 Remove old stuff 2017-01-30 10:54:45 -08: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
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
Robert Dockins
998bddc7a7 Merge remote-tracking branch 'origin/master' into new-eval
Fix some minor conflicts in the test suite.
Conflicts:
	tests/issues/issue002.icry.fails
	tests/issues/issue148.icry.stdout
	tests/issues/issue198.icry.stdout
	tests/issues/issue214.icry.stdout
	tests/issues/issue290v2.icry.stdout
	tests/issues/issue312.icry.fails
2016-07-12 14:58:53 -07:00
Adam C. Foltzer
3c25c096a7 clean up build a bit 2016-07-06 16:20:01 -07:00
Adam C. Foltzer
78cacc4d3e Merge pull request #333 from RyanGlScott/master
Put bench/data/*.cry in extra-source-files
2016-07-05 08:49:53 -07:00
Robert Dockins
c3c1bb2c74 Merge branch 'master' into new-eval-merge 2016-06-13 16:29:36 -07:00
Robert Dockins
b95b734b74 Refactoring of how bits and words are handled in the interpreters.
The major change in this patch is to add a new type of 'WordValue'
which is always used to represent finite sequences of bits.  A word
value is either a packed word, or a sequence of lazy bits.  The 'VSeq'
constructor, in constrast, is now never used for a finite sequence of
bits.

This avoids certain thorny problems that arise when trying to faithfully
implement the lazy semantics of Cryptol.  We now do not have to commit
to a value at type '[n]' being represented as a packed word or as an
unpacked word until relatively late.  This allows us to perform type-directed
eta-expansion at every recursive call before we know how words will be represented.

This patch fixes all the outstanding strictness bugs that I know of.

Unfortunately, we seem to lose some ground on performance.  The new evaluator
is now about 5% slower than the old one on the AES benchmark, and quite a bit
slower on the SHA1 benchmark.  Fortunately, the use if LRU caches for memoization
of sequences seems to keep heap usage to manageable levels; so programs generally
complete, even if they take a long time.
2016-06-09 08:31:23 -04:00
Adam C. Foltzer
76be770d83 clean up 7.8-isms 2016-06-07 13:40:15 -07:00
Robert Dockins
99526f5700 Merge branch 'master' of github.com:GaloisInc/cryptol into new-eval 2016-06-01 15:22:09 -07:00
Thomas M. DuBuisson
363651c907 Fixes #320 Use -N1, not -N, as the default RTS option. 2016-05-31 10:38:13 -07:00
Rob Dockins
bdcfdd39a1 Update benchmarks for new interpreters 2016-05-30 23:07:05 -07:00
Rob Dockins
b518336885 Merge branch 'master' of cryptol into new-eval 2016-05-30 17:25:10 -07:00
Trevor Elliott
2f21dd509a Remove the generic-trie dependency 2016-05-27 17:05:16 -07:00
Ryan Scott
f1a45163a4 Put bench/data/*.cry in extra-source-files 2016-05-20 15:04:53 -04:00
Robert Dockins
7e968d2d18 WIP. New monadic Cryptol interpreter.
The concrete evaluator now seems to be working correctly,
but seems to suffer from major performace problems.
2016-05-12 18:44:06 -07:00
Sergei Trofimovich
ab43c275d4 tweak for deepseq-generics-0.2
deepseq-generics-0.2 stopped reexporting NFData from deepseq.
Patch imports it explicitly.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
2016-03-25 14:35:55 +00:00
Adam C. Foltzer
feb9d22a88 version bump & housekeeping
Bumped to version 2.4.0 and dropped the minor version from the GHC710
etc variables
2016-01-26 12:09:54 -08:00
Adam C. Foltzer
4d3fc9a413 Update copyright dates and add missing headers 2016-01-19 18:19:35 -08:00
Adam C. Foltzer
da6916702b split new Prelude definitions into Extras module
The definitions added in #299 cause a regression in Prelude typechecking
performance. Until we sort out the performance, we'll keep these
definitions in the module `Cryptol::Extras`.
2016-01-19 18:19:24 -08:00
Adam C. Foltzer
31176993e0 add lower bound for optparse-applicative
With the newer `transformers-compat` release, cabal was resolving this
dependency all the way back to `0.0.1`
2016-01-19 18:18:03 -08:00
Adam C. Foltzer
5c80fc2e1c temporary upper bound for deepseq-generics
We're only using this package for 7.8 compatibility, which will end when
GHC 8.0 is released soon. For now, just limit to the older version to
avoid import errors.
2016-01-08 11:53:01 -08:00
Thomas M. DuBuisson
752310cd0d Merge branch 'master' into writeFile 2015-12-25 21:39:01 -08:00
Adam C. Foltzer
9c07fe1006 merge in the 2.2.6 changes, including z3 switch 2015-12-23 16:10:56 -08:00
Thomas M. DuBuisson
1c36537d78 Update for SBV 5.7
Conflicts:
	cryptol.cabal
	src/Cryptol/Symbolic.hs
	src/Cryptol/Symbolic/Prims.hs
2015-12-23 14:13:59 -08:00
Adam C. Foltzer
579ccc96a0 backport prover command interface
Conflicts:
	src/Cryptol/REPL/Command.hs
	src/Cryptol/Symbolic.hs
2015-12-23 14:03:59 -08:00
Adam C. Foltzer
917cc27145 version bump to 2.2.6 2015-12-23 11:33:36 -08:00
Adam C. Foltzer
aeefab69a1 refactor :check and :exhaust
This is to set up improvements to the cryptol-server, and therefore
pycryptol interface.

This patch also fixes a regression in pretty-printing output caused by a
previous error in fixity of the `<>` operator
2015-12-22 18:17:20 -08:00
Adam C. Foltzer
f87ea62646 Merge branch 'server-interrupts' into HEAD 2015-12-14 13:56:52 -08:00
Thomas M. DuBuisson
1ffc086ed4 Update for SBV 5.6 2015-12-10 12:38:26 -08:00
Adam C. Foltzer
04d62ae221 refine interrupt behavior
In order to prevent Ctrl-Cs in, e.g. Python from bringing down the
server, there's now an option to swallow SIGINT when launching the server.
2015-12-04 15:53:51 -08:00
Adam C. Foltzer
563efcc25b start improving handling of interrupts in server
This notably adds a `MonadBaseControl` instance for the `REPL` monad so
that we can catch asynchronous exceptions in the middle of `REPL`
computations. Since this is a generalization of Haskeline's exception
support, that orphan instance for the console executable is now in terms
of this new instance.
2015-12-03 15:36:43 -08:00
Adam C. Foltzer
4796b0a75a tweak how the prelude is loaded
This removes the `self-contained` flag, since it is fine for all builds
to have the baked-in prelude as a last resort. Tinkerers can still
change the prelude as long as it's in the search path.

Also removes some unnecessary extra prelude loading by the Cryptol
server by means of a new command
2015-11-16 12:56:36 -08:00
Thomas M. DuBuisson
0d18bc821c Merge branch 'writeFile' of github.com:TomMD/cryptol into tommd/writeFile 2015-11-15 10:16:16 -08:00
Adam C. Foltzer
6203eedf3a bump SBV lower bound 2015-11-11 15:11:19 -08:00
Adam C. Foltzer
9f3d42344d require new aeson 2015-10-27 16:10:50 -07:00
Adam C. Foltzer
f34145282d relax aeson dependency for stackage 2015-10-27 15:00:23 -07:00
Adam C. Foltzer
b8ba4ebd69 fix benchmarks and NFData instances
The benchmark suite no longer uses the `iteSolver` option.

Added a dependency on `deepseq-generics` so that the `NFData` instances
work correctly in Stackage LTS 2. Versions of `deepseq` before 1.4 have
a default instance that amounts to WHNF rather than NF, so benchmarks
were being measured incorrectly.
2015-10-21 13:19:15 -07:00
Adam C. Foltzer
dfea6365f9 support older directory without CPP 2015-10-21 13:19:15 -07:00
Adam C. Foltzer
d31fc9d24a Adapt to SBV 5.3 interface
We special-case `allSat` because we don't support running parallel
solvers for multiple answers
2015-10-21 13:18:37 -07:00
Trevor Elliott
39bac2034a Merge remote-tracking branch 'origin/master' into wip/name-change 2015-10-16 13:23:29 -07:00
Adam C. Foltzer
ad3fdb4e14 use base-compat to remove much CPP 2015-10-08 16:54:08 -07:00
Trevor Elliott
5436acdbb8 Merge remote-tracking branch 'origin/master' into wip/name-change 2015-10-04 11:49:57 -07:00
Adam C. Foltzer
80daf82b8c add threading by default for executables 2015-10-01 13:50:32 -07:00
Adam C. Foltzer
baddfcaab8 Merge branch 'heads/hotfixes/v2.2.5' 2015-10-01 10:56:30 -07:00
Adam C. Foltzer
7d81568555 remove iteSolver option for compat with sbv 5+ 2015-09-30 14:24:21 -07:00
Adam C. Foltzer
243e051df3 bump version number, add SBV upper bound
Conflicts:
	stackage.config
2015-09-29 11:28:30 -07:00
Trevor Elliott
55ae1f852d Major changes plumbed through, now for the bugs! 2015-09-24 16:47:52 -05:00
Trevor Elliott
9092492d6a Improvement improvements
Integrate interval analysis into improvements to simplify fin constraints, and
rewriting of equality constraints.
2015-08-14 17:38:50 -07:00
Adam C. Foltzer
dce6f994e8 Merge branch 'master' into feature/benchmarks 2015-08-14 16:23:10 -07:00
Trevor Elliott
c10a92be84 First pass at goal rewriting
Attempt to normalize equality constraints involving a single unification
variable into a form where that variable is alone on one side of the equation.
Applying this normalization before attempting to simplify goals seems to clean
up some cases that the solver wasn't able to deal with.
2015-08-11 23:35:19 -07:00
Adam C. Foltzer
d3d6ae154a add typechecking and large sequence benchmarks 2015-08-10 13:52:01 -07:00
Adam C. Foltzer
b6d6691ab0 start benchmarking suite with a Prelude parse test 2015-08-10 11:24:36 -07:00
Nathan Collins
7c52103fab Only require cryptol-server's build depends when it's being built.
By moving `build-depends` under the `if flag(server)` check. The diff
is a little hard to read, because I did not change the indentation of
the dependencies. Thanks @elliottt for the fix!
2015-07-22 09:22:15 -07:00
Adam C. Foltzer
900e4acf8b clean up cryptol-server for merging 2015-07-21 11:52:17 -07:00
Adam C. Foltzer
89b4567b93 add missing cryptol-server directory 2015-07-08 18:01:22 -07:00
Adam C. Foltzer
dbb41dd646 fold server into main Cryptol package
once merged, we'll disable the build by default so we don't incur the
zeromq dependency, but it would be nice to eventually make the server
the core of all our clients
2015-07-07 18:13:34 -07:00
Aaron Tomb
55154aff2b Allow use of Cabal 1.18 during build
This eases the build using Stack and GHC 7.8, since GHC 7.8 comes with
Cabal 1.18.
2015-06-26 13:45:26 -07:00
Trevor Elliott
4b323b8446 Remove primitives 2015-06-08 16:00:14 -07:00
Adam C. Foltzer
ebaa98699b bump version 2015-06-01 12:34:33 -07:00
Adam C. Foltzer
1ae907f5d9 version bump to 2.3.0; fix warnings 2015-05-26 14:04:31 -07:00
Trevor Elliott
ace54c884f Add a naming environment to the pretty printer 2015-05-21 23:13:04 -07:00
Thomas M. DuBuisson
5e094f3acd Add a ':write' command
The intent here is to allow users to write expressions to disk without
copy and pasting the ASCII representation into some other system (ex: a
Haskell script) to perform the actual file write.

Use:

```
Cryptol> :write /tmp/foo "hello Cryptol!\n"
Cryptol> :!cat /tmp/foo
hello Cryptol!
Cryptol> let var = "Complex computation\n"
Cryptol> :write /tmp/foo var
Cryptol> :!cat /tmp/foo
Complex computation
Cryptol> let var = 32 : [32]
Cryptol> :write /tmp/foo var
Can not write expression of types other than [n][8].  Type was:  [32]
```

Also: Tab completion for FileExprArg commands.

This is rather half-done.  The actual completion should depend on if
the user is inputting the 1st or 2nd argument, but we can't really
determine that without live parsing which is probably a largish change.
Instead, we just assume the completion is wrt the expr, since the file
will likely be new and not be able to tab-complete in real uses.
2015-05-21 10:57:14 -07:00
Iavor S. Diatchki
6249563fd8 First stab at type-checker sanity checking. 2015-05-19 14:25:56 -07:00
Iavor S. Diatchki
2400c1d300 Split out expression simplification in a separate module 2015-05-08 13:40:35 -07:00
Iavor S. Diatchki
2508f15b60 Split off in a separate module 2015-05-06 10:19:01 -07:00
Adam C. Foltzer
4438329f76 Merge branch 'releases' 2015-04-30 15:31:14 -07:00
Adam C. Foltzer
8007f97205 prepare for 7.10
- Move the stackage file so it's not on by default (will test with it on
  Jenkins instead of all the time)
- Use CPP to remove unnecessary import warnings in 7.10
2015-04-30 13:53:24 -07:00
Adam C. Foltzer
a07980b652 bump version to 2.2.3 2015-04-30 13:53:24 -07:00
Brian Huffman
43cd2df448 Bump sbv minimum version to 4.3 2015-04-30 13:53:24 -07:00
Brian Huffman
ba91e37a5d Merge module Cryptol.Symbolic.BitVector into Cryptol.Symbolic.Value 2015-04-30 13:53:24 -07:00
Adam C. Foltzer
10dcfd7243 Merge branch 'releases' into master from 2.2.2
We accidentally forgot to merge the 2.2.2 changes back into master, but
since they were mostly temporary fixes pending SBV updates, this didn't
cause any problems. This commit is just to be tidy :)
2015-04-30 13:51:51 -07:00
Iavor S. Diatchki
58bb7254da Remove old stuff 2015-04-17 16:19:43 -07:00
Adam C. Foltzer
9660f251c2 fix #197
Remove the autoconf hooks from Setup.hs and bump cabal version
requirement so that `license-files` is supported
2015-04-10 11:23:00 -07:00
Adam C. Foltzer
ce36319f09 add upper bound to SBV; bump version 2015-04-10 11:22:38 -07:00
Brian Huffman
711ba43e7b Bump sbv minimum version to 4.3 2015-04-10 10:49:30 -07:00
Brian Huffman
639d9fd9a6 Merge module Cryptol.Symbolic.BitVector into Cryptol.Symbolic.Value 2015-04-09 10:57:42 -07:00
Trevor Elliott
42c6552b54 Upgrade the simple-smt dependency 2015-03-31 17:38:04 -07:00
Trevor Elliott
3203128b40 Merge remote-tracking branch 'origin/master' into wip/cs 2015-03-30 16:25:25 -07:00
Trevor Elliott
e68caee830 Support z3 through the use of the :global-decls option 2015-03-30 16:21:09 -07:00
Adam C. Foltzer
5768dac5c0 prepare for 7.10
- Move the stackage file so it's not on by default (will test with it on
  Jenkins instead of all the time)
- Use CPP to remove unnecessary import warnings in 7.10
2015-03-30 13:07:37 -07:00
Iavor S. Diatchki
afd53bb6a1 Merge remote-tracking branch 'origin/master' into wip/cs
Conflicts:
	cryptol.cabal
	src/Cryptol/TypeCheck/Solve.hs
	src/Cryptol/TypeCheck/Solver/CrySAT.hs
	src/Cryptol/TypeCheck/Solver/Selector.hs
2015-03-30 11:29:20 -07:00
Adam C. Foltzer
275b9a99f1 fix #197
Remove the autoconf hooks from Setup.hs and bump cabal version
requirement so that `license-files` is supported
2015-03-27 12:10:42 -07:00
Adam C. Foltzer
7f57eea48e bump to 2.2.1 2015-03-25 11:30:39 -07:00
Adam C. Foltzer
7ec1106eeb fix problems uncovered by hackage and stackage 2015-03-25 11:13:46 -07:00
Adam C. Foltzer
890e74ff76 bump version for 2.2.0 release 2015-03-17 17:04:21 -07:00
Adam C. Foltzer
1587c01706 bump SBV version for better ABC support 2015-03-17 16:30:49 -07:00