Semantics of Boolean and comparative operators in the context of three-valued logic

The professor asks me this question:

What is the semantics of Boolean and comparison operators in the context of three-valued logic?

I'm not sure what he meant. What is a comparison operator? Is it the same as a relational operator? Semantics? He asks about the "meaning" of these two terms in the context of three-valued logic?

Thanks.

+7
null sql
source share
3 answers

Logical values, by definition, consist of two options: True and False, or their representation as 1/0, ON / OFF, YES / NO, etc.

Many database systems also allow you to store NULL values ​​in fields designated as Boolean so that they can represent three values: Yes, No, and Unknown (NULL).

Boolean operators are AND, OR, and NOT.
Comparison operators are some form of EQUALS or NOT EQUALS.

Operations with TRUE / FALSE values ​​at both ends are obvious:
TRUE or FALSE β†’ TRUE
NOT TRUE β†’ FALSE

TRUE = TRUE β†’ TRUE

What it gets is the consequences of adding a NULL value (Unknown):
TRUE or UNKNOWN (NULL) β†’ ??? NOT UNKNOWN (NULL) β†’ ???
TRUE = UNKNOWN (NULL) β†’ ???

+6
source share

http://en.wikipedia.org/wiki/Null_(SQL)#Three-valued_logic_.283VL.29

Basically, the three logic values ​​are true / false / null, and the boolean / compare operators will work in a certain way when comparing true == null, null == null, etc.

+3
source share

Logical logic, by definition, uses only two values. For me, this question does not make sense. If he asked how you can define or extend logical logic so that it can use a three-digit system, that would be clearer.

0
source share

All Articles