Odd behavior of and()
| Bugzilla Link | 592 |
| Created on | Nov 13, 2009 22:09 |
| Version | 1.00beta |
| OS | Linux |
| Architecture | PC |
Extended Description
I was looking at match() code, and noted that it uses
fold. At that point, I began to wonder if foldfix was
working not working, or integrated into fold.
So, I wrote this here function:
use Array:all;
use StdIO:{print};
int main()
{
b = genarray([200000000], true);
z = any (b);
print(z);
return(0);
}
It generates this WL:
_pinl_225_res = with {
([ 0 ] <= _pinl_223_iv=[_pinl_226__eat_12] < [ 200000000 ])
{
_pinl_227__ea_165_res = _accu_( _pinl_223_iv);
_pinl_233__217__flat_13 = _or_SxS_( _pinl_227__ea_165_res, _flat_1);
} : _pinl_233__217__flat_13 ;
} :
fold( ScalarArith::|, _pinl_222__flat_6);
From what I can tell, that the fold WL does not quick-stop, suggesting
that foldfix is broken, non-existent, or something else.
However, more interesting is the slight variant on the above, when you change
the "true" to false. Then, it generates this:
_pinl_225_res = false;
This suggested to me that the typechecker might be detecting
one possible reduction identity case, but not the other.