Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: Missing as true - Was: Re: st: RE: Another Stata feature


From   Bill Rising <[email protected]>
To   "Stata Listserve" <[email protected]>
Subject   RE: Missing as true - Was: Re: st: RE: Another Stata feature
Date   Thu, 8 Jan 2004 09:45:56 -0500

On 1/8/04 6:50, Nick Cox wrote

[snip...]

If the lazy evaluation model were used, 'or' would be true as long as at 
least one is true, and 'and' would be false if at least one is false. 
Extending this with the normally unnecessary extensions that 'or' is 
false if all are false, and 'and' is true if all are true would give a 
nice logical way to work.

>
>1. fill in truth tables 
>
&                 true  false irrelevant  
true                T     F      I
false               F     F      F
irrelevant          I     F      I
>
|                 true  false irrelevant  
true                T     T      T
false               T     F      I
irrelevant          T     I      I

This still keeps the !(A|B) = (!A) & (!B) and the !(A&B) = (!A) | (!B) 
working fine, as well as the distributive laws.

It would be like treating '&' as 'min' and '|' as 'max' while 't' would 
be 1, 'f' would be 0, and 'irrelevant' would be 1/2, instead of + or - 
infinity. This would then screw up any fuzzy logic routines that would 
ever be built in the future.

I'd think this would be very easy to explain, BUT Nick's point about it 
being far too late to change is well taken. Stata's current 
implementation surely speeds up execution by a lot, since C uses lazy 
evaluation, which means that as few logical statements are evaluated as 
possible. I guess I'll just blame Boole, as suggested.

Bill
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index