vermaseren / form

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

Asking for commentary about a potential new feature #283

Open vermaseren opened 6 years ago

vermaseren commented 6 years ago

One thing that bothered me in the forcer program is that we put all topologies etc in dollar variables. The finding of the variables then follows a balanced tree. I know there was already some thinking about arrays of dollars. I am currently looking slightly differently: make a variable type array that can contain worked-out expressions (as in the dollars, or sometimes tables), but also code. The code should solve the outstanding problem of that we had to process many topologies sequentially, while actually they could easily have been processed together, except that then there would have only been if-statements with a little bit of code. I am still thinking over how to do this best. Maybe you have suggestions as well. For instance:

Array a[0:100,0:10](code from topo);
…...
a[1,2] = id,p1 = p2-p3;
a[2,2] = id,p3 = p1+p2;
…...

and then if a term is marked by topo(1) or by topo(2) somehow we make that it either executes the first or the second statement. Of course, this needs a number of options. Also it should be possible to extend this dynamically which the tables currently cannot do completely. The Fill is only working at the start of the module. I want some addtoarray statement that adds something during execution and applies it immediately to the terms that follow. (needs some interesting locks in tform).

At the moment I am thinking about how to implement this. It may or may not be simple. But I would first like to hear your opinion.

Takahiro already suggested that it would be really nice if 'code' could mean more than a single statement as in

a[1,2] = {
  id,p1 = p2-p3;
  id,p3 = p1+p2;
};

This will indeed add even more power, but may also require a bit more thinking about the implementation.

Jos