Commit Graph

779 Commits

Author SHA1 Message Date
Dylan McNamee
68b7e61c6e regression with new constraint solver 2015-03-03 14:20:19 -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
Dylan McNamee
0059791b15 hoping this simple padding example is solvable by the new constraint solver 2015-03-03 11:50:47 -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
Dylan McNamee
a246f25211 coins puzzle added to funstuff 2015-03-03 10:51:18 -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
Iavor S. Diatchki
8404fc7d05 Fix a panic, when we "improve" an unused variable 2015-02-27 16:44:05 -08:00
Iavor S. Diatchki
55140b0685 Simplify simplification rules for addition 2015-02-27 14:37:51 -08:00
Iavor S. Diatchki
e0b1b3b502 Clean up rules a bit, and add a note about some missing rules 2015-02-27 13:09:12 -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
Iavor S. Diatchki
089ddc688e Port defaulting to new solver; hook it in with prove implication. 2015-02-25 16:52:24 -08:00
Iavor S. Diatchki
99c1dd66e1 Fix test (again) 2015-02-25 15:43:42 -08:00
Iavor S. Diatchki
77a9f7135a Better errors 2015-02-25 15:43:35 -08:00
Iavor S. Diatchki
d11cc88633 Merge remote-tracking branch 'origin/master' into wip/cs 2015-02-25 14:21:20 -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
Iavor S. Diatchki
688e5cfebf Fix test. 2015-02-25 13:44:29 -08:00
Iavor S. Diatchki
22abf73fe0 Allow for negatives in linear relations. 2015-02-25 13:12:33 -08:00
Iavor S. Diatchki
25bf376a01 Run linear relation improvement, even (especially!) then the values differ. 2015-02-25 11:23:58 -08:00
Iavor S. Diatchki
d85a5d5aa0 Just debugging improvements. 2015-02-25 11:21:56 -08:00
Iavor S. Diatchki
ce09d23d74 Hook in and improve linear relations.
There is still an issue with the encoding of finitness.
For example, if we know:

a = 1 + min b a

And we know that `b`z is finite, we SHOULD know that `a` is finite too,
but apparently we don't.
2015-02-24 18:19:01 -08:00
Iavor S. Diatchki
e70e1153fb Generalize anyJust 2015-02-24 18:17:17 -08:00
Iavor S. Diatchki
037726f0fa Comments, and some small changes:
1. Preserve order of TODO list, os that we prefer unification variables
  2. Stop early when looking for `x = y`.

So if we have 'a = b = c` now we'll get:

a = b
b = c

Before we would get:
a = b
a = c
2015-02-24 18:17:07 -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
Iavor S. Diatchki
0b0c94e489 Add flag to support division by constant. 2015-02-23 14:22:43 -08:00
Iavor S. Diatchki
ac965519e6 Add a rewrite for a common pattern involving width 2015-02-23 14:22:13 -08:00
Iavor S. Diatchki
43d4adf90a Fix the non-linearity test 2015-02-23 14:21:49 -08:00
Iavor S. Diatchki
46718d710f Be queit 2015-02-23 11:40:19 -08:00
Iavor S. Diatchki
e85c1610a5 Fix the location of fin constriaints when exporting to SMT 2015-02-23 11:39:56 -08:00
Iavor S. Diatchki
4fb370c8ec When declaring non-linear variables, assert their finatness also. 2015-02-20 17:35:34 -08:00
Iavor S. Diatchki
62c5f04589 Disable some of the NL code; get back to a somewhat working state. 2015-02-20 15:38:11 -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
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
Iavor S. Diatchki
2fe2949e10 Merge remote-tracking branch 'origin/master' into wip/cs 2015-02-18 11:41:25 -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