vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.15k stars 136 forks source link

A way to clear extrasymbol definitions? #347

Closed jodavies closed 4 years ago

jodavies commented 4 years ago

As far as I know, there is no way to clear definitions of extrasymbols. I regularly use a construction like

Bracket x;
.sort
Collect coll;
ArgToExtraSymbol coll;

* many modules involving x

Identify coll(x?) = x;
FromPolynomial;

If the expression is large enough for disk-based sorting and there are many modules to work through, this can provide a large performance improvement, trading some memory usage (for the extrasymbol definitions) for much faster sorts.

The problem is now that if I want to do this many times with a loop or procedure calls etc, the extrasymbol definitions use too much memory and lead to crashes.

It would be useful if there were a way to do something like #clearextrasymbols which one can use when they know they have no further use for the current extrasymbol definitions, and the next ArgToExtraSymbol will start again with Z1_.

Thanks, Josh.

benruijl commented 4 years ago

This feature is probably not that hard to add since there is an instruction to clear the extra symbols of the code optimization already.

On Mon, 8 Jun 2020, 11:56 jodavies, notifications@github.com wrote:

As far as I know, there is no way to clear definitions of extrasymbols. I regularly use a construction like

Bracket x; .sort Collect coll; ArgToExtraSymbol coll;

  • many modules involving x

Identify coll(x?) = x; FromPolynomial;

If the expression is large enough for disk-based sorting and there are many modules to work through, this can provide a large performance improvement, trading some memory usage (for the extrasymbol definitions) for much faster sorts.

The problem is now that if I want to do this many times with a loop or procedure calls etc, the extrasymbol definitions use too much memory and lead to crashes.

It would be useful if there were a way to do something like

clearextrasymbols which one can use when they know they have no further

use for the current extrasymbol definitions, and the next ArgToExtraSymbol will start again with Z1_.

Thanks, Josh.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/347, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACEMGOZSWWVYQGKKUQXMC3RVSYURANCNFSM4NYH2FAQ .

tueda commented 4 years ago

Delete extrasymbols;?

jodavies commented 4 years ago

Oh, great! I didn't know about that...