-
Notifications
You must be signed in to change notification settings - Fork 10
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
Code duplication #12
Comments
In fact it seems possible to derive the n-ary relations from the 1-ary one. I'm experimenting with it here: https://github.com/Lysxia/coq-recursion-schemes/blob/544c146d0426a5e7983829d9fab9eb60028ca721/theories/PCofix.v |
That's very interesting. I'll bring this issue to @gilhur. Thanks for contribution! |
@Lysxia The situation is more compilcated. However, following your idea, we can define and prove n-ary paco with 1-ary paco for each n. I implemented this idea in #13. In my test, compilation time is reduced a lot(75sec -> 17sec). |
That's impressive! |
Here's a new version generalizing over dependent products: https://github.com/Lysxia/coq-recursion-schemes/blob/2de29c486f201d1fde6e50c43c5a8108f5381c6b/theories/PCofix.v I couldn't figure out the right type-inference behavior though. So now my hope is to somehow get |
I've been taking a look at this again, and I'm wondering whether there's a reason for the way some properties are stated. For example: (* paco_internal.v *)
monotone gf := forall x0 r r' (IN : gf r x0) (LE : r <1= r'), gf r' x0 Why not write this instead: monotone gf := forall r r', (r <1= r') -> (gf r <1= gf r') I think this would make things easier to generalize. |
It seems paco's code is actually generated by the python scripts, and the code duplication leads to somwhat long compile times. Instead of copying mostly the same code for each arity, have you considered a generalization in pure Coq (say, indexing predicates by the arity as a
nat
)? What are the difficulties with that approach?The text was updated successfully, but these errors were encountered: