Commit Graph

368 Commits

Author SHA1 Message Date
Adam C. Foltzer
abf5a49333 add pointer to CRYPTOLPATH in error message 2015-03-20 14:30:33 -07:00
Adam C. Foltzer
7c85517ae2 add environment variable documentation to --help 2015-03-20 14:24:39 -07:00
Adam C. Foltzer
3d9628cf6f clean up warnings and remove dead code 2015-03-20 12:04:01 -07:00
Adam C. Foltzer
40c0bf9395 add latest Stackage LTS for release 2015-03-17 17:06:11 -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
Brian Huffman
37cb5880fd Speed up 'packWord' and 'unpackWord' functions in SBV backend
This greatly speeds up primitives such as 'split' when
applied to very large bitvectors. Fixes #189.
2015-03-17 15:47:34 -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
Dylan McNamee
1fd98e02b0 removed property keyword from helper functions. Thanks to Joey Dodds for pointing this out. 2015-03-09 14:43:30 -07:00
Adam C. Foltzer
5fb8521ea7 add abc prover support 2015-03-09 14:20:27 -07:00
Adam C. Foltzer
faab7b0b0a tweak paths in test output for Windows 2015-03-06 12:03:21 -08:00
Adam C. Foltzer
56ab951d7f fixup last commit 2015-03-05 16:10:34 -08: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
11405230aa tweak to Makefile for Windows dist 2015-03-04 14:53:59 -08:00
Brian Huffman
cadfaced80 Update test for issue #177
The issue is not the set of names in scope, it is the type names
printed out by the :t command. It should use the same names that
are in scope in the module.

If the type of an expression contains a type synonym that is not
in scope at all, then I'm not sure what exactly it should do.
2015-03-04 11:22:37 -08:00
Brian Huffman
0eb57b9674 Add test for issue #177. 2015-03-04 09:58:53 -08:00
Adam C. Foltzer
6e1abbd2c3 adjust path on windows for relocatable build 2015-03-04 09:19:22 -08:00
Adam C. Foltzer
528a7d516d add an install target
meant to make distribution with, eg., Homebrew an easier task
2015-03-03 17:21:29 -08:00
Adam C. Foltzer
72dcea9262 tweak how often we generate GitRev.hs 2015-03-03 16:27:40 -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
e1f89dc7d0 README cleanups
- update copyright date
- point to new Haskell.org downloads rather than HP
- new WiX version
- smoke test subsumes `:prove True`
- repo layout simpler (no `notebook`, `sbv` subdirs)
- no notebook documentation
2015-03-03 13:48:32 -08:00
Adam C. Foltzer
993961c2a4 remove icry directory from dist target 2015-03-03 13:42:00 -08:00
Adam C. Foltzer
94175c5385 remove ICryptol subdir after repo spinout 2015-03-03 13:20:33 -08:00
Adam C. Foltzer
3e6579a24d Merge branch 'master' into feature/issue75
Conflicts:
	Makefile
	cryptol/Main.hs
	src/Cryptol/REPL/Command.hs
	src/Cryptol/REPL/Monad.hs
2015-03-03 11:41:34 -08:00
Adam C. Foltzer
243b97d1a6 add smoke testing with cvc4 test
Closes #112.

This adds a check at REPL startup that `cvc4` is an executable on the
path. It doesn't check for versions, as we're mostly stuck with
"prerelease" versions.

I made it easy to add more smoke tests at startup; we should add these
as we think of them.
2015-03-03 11:30:22 -08:00
Adam C. Foltzer
116b269de7 fix name collision for initialization script
We previously read a batch script from `$HOME/.cryptol` on REPL startup,
but this turns out to conflict with the directory returned by
`System.Directory.getAppUserDataDirectory`.

This commit changes the name to `.cryptolrc` and updates the interpreter
flags and such accordingly.
2015-03-03 11:30:22 -08:00
Adam C. Foltzer
3f5c05b93d bump license years 2015-03-02 15:48:39 -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
Brian Huffman
56a20cfb2b Updates to the Cryptol specializer:
- Introduce monad type SpecT m a = StateT SpecCache (ModuleT m) a
  (easier to call from code written in ModuleT monad)

- Fix bug where specializing expressions under ETAbs could cause
  type variables to `escape` from their scopes.

- Function `withDeclGroups` lets you run arbitrary specializer monad
  action within the context of a set of DeclGroups. This is used to
  implement specialization of where-expressions, and also for the new
  function `specializeDeclGroups`, which specializes a set of DeclGroups
  using the monomorphic bindings as the 'root set' to determine what
  other specialized bindings to include.
2015-02-27 20:34:18 -08:00
Adam C. Foltzer
8ea7ba0b75 make cryptol interpreter utf8 by default
Previously we were just using Prelude's `readFile`, which uses the
system default locale. This meant that people writing Cryptol in other
locales might produce source files that work fine for them but not
others. Now the interpreter sets the default locale to utf8 at startup.

Additionally, the code to catch exceptions from loading modules was too
lazy, allowing exceptions to bring down the whole process when the
module contents were forced outside of the `try`.

We also assumed that any IO exception was from files not being found;
there's now an "Other IO exception" possiblity. Incorrect locales will
trigger this alternative because the actual IOException raised isn't
specific to locale errors.
2015-02-26 17:35:41 -08:00
Iavor S. Diatchki
55a3a56659 Merge branch 'master' of github.com:GaloisInc/cryptol 2015-02-25 14:19:35 -08:00
Iavor S. Diatchki
be546b4261 Modify testrunniner to figure out on its own if we have a dir or a test.
This means we don't need -d anymore, and now we can run individual tests
from the comman line.
2015-02-25 14:19:11 -08:00
Trevor Elliott
a0f60c3f55 Merge pull request #172 from bryant/issue-167
Issue 167
2015-02-24 15:47:52 -08:00
bryant
e73c35bcf4 add empty module test 2015-02-24 18:00:59 -05:00
bryant
9b3619cc34 insert end-of-layout-block early when eof 2015-02-24 16:17:49 -05:00
Trevor Elliott
6d2f26785a Add the filename to parser errors
Closes #168
2015-02-18 15:37:15 -08:00
Trevor Elliott
b08ed758fb Fix a typo 2015-02-18 13:52:52 -08:00
Trevor Elliott
af0f0fb3b5 Always pack the zero literal 2015-02-18 13:51:59 -08:00
Adam C. Foltzer
0b500d79d9 move issue218 test to issue116
218 was an issue number on our old trac wiki; #116 (and #2) are the
corresponding tickets on GitHub. Pointed out by @weaversa in #170
2015-02-18 10:43:03 -08:00
Adam C. Foltzer
deb6f62d2c update (failing) test case for 0-based tuple index
Between this and the fix for #117, this fixes #170
2015-02-18 10:34:59 -08:00
Adam C. Foltzer
67b4e5f39f correction: 49030290 fixes #117 2015-02-18 10:27:33 -08:00
Adam C. Foltzer
49030290e9 fix #93
Revised how we do output for `:sat` and `:prove` without arguments,
making it more clear what properties are being checked in each case.

Also reworded the output of `:check` slightly in the case where the
property has no inputs. It would be nice to make `:check` output more
consistent with the others.
2015-02-18 10:25:46 -08:00
Adam C. Foltzer
3d275ea44c add load targets to search path
Fixes a bug pointed out by @weaversa:
https://github.com/GaloisInc/cryptol/issues/127#issuecomment-64464455

In addition to the other search path changes in #127, we now will add
the directory containing files to be loaded to the search path. This
applies to:

- files loaded with a command line argument, like in the original
  comment
- arguments to `:l`, so for example `:l examples/DES.cry` would work
- batch file arguments, so for example running `cryptol -b
  /some/path/bar.cry` adds `/some/path` to the search path.
2015-02-17 15:27:59 -08:00
Adam C. Foltzer
bf25c5190f exceptions no longer bring down the kernel
listed in #163
2015-02-16 17:02:10 -08:00
Adam C. Foltzer
649494bc03 fewer default warnings in notebook
By popular demand and general consensus (#163), defaulting and shadowing
warnings are now off by default in the notebook. They can be reenabled
by using `:set` in a cell much like they can be toggled at the command
line.

The main reason for this change is that we can't help but emit all of
the warnings for the entire module context whenever any part of that
module changes. If we could focus the warnings so that they're only
relevant for this particular cell, we should probably reenable them by
default.
2015-02-16 14:44:50 -08:00
Adam C. Foltzer
30dd6d0c26 configuration depends on cryptol.cabal 2015-02-16 14:40:24 -08:00
Adam C. Foltzer
64d3d1353f add warnShadowing REPL option
Conflicts:
	cryptol/REPL/Command.hs
2015-02-16 14:40:06 -08:00