-
Notifications
You must be signed in to change notification settings - Fork 246
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
Magma reasoning #1146
Magma reasoning #1146
Conversation
Nice. |
@alexarice thanks for the PR. This is incredibly cool, I wouldn't have guessed you could do this without reflection! I guess my main question is what are the advantages of this over #1136? It's true that it doesn't use reflection, but I don't think that's going to be a big selling point. Reflection doesn't require us to introduce any more rules, especially as #1136 uses |
The limitations of reflection I have seen when I try to use it are the following:
Further briefly reading #1136 suggested it relied on having a full cong operation and so I think it might not work with the algebra structures that are setoid enriched. Again I could be incorrect here. |
Further, this can be used reasonably well with at least single operation structures (although it does not cope with inverse cong). |
From the sound of it should be able to work with arbitrary setoids. If it's okay with you, I suggest we wait until @dylanede opens a PR for it and then we can do an actual comparison rather than discussing hypotheticals? |
sounds good to me |
This reminds me of Conor's category/functor solver, which shows how this sort of thing can be integrated with algebraic laws. There's a fairly broad and largely untested design space here. One thing I thought of in particular is that it's possible to have multiple foci, which might help in some situations and also simplify the syntax (the distinction between |
I can't immediately see how having multiple foci simplifies the syntax, could you explain? Thanks for the link, I'll try to have a read through it at some point |
It simplifies the interface you can give to users. The distinction between To deal with multiple foci requires a little bit more from the implementation to present the equations arising from the foci. Conor does a particularly cheap thing in |
Ah I see, this is currently representing the focus as a path through the tree, so there isn't a reason that there could be a list of foci instead, putting some arbitrary order on (likely left to right) |
I remember part of the problem I had is allowing an unfocused variable to be treated as an expression. From my understanding, allowing multiple foci would allow you to have just one syntax for combining two sub expressions, however I can't see how you would avoid having to introduce syntax for an "unfocused leaf" |
Closing this as I think the tactic-based approach added in #1658 is more powerful and has better syntax. |
Added a new module magma reasoning, which allows automation of congs in proofs.
See README.Algebra.Reasoning.Magma for an example
Extends #1144
Built on top of #1145
This is a non reflection based approach to #1136 which is specific to Magmas. Most of the syntax is pulled from the discussion in that issue
EDIT: WIP because I have realised I still need to think about how tightly the Expr builders bindHave put something in but am not sure if it is the best