[net.lang.mod2] Complicated boolean expressions

adrian@ru-cs44.UUCP (10/24/83)

Here's a simple prog. for you all to try.
==========================================
MODULE test;

FROM TTIO IMPORT WriteString, WriteLn;

VAR
	x : INTEGER;
	a, b, c : INTEGER;

BEGIN
	x := 1;
	a := 32;
	b := 32;
	c := 22;
	IF ((x = 1) AND ((a = b) OR (a = c))) OR
	   ((x = 2) AND ((c = a) OR (c = b))) THEN
		WriteString('Succeeded',0)
	ELSE
		WriteString('Failed',0)
	END;
	WriteLn;
END test.
==========================================

On the New South Wales compiler running here, it prints 'Failed' which
is incorrect.  The problem seems to be in the code generated for the
boolean expression s.t. if x=1 and a=b, the next test applied is 
((c=a) OR (c=b)) which is in a different arm of the conditional.  
I'd be interested in anybody else's experiences with this and if you
send me results by MAIL, I'll post a summary in a few weeks.

Incidentally, the fix to our compiler is by no means obvious, and
hasn't been done yet.  Watch this space.

-- 
Adrian Pell		({vax135,mcvax,edcaad}!ukc!ru-cs44!adrian)
Computer Science Dept.
University of Reading
UK