vermaseren / form

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

Issues with the count_ function vector options #435

Open sjteale opened 1 year ago

sjteale commented 1 year ago

There appears to be an issue using the count_ version of the count option in if statements. When it comes to specifying the v,d,f,?set options an undefined variable error is returned for all options. As an example:

Vector vec;
Function tens;
Autodeclare index mu;

L Test = vec(mu1)*vec(mu2)*tens(vec,vec,mu3);

mu count_(vec+v,1);

Print;

.end

this code returns

Counttest.frm Line 8 --> Undeclared variable v
tueda commented 1 year ago

This requires a major change in the FORM syntax or some special exception for the handling of count_.

My impression is that the documentation of count_:

count_

Similar to the count object in the if statement (see 7.71). This function expects the same arguments as the count object and returns the corresponding count value for the current term.

is simply not accurate and the syntax parser just does not support "+vdf?set"; clearly vec+v gives vec plus v.

If we had a literal string type in FORM (like "+v"), we could have introduced an optional argument to the count_ function such as, for example, count_(vec,"+v",1).