Trying to recompute the inductive structure of the main (co)-inductive types when checking the guard condition#17950
Closed
herbelin wants to merge 12 commits intorocq-prover:masterfrom
Closed
Conversation
73518b7 to
2cfe1e6
Compare
Member
Author
|
@coqbot: run full ci |
2cfe1e6 to
05a1083
Compare
This was referenced Oct 30, 2023
Merged
Contributor
|
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
For efficiency, Rtree.inter tries to preserve as much of the common
structure of the two trees to intersect, so expansions are done
lazily.
Rtree.inter uses an history and I understand that this history is used
to ensure that only a finite number of expansions is needed to manage
overlapping expansions.
My understanding is that the effective expansion of variables is
missing when using this history: this is a reason for an
incompletenesses of Rtree.inter, which sometimes falls and fails in an
unsupported Rec/Var case.
The commit is fixing this, by instantiating the variables before using
the history.
A typical example of incompleteness before the fix is when comparing
the following equivalent trees:
Rec{Mrec[Wrapper, 0],
[(Rec{Nested[Unwrapper, 0], [(), (#1:0)]})]}
and
Rec{Nested[Wrapper, 0],
[(Rec{Mrec[Unwrapper, 0], [(), (Rec{Nested[Wrapper, 0], [(#1:0)]})]})]}
(example from success/fix.v)
The trick is to not duplicate the nested recursive calls but to refer to them using a variable. E.g., in μX.F(μY.G(X,Y)) we do not expand the body into F(μY.G(μX.F(X,μY.G(X,Y)),Y)) but into F(μY.G(μX.F(X,Y),Y))
05a1083 to
688ade6
Compare
688ade6 to
a689b14
Compare
a689b14 to
346d104
Compare
346d104 to
693e030
Compare
…int. We use for that a modification of get_recargs_approx.
693e030 to
9e2b86d
Compare
Contributor
|
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
Contributor
|
This PR was not rebased after 30 days despite the warning, it is now closed. |
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.
This should have been done for a very long time already: we recompute dynamically the recursive structure of the decreasing argument of fixpoints.
We could have introduced a notion of parametric recursive structure (precomputed "recarg") and instantiate the parameter dynamically (this is what we made in a first attempt of the PR actually), however we would have failed to support examples requiring a computation after instantiation of the parameters as in:
Closes #9045, #12781, #13855, #15932.
Depends on #18229 and #18242.
To do: