Commit Graph

303 Commits

Author SHA1 Message Date
Adam C. Foltzer
64d3d1353f add warnShadowing REPL option
Conflicts:
	cryptol/REPL/Command.hs
2015-02-16 14:40:06 -08:00
Adam C. Foltzer
025ad73411 document the make run target
This is a convenience for getting the library path right when running
from the staged dist area
2015-02-11 17:38:32 -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
Trevor Elliott
e338574ea1 Remove reloaded modules from the cache
Loading modules explicitly that were already loaded would cause the previous,
cached module to be kept, and the new checked one to be thrown away.
2015-01-27 15:13:26 -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
7d650526cd Update book pdf with changes from a15fb75 2015-01-21 15:49:25 -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
Adam C. Foltzer
a15fb75856 update book with allSat 2015-01-18 17:03:43 -08:00
Adam C. Foltzer
2b2c3e5ff6 Merge branch 'yuuko-master' 2015-01-18 16:16:54 -08:00
Adam C. Foltzer
a5cf80c570 Merge @yuuko's allsat pull requests
Cryptol's invocation of proof tools has changed quite a bit since this
PR was first opened, so this took a fair amount of work to
integrate. However we now have the :satNum option, and multiple sat
results are correctly bound to `it`.
2015-01-18 16:13:56 -08:00
Adam C. Foltzer
22df9717cb properties and cleanup for new contrib examples 2015-01-18 12:46:03 -08:00
Adam C. Foltzer
d7e9b9b3c6 add README for contrib 2015-01-18 12:45:39 -08:00
Adam C. Foltzer
473b175922 move RC4 to contrib directory 2015-01-18 11:47:40 -08:00
orchid
1f3c9b8203 RC4 2015-01-18 11:47:40 -08:00
Adam C. Foltzer
85e1725b29 Merge pull request #69 from mknight-tag/master
Add MKRAND RBG to contrib
2015-01-18 11:42:21 -08:00
Adam C. Foltzer
193e6595ff serialize alex and happy targets
Fixes #161
2015-01-18 11:39:04 -08:00
Brian Huffman
ae219c2e90 Fix definitions of sbvRotate{Left,Right} for large rotation amounts;
Also add regression tests for symbolic rotations.

Fixes #160.
2015-01-16 11:06:12 -08:00
Brian Huffman
811dc0f816 Add regression test for issue #158. 2015-01-15 16:24:21 -08:00
Brian Huffman
5f8b8947d4 Merge changes from latest SBV version (3.5 pre-release)
Includes changes after LeventErkok/sbv@6468f41bde (Dec 5)
and up to LeventErkok/sbv@49375110c5 (Jan 14)
2015-01-15 10:31:01 -08:00
brianhuffman
59fb642486 Merge pull request #157 from dmwit/master
canonicalize records during comparison in :prove
2015-01-14 16:33:11 -08:00
Daniel Wagner
44c2a1f709 canonicalize records during comparison in :prove 2015-01-13 19:09:50 -08:00
Brian Huffman
30b255a740 Avoid importing private modules from sbv package 2015-01-13 14:27:41 -08:00
Iavor S. Diatchki
faab3aee1f Import Applicative for pre 7.10 2015-01-08 09:19:20 -08:00
Iavor S. Diatchki
e217600b61 Changes to make things work with GHC 7.10 2015-01-06 09:21:47 -08:00
Trevor Elliott
57c6580b5b Give FM an Alternative instance 2014-12-31 14:58:51 -08:00
Trevor Elliott
f29078f341 Change the precedence of xor (^)
Move xor in the precedence table to be between comparisons and (#), which
reflects where it lives in the haskell hierarchy.
2014-12-31 11:12:54 -08:00
Trevor Elliott
1eac4a3b9d Switch from always inferring to checking when possible 2014-12-30 10:49:43 -08:00
Trevor Elliott
ec368fe6af Fix #16
Propagating type signatures down when they're given seems to fix this bug.
2014-12-30 10:49:01 -08:00
Trevor Elliott
41ca73ffaa Update tests for changes to inference
The changes didn't alter the behavior of the typechecker, only the
warning/error output, and the order of some variables when generalizing.
2014-12-30 10:43:38 -08:00
Trevor Elliott
12e0d8605c Remove unused inferFun function 2014-12-29 23:27:31 -08:00
Trevor Elliott
46e176ed5b Avoid redundant cases 2014-12-29 23:27:03 -08:00
Adam C. Foltzer
80b3102512 Add support for .cryptol files
Fixes #97
2014-12-23 17:48:26 -08:00
Trevor Elliott
ea01ec4aaf Fix a bug with comprehension checking
Wasn't relating the size of the goal type to the size of the arms of the
comprehension.
2014-12-22 14:59:52 -08:00
Trevor Elliott
881f397a48 Check instead of infer
We can take advantage of information from signatures if we check instead of
infer.  I'm not sure if this is actually paying off, but it should mean that we
unify less when signatures are present, and generate goals that are a little
more specific.
2014-12-19 17:33:16 -08:00
Trevor Elliott
8f06d2eaf4 Avoid re-applying the substitution to goals 2014-12-18 17:28:55 -08:00
Trevor Elliott
ca6cead8f0 Update the output for test 225 2014-12-18 17:28:34 -08:00
Trevor Elliott
ed14d8a708 Add mapMaybeWithKeyTM to the TrieMap class 2014-12-18 17:16:13 -08:00
Trevor Elliott
09894319fe Warning removal 2014-12-18 11:04:18 -08:00
Trevor Elliott
e3d41b0f2c Add unionTM to the RewMap' Trie 2014-12-18 11:04:08 -08:00
Trevor Elliott
1e063e58f3 Fix Functor/Applicative warning for Result 2014-12-18 11:03:13 -08:00
Dylan McNamee
16bca156d7 Salsa20 working better with type checker improvements (thanks, Sean!) 2014-12-17 06:44:39 -05:00
Trevor Elliott
b1d65e1655 Update issue225.icry
mono-binds is irrelevant to the bug now.
2014-12-16 17:59:07 -08:00
Trevor Elliott
1466d99e1b This is fixed by mono-binds 2014-12-16 17:56:28 -08:00
Trevor Elliott
2401954532 The goals are equivalent 2014-12-16 17:56:07 -08:00
Iavor S. Diatchki
2836070488 Fixes to applying substitutin to TypeMap keys. 2014-12-16 17:47:22 -08:00
Trevor Elliott
9e5bf0873f Fix apSubstTypeMapKeys
apSubstTypeMapKeys wasn't pushing the substitution down when the key contained
multiple variables.
2014-12-16 15:09:05 -08:00
Trevor Elliott
b4d9c85635 Merge in the history of the mono-binds change 2014-12-16 09:58:06 -08:00
Adam C. Foltzer
284338c938 Add the mono-binds flag
When `:set mono-binds=on`, any local definitions lacking type
signatures will not be generalized (i.e., will be monomorphic). This
reduces what is in most cases unnecessary polymorphism that can give
rise to constraints that are difficult to solve. This also improves
the performance of the Cryptol interpreter by lifting many polymorphic
type applications out of the inner loops that are commonly defined as
bindings in `where` clauses.

The flag is on by default in the Cryptol REPL, and in most cases makes
it possible to leave out more type signatures in `where` clauses than
before. However, some programs really do rely on inferring polymorphic
types for local variables; in this case adding an explicit polymorphic
type signature to the local binding in question will make the program
typecheck.
2014-12-15 17:48:25 -08:00