Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Combinatory logic
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Examples of combinators === The simplest example of a combinator is '''I''', the identity combinator, defined by :('''I''' ''x'') = ''x'' for all terms ''x''. Another simple combinator is '''K''', which manufactures constant functions: ('''K''' ''x'') is the function which, for any argument, returns ''x'', so we say :(('''K''' ''x'') ''y'') = ''x'' for all terms ''x'' and ''y''. Or, following the convention for multiple application, :('''K''' ''x'' ''y'') = ''x'' A third combinator is '''S''', which is a generalized version of application: :('''S''' ''x y z'') = (''x z'' (''y z'')) '''S''' applies ''x'' to ''y'' after first substituting ''z'' into each of them. Or put another way, ''x'' is applied to ''y'' inside the environment ''z''. Given '''S''' and '''K''', '''I''' itself is unnecessary, since it can be built from the other two: :(('''S K K''') ''x'') :: = ('''S K K''' ''x'') :: = ('''K''' ''x'' ('''K''' ''x'')) :: = ''x'' for any term ''x''. Note that although (('''S K K''') ''x'') = ('''I''' ''x'') for any ''x'', ('''S K K''') itself is not equal to '''I'''. We say the terms are [[extensional equality|extensionally equal]]. Extensional equality captures the mathematical notion of the equality of functions: that two functions are ''equal'' if they always produce the same results for the same arguments. In contrast, the terms themselves, together with the reduction of primitive combinators, capture the notion of ''intensional equality'' of functions: that two functions are ''equal'' only if they have identical implementations [[up to]] the expansion of primitive combinators. There are many ways to implement an identity function; ('''S K K''') and '''I''' are among these ways. ('''S K S''') is yet another. We will use the word ''equivalent'' to indicate extensional equality, reserving ''equal'' for identical combinatorial terms. A more interesting combinator is the [[fixed point combinator]] or '''Y''' combinator, which can be used to implement [[recursion]].
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Combinatory logic
(section)
Add topic