Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof development primitives #1637

Merged
merged 14 commits into from
Aug 8, 2022
Merged

Proof development primitives #1637

merged 14 commits into from
Aug 8, 2022

Commits on Aug 8, 2022

  1. Reimplement the TopLevel monad based on the

    StateContT transformer, which gives us the ability to
    capture continuations. This allows us to implement
    `callcc` as a saw-script command.  Additionally,
    implement a "checkpoint" command that will capture the
    TopLevel monad state and allow it to be restored later.
    
    Also, rework some aspects of error handling. The previous
    method no longer worked properly with a continuation-based
    TopLevel monad.
    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    aade958 View commit details
    Browse the repository at this point in the history
  2. Implement a "subshell" command.

    When invoked from a batch file (or from an ongoing REPL session)
    starts a "subshell" REPL session. The intent here is to allow
    for exploration and experimentation in the middle of a larger run.
    
    For now, subshells are not very useful, as there isn't a good way
    to expose the local SAW environment to the shell.
    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    8f37eeb View commit details
    Browse the repository at this point in the history
  3. Push the SAW script "local environment" into the read-only section

    of the TopLevel monad. This allows it to interact with primitive
    operations; in particular, we can start a subshell with local
    SAW script bindings in scope.
    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    7a305d7 View commit details
    Browse the repository at this point in the history
  4. Prevent the REPL from grabbing and printing exceptions it should

    be leaving alone (async and exit exceptions).
    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    dbe32ba View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d9f6ba0 View commit details
    Browse the repository at this point in the history
  6. Make checkpoint somewhat less broken. This change causes the

    `NameSeeds` value used internally by Cryptol to be carried forward
    across checkpoints.  This prevents internal nonce values from being
    reused, which, in turn, avoids errors about registering duplicate
    names.
    
    It is unclear if this is the correct long-term fix, but it allows
    checkpoint to work more reliably when importing Cryptol modules
    or using `let {{ ... }}` constructs.
    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    e85d331 View commit details
    Browse the repository at this point in the history
  7. Move the SharedContext and TheoremDB objects into the

    mutable state part of the TopLevel monad.  This allows them
    to participate in the checkpoint/restore mechanism.
    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    8bb8cae View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8780ee2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d942988 View commit details
    Browse the repository at this point in the history
  10. Add a saw_assert override function with the following signature:

    ```
    void saw_assert( uint32_t );
    ```
    
    This allows the program source to directly assert a proposition inline
    which is then assumed as part of the path condition. This can sometimes
    help the path sat checker by stating helpful lemmas whose proof can
    be deferred to the VC-checking phase. It can also be helpful for
    program/proof exploration, allowing the user to directly state
    inline hypotheses about program behavior, and then attempt to prove them.
    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    bbb8055 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    4101e38 View commit details
    Browse the repository at this point in the history
  12. Update saw-remote-api

    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    eef3bb4 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    b8d17bc View commit details
    Browse the repository at this point in the history
  14. Add a proof_checkpoint command that captures and

    allows the user to restore proof states.
    robdockins committed Aug 8, 2022
    Configuration menu
    Copy the full SHA
    6952456 View commit details
    Browse the repository at this point in the history