I started to learn Prolog and I just read that the atom at the beginning of an structure is usually called functor.
I'm also familiar with the term functor from Category Theory and Functional Programming.
So my question is, does the choice of the word functor in Prolog have any implications on Category Theory? Are functors in Prolog a type of transformation? Or is the choice of the name mere coincidence?
Thanks so much!
No.
No.
Answering that subjectively can lead to many rebuttal comments; here are the facts.
Prolog has an ISO standard and in the standard is
If you work with Prolog enough you will learn to think symbolically and then realize that
functoris just a name for something. Other common names in Prolog areterm,list,atom,variable.See this post for more details.
I would not say coincidence as if you look at the pedigree of both words you will probably arrive at a common point related to math, so it is not a coincidence it is that when people have a choice for naming something sometimes they use a familiar name or sometimes they coin a new word.
In this case over the years people just keep using functor over and over again for various things and the tree of what it means has grown significantly.
At least the use of the word
functoris not as bad as the over use of comma as an operator in programming languages.Side note on possible pedigree for functor use in Prolog.
In Googling for a definition of
functorfound the Wikipedia article functor which noted the Wikipedia article function word. Forfunction wordit notesIf you know that Prolog was first created for processing the French language [1] then this seems like a likely path for the pedigree of the word functor on the Prolog side.
1 - "The birth of Prolog" by Alain Colmerauer and Philippe Roussel