Flat, OneIdentity Again
- To: mathgroup at smc.vnet.net
- Subject: [mg21637] Flat, OneIdentity Again
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Tue, 18 Jan 2000 02:35:21 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Thanks to all who answered my question on Flat and OneIdentity.
I have more strange behavior on this subject.
it says in so many words ....
If (f) has the Flat attribute you better not have a definition like
because if you do, then an attempt to evaluate f[1,2] will not work and the
kernel will have to quit when the infinite iteration limit is exceeded.
In addition I found that you can't even evaluate f in the above case, and
it doesn't help if (f) also has the OneIdentity attribute!
I wanted to understand just what the kernel is doing to exceed the iteration
limit when we try to evaluate f[1,2] or f above. The lines below offer
some clues, but also add to the mystery. I wonder if any of you have an
After the input above (f) has the Flat attribute and no definitions.
f[1,2] as f[f[1,2]].
The idea that the pattern matcher treats
f[1,2] as f[f[1,2]] is sort of verified
at Out below.
But if the pattern matcher treats f[1,2] as f[f[1,2]]
why doesn't MatchQ return True in Out below ?
Even stranger is the next line where the pattern is much more general!
Notice that is a triple blank inside (f).
All the results above come out the same if (f) has the attributes Flat,
I have a hunch what may be going on here. Perhaps this is a bug. Could it be
that the part of the pattern matcher that handles Flat is oblivious to
HoldPattern and checks for a match with the patterns f[_Integer,_Integer]
when it should check for a match with f[f[_Integer,_Integer]] and f[f[___]]
respectively in the lines above?
I did all this using Version 4.
On 12-18-99 Mathematica tips, tricks at
had a major update
Prev by Date:
Re: Flat, OneIdentity attributes
Next by Date:
Re: generating subsets
Previous by thread:
Re: Help! Mathematica on my 500MHz outperforms my GHz machine!
Next by thread:
Re: Flat, OneIdentity Again