notebook/notes/combinators/index.md

21 KiB

title TARGET DECK FILE TAGS tags
Combinators Obsidian::STEM combinator
combinator

Overview

Assume that there is given an infinite sequence of expressions called variables and a finite or infinite sequence of expressions called atomic constants, different from the variables. Included in the atomic constants are some #Basic Combinators. The set of expressions called CL-terms is defined inductively as follows:

  • all variables and atomic constants are CL-terms;
  • if X and Y are CL-terms, then so is (XY).

An atom is a variable or atomic constant. A non-redex constant is any atomic constant other than the basic combinators. A non-redex atom is a variable or non-redex constant. A closed term is a term containing no variables. A combinator is a closed term containing no atomic constants other than the basic combinators.

If the sequence of atomic constants is empty (besides the basic combinators), the system is called pure. Otherwise it is called applied.

%%ANKI Basic Who is usually attributed the creation of combinatory logic? Back: Moses Schönfinkel. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic How many variables exist in a combinatory logic system? Back: An infinite number. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic How many atomic constants exist in a combinatory logic system? Back: The basic combinators plus zero or more. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What distinguishes variables and atomic constants in a combinatory logic system? Back: The latter is meant to refer to constants outside the formal system. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What two classes of expressions does an "atom" potentially refer to in a combinatory logic system? Back: Variables and atomic constants. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What general term refers to both variables and atomic constants in a combinatory logic system? Back: Atoms. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic Why are variables and atomic constants called "atoms" in a combinatory logic system? Back: They are not composed of smaller CL-terms. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic When is a combinatory logic system considered pure? Back: When there exist no atomic constants in the system (besides the basic combinators). Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic When is a combinatory logic system considered applied? Back: When there exists at least one atomic constant in the system (besides the basic combinators). Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Cloze A combinatory logic system is either {pure} or {applied}. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What term(s) correspond to the base case of the CL-term definition? Back: The atoms. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What term(s) correspond to the inductive case of the CL-term definition? Back: For CL-terms X and Y, (XY) is a CL-term. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic Consider CL-term (S0). Is our combinatory logic system pure or applied? Back: Applied. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic Consider CL-term (SS). Is our combinatory logic system pure or applied? Back: Indeterminate. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What atomic constants are permitted in a pure combinatory logic system? Back: Just the basic combinators. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What variables are permitted in a pure combinatory logic system? Back: Any. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What atomic constants are permitted in an applied combinatory logic system? Back: Any. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What variables are permitted in an applied combinatory logic system? Back: Any. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What atoms are permitted in a pure combinatory logic system? Back: All variables and the basic combinators. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What atoms are permitted in an applied combinatory logic system? Back: Any. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What are the non-redex constants in a combinatory logic system? Back: Any atomic constant other than the basic combinators. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What are the redex constants in a combinatory logic system? Back: The basic combinators. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What are the non-redex atoms in a combinatory logic system? Back: Any variable or non-redex constant. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What are the redex atoms in a combinatory logic system? Back: The basic combinators. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What distinguishes non-redex constants from non-redex atoms? Back: The latter also refer to variables. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic Which of non-redex constants or atoms is more general? Back: The non-redex atoms. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic In a combinatory logic system, what is a closed term? Back: A CL-term with no variables. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic In a combinatory logic system, what is a combinator? Back: A closed term with no atomic constants. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic In a pure combinatory logic system, what distinguishes closed terms from combinators? Back: N/A. They are equivalent. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic In an applied combinatory logic system, what distinguishes closed terms from combinators? Back: Closed terms are permitted to have atomic constants other than the basic combinators. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic Is CL-term (\mathbf{S}0) a closed term? Back: Yes. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic Is CL-term (\mathbf{S}x) a closed term? Back: No, assuming x is a variable. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic Is CL-term (\mathbf{S}0) a combinator? Back: No. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic Is CL-term (\mathbf{S}x) a combinator? Back: No. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic In what kind of combinator logic are closed terms equivalent to combinators? Back: Pure systems. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Cloze A {1:CL}-term is to {2:combinatory logic} whereas a {2:\lambda}-term is to {1:\lambda-calculus}. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What are the non-redex constants in CL-term (((\mathbf{SK})((\mathbf{SK})(x)))(\mathbf{I}0))? Back: Just 0. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What are the redex constants in CL-term (((\mathbf{SK})((\mathbf{SK})(x)))(\mathbf{I}0))? Back: Each \mathbf{S}, \mathbf{K}, and \mathbf{I}. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What are the non-redex atoms in CL-term (((\mathbf{SK})((\mathbf{SK})(x)))(\mathbf{I}0))? Back: x and 0. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What are the redex atoms in CL-term (((\mathbf{SK})((\mathbf{SK})(x)))(\mathbf{I}0))? Back: Each \mathbf{S}, \mathbf{K}, and \mathbf{I}. Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

Basic Combinators

The combinatory logic is a notation that eliminate the need for quantified variables. We start with basis \mathbf{S}, \mathbf{K}, and \mathbf{I}. These basic combinators are defined as:

  • \mathbf{S} (the starling); (\mathbf{S}(f, g))(x) = f(x, g(x))
  • \mathbf{K} (the kestrel); (\mathbf{K}(a))(x) = a
  • \mathbf{I} (the idiot bird); \mathbf{I}(f) = f

%%ANKI Basic How is the \mathbf{S} combinator defined? Back: As (\mathbf{S}(f, g))(x) = f(x, g(x)). Reference: Hindley, J Roger, and Jonathan P Seldin. Lambda-Calculus and Combinators, an Introduction, n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What name does Smullyan give the \mathbf{S} combinator? Back: The starling. Reference: Smullyan, Raymond M. To Mock a Mockingbird. Oxford: Oxford university press, 2000.

END%%

%%ANKI Basic How is the starling combinator defined? Back: As (\mathbf{S}(f, g))(x) = f(x, g(x)). Reference: Smullyan, Raymond M. To Mock a Mockingbird. Oxford: Oxford university press, 2000.

END%%

%%ANKI Basic How is the \mathbf{K} combinator defined? Back: As (\mathbf{K}(a))(x) = a. Reference: Hindley, J Roger, and Jonathan P Seldin. Lambda-Calculus and Combinators, an Introduction, n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What name does Smullyan give the \mathbf{K} combinator? Back: The kestrel. Reference: Smullyan, Raymond M. To Mock a Mockingbird. Oxford: Oxford university press, 2000.

END%%

%%ANKI Basic How is the kestrel combinator defined? Back: As (\mathbf{K}(a))(x) = a. Reference: Smullyan, Raymond M. To Mock a Mockingbird. Oxford: Oxford university press, 2000.

END%%

%%ANKI Basic How is the \mathbf{I} combinator defined? Back: As I(f) = f. Reference: Hindley, J Roger, and Jonathan P Seldin. Lambda-Calculus and Combinators, an Introduction, n.d. https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf.

END%%

%%ANKI Basic What name does Smullyan give the \mathbf{I} combinator? Back: The idiot bird. Reference: Smullyan, Raymond M. To Mock a Mockingbird. Oxford: Oxford university press, 2000.

END%%

%%ANKI Basic How is the idiot bird combinator defined? Back: As I(f) = f. Reference: Smullyan, Raymond M. To Mock a Mockingbird. Oxford: Oxford university press, 2000.

END%%

Bibliography