开发者

Origin of the term "Predicate" to refer to a boolean function?

开发者 https://www.devze.com 2023-03-14 01:14 出处:网络
In Scheme, the term \"predicate\" is used as follows: A predicate is a procedure that always returns a boolean v开发者_如何学Goalue (#t or #f).

In Scheme, the term "predicate" is used as follows:

A predicate is a procedure that always returns a boolean v开发者_如何学Goalue (#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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号