-
Notifications
You must be signed in to change notification settings - Fork 149
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
Support for Rules and Patterns #1209
Comments
@LukeLongworth, this looks very reasonable to add. Can you please provide examples of exactly what you do need? |
@LukeLongworth we may have a snag here. If you try just
To fully support this feature we need to expand the parser (comments @aharjula?), or we insist on a workaround as shown here cfd0887#diff-aad04ae351ba675f6ae80a98e32ef7c4b57f41d6e0c614ec9f6d84e3b0d8ae28R2944 which avoids the problem of this return value in the Maxima -> PHP connection. |
Well, wrapping it and piping the return value out to some bit bucket instead of returning it would be the workaround for now. You can naturally add a new operator to the current parser, but:
I would rather start investing in the next-gen parser with its configurable lexers so that one could when needed, use a lexer that accepts that as an operator and otherwise allow simpler ones to be used. This would have less vocabulary and, thus, simpler syntax error messages. Basically, if it currently aims to provide localisable syntax lexers, it can easily also adjust and provide a larger syntax parser for return values from the CAS, or author side code, when need be. |
I agree @aharjula that adapting the parser is too much work for this case, and probably prone to causing more problems. We'll document the use of @LukeLongworth could you create some use-cases and perhaps some docs? |
@LukeLongworth I would really like to get this functionality into the next release (19th Nov). Do you have anything to add, e.g. some compelling use-cases? |
@sangwinc I haven't been able to experiment with this, as I usually just use the CAS chat in our local install to play around with Maxima. The thing that originally drove me to investigate this was symbolic matrix algebra. I wanted Maxima to understand that I can also imagine a use case where more complex simplifications could be managed. I have had many headaches with a particular implicit partial differentiation question we have, where rearranging the original equations before differentiating will produce valid answers (ignoring any domain restrictions that get introduced) that STACK won't recognise. One possible solution would be to ask STACK to, for example, look for any expressions of the form If this functionality gets into the next version of STACK, I would be happy to play around and write some example use cases. 19th of November might even give us enough time to include it in our December update! It would be a rare treat for us to actually be on the latest version for a while. |
Thanks @LukeLongworth, this is in the dev branch, and scheduled for the next release. Please do make use of this and add examples and "know how" here: |
The set of functions for rules and patterns
looks like it would be useful for manipulation of certain symbolic expressions. Should some or all of these functions be unbanned?
Some use case examples in the documentation are:
( let(sin(a)^2, 1 - cos(a)^2), letsimp (sin(x)^4) )
to givecos(x)^4 - 2*cos(x)^2 + 1
My own use case that inspired me to look into this (may or may not be possible, I'm not sure):
I
andO
to be multiplicative and additive identities respectively for symbolic matrix expression simplificationThe text was updated successfully, but these errors were encountered: