Commit Graph

202 Commits

Author SHA1 Message Date
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
Adam C. Foltzer
293200e722 switch to hackage version of gitrev 2015-03-17 12:03:58 -07:00
Adam C. Foltzer
fe1a2403c9 handle EvalErrors more gracefully in :check
Fixes #114 (mostly; Ctrl-C still doesn't clean everything up, but fixing
that would require a whole lot of work).
2015-03-16 17:17:36 -07:00
Adam C. Foltzer
a46b4c31c2 switch to TH solution for GitRev
This helps with #18 and should also reduce the number of unnecessary
recompiles that were triggered by the Makefile and/or cabal. The cabal
build type is now Simple.

Most of the complication in the TH.hs module is due to the various
places the current git hash might be stored:

1. Detached HEAD: the hash is in `.git/HEAD`
2. On a branch or tag: the hash is in a file pointed to by `.git/HEAD`
in a location like `.git/refs/heads`
3. On a branch or tag but in a repository with packed refs: the hash is
in `.git/packed-refs`

These situations all arise under normal development workflows and on the
Jenkins build machines, but there might be further scenarios that cause
problems. The tradeoff seems worthwhile though as now projects that
build Cryptol as a dependency wind up having to rebuild Cryptol far less
frequently.
2015-03-16 13:18:28 -07:00
Adam C. Foltzer
489a926589 clean up cabal file for Hackagability
Fixes #18
2015-03-09 15:17:26 -07:00
Adam C. Foltzer
5fb8521ea7 add abc prover support 2015-03-09 14:20:27 -07:00
Adam C. Foltzer
0c7b21674c add "self-contained" mode for Cryptol-as-a-Library
Many of our projects that depend on Cryptol break because we forgot to
drag along `Cryptol.cry` or it just can't work out where it is from the
perspective of the other executable.

There's now a new flag `self-contained` in `cryptol.cabal` that is on by
default that bakes the contents of the Prelude into the library, so that
it can be reproduced on demand.

This is really a hack at this point because the module system bakes in
the assumption that a module has an associated file path, so we actually
have to write the contents to a tmp file before reading them back
in. Let's do better than this in the future.

This option is disabled for targets in the Makefile because we want the
standalone interpreter to be using the distribution's `Cryptol.cry`.
2015-03-05 15:18:18 -08:00
Adam C. Foltzer
ba9c1461ca distribution tweaks
Makefile now has two modes depending on whether PREFIX is set. If it's
not, we try to make the distribution as relocatable as possible, meaning
we don't rely on the baked-in-by-cabal data directory. If it is set, we
do use that path.
2015-03-03 16:22:14 -08:00
Adam C. Foltzer
9923b6f11a split out notebook into separate package
This involved:

- Moving a couple REPL modules into the Cryptol library hierarchy (those
  that don't depend on console libraries)
- Splitting up the Makefile, which unfortunately resulted in a lot of
  not-quite-duplication between the two Makefiles. Let's look into
  better abstraction...
2015-03-02 15:46:21 -08:00
Iavor S. Diatchki
d85a5d5aa0 Just debugging improvements. 2015-02-25 11:21:56 -08:00
Iavor S. Diatchki
0b4611c3fd Use Map instead of Trie for the moment (Tries take too long to build) 2015-02-20 10:51:28 -08:00
Adam C. Foltzer
3f401b4321 bump version constraint for ipython-kernel 2015-02-12 08:57:18 -08:00
Adam C. Foltzer
adcd96fa47 make notebook distributable
This commit brings the notebook into the rest of the distribution
infrastructure set up for cryptol. The main points are:

- new icryptol-kernel executable
- new icryptol shell script that wraps ipython and makes sure the
  cryptol profile is set up
- Makefile target for friendly local testing (`make notebook`)
- moved example notebooks to examples subdirectory
2015-02-11 16:21:43 -08:00
Adam C. Foltzer
62d8277574 add just enough strictness to evalCmd 2015-02-05 17:05:11 -08:00
Adam C. Foltzer
3180d12740 Merge branch 'master' into feature/issue75 2015-02-05 16:28:56 -08:00
Adam C. Foltzer
9f61032289 update notebook build mechanisms 2015-02-05 16:12:36 -08:00
Iavor S. Diatchki
67ba18bbcc Merge remote-tracking branch 'origin/master' into wip/cs
Conflicts:
	cryptol.cabal
2015-01-29 10:54:33 -08:00
Adam C. Foltzer
705230f24b another sdist fix 2015-01-28 11:28:52 -08:00
Adam C. Foltzer
92edf47dbd fix cabal sdist by including configure 2015-01-28 11:01:53 -08:00
David Raymond Christiansen
7cd2739831 Make notebook use iPython Haskell library
Now, the notebook interface runs its own ZeroMQ interface using the
EasyKernel module that is now exported from IHaskell's underlying
ipython-kernel library. This eliminates the line protocol with the
Python wrapper, and it should work on Windows (though it is not tested
there).

Part of this involved making the REPL monad able to change the IO action
used to print strings.

Continuing issues and improvment possibilities are in the issue tracker
- see issue #75 for a starting point.
2015-01-27 17:38:24 -08:00
Trevor Elliott
ca06580fc6 Remove the dependency on mtl 2015-01-27 15:12:35 -08:00
Brian Huffman
64d53546fe Remove custom fork of SBV library in favor of the official SBV-4.0.
Fixes #35.
2015-01-23 14:22:18 -08:00
Adam C. Foltzer
13a385d8c5 Fixes #172
There's now a more sensible hierarchy of locations that Cryptol uses to
look for modules. By default, in order it looks for libraries in:

1. The directories specified in the CRYPTOLPATH environment variable
2. The current directory
3. The user data directory (something like `$HOME/.cryptol`)
4. Relative to the executable's install directory
5. The static path used when building the executable (cabal's data-dir)

There is also a new command-line flag for the interpreter:
`--cryptolpath-only` which makes the interpreter ignore locations 2-5.

This commit also reworks the Makefile and build/release process. These
are bunched together because they play off each other quite a bit; the
build/release process determines the location of the `Cryptol.cry`,
which must be found when looking for modules.

Rather than leaning on `cabal install`, we now use a combination of
`cabal configure`, `cabal build`, and `cabal copy`. A couple of upshots
to this:

- More of the release staging is handled by cabal -- we don't have to go
  in and manually copy things out of the sandbox. In fact, the `cryptol`
  executable never goes into the sandbox.

- The testing infrastructure runs on executables that are in place in
  the staging directory, rather than in the sandbox. This should be more
  hygienic and realistic.

- The `Cryptol.cry` prelude file is now in `/share/cryptol` in order to
  better reflect the common POSIX structure. This means Cryptol will
  play nicer in global installs, and mirrors what other interpreted
  languages do.

- The default build settings use a prefix of `/usr/local` rather than
  using the sandbox directory. This makes them more relocatable for
  binary distributions. Set PREFIX= before making to change this.
2015-01-21 15:03:16 -08:00
Iavor S. Diatchki
4fcd9b768b Remove dependency on pressburger 2015-01-06 09:31:51 -08:00
Iavor S. Diatchki
d2110749be Merge branch 'master' into wip/cs
Conflicts:
	src/Cryptol/TypeCheck/Solver/CrySAT.hs
2015-01-06 09:24:23 -08:00
Iavor S. Diatchki
e217600b61 Changes to make things work with GHC 7.10 2015-01-06 09:21:47 -08:00
Iavor S. Diatchki
b9bdc391b4 Improve non-linear story a bit; eliminate SMTProp 2015-01-05 14:55:54 -08:00
Iavor S. Diatchki
7a933304bd Add dependency on fixed version of SimpleSMT 2014-12-12 10:04:36 -08:00
Iavor S. Diatchki
08cec44702 Merge remote-tracking branch 'origin/master' into wip/cs 2014-12-10 14:10:49 -08:00
Iavor S. Diatchki
9d385d5af2 Make general substitutions, and move code into AST module. 2014-12-05 11:46:09 -08:00
Iavor S. Diatchki
71f3b8dd13 Split off translation between TypeCheck.AST and TypeCheck.Numeric.AST 2014-12-05 11:32:11 -08:00
Iavor S. Diatchki
c983dbfe5d Split-up CrySat into multiple modules. 2014-12-01 16:28:29 -08:00
Adam C. Foltzer
794017ecf5 add guards for bit vector widths during concrete evaluation
Tested on my 64-bit machine; will run tests on Jenkins slaves
2014-11-04 12:11:24 -08:00
Adam C. Foltzer
b7c33c1e86 add reasonable profiling defaults for library and executable 2014-09-25 16:45:28 -07:00
Adam C. Foltzer
6b12984912 bump version for 2.1.0 alpha 2014-09-14 19:35:24 -07:00
Adam C. Foltzer
68d1e3d6c6 Add default-language to cabal file. Closes #71 2014-09-14 14:37:43 -07:00
Thomas M. DuBuisson
a2fbf632f5 Use tf-random for higher-quality randoms.
Notice the randoms from StdGen are well-known to be quite bad.  For
example, see comments in issue #86.
2014-09-08 21:47:05 -07:00
Adam C. Foltzer
d409116160 Merge branch 'devel'
This was the branch I originally set up for git flow, but we're moving
to production=release and develop=master, so this branch is obsolete.
2014-08-19 10:31:31 -07:00
Aaron Tomb
abe336d907 Added SignCast instance and exported sbv
Changes necessary for SAWCore's use of SBV. Ultimately, these should be
merged into the upstream SBV package.
2014-08-06 09:49:19 -07:00
Adam C. Foltzer
ab39a74c98 fix #67
The python side of the notebook needed to be updated to expect a
.cabal-sandbox rather than cabal-dev sandbox. Also added a -fnotebook
flag to the cabal file to build the Haskell side of it.
2014-07-29 08:53:44 -07:00
Brian Huffman
db08bfafa9 Merge changes from SBV release version 3.1 2014-07-21 15:23:34 -07:00
Brian Huffman
b304eb2ef0 New module Cryptol.TypeCheck.TypeOf has functions to compute Type of an Expr 2014-05-09 16:27:07 -07:00
Adam C. Foltzer
7f44d616dd fixup: Paths_cryptol_parser 2014-04-18 10:28:46 -07:00
Adam C. Foltzer
5b25f8c21a it's not just a parser anymore 2014-04-18 10:18:26 -07:00
Adam C. Foltzer
ba0a0e8576 Initial import from internal repo 2014-04-17 15:34:25 -07:00