Repository navigation
Boundary scavenging - #6529
Merged
Merged
Boundary scavenging#6529
Conversation
Any constraints that got picked up by boundary scavenging don't need to show up in the unsolved list, especially since the unsolved list can get *huge* when cubes are involved
When having e.g. a Path value in a constraint with boundary constraints, η-conversion for paths meant the value had a constraint on the *next variable to be introduced* (the negative first variable!). We don't consider these boundary constraints anymore, since they will be reported as soon as the user actually refines the goal.
The previous "hide boundaries" patch was far too aggreesive and ended up silencing some constraints that had nothing to do with cubes. This fixes that.
5 new interaction test cases for boundary scavenging + fixes the old tests.
Contributor
Author
|
Twice today I got a CI failure on a nontrivial change because the left fish is not in scope... one would have thought I would have learned |
plt-amy
force-pushed
the
aliao/ip-boundary
branch
from
March 13, 2023 21:55
6634879 to
22adf26
Compare
andreasabel
approved these changes
Mar 14, 2023
andreasabel
left a comment
Member
There was a problem hiding this comment.
Great! A PR with video demo! A new level of PR motivation!
I just skimmed the text, noticing a few stylistic changes. If it is not too much effort, would you mind putting them into a separate commit, or for some, revert them maybe? (Depending how strongly you feel about them.)
Contributor
Author
|
All but one of those changes were from partially reverting an attempt to make |
Member
|
@plt-amy : Consider adding some advertisement to CHANGELOG. |
2 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Third time's the charm?
Closes #5997, closes #5900, closes #3605, closes #3690. As proposed in #5997, boundary constraints are recovered during unification, before bailing in
assignMeta'. If the meta assignment failed because the meta spine had endpoints (i0/i1) on it, we invert the spine anyway, but add the RHS as a boundary constraint. Inverting the meta spine is necessary to put all the RHS-es collected during unification in the same context: the top-level context. When printing, we apply the RHS-es (represented by lambdas) to the meta's context.The boundary of an interaction point in context
Γis aMap (IntMap Bool) Term; theTermis guaranteed to be headed by (at least) as many lambdas as there are variables inΓ. Higher-order situations, eg. funext before introducing the point argument, can lead to extra lambdas. EachIntMap Boolhas itskeysSeta subset of theI-typed variables inΓ.Since we store the face constraints as keyed by variables in the actual meta context (instead of in an arbitrary closure), it's trivial to implement #3690. I changed the boundary display to look like the following when running
Cmd_goal_type_context_inferw/ a non-empty interaction point.Demo from a week or so ago:
goal-boundary-want-have.mp4
Overview of changes:
isFaceConstraint,tryAddBoundarytoMetaVars.hs. These turn equational problems into boundary constraints (according to the scheme I proposed in Collect interaction point boundaries while elaborating right-hand-sides? #5997)IPBoundaryis now a newtype of thatMaptype I mentioned, the user sees a list ofIPFace'instead.getIPBoundaryinBasicOps.hsis responsible for turning that boundary into a list ofIPFace's in the right context. Boundaries are associated with the IP instead of the IPClause.isFaceConstraintare not reported asUnsolvedConstraintswarnings, but asInteractionMetaBoundariesinstead (getAllUnsolvedWarningsinPretty/Warnings.hs)