Re: boolean operators and type errors

More info, after a #swig discussion around

Using the table from
writing 0 (Unknown) as E, 1 (True) as T and 2 (False) as F:

A       B   |   NOT A   A && B  A || B
E       E   |   E       E       E
E       T   |   E       E       T
E       F   |   E       F       E
T       E   |   F       E       T
T       T   |   F       T       T
T       F   |   F       F       T
F       E   |   T       F       E
F       T   |   T       F       T
F       F   |   T       F       F

which Bijan on IRC checked works with Demorgan's laws.

compare to current situation as described by ericP:
with the difference to above:

A       B  |  A || B
T       T  |  T
T       F  |  T
F       T  |  T
F       F  |  F
T       E  |  T
F       E  |  F  (in table 1 gives E)
E       T  |  T
E       F  |  F  (in table 1 gives E)
E       E  |  E

which exactly matches the proposed changes in 0360.

So this change makes sense to me.

As to the & operator, this would need changing too if aligning with
this tri-logic was the method as E does not always propogate: in
table 1, F & E -> F and E & F -> F wheras we currently have any other
operator returning E on a type error on an argument.


Received on Thursday, 8 September 2005 17:44:43 UTC