三值逻辑上下文中布尔运算符和比较运算符的语义

发布于 2024-08-23 01:25:29 字数 155 浏览 2 评论 0原文

教授问我这个问题:

三值逻辑上下文中布尔运算符和比较运算符的语义是什么?

我不确定他的意思是什么。什么是比较运算符?和关系运算符一样吗?语义?他询问这两个术语在三值逻辑背景下的“含义”?

谢谢。

Professor ask me this question:

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

I'm not sure what he meant by that. What is comparison operator? Is that the same as relational operator? Semantics? He asking about 'meaning' of those two terms in context of three-valued-logic?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

说谎友 2024-08-30 01:25:29

根据定义,布尔值由两个选项组成:True 和 False,或者它们的某种表示形式,如 1/0、ON/OFF、YES/NO 等。

许多数据库系统还允许您在指定为 Boolean 的字段中存储 NULL 值允许它们代表三个值:是、否和未知 (NULL)。

布尔运算符为 AND、OR 和 NOT。
比较运算符是某种形式的 EQUALS 或 NOT EQUALS。

两端都有 TRUE/FALSE 值的操作是显而易见的:
对或错 ->正确
不正确 ->错误
真=真-> TRUE

他得到的是添加 NULL(未知)值的结果:
TRUE 或 UNKNOWN(NULL) -> ???
未知(空)-> ???
TRUE=未知(NULL)-> ???

Boolean values by definition consist of two options: True and False, or some representation of them like 1/0, ON/OFF, YES/NO, etc.

Many database systems also allow you to store a NULL value in fields designated as Boolean to allow them to represent three values: Yes, No, and Unknown (NULL).

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

Operations with TRUE/FALSE values on both ends are obvious:
TRUE or FALSE -> TRUE
NOT TRUE -> FALSE
TRUE=TRUE -> TRUE

What he is getting at are the consequences of adding the NULL (Unknown) value:
TRUE or UNKNOWN(NULL) -> ???
NOT UNKNOWN(NULL) -> ???
TRUE=UNKNOWN(NULL) -> ???

岛歌少女 2024-08-30 01:25:29

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

基本上,三值逻辑是 true/false/null,布尔/比较运算符在比较 true == null、null == null、 ETC。

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

Basically, three value logic is true/false/null, and the boolean/comparison operators will function in certain ways when comparing true == null, null == null, etc.

风吹雪碎 2024-08-30 01:25:29

根据定义,布尔逻辑仅使用两个值。对我来说,这个问题没有意义。如果他问如何定义或扩展布尔逻辑以便它可以使用三值系统,那就更清楚了。

Boolean logic by definition uses only two values. To me, this question doesn't make sense. If he would asked how can you define or extend Boolean logic so that it could use three-value system, it would be clearer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文