Commit Graph

280 Commits

Author SHA1 Message Date
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
Trevor Elliott
86585ccbe1 Add a Goals newtype
This makes it easier to get the behavior of the TVars instance under control,
as we can choose to only apply the substitution to the values of the map after
first applying it to the keys, and thus possibly removing redundant goals.
2014-12-15 17:01:30 -08:00
Trevor Elliott
24b80b1b40 Store goals in a TypeMap, instead of a list
This should reduce the number of redundant constraints getting generated.
2014-12-15 13:10:57 -08:00
Adam C. Foltzer
80a3826ac9 fix up a couple mono-binds-related tests
mono-binds/test03 is no longer a really relevant test since mono-binds
doesn't do any generalization. However I fixed up the type signature
and updated the output in case it becomes relevant again in the
future.

issues/issue225 is fine, but work on the master branch increased the
verbosity of constraint solver failures when mono-binds is off. It
still works fine when we monomorphize the local definition.
2014-12-15 10:44:58 -08:00
Adam C. Foltzer
c291ef5c06 Merge branch 'master' into wip/mono-binds 2014-12-12 15:55:27 -08:00
Adam C. Foltzer
ffb6148339 update documentation of where clauses with mono-binds info 2014-12-12 15:43:18 -08:00
Adam C. Foltzer
fed2978fda exclude emacs autosave files from Cryptol dependencies in Makefile 2014-12-12 15:41:49 -08:00
Brian Huffman
93b0789a98 Export schema-parsing functions 2014-12-12 15:08:53 -08:00
Brian Huffman
b88e2d1a11 Add test cases for issue #58. 2014-12-11 15:50:22 -08:00
Trevor Elliott
28fdd44100 Fix #140
The Smtlib solver was translating Fin constraints to True, as it didn't know
how to handle them.  They should have been skipped, and returned back as
unsolved goals instead.
2014-12-11 15:12:14 -08:00
Trevor Elliott
296ee335a0 Try to minimize the differences with master 2014-12-10 11:45:21 -08:00
Trevor Elliott
ad664014dd All bindings without signatures are monomorphic with mono-binds
Tracking the closed environment was tricky, and it wasn't clear how easy it
would be to find free type variables in bindings that lack signatures, as we
don't kind check the AST before making the decision about making it monomorphic.
2014-12-10 11:41:32 -08:00
Trevor Elliott
441d3e84f9 Add three more tests for mono-binds 2014-12-09 18:09:06 -08:00
Trevor Elliott
00b99b7581 Revert "Update two tests for mono-binds changes"
This reverts commit 23cd430f3b.
2014-12-09 16:54:45 -08:00
Trevor Elliott
8e954b1ab1 Stop accidentally clobbering the top-level closed env 2014-12-09 16:53:53 -08:00
Trevor Elliott
23cd430f3b Update two tests for mono-binds changes 2014-12-09 16:17:52 -08:00
Trevor Elliott
1742ce0912 Forgot to add this module in the last commit 2014-12-09 16:17:36 -08:00
Trevor Elliott
808e16db2d Fix a bug with the closed env, and add a test
It was possible to exploit shadowing to get a name into the closed environment
that wasn't actually closed.  The change here is that `partitionClosed` now
returns a completely new closed environment with any shadowed names removed, and
that environment is used when checking the declarations it describes, instead.
2014-12-09 16:17:02 -08:00
Trevor Elliott
ae2f0b6770 Update issue 225 to reflect the use of mono-binds 2014-12-09 13:57:27 -08:00
Trevor Elliott
86336b9c02 Add a test that shows programs that fail with mono-binds 2014-12-09 13:54:22 -08:00