术语“谓词”的起源引用布尔函数?
在Scheme中,术语“谓词”被用作作为如下:
谓词是一个始终返回布尔值(#t 或 #f)的过程。
为什么scheme要用“谓词”来指代这样的函数呢?如果该用法来自以前的语言,那么首先选择这个术语的动机是什么?
In Scheme, the term "predicate" is used as follows:
A predicate is a procedure that always returns a boolean value (#t or #f).
Why does scheme use "predicate" to refer to such a function? And if the usage comes from a previous language, what was the motivation for selecting this term in the first place?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,这来自数学逻辑,正如 Wikipedia 所说,谓词是一个基本概念在一阶逻辑中。在逻辑的每个“实现”中,谓词是一个要么是真要么是假的句子 - 因此它非常适合编程语言。
Well, this comes from mathematical logic, as Wikipedia says, predicate is a fundamental concept in first-order logic. In every "implementation" of logic, predicate is a sentence that is either true or false - so it fits into programming languages very well.