1. Re: 'Unknown' and three-valued logic
- Posted by Christian.CUVIER at agriculture.gouv.fr Nov 26, 2002
- 394 views
Well, 3 is not a computer-world number, while 4 is. Actually, most of our modelling of unknown values could be represented as two booleans: - b1=0 and b2=0 --> can't decide (undecidable) - b1=0 and b2=1 --> unknown, but could decide, have idea on how to decide (decidable) - b1=1 --> decision made, b2 is ordinary true/false boolean So, if x and y are two such pairs of booleans: - not x=x if b1=0, otherwise the expected thing; - x and y will have b1=0 if x.b1 or y.b1 is; - and then b2=1 only if x.b2 and y.b2 are 1. Why separate decidable and undecidable? Just because it leads you to different courses of action in real life. "Decidable" means you may start and find extra data to make the decision and set the relevant b1 to 1. "Undecidable" means you won't because you have no clue (could fit somebody on this list, :)) and you either raise a logical error, don't return a decision, return a random decision, whatever. And also because 3-state hardware is expensive if it ever exists, while pairs of booleans can be handled neatly by any language on standard hardware. Getting uninitialised variables contents falls in the (0,0) case: raise an error (Euphoria), return whatever rubbish is there (most others). Not finding a file, or finding unexpected syntax, is rather (0,1), because the most logical approach is to search extra information, for instance in a plugin handling extended syntax, in a user-filled form or box,... (hint, hint, Rob). Have a nice day! CChris > > But I digress. I think the key point is that you *can* in fact represent > information like "we don't know" as a boolean fact, and it doesn't > necessitate the creation of a third logic value. > > -- David Cuny >