-
Notifications
You must be signed in to change notification settings - Fork 260
Refactor Data.List.Relation.Binary.Permutation.*, part I
#2333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Data.List.Relation.Binary.Permutation.*, part I
#2333
Conversation
src/Data/List/Relation/Binary/Permutation/Propositional/Properties.agda
Outdated
Show resolved
Hide resolved
src/Data/List/Relation/Binary/Permutation/Setoid/Properties.agda
Outdated
Show resolved
Hide resolved
src/Data/List/Relation/Binary/Permutation/Setoid/Properties.agda
Outdated
Show resolved
Hide resolved
|
Generally looks good though! The drastic reduction in proof length is pretty great! |
|
@MatthewDaggitt I think that's all of your review comments handled now! But leaving |
MatthewDaggitt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that looks great!
| ↭-refl : Reflexive _↭_ | ||
| ↭-refl = refl | ||
|
|
||
| ↭-prep : ∀ x → xs ↭ ys → x ∷ xs ↭ x ∷ ys | ||
| ↭-prep = prep | ||
|
|
||
| ↭-swap : ∀ x y → xs ↭ ys → x ∷ y ∷ xs ↭ y ∷ x ∷ ys | ||
| ↭-swap = swap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As always I am going to be annoying and complain that I don't like prefixed
names because users can either use the short names or import the module
qualified if they need to manually disambiguate.
The same goes for split being renamed to ↭-split (although in that case
the name split is already pretty poor IMO).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gallais I don't find the comment annoying!
What I find annoying is the the abstraction failure when explicitly exporting constructors from an inductive definition which should remain (externally, to clients) abstract, IMHO (cf. z<s in Data.Nat.Base, and 0<1+n in Data.Nat.Properties, not that I/we are entirely consistent in enforcing this...)
Since this is also part of a greater project of refactoring Permutation towards completing #1761 / #1354 I wanted to make sure that in Properties, references to the constructors were abstracted on those lines before proceeding further.
As regards ↭-split, this is not a renaming of split, but a significant generalisation which permits a much improved proof of dropMiddleElement... so a cognate name change is needed to reflect the 'better' typing! As for giving it a better name, I'm open to suggestions!
|
Modulo @gallais 's comment, and my (attempted) rebuttal, I think that this is good to go @MatthewDaggitt unless there are review comments of yours that you are not happy have been dealt with...? |
|
At some point, the merge conflict resolution (probably thanks to me) went wrong, so fixing things now... |
|
Resolving latest round of merge conflicts exposed some issues with Meanwhile, there are still the (potentially) unresolved comments form @gallais about naming/synonyms for constructors, but I think these can be postponed until subsequent parts of this overall plan to revise/reform |
|
Hmmm.... fixing the merge conflict may need a bit more thought. UPDATED: I think that works now... Nope, something seems to have gone wrong somewhere. The |
Deleted spurious attribution of the lemmas in `Data.List.Properties` about `product` to `Data.List.Relation.Unary.All.Properties`. Hope this fixes things now!
Part I of a project to fix #1354
Highlights of the refactoring, cf. #2317 :
breakingforv2.1PropositionalandSetoidand theirPropertiesreconcile, more or less, the shared parts of the APIPermutationReasoningadditional syntax Parsing problems with thePermutationReasoningcombinators inData.List.Relation.Binary.Permutation.Propositional#2319variables etc.Propositionalof the relation and theSetoid (setoid _)instancePropositional.product-↭in that spiritSetoidchanges the proof of↭-transin terms of new lemmas↭-transˡ-≋and↭-transʳ-≋; with them a sharpening of the analysis insplitvia a new lemma↭-split(purely structural; no WF-induction required)Homogeneous, and deprecation inSetoid, ofsteps; towards removing legacy cruft now rendered obsolete by the above analysisstepsis deprecated inSetoid, but doesn't trigger theWARNING_ON_USAGEwhen the qualified-imported modulePermutation Sisopened inPropertiesBagAndSetEqualityfinishing off refactoring begun in RefactorData.List.Relation.Binary.BagAndSetEquality#2321Not done, but could be:
Setoid.PropertiesintoCoreand derivedPropositional, and then rederived via theSetoid (setoid _)instance (eg even thedrop...properties can be derived from those inSetoid)Won't do:
Setoidproperties toHomogeneous(as in RefactorData.List.Relation.Binary.Permutation.*#2317) and knock-on refactoring of theCoreproperties etc.