Commit Graph

3086 Commits

Author SHA1 Message Date
Felix Yan
89660676b1
Allow sbv 8.11
Tested to build fine here.
2021-03-13 19:13:49 +08:00
Iavor Diatchki
1ea868228c Bug-fixes from code-review on 12 March 2021 2021-03-12 16:57:39 -08:00
Iavor Diatchki
e353c83b2b Fix typo 2021-03-12 13:12:53 -08:00
Iavor Diatchki
fe17d24e69 Add a test 2021-03-12 11:50:43 -08:00
Iavor Diatchki
c1914ccc60 Don't add extra dependency for the same module 2021-03-12 11:50:35 -08:00
Iavor Diatchki
fad47f57da This can happen because we are working on the renamed syntax 2021-03-12 11:50:11 -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
LisannaAtGalois
8a0a0094ae
Fix nightly builds (#1101)
* Restore files used in nightly
* fix helm test to use renamed argo
* point test to correct python location
* use python 3.9 for :=
2021-03-10 08:04:31 -08:00
Andrew Kent
9943b5ce0c test: test cryptol-remote-api docker image alongside other builds 2021-03-04 14:38:47 -08:00
robdockins
48443b5ca7
Merge pull request #1085 from GaloisInc/exclusive-enumeration
Exclusive enumeration
2021-03-02 22:58:57 -08:00
Andrew Kent
40626a3061
Merge pull request #1095 from GaloisInc/co-located-py-client
Colocate python client with server
2021-03-02 18:58:26 -08:00
Rob Dockins
eb9d3e900d Update book exercise output 2021-03-02 17:18:36 -08:00
Rob Dockins
38ab19bc3b Update test suite outputs 2021-03-02 17:18:36 -08:00
Rob Dockins
8009e8a9c0 Implement syntax for enumerations with exclusive upper bounds.
`[ x   .. < y ]` --> ``fromToLessThan`{first=x, bound=y}``
`[ x:t .. < y ]` --> ``fromToLessThan`{first=x, bound=y, a=t}``
2021-03-02 17:18:36 -08:00
Rob Dockins
ddbb673601 Add LiteralLessThan and fromToLessThan primitives.
This allows us to express enumerations with exclusive upper bounds.
In contrast with the `Literal` constraint, `LiteralLessThan n a`
express that `a` contains all the literals strictly less than `n`,
and explicitly allows `n` to be `inf` for unbounded types like
`Integer` and `Rational`.

It is possible to define `Literal n a` as
`(fin n, LiteralLessThan (n+1) a)` instead of leaving it primitve.
However, this makes infered types and error messages worse, IMO.
As it stands, the typechecker has no real knowledge of the connection
between `Literal` and `LiteralLessThan`.
2021-03-02 17:18:36 -08:00
Andrew Kent
a95ea3b52c feat: bump argo submodule, test server can serve many requests 2021-03-02 16:32:44 -08:00
brianhuffman
8f914a7b88
Merge pull request #1096 from GaloisInc/symbolic-bv0
Make `freshVar` produce a VWord instead of a VSeq for type `[0]`.
2021-03-02 14:36:57 -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
Brian Huffman
47351177b4 Make freshVar produce a VWord instead of a VSeq for type [0].
Fixes #1093. Fixes #1094.
2021-03-02 12:18:08 -08:00
Andrew Kent
af33f2e4a9 doc: Python client README content 2021-03-02 08:26:51 -08:00
Andrew Kent
307c18f1f4 feat: initial co-located python client 2021-03-01 15:56:28 -08:00
Andrew Kent
27b8718891 Merge branch 'main' of ../galois-py-toolkit into remote-server-ci 2021-03-01 13:19:05 -08:00
Andrew Kent
b2562b3d27 bump argo, minor rpc tweaks 2021-03-01 13:19:00 -08:00
Andrew Kent
2c97f85c0e chore: grab cryptol python code for move 2021-03-01 13:16:45 -08:00
Andrew Kent
5feef24c9a chore: gather cryptol py code before migration 2021-03-01 13:14:54 -08:00
Andrew Kent
665b1c7b5d
chore: make problematic warnings error for cryptol-remote-api (#1088) 2021-02-24 14:14:07 -08:00
Rob Dockins
6b784b11ec Typo
Fixes #1039
2021-02-17 16:13:04 -08:00
robdockins
5f3ff5b603
Merge pull request #1071 from GaloisInc/parse-panic
Fix parse panic
2021-02-16 17:42:41 -08:00
Rob Dockins
6734400706 More comments to illustrate how projections and type applications
are supposed to interact.
2021-02-16 15:42:33 -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
668c1356e6 Demote the panic that arises from bare type applications
to a kind-checking error.  This at least provides actionable
feedback about where the error occurs.

We should also improve the parser post-processing pass to
handle these situations better, but this at least removes
the panic.
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
robdockins
e19d6bc1f2
Merge pull request #1080 from felixonmars/patch-2
Allow sbv 8.10
2021-02-16 15:09:56 -08:00
Rob Dockins
dca95bf265 Fix test-suite outputs 2021-02-16 14:33:46 -08:00
Andrew Kent
31ddad6ccc
change remote Dockerfile's cwd for server (#1082)
* change remote Dockerfile's cwd for server

* Update cryptol-remote-api/Dockerfile

Co-authored-by: LisannaAtGalois <72424138+LisannaAtGalois@users.noreply.github.com>

Co-authored-by: LisannaAtGalois <72424138+LisannaAtGalois@users.noreply.github.com>
2021-02-16 13:32:11 -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
robdockins
7e66437098
Merge pull request #1075 from GaloisInc/persist-solver
Persist solver
2021-02-16 10:37:31 -08:00
Felix Yan
a0aa00d15f
Allow sbv 8.10
Tested to build fine here.
2021-02-16 17:21:31 +08:00
robdockins
6181f3213f
Merge pull request #1076 from GaloisInc/loop-err
Add some text to the <<loop>> error
2021-02-15 14:05:02 -08:00
robdockins
9c4e8fb05e
Merge pull request #1077 from GaloisInc/nopat-refactor
NoPat refactor
2021-02-15 13:58:51 -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
b5b7403bd8 Add FunDesc information to the parsed AST.
This allows us to attach information to `EFun` nodes that describe
which named function the lambda belongs to, and which arguments
it handles.  This information is filled in by the `NoPat` pass
as it desugars multi-argument functions into a sequence of lambdas
and is used during typechecking to produce error messages.

There is an odd potential for the renamer to get things wrong here.
If a named function has an argument that shadows it's own name,
the renamer may incorrectly resolve the name in a function description
for later arguments.  The resulting error message will then point to
the wrong name (although it will be in the vicinity...).  It's hard
to fix this without folding the NoPat pass into the renamer (which
we should also do, but it's a nontrivial refactoring).
2021-02-13 14:58:44 -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
ecde98e5bf Minor updates to CryHtml.hs
This produces more useful "raw" source rendering.
2021-02-12 10:35:42 -08:00
Rob Dockins
152f9b19c1 Add some text to the <<loop>> error.
Explain that the error might occur because of retrying an
interrupted computation and suggest that reloading might
alleviate the issue.

Fixes #1030
2021-02-12 09:32:23 -08:00