[ refactor ] Infrastructure for Data.Tree.AVL.Indexed.*#2968
Open
jamesmckinna wants to merge 8 commits intoagda:masterfrom
Open
[ refactor ] Infrastructure for Data.Tree.AVL.Indexed.*#2968jamesmckinna wants to merge 8 commits intoagda:masterfrom
Data.Tree.AVL.Indexed.*#2968jamesmckinna wants to merge 8 commits intoagda:masterfrom
Conversation
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 PR arises from my review of #2961 and introduces some additional typedefs and lemmas which help streamline the analysis of
insert,deleteand their various helperjoin*functions. Specifically, the analysis of base cases for such helpers when one sub-tree is aleafrelies on two new lemmas about instances of the balance relation at height 0.Systematically uses
variabledeclarations to aid readability; as ever, this technically might be considered breaking, because any given type signature might have subtle differences wrt their prenex implicit forms when fully elaborated, but I think we should regard such things as 'bug fixes' at best (worst?).Intended to be minimally invasive, but in the course of doing this, I observe:
satisfied/satisfiableclash arising in Rename lemmasatisfiedtoany⇒satisfiablein*.Relation.Unary.Any#2865 / [ refactor ] fix #2865 for v2.4 #2954, forData.Tree.AVL.Indexed.Relation.Unary.Anyimportstructure is pretty unwieldy, and lower level imports fromStrictTotalOrderand their extensions by min/max elements I think really should be folded into the exports fromData.Tree.AVL.Indexed.Key?breakingso not considered here (egData.Tree.AVL.Indexed.Key.trans⁺makes its first argument explicit, rather than typing this asTransitive _<⁺_... but why?)NB/TODO:
compare k′ k(lookup,delete, etc.) elsecompare k k′(insert,insertWith) and this discrepancy should be fixed! But doing so might hold up Add properties that characterizeData.Tree.AVL.Indexed.delete. #2961 so I'd be happy to take responsibility to follow up on this downstreamPropertiesand the new ones added in Add properties that characterizeData.Tree.AVL.Indexed.delete. #2961 wrt an as-yet undefined property