Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR cleans up the Mr. Solver interface and introduces a new type of Mr. Solver assumption.
The interface now consists of:
mr_solver_prove t1 t2
which asks Mr. Solver to provet1 |= t2
, throwing an error and exiting if it cannot, or adding a new assumption to the Mr. Solver context if it can. For refinements of the formf1 ... |= f2 ...
, the assumption is added as an opaque assumption, which means calls tof1
on the LHS will now only be unfolded if a matchingf2
cannot be found on the RHS. (Specifically, if we have such an opaque assumption and encounterf1 args1 >>= k1 |= f2 args2 >>= k2
, we now prove thatf1 args1 |= f2 args2
is provable from our assumption, then continue provingk1 |= k2
.) Otherwise, for refinements of the formf1 ... |= rhs
, the assumption is added as a rewrite assumption, which has the old behavior: always replacing calls off1
on the LHS withrhs
.mr_solver_test t1 t2
which is like the above, but does not add the result as an assumption. This is useful for testing that a refinement holds in isolation, e.g. for reflexivity or no-errors proofs.mr_solver_query t1 t2
which asks Mr. Solver to provet1 |= t2
, but unlike the above returns a boolean as to whether it could or could not. Calls to this function will never fail, and never add any assumptions.mr_solver_set_debug_level i
sets the debug level of Mr. Solver until its next invocation.Additionally, the first three have new console output which indicate when and when not assumptions are added to scope.
Finally, a change to the way memoization works in monadification was needed to make sure examples which use opaque assumptions work properly.