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 is still a bit off from merging. Posting here to describe some of the ideas and design decisions.)
This PR reimplements the matcher using a similar phase-1/phase-2 distinction we already internally use for type checking, utilizing uvars instead of substitions to represent the unifier. In the first phase we just run the unifier, and in only in the second phase do the actual type-checking and SMT queries happen. The API allows user code to skip the second phase entirely (it is returned as a continuation elaborator), so this new matcher can be used for the impure specs feature as well.
The new matcher is a lot stricter on mkeys; this is also with a future
pulse_pattern
feature in mind.[@@@mkey]
then effectively all arguments become mkeys. If the slprop is marked as[@@no_mkeys]
, then no arguments are mkeys. (I believe this is the current semantics, but not 100% sure.)For example, if you have a resource
x |-> 1
and you need to solve fory |-> ?u
, then this will reliably fail, even if you havepure (x == y)
in the context. This is necessary because in the future we want to backtrack on this failure, and maybe insert a ghost lemma that turnsx |-> 1
intoy |-> 1 ** trade (y |-> 1) (x |-> 1)
.Current state:
(fun a b c -> a) x y z
(where the arguments are all local variables). I'm not sure why this happens, but it means we need to sprinkle a few more normalizer calls all over the place.Fixes #32.
Fixes #107.
Fixes #110.