-
Notifications
You must be signed in to change notification settings - Fork 242
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
[discussion] a view-based analysis of punchOut
, punchIn
and pinch
from Data.Fin
#1921
Conversation
Would it be possible to have a little bit more documentation above |
OK, thanks for this Jacques. Views such as these really are the inductive definition of the 'graph relation' of the function concerned: each constructor corresponds to a particular call-pattern in the original function definition; recursive calls are represented by inductive premises etc. And the recursion/pattern analysis of the original function definition (which is responsible for showing termination in the first place) is then exactly replicated in the definition of the covering function As to their possible use, as with PR #1923, it's really a case of wanting to contrast an ostensibly ad hoc analysis as in PR #1913 with a systematic derivation of the same properties by dint of... 'programming from the specification'. The original functions themselves were introduced by Conor in his paper on unification by structural recursion (they're context manipulations to insert/delete new (meta)variable positions, IIRC), and I guess that Nathan is using them in his ongoing work on permutations on ... and yes, it seems valuable to insist that each relation always be called |
I'm afraid to say that to me this seems like an awful lot of machinery to produce proofs that, in this case at least, are not significantly more understandable |
Nathan, thanks for that. While I am tempted (from one side) to agree, from the other I am/have been trying to argue that for subsequent properties that you may wish to have about these functions (your examples of preserving and reflecting orderings are just that, examples), having a general method might be preferable to having to rethink a pattern analysis each time. Your PR #1913 is admirably clear, and even draws attention to the need for "better patterns"; the method of views-of-functions provides a way to encapsulate such 'better' choices once and for all. Eg your proofs for I started to think about this (and the related PR #1923 ) after reading your proofs and those of @uzytkownik regarding So yes: more weight, but I would argue, more power, and with it more reusability downstream. |
I'm going to close this for now, against a future version of the library which might make more use of views/view-based programming. |
Currently lodged in
Data.Fin.Relation.Ternary
, but if I were to add more of these (see also PR #1901), I'd be strongly tempted to have a separate category, rather than something (of potentially arbitrary arity) underRelation.*
... I'd suggest underView.*
. Thoughts welcome.This is an obvious duplicate/competitor to PR #1913 but founded on a slightly different basis.
No
CHANGELOG
at this stage: for discussion only.