S3 says:

    1|2 + 3&4;                              # (4|5) & (5|6) 

but shouldn't that equal

      (1 + (3&4)) | (2 + (3&4))
    = (4&5) | (5&6)
    = (4|6) & 5                             # ???

For one thing, OR's of AND's (DNF) is just nicer than AND's of OR's
(CNF).  For another, I read that as "1 or 2 plus 3 and 4"; it would be
surprising if that were equal to "(4 or 5) and (5 or 6)", since that
equals "5 and 5".

I haven't run through many examples, but I think it should be a
general rule than when combining conjuctions with disjuctions through
any operation, the conjuction should distribute over the disjuction.
I know these aren't strictly logical ops, but if I say

    @a = (0,0,0,0,1,0);
    print "yes" if @a[1|2 + 3&4];

I would be chagrined if it printed "yes".  Then again, I would be
chagrined to have to read that code, anyways.

/s

Reply via email to