vermaseren / form

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

x^n? doesn't match x within a function argument #174

Closed jodavies closed 7 years ago

jodavies commented 7 years ago

The following script should also match the x inside f, if it is to be consistent with how x is matched outside of the function argument,

#-
Off Statistics;
CFunction f;
Symbol x,y,n;

Local test = f(x^-1,1) + f(x,1) + f(x^2,1) + x^-1 + x + x^2;

Repeat Identify f(?a,x^n?,?b) = f(?a,?b)*y^n;
Identify x^n? = y^n;

Print +s;
.end

which produces

FORM 4.1 (Mar 16 2017, v4.1-20131025-300-g6f4672b) 64-bits  Run: Fri Mar 17 10:30:49 2017
    #-

   test =
       + y^-1
       + y
       + y^2
       + f(x,1)
       + f(1)*y^-1
       + f(1)*y^2
      ;

  0.00 sec out of 0.00 sec

Thanks, Josh.

jodavies commented 7 years ago

Ah, I see that I found this bug already, see issue 63.

benruijl commented 7 years ago

Duplicate of #63 .