Commit Graph

50 Commits

Author SHA1 Message Date
Iavor S. Diatchki
139c7d50ac
Merge pull request #576 from GaloisInc/fingerprints
Track file content fingerprints alongside loaded modules
2019-02-28 11:02:27 -08:00
Eric Mertens
5e75f834e7 Update test for new utf-8 error message 2019-02-28 10:04:17 -08:00
Brian Huffman
c387dbe5fd Remove all uses of [x..] syntax from examples and tests. 2019-02-27 16:25:53 -08:00
Brian Huffman
9b7597c4fd Update changed test output. 2018-12-11 15:52:19 -08:00
Brian Huffman
20b9b1c193 Rename prelude function width to length, and generalize its type.
Fixes #550.
2018-10-10 16:21:38 -07:00
Brian Huffman
f609b36225 Rename primitive demote to the more self-explanatory name number.
The name "demote" is only meaningful to those who already know what
the Cryptol primitive does. Also, due to recent changes in the error
and warning messages, the name "demote" is showing up much more often
in REPL output. For example:

    Defaulting type argument 'rep' of 'demote' to [2]

    Showing a specific instance of polymorphic result:
      * Using 'Integer' for type argument 'rep' of 'Cryptol::demote'

These messages will hopefully be made less confusing to non-experts
if the name "demote" is replaced with "number".
2018-07-27 13:52:57 -07:00
Brian Huffman
5def499908 Capitalize sentences in output of :check and :exhaust. 2018-07-20 10:55:24 -07:00
Brian Huffman
836771aded Tweak names and order of type variables on Cryptol prelude functions.
Also update test output for new type variable names.

See #517.
2018-06-28 14:14:44 -07:00
Iavor Diatchki
0bf36808ed Improve various defaulting/instantiatiation warnings and error messages. 2018-06-25 16:48:10 -07:00
Iavor Diatchki
0d81f0ba25 Implement defaulting in the presence of overloaded literals. 2018-06-20 15:06:19 -07:00
Iavor Diatchki
e579113d05 Merge remote-tracking branch 'origin/master' into literal-class
# Conflicts:
#	tests/mono-binds/test04.icry.stdout
#	tests/regression/check01.icry.stdout
#	tests/regression/check16-tab.icry.stdout
#	tests/regression/check16.icry.stdout
#	tests/regression/check21.icry.stdout
#	tests/regression/check22.icry.stdout
2018-06-20 09:14:17 -07:00
Iavor Diatchki
33f0ab3979 Improved locations for defaulting warnings. 2018-06-19 17:28:59 -07:00
Brian Huffman
e512dc2c17 Update test case output. 2018-06-15 14:15:39 -07:00
Iavor Diatchki
ca6b34f621 Refactor module system things; better loading of `A modules. 2017-10-23 15:12:12 -07:00
Rob Dockins
2df09a428a Change how test coverage statistics are computed.
This formulation accounts for the fact that test vectors
are chosen randomly with replacement.

Fixes #461
2017-10-03 17:37:48 -07:00
Iavor S. Diatchki
ec58bec6aa Add .cryptolsrc files 2017-02-15 09:08:02 -08:00
Robert Dockins
e9c8b6ccd1 Add regression test for bitshift operations 2016-08-22 15:36:16 -07:00
Robert Dockins
3becedd910 Update tests to remove spurious failures 2016-08-18 16:05:23 -07:00
Brian Huffman
1322156d28 Remove trailing whitespace 2016-02-19 10:08:20 -08:00
Adam C. Foltzer
4d3fc9a413 Update copyright dates and add missing headers 2016-01-19 18:19:35 -08:00
Adam C. Foltzer
9e179d14bc finally add Even-Mansour example; closes #124 2016-01-12 16:49:47 -08:00
Adam C. Foltzer
9c07fe1006 merge in the 2.2.6 changes, including z3 switch 2015-12-23 16:10:56 -08:00
Adam C. Foltzer
3ae0dda7ac switch to Z3 for typechecking and proving
Note: the hardcoding in this patch is only for the 2.2 hotfix branch; in
the 2.3 branch we will only have to change the default setting for the
typechecker.
2015-12-23 14:59:10 -08:00
Trevor Elliott
cacc59529e Update test output 2015-09-29 17:35:18 -07:00
Trevor Elliott
f8e6582230 Update tests and output 2015-09-28 21:26:26 -07:00
Trevor Elliott
60694f8456 Output format changed 2015-09-28 12:07:42 -07:00
Daniel Wagner
a958ce3328 regression test for a specializer bug 2015-07-23 18:08:14 -07:00
Trevor Elliott
fb98af636a Slight test output change 2015-06-09 17:02:07 -07:00
Trevor Elliott
e4258b4d2c Add a regression test for xor precedence 2015-06-03 15:36:18 -07:00
Trevor Elliott
69c9465cab Experiment with defaulting using the SMT solver 2015-04-03 15:12:36 -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
0536d0f15a update copyright years 2015-03-24 11:19:52 -07:00
Iavor S. Diatchki
db0d036966 Correct the test to expose the proper bug. 2015-03-05 10:36:15 -08:00
Dylan McNamee
063fe14014 simpler r05 2015-03-03 15:10:45 -08:00
Dylan McNamee
68b7e61c6e regression with new constraint solver 2015-03-03 14:20:19 -08:00
Iavor S. Diatchki
15523027e9 Merge remote-tracking branch 'origin/master' into wip/cs 2015-02-27 11:01:32 -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
a42b3a7fc1 Switch to new defaulting code in type inference.
The changes in the tests are just to do with order of constraints.
2015-02-25 17:21:51 -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
64d3d1353f add warnShadowing REPL option
Conflicts:
	cryptol/REPL/Command.hs
2015-02-16 14:40:06 -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
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
ee3647b814 Update renamer errors to clarify some funny situations
This tries to address #125 by making the errors from the renamer a little bit
more clear.

Squashed commit of the following:

commit 8afd3d7961b58df042fe801c3c5e1b9787f813bc
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 19:33:59 2014 -0800

    Update tests for new renamer errors

commit 7cac01836d8943cf3b08d6715ac328e3b6658cef
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 19:33:49 2014 -0800

    Add `at` on errors and warnings to be more consistent

commit 308908ba318a4cdc839710f66f1a487543f8c07e
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 19:06:57 2014 -0800

    More consistent renamer warnings

commit be8100a78e9eaba6d554591121c24ed5dcd3c780
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 18:56:53 2014 -0800

    More consistent error formatting from the renamer

commit 26c45c3b51e0bdbcf6a1431cab8e1eb8760ea0bb
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 18:56:36 2014 -0800

    Remove an un-triggerable error

commit ccdb93e036ba1e111ccd977c8b3b35523f3c1bf0
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 16:38:44 2014 -0800

    Try to give better errors for unbound identifiers

commit eb5784145985bb55c761088eaba27c67d08c1326
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 16:38:23 2014 -0800

    Remove old TODOs about located errors

commit b984bb5f451f3aa7b4fc8f15167483c5142ee9a3
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 14:37:34 2014 -0800

    Differentiate missing type and expression symbols

commit b9e6f13856db6765dced3cb9565cdc8387a7976d
Author: Trevor Elliott <trevor@galois.com>
Date:   Wed Dec 3 14:36:52 2014 -0800

    Remove a shadowing warning
2014-12-03 19:36:06 -08:00
Trevor Elliott
68b64ab083 Don't close layout with commas when not in an explicit block
Fixes #110
2014-09-22 14:14:04 -07:00
Dylan McNamee
9319e0c19c tweaking notice, adding regression test for GitHub issue #110 2014-09-19 13:09:44 -07:00
Adam C. Foltzer
c3c043cc6b implement 0-based tuple indexing; fixes #82 2014-09-09 11:59:39 -04:00
Adam C. Foltzer
6a79019ef6 fixes #89
Very small change to code, lots of change to expected output of interpreter!
2014-09-09 10:49:29 -04:00
Trevor Elliott
a1b7cbc39d Fix a lexer bug, and add a regression
Closing brackets weren't closing virtual layout blocks.
2014-09-03 13:46:47 -07:00
Brian Huffman
4f28f4bfed Update regression tests for :prove and :sat output
As of ee8685e4f2, :sat and :prove now
parse and then pretty print the given predicate with appropriate
parenthesization.
2014-07-15 16:26:37 -07:00
Adam C. Foltzer
ba0a0e8576 Initial import from internal repo 2014-04-17 15:34:25 -07:00