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.
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
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.
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
* 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.
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#962Fixes#1045Fixes#1050
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.
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.
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