Skip to content
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

Questions on some rules (which came up in preparation of a Maxima port) #53

Open
MSoegtropIMC opened this issue Jun 19, 2024 · 20 comments

Comments

@MSoegtropIMC
Copy link

Dear Rubi Team,

I started a port of Rubi to Maxima, which is based on the idea of the late Albert Rich to automatically convert the rule base to a decision tree - which should then be easily portable to various systems including Maxima. The plan is to write the converter in OCaml, because I think it is easier to do this in a strictly typed language supporting algebraic data types. Also I plan to port it to Coq some day.

As first step I wrote a parser for the subset of Mathematica used in Rubi rules in Menhir (OCaml's yacc). I know that Mathematica parsers exist, but it is easier this way and it also helps me to find out what subset of Mathematica is actually used in Rubi.

I came across a few rules which look questionable to me.

First there are quite a few rules which use \[Star] where I would expect ASCII * aka. Times. E.g.:

b^IntPart[p]*(b*x^2)^FracPart[p]/x^(2*FracPart[p]) \[Star] Int[x^(2*p),x] /;

Is this a typo (when the file is loaded, the rendering is hard to distinguish from ASCII *) or is this some trick I need to understand? In the latter case, can you please explain it?

Second there are a few rules which use float numbers while almost all rules user integers / rationals: E.g. the x_^2. in:

Is this intentional?

Best regards,

Michael

@stblake
Copy link
Collaborator

stblake commented Jun 20, 2024 via email

@arthurcnorman
Copy link

See https://reference.wolfram.com/language/ref/character/Star.html for what Mathematica says [Star] means. How that participated in sunsequent Mathematica transformations is not my expertise, but in my activity parting the Rubi rulke-set for Reduce I encountered the same syntax.
If you are working on a Maxima port and I am in parallel looking at Reduce then it could well make sense for us to exchange experiences and problems encountered - I have a medium length list of thoughts. But the level of detail in what we might be exchanging would seem to me to mean that would be best done by direct email between us not through this forum.

I can parse all the Rubi rules (and indeed test examples) from the mathematica syntax they come in into LIsp prefix form with operators such as "/;" and so on. I have been experimenting with various transformations there but the details of where I am are very fluid and are messy enough that I am not going to post details here to bore everybody else. But if you are active on a project a bit of joining forces might be a good plan? Arthur Norman
(find me if you need via the reduce-algebra project on sourceforge).

@axkr
Copy link

axkr commented Jun 20, 2024

I started a port of Rubi to Maxima, which is based on the idea of the late Albert Rich to automatically convert the rule base to a decision tree - which should then be easily portable to various systems including Maxima.

I'm also planning to create a generator for converting rules into a Java source code method:

I have some uncommitted changes creating a simplified decision tree (discrimination net).
I think the Rubi rules are to complicated for the first step and I will try to support only simple pattern-matching rules for "builtin-function" at the beginning.

Maybe we can work together on the level of "best used data structures" or "known papers" for this topic?

@MSoegtropIMC
Copy link
Author

@arthurcnorman @axkr : thank you - indeed it makes sense to work together on this!

@arthurcnorman: are you fine with the basic approach of creating a decision tree / discrimination network offline with a common tool and exporting this into various languages? The advantage of this method I see is that it should be easier to port than reimplementing Mathematica pattern matching and it should also be much faster (if one does the creation of the tree/net offline once).

@axkr: I also had the plan to first look into what MatchPy does (the paper you linked), just as an offline solution. The SymPy Rubi port reportedly also uses MatchPy, but it is said that the online generation of the tree / net is too slow. One could think about generating Maxima / Java code using MatchPy, so that the generation time would not be an issue.

Where do we want to continue to discuss this? I think it would make sense to have a public discussion and IMHO it makes sense to have the discussion somewhere under Rubi, but maybe under Rubi-5 since this was the main intention of Rubi-5 and there might be fewer people who are subscribed to all issues.

Does someone from the Rubi team object?

@stblake
Copy link
Collaborator

stblake commented Jun 20, 2024 via email

@stblake
Copy link
Collaborator

stblake commented Jun 21, 2024 via email

@stblake
Copy link
Collaborator

stblake commented Jun 23, 2024 via email

@axkr
Copy link

axkr commented Jun 23, 2024

Has anyone here looked at this?

yes, despite the name, the https://matheclipse.org/ is the Symja demo page.
If you know some Java you can install it locally:

@stblake
Copy link
Collaborator

stblake commented Jun 24, 2024 via email

@robert-dodier
Copy link

@arthurcnorman About exchanging ideas with others working on integration rules, I would like to very strongly encourage you to conduct the discussion in a public forum, whatever is convenient for you, even if at this time only one other person is participating. Whatever you discover or encounter is potentially useful to others, even if it is not clear to anyone at present what form that will take.

All the best, Robert Dodier (developer and project administrator for Maxima)

@axkr
Copy link

axkr commented Jun 24, 2024

I was surprised to see this time-out: Integrate[1/(x^5+1), x] Error: 𝖳𝗂𝗆𝖾𝗈𝗎𝗍 𝖾𝗑𝖼𝖾𝖾𝖽𝖾𝖽. 𝖢𝖺𝗅𝖼𝗎𝗅𝖺𝗍𝗂𝗈𝗇 𝖺𝖻𝗈𝗋𝗍𝖾𝖽!

Yes the demo on google appengine is very slow and times out after 30 seconds.

Locally on my machine, I get this result:
image

@axkr
Copy link

axkr commented Jun 24, 2024

@arthurcnorman About exchanging ideas with others working on integration rules, I would like to very strongly encourage you to conduct the discussion in a public forum, whatever is convenient for you, even if at this time only one other person is participating. Whatever you discover or encounter is potentially useful to others, even if it is not clear to anyone at present what form that will take.

the maintainers of the github Rubi organization can enable "discussions" for this purpose in their organization:

or in a specific Rubi repo:

For chatting I personally prefer Discord nowadays:

@stblake
Copy link
Collaborator

stblake commented Jun 25, 2024 via email

@stblake
Copy link
Collaborator

stblake commented Jun 25, 2024 via email

@stblake
Copy link
Collaborator

stblake commented Jun 25, 2024 via email

@arthurcnorman
Copy link

arthurcnorman commented Jun 25, 2024 via email

@stblake
Copy link
Collaborator

stblake commented Jun 26, 2024 via email

@stblake
Copy link
Collaborator

stblake commented Jun 30, 2024 via email

@stblake
Copy link
Collaborator

stblake commented Jun 30, 2024 via email

@stblake
Copy link
Collaborator

stblake commented Jul 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants