Bug SS-2401
1 vote

[Maxima] takeover of sum(4) and int(4) broken

Created by Martin Kraska on 9/13/2016 11:15 AM Last Updated by Martin Kraska on 8/1/2017 12:14 PM
%
 (hrs)
Logged: 0   (hrs)

 Description

SMath 0.98.6096

Maxima SVN 2178

Because of the current SMath core policy of not allowing other plugins  the override of functions from plugin Special functions, the Takeover mechanism in the Maxima plugin is broken.

This basically affects sum(4) and int(4).

det() is not affected, because it is not provided by Special functions.

diff(1), lim() and int(2) are not affected, because they are not provided at all (yet have operator shapes provided)

diff(2) and diff(3) are affected but that does not harm too much because SMath native diff is good enough.

Workarounds for access to Maxima's sum4 and int(4) are given in the screenshot. Could these workarounds somehow exploited by the Maxima plugin? If MaximaTakeover("Int") would just execute the workaround on the canvas, would that be possible?

As another workaround, Maxima provides functions Int(4) and Sum(4) without operator representation.

 

    Martin Kraska (Tuesday, August 1, 2017 12:13 PM) #

Fixed in SVN 2425 by re-implementation of MaximaTakeover() using context.AddDefinition() and context.Clear().

    Martin Kraska (Friday, July 28, 2017 11:49 PM) #

Seems that the concept works.

Now, I have to find out how to remove the definition. Will context.Clear(def) do?

    Martin Kraska (Friday, July 28, 2017 6:59 PM) #

As the workarounds below show, the special function  int(4)  (and probably others) can be re-defined in the SMath sheet. Other than the original MaximaTakeover(), which acts on a per-SMath-instance base, this acts on a per-document base, which is much better.

To remove that definition, Clear() can be used.

For the implementation of the workaround in the plugin, I want to use AddDefinition() and RemoveAt() or Clear()

If a function is to be replaced by Maxima, then AddDefinition() is used and the resulting index is stored. If the function is to be given back to SMath, then RemoveAt(index) is used.

That's the idea. If it works, then the full functionality of the Maxima Plugin can be restored without adjustments in old documents required.

    Martin Kraska (Wednesday, July 12, 2017 11:54 PM) #

beginning with SVN 2418, the takeover mechanism is disabled. Use the replacement functions Int() and Sum() instead or wrap symbolic sums or integrals with Maxima().

I try to find a way to suppress preprocessing of the Maxima() argument (with the option to catch calls to sum, int and the like and do preprocessing with their arguments)