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

Strange error in 'also once' in combination with 'replace_' #88

Closed t-hahn closed 8 years ago

t-hahn commented 8 years ago

The following code... cf ABB; i mu; L test = 1; once ABB(mu?) * ABB(mu?) = 1; also once ABB(mu?, ?b, mu?) = replace_(mu, N100_?); .end ... gives the strange error Idold/also should follow an id/idnew statement.

Remarkably enough, the appearance of this error depends on the rhs of the 'also once' statement. To wit: if you replace the rhs by, say, 1, there is no error, though I have no idea what else (except the replace_ function) would trigger the error.

Best, Thomas

tueda commented 8 years ago

Just for information: git bisect says this bug was introduced by 00e5dd9329: maybe related to the compiler code changes(?)

vermaseren commented 8 years ago

Looks like collateral damage of getting the error messages for id,all correct. It may run better if you use id,once,… also,once,…. although I am not sure. I will get to this after the LL2016.

Jos

On 27 apr. 2016, at 23:03, Takahiro Ueda notifications@github.com wrote:

Just for information: git bisect says this bug was introduced by 00e5dd9 https://github.com/vermaseren/form/commit/00e5dd9329a4ecd119c270fa695d4d9c8eaff5d6: maybe related to the compiler code changes(?)

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/vermaseren/form/issues/88#issuecomment-215228514

vermaseren commented 8 years ago

I think I got it to work properly now, but you better check.

jodavies commented 8 years ago

This would be easier to use in loops if an occurrence of Also that doesn't follow an Identify were to be treated like a regular Identify.

Something like

#do i = 1,`UPPERBOUND'
    Also f(`i') = expr`i';
#enddo

You could take the first statement out of the loop and make the Also an Identify if you know for sure that UPPERBOUND can't be < 1, but otherwise not as expr0, say, might not exist?

vermaseren commented 8 years ago

Or you could put some dummy id before the loop (like id f=f; in this case). It was necessary to put up the error checking, and it was basically an omission that this checking was not there before. If it would be like you suggest the action would be different, depending on whether it so happens that another id statement (which may not be related) is in front. That could be an interesting source of errors.

Jos

On 4 mei 2016, at 17:40, jodavies notifications@github.com wrote:

This would be easier to use in loops if an occurrence of Also that doesn't follow an Identify were to be treated like a regular Identify.

Something like

do i = 1,`UPPERBOUND'

Also f(`i') = expr`i';

enddo

You could take the first statement out of the loop and make the Also an Identify if you know for sure that UPPERBOUND can't be < 1, but otherwise not as expr0, say, might not exist?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/vermaseren/form/issues/88#issuecomment-216905893

t-hahn commented 8 years ago

I had found a workaround before already but I went back to my old code and it works now. Thanks!

Thomas