Commit Graph

486 Commits

Author SHA1 Message Date
Iavor S. Diatchki
142567d04c
Merge pull request #1186 from GaloisInc/layout
Layout
2021-05-10 14:12:04 -07:00
Brian Huffman
52c91817d9 Update test output due to changed cryptol prelude. 2021-05-06 14:01:27 -07:00
Brian Huffman
9b7e60b9f4 Add some regression tests for sortBy to test stability of the sort. 2021-05-06 12:03:47 -07:00
Rob Dockins
a05b4eda7f Add test case for issue 1191 2021-05-05 17:43:32 -07:00
Iavor Diatchki
f43d652337 Improve error message and some tests 2021-04-29 14:42:43 -07:00
Iavor Diatchki
54780379cf Rename files to have correct OS extension 2021-04-22 16:39:37 -07:00
Iavor Diatchki
c16583230a Print test-runner version, and always build it. 2021-04-22 14:04:15 -07:00
Iavor Diatchki
b572b086b0 Require version 0.3 of test-lib 2021-04-22 09:08:19 -07:00
Iavor Diatchki
0c65f5e82b Change CI to use test-lib-0.3 and add a windows test for modsys/T18 2021-04-21 15:33:29 -07:00
Iavor Diatchki
aa7cce1668 Require version 0.3 of test-runner and a windows specific result for the test 2021-04-21 14:38:37 -07:00
Iavor Diatchki
1c175f5c85 Fix test (accounts for chanes in the standard library) 2021-04-20 14:53:21 -07:00
Iavor Diatchki
6818969db6 Fixes #1169 2021-04-20 14:47:32 -07:00
Rob Dockins
aac42f4991 Fix test suite 2021-04-13 10:27:17 -07:00
Rob Dockins
69ad34b231 Add test case for issue640
I think we've finally cracked the nut on this strictness bug.
Fixes #640
2021-04-13 10:27:17 -07:00
Rob Dockins
31ab387c19 Update the test for issue 211 to restore the old test behavior.
Also, test for looping computations in addition to `error` computations.
This doesn't let us cheat by eta-expanding the error, as we were
doing before.
2021-04-13 10:27:17 -07:00
Rob Dockins
b812cd5036 Temporary fix to the test for issue211.
We should either decide that the semantics of `#` requires it to be
strict in its arguments, or we should fix the definition.
2021-04-13 10:27:17 -07:00
Rob Dockins
b5454bce29 Fix test suite 2021-04-13 10:27:17 -07:00
Rob Dockins
234437af06 Remove our dependency on the random package.
Instead, directly use the generators defined in `tf-random`.
This changes the generation algorithm for some types, so we
need to update the tests that depend on those concrete values.

Fixes #1102
2021-04-07 12:12:32 -07:00
robdockins
b72f80112c
Merge pull request #1152 from GaloisInc/ref-panic
Include REPL let bindings in the reference interpreter
2021-04-06 10:14:58 -07:00
robdockins
ebfcebcbc2
Merge pull request #1150 from GaloisInc/literallt-tests
Update the instances regression test to include `LiteralLessThan`
2021-04-06 10:14:28 -07:00
Rob Dockins
235fe78049 Include REPL let bindings in the reference interpreter.
Fixes #1133
2021-04-06 09:48:41 -07:00
Rob Dockins
808d696797 Update the instances regression test to include LiteralLessThan. 2021-04-06 09:37:53 -07:00
Rob Dockins
3258bb1258 Make the issue148 test less sensitive to solver versions 2021-04-06 09:36:59 -07:00
Rob Dockins
8915ee3899 Teach the typechecker a bit more about exponents.
This fixes issue #734, and partially addresses #930.
The basic issue with 734 was that the solver was chosing
spurious counterexamples for the exponent function; in particular,
models where the output was not at least 1.  The fairly restricted
axiom we add here just says that the exponent function is at least
as large as its base for positive inputs.
2021-04-06 09:28:31 -07:00
Iavor Diatchki
277a65781c Changes to make new command line scope and browsing work with the current
parameterzied modules.

Some of this is a bit of a hack, but that code would change with the new
parameterized modules, so the hack is temporary.
2021-04-05 17:09:29 -07:00
Iavor Diatchki
501f884353 Merge branch 'master' into nested-modules 2021-04-01 15:23:02 -07:00
Iavor Diatchki
f85b0e4994 Add implicit imports for locally defined modules
This also fixes the extra space in the "invlid dependency" error
2021-04-01 15:21:29 -07:00
Iavor Diatchki
8b4778b8c2 Add implicit imports of locally defined modules 2021-04-01 11:50:16 -07:00
Iavor Diatchki
cb21ab61ba Show the locations of the definitions when reporting invalid dependencies
We only show the file location as these will always be in the same file,
I think.
2021-04-01 11:17:08 -07:00
Iavor Diatchki
65cd467741 Fix dependency tracking with nested modules.
See the example on the PR thread, which is captured in test T11
2021-04-01 10:45:14 -07:00
Rob Dockins
143e0395ba Don't use the showFreeMin floating-point printing mode, which
has highly counterintuitive results.  Instad, use the `showFree`
mode, which produces results more accurate to the underlying
bit representation.  The `showFree` mode often produces unfortunate
trailing zeros in decimal representations, so we take some care
to trim those out.

Fixes #1089
2021-03-15 16:02:58 -07:00
Iavor Diatchki
1ea868228c Bug-fixes from code-review on 12 March 2021 2021-03-12 16:57:39 -08:00
Iavor Diatchki
fe17d24e69 Add a test 2021-03-12 11:50:43 -08:00
Iavor Diatchki
dc1559f1fc Fix missed test 2021-03-12 11:03:24 -08:00
Iavor Diatchki
34b1d87df3 Implementation of nested modules.
* Limitations:
    Does not work in combination parameterized modules, as I am
    about to redo how that works.

  * General refeactorings:
    * Namespaces:
      - We have an explicit type for namespaces, see `Cryptol.Util.Ident`
      - Display environments should now be aware of the namespace of the
        name being displayed.

    * Renamer:
      - Factor out the renamer monad and error type into separate modules
      - All name resultion is done through a single function `resolveName`
      - The renamer now computes the dependencies between declarations,
         orders things in dependency order, and checks for bad recursion.

    * Typechecker: Redo checking of declarations (both top-level and local).
      Previously we used a sort of CPS to add things in scope.   Now we use
      a state monad and add things to the state.  We assume that the renamer
      has been run, which means that declarations are ordered in dependency
      order, and things have unique name, so we don't need to worry about
      scoping too much.

  * Change specific to nested modules:
    - We have a new namespace for module names
    - The interface file of a module contains the interfaces for nested modules
    - Most of the changes related to nested modules in the renamer are
      in `ModuleSystem.NamingEnv` and `ModuleSystem.Rename`
        - There is some trickiness when resolving module names when importing
          submodules (seed `processOpen` and `openLoop`)
    - There are some changes to the representation of modules in the typechecked
      syntax, in particular:
        - During type-checking we "flatten" nested module declarations into
          a single big declaration.  Hopefully, this means that passes after
          the type checker don't need to worry about nested modules
        - There is a new field containing the interfaces of the nested modules,
          this is needed so that when we import the module we know we have the
          nested structure
        - Declarations in functor/parameterzied modules do not appear in the
          flattened list of declarations.  Instead thouse modules are collected
          in a separate field, and the plan is that they would be used from
          there when we implmenet functor instantiation.
2021-03-12 09:55:56 -08:00
Rob Dockins
38ab19bc3b Update test suite outputs 2021-03-02 17:18:36 -08:00
Brian Huffman
8d419f35cc Extend issue1093.cry to test what4 backend in addition to sbv. 2021-03-02 14:10:10 -08:00
Brian Huffman
5ff4f5bfca Add regression test for issues #1093 and #1094. 2021-03-02 12:21:53 -08:00
Rob Dockins
5f269dd628 Update tests outputs 2021-02-16 15:11:04 -08:00
Rob Dockins
2a2ec6e020 Update the parser to deal more robustly with type applications.
We now reject situations where the user writes a type application
on a term that is not an identifier, and we correctly unwind
and reapply tuple and field selectors.

Fixes #962
Fixes #1045
Fixes #1050
2021-02-16 15:11:04 -08:00
Rob Dockins
bad2649f53 Add failing tests for issues 962, 1045, and 1050.
These are all related to the parsing of explicit type application
forms, and the fixup pass that is supposed to attach them to
function identifiers.
2021-02-16 15:10:36 -08:00
Rob Dockins
dca95bf265 Fix test-suite outputs 2021-02-16 14:33:46 -08:00
robdockins
538b6c4ff5
Merge pull request #1073 from GaloisInc/standardize-set
Rename the runtime-settable options to use a consistent style
2021-02-16 10:42:01 -08:00
robdockins
da91730a3f
Merge pull request #1072 from GaloisInc/bad-kinds
Improved kind-checking for parameters
2021-02-16 10:40:11 -08:00
Rob Dockins
752e1d0d8a Fix the funny numbers.
Reordering the where declarations in pattern desugaring caused
some minor changes in error message output, as well as
changes in the specializer.
2021-02-13 14:58:48 -08:00
Rob Dockins
a1b678a5ec Refactor the desugaring of multi-argument functions.
Multi-argument functions are now desuguared into nested lambdas
in the `NoPat` phase instead of during typechecking.  This gives
more sensible results when the same variable is shadowed in the argument
list.  In particular, extra "where" bindings that are added for pattern
desugaring now have a scope that is outside patterns and variables
occuring further to the right.

Some programs that used to produce "overlapping symbols" errors are
now accepted with a shadowing warning instead.

The main downside of this refactoring is that the `checkFun` operation
no longer has access to function name or argument numbers for definitions,
as all functions have become single-argument lambdas by typechecking time.
This can be fixed by recording this information in the AST during the
NoPat desugaring instead.
2021-02-13 14:57:06 -08:00
Rob Dockins
710f13c0b0 Document the current state of affairs regarding issue 567.
The name binding structure that results from multi-parameter
functions with repeated names, and the interaction with pattern
desugaring is currently very counterintuitive.  See issue #567 for
more discussion.
2021-02-13 14:57:06 -08:00
Rob Dockins
3e0cf3e167 Rename the runtime-settable options to use a consistent style.
Options are now all named in camelCase style.  However, multiword
options may still be set using the old hypenated names as aliases,
so interaction scripts and the test suite do not have to be
changed. In addition, option lookup is altered to be case insensitive.

Thus, the canonical option name for the output SMT file when
an offline prover is selected is `smtFile`, which is what will
show up when running `:set` with no arguments, and what will be
suggested for tab-completion.  However, the option may be set
using the strings `smtfile` `SMTFile`, `smt-file`, `SMT-file`, etc.

Fixes #656
2021-02-11 14:47:32 -08:00
Rob Dockins
fcfe0f86c1 Test case for issue #1024 2021-02-11 13:12:34 -08:00
robdockins
c25a1bd181
Merge pull request #1070 from GaloisInc/issue975
Fix printing of parse errors in enumeration sequences
2021-02-10 09:23:12 -08:00