Prolog 中的术语 "Functor" 与范畴论中的术语有任何关系吗?

Does the term "Functor" in Prolog have any relation to the term taken from Category Theory?

我开始学习Prolog,刚读到结构开头的原子通常叫做functor

我也熟悉类别理论和函数式编程中的术语 仿函数

所以我的问题是,在 Prolog 中选择函子这个词对范畴论有什么影响吗? Prolog 中的仿函数是一种转换吗?还是取名纯属巧合?

非常感谢!

Does the term "Functor" in Prolog have any relation to the term taken from Category Theory?

没有


Does the choice of the word functor in Prolog have any implications on Category Theory?

没有


Are functors in Prolog a type of transformation?

主观地回答会导致很多反驳意见;这是事实。

Prolog 有一个 ISO 标准,在标准中是

§3.77 functor: An identifier together with an arity.

如果你对 Prolog 的使用足够多,你将学会用符号来思考,然后意识到 functor 只是某物的一个名称。 Prolog 中的其他常见名称是 termlistatomvariable.

有关详细信息,请参阅此


Or is the choice of the name mere coincidence?

我不会说巧合,因为如果你查看这两个词的谱系,你可能会得出一个与数学相关的共同点,所以这不是巧合,而是当人们有时可以选择命名某物时他们使用熟悉的名字,或者有时他们创造一个新词。

在这种情况下,多年来人们一直在为各种事物一遍又一遍地使用仿函数,而它的含义树已经显着增长。

至少 functor 这个词的使用没有在编程语言中过度使用逗号作为运算符那么糟糕。


关于在 Prolog 中使用仿函数的可能谱系的旁注。

在谷歌搜索 functor 的定义中找到维基百科文章 functor which noted the Wikipedia article function word。对于 function word,它指出

In linguistics, function words (also called functors) are words that have little lexical meaning or have ambiguous meaning and express grammatical relationships among other words within a sentence, or specify the attitude or mood of the speaker.

如果您知道 Prolog 最初是为处理法语语言而创建的 [1] 那么这似乎是 Prolog 方面的词函子谱系的可能路径。

1 - Alain Colmerauer 和 Philippe Roussel 的“Prolog 的诞生”