Free variables and bound variables
This article needs additional citations for verification. (December 2008) |
In mathematics, and in other disciplines involving formal languages, including mathematical logic and computer science, a variable may be said to be either free or bound. Some older books use the terms real variable and apparent variable for free variable and bound variable, respectively. A free variable is a notation (symbol) that specifies places in an expression where substitution may take place and is not a parameter of this or any container expression. The idea is related to a placeholder (a symbol that will later be replaced by some value), or a wildcard character that stands for an unspecified symbol.
In computer programming, the term free variable refers to variables used in a function that are neither local variables nor parameters of that function. The term non-local variable is often a synonym in this context.
An instance of a variable symbol is bound, in contrast, if the value of that variable symbol has been bound to a specific value or range of values in the domain of discourse or universe. This may be achieved through the use of logical quantifiers, variable-binding operators, or an explicit statement of allowed values for the variable (such as, "...where is a positive integer".) A variable symbol overall is bound if at least one occurrence of it is bound.[1]pp.142--143 Since the same variable symbol may appear in multiple places in an expression, some occurrences of the variable symbol may be free while others are bound,[1]p.78 hence "free" and "bound" are at first defined for occurrences and then generalized over all occurrences of said variable symbol in the expression. However it is done, the variable ceases to be an independent variable on which the value of the expression depends, whether that value be a truth value or the numerical result of a calculation, or, more generally, an element of an image set of a function.
While the domain of discourse in many contexts is understood, when an explicit range of values for the bound variable has not been given, it may be necessary to specify the domain in order to properly evaluate the expression. For example, consider the following expression in which both variables are bound by logical quantifiers:
This expression evaluates to false if the domain of and is the real numbers, but true if the domain is the complex numbers.
The term "dummy variable" is also sometimes used for a bound variable (more commonly in general mathematics than in computer science), but this should not be confused with the identically named but unrelated concept of dummy variable as used in statistics, most commonly in regression analysis.[2]p.17
Examples
[edit]Before stating a precise definition of free variable and bound variable, the following are some examples that perhaps make these two concepts clearer than the definition would:
In the expression
n is a free variable and k is a bound variable; consequently the value of this expression depends on the value of n, but there is nothing called k on which it could depend.
In the expression
is a free variable and is a bound variable; consequently the value of this expression depends on the value of , but there is nothing called on which it could depend.
In the expression
x is a free variable and h is a bound variable; consequently the value of this expression depends on the value of x, but there is nothing called h on which it could depend.
In the expression
is a free variable and and are bound variables, associated with logical quantifiers; consequently the logical value of this expression depends on the value of , but there is nothing called or on which it could depend.
More widely, in most proofs, bound variables are used. For example, the following proof shows that all squares of positive even integers are divisible by
- Let be a positive even integer. Then there is an integer such that . Since , we have divisible by
not only k but also n have been used as bound variables as a whole in the proof.
Variable-binding operators
[edit]The following
are some common variable-binding operators. Each of them binds the variable for some set .
Many of these are operators which act on functions of the bound variable. In more complicated contexts, such notations can become awkward and confusing. It can be useful to switch to notations which make the binding explicit, such as
for sums or
for differentiation.
Formal explanation
[edit]
Variable-binding mechanisms occur in different contexts in mathematics, logic and computer science. In all cases, however, they are purely syntactic properties of expressions and variables in them. For this section we can summarize syntax by identifying an expression with a tree whose leaf nodes are variables, constants, function constants or predicate constants and whose non-leaf nodes are logical operators. This expression can then be determined by doing an inorder traversal of the tree. Variable-binding operators are logical operators that occur in almost every formal language. A binding operator Q takes two arguments: a variable v and an expression P, and when applied to its arguments produces a new expression Q(v, P). The meaning of binding operators is supplied by the semantics of the language and does not concern us here.
Variable binding relates three things: a variable v, a location a for that variable in an expression and a non-leaf node n of the form Q(v, P). Note: we define a location in an expression as a leaf node in the syntax tree. Variable binding occurs when that location is below the node n.
In the lambda calculus, x
is a bound variable in the term M = λx. T
and a free variable in the term T
. We say x
is bound in M
and free in T
. If T
contains a subterm λx. U
then x
is rebound in this term. This nested, inner binding of x
is said to "shadow" the outer binding. Occurrences of x
in U
are free occurrences of the new x
.[3]
Variables bound at the top level of a program are technically free variables within the terms to which they are bound but are often treated specially because they can be compiled as fixed addresses. Similarly, an identifier bound to a recursive function is also technically a free variable within its own body but is treated specially.
A closed term is one containing no free variables.
Function expressions
[edit]To give an example from mathematics, consider an expression which defines a function
where t is an expression. t may contain some, all or none of the x1, …, xn and it may contain other variables. In this case we say that function definition binds the variables x1, …, xn.
In this manner, function definition expressions of the kind shown above can be thought of as the variable binding operator, analogous to the lambda expressions of lambda calculus. Other binding operators, like the summation sign, can be thought of as higher-order functions applying to a function. So, for example, the expression
could be treated as a notation for the expression
where is an operator with two parameters—a one-parameter function, and a set to evaluate that function over. The other operators listed above can be expressed in similar ways; for example, the universal quantifier can be thought of as an operator that evaluates to the logical conjunction of the Boolean-valued function P applied over the (possibly infinite) set S.
Natural language
[edit]![]() | This section has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
Natural Language
[edit]When analyzed through the lens of formal semantics, natural languages exhibit a system of variable binding that is analogous to what is found in formal logic and computer science.[4] This system governs how referring expressions, particularly pronouns, are interpreted within a sentence or discourse.[5]
Pronouns as Free Variables
[edit]In English, personal pronouns such as he, she, they, and their variants (e.g., her, him) can function as free variables.[6] A free variable is a term whose referent is not determined within the immediate syntactic structure of the sentence and must be identified by the broader context, which can be either linguistic or situational (pragmatic).[7]
Consider the following sentence:
Lisa found her book.
The possessive pronoun her is a free variable. Its interpretation is flexible; it can refer to Lisa, an entity within the sentence, or to some other female individual salient in the context of the utterance.[5] This ambiguity leads to two primary interpretations, which can be formally represented using co-indexing subscripts.[8] An identical subscript indicates coreference, while different subscripts signal that the expressions refer to different entities.
- Lisai found heri book.
- (This interpretation signifies coreference, where "her" refers to Lisa. This is often called an anaphoric reading, where "her" is an anaphor and "Lisa" is its antecedent.)
- Lisai found herj book.
- (In this interpretation, "her" refers to a female individual who is not Lisa, for instance, a person named Jane who was mentioned earlier in the conversation.)
This distinction is not merely a theoretical exercise. Some languages have distinct pronominal forms to differentiate between these two readings. For example, Norwegian and Swedish use the reflexive possessive sin for the coreferential reading (heri) and a non-reflexive form like hennes (in Swedish) for the non-coreferential reading (herj).[9]
While English does not have this explicit distinction in its standard pronouns, it can force a coreferential reading by using the emphatic possessive own.[10]
- Lisai found heri own book. (Coreference is required)
- *Lisai found herj own book. (This interpretation is ungrammatical)
Anaphors as Bound Variables
[edit]In contrast to personal pronouns, reflexive pronouns (e.g., himself, herself, themselves) and reciprocal pronouns (e.g., each other) act as bound variables, also known in linguistics as anaphors.[8] A bound variable is an expression that must be co-indexed with, and c-commanded by, an antecedent within a specific syntactic domain.[8]
Consider the sentence:
Jane hurt herself.
The reflexive pronoun herself must refer to the subject of the clause, Jane. It cannot refer to any other individual.[5] This obligatory coreference is a hallmark of a bound variable.
- Janei hurt herselfi. (Grammatical interpretation: herself = Jane)
- *Janei hurt herselfj. (Ungrammatical interpretation: herself ≠ Jane)
This binding relationship can be formally captured using a lambda expression, a tool from lambda calculus used in formal semantics to model function abstraction and application.[11] The sentence can be represented as:
(λx.x hurt x)(Jane)
In this notation:
λx
is the lambda operator that binds the variable x.x hurt x
is the predicate, a function that takes an argument and states that this argument hurt itself.(Jane)
is the argument applied to the function.
The expression evaluates to "Jane hurt Jane," correctly capturing the fact that the subject and object of the verb are the same entity.[11]
Binding Theory
[edit]The distinct behavior of pronouns and anaphors is systematically explained by the Binding Theory, a central component of Noam Chomsky's Government and Binding Theory.[8] This theory proposes three principles that govern the interpretation of different types of noun phrases:
- Principle A: An anaphor (reflexive, reciprocal) must be bound in its governing category (roughly, the local clause).[8] This explains why herself in "Jane hurt herself" must be bound by Jane.
- Principle B: A pronoun must be free in its governing category.[8] This explains why a personal pronoun often cannot be bound by a local antecedent. For example, in "Ashley hit her," the pronoun her cannot refer to Ashley.[12]
- *Ashleyi hit heri. (Ungrammatical due to Principle B)
- Ashleyi hit herj. (Grammatical; her refers to someone other than Ashley)
- Principle C: An R-expression (a referring expression like a proper name, e.g., Jane, or a definite description, e.g., the woman) must be free everywhere.[8] This prevents an R-expression from being co-indexed with a c-commanding pronoun, as in *Hei said that Johni was tired*. [13]
Quantificational Noun Phrases
[edit]The concept of variable binding is essential for understanding quantificational noun phrases (QNPs), such as every student, some politician, or no one.[11] Unlike proper names, these phrases do not refer to a specific entity. Instead, they express a quantity over a set of individuals.[11] A QNP can bind a pronoun that falls within its scope, making the pronoun a bound variable.
Every studenti thinks hei is smart.
In this sentence, the pronoun he is most naturally interpreted as a bound variable.[14] Its reference co-varies with the individuals in the set denoted by "every student". The sentence does not mean that every student thinks a specific person (e.g., Peter) is smart; rather, it means that for each individual student , thinks that is smart. In syntactic theories, this is often analyzed via a process of Quantifier Raising (QR), where the QNP moves at the abstract syntactic level of Logical Form to a position where it c-commands and binds the pronoun.[14]
Wh-Questions and Relative Clauses
[edit]Variable binding is also central to the analysis of wh-movement, which occurs in the formation of questions and relative clauses.[15] Wh-words like who, what, and which function as operators that bind a variable in the main clause.[16]
- Question: Whoi does John like ti?
- Relative Clause: The man [whoi Mary saw ti] is my brother.
In these structures, the wh-word is said to move from an underlying position, leaving behind a "trace" (t), which is treated as a bound variable.[8] The meaning of the question can be paraphrased as "For which person x, does John like x?".[11] Similarly, the relative clause denotes a set of individuals x such that "Mary saw x".[11]
Sloppy vs. Strict Identity in Ellipsis
[edit]The distinction between free and bound variables provides a powerful explanation for certain ambiguities that arise under VP-ellipsis.[17][18] Consider the following sentence:
John loves his mother, and Bill does too.
This sentence has two distinct interpretations:
- Strict Identity: Bill loves John's mother.
- Sloppy Identity: Bill loves Bill's mother.
This ambiguity can be explained by the status of the pronoun his in the first clause.[12]
- If his is treated as a free variable referring to John, the elided (or "missing") verb phrase is interpreted as "loves John's mother". When this is applied to Bill, the result is the strict reading.[12]
- If his is treated as a bound variable bound by the subject of its clause (i.e., John), the verb phrase is interpreted as a lambda-abstracted property:
λx.x loves x's mother
. When this property is applied to Bill, the result is the sloppy reading.[12]
The existence of the sloppy identity reading is considered strong evidence for the psychological reality of bound variable interpretations in the grammar of natural languages.[19]
Thus, the distribution and interpretation of pronouns and other referring expressions in natural languages are not random but are governed by a sophisticated syntactic and semantic system.[5] The distinction between free and bound variables is a cornerstone of modern linguistic theory, providing the analytical tools necessary to account for coreference, quantification, question formation, and ellipsis.
See also
[edit]- Closure (computer science)
- Combinatory logic
- Lambda lifting
- Name binding
- Scope (programming)
- Scope (logic)
References
[edit]- ^ a b W. V. O. Quine (1981) Mathematical Logic, Harvard University Press ISBN 0-674-55451-5
- ^ Robert S. Wolf (2005) A Tour through Mathematical Logic ISBN 978-0-88385-036-7
- ^ Thompson 1991, p. 33.
- ^ Heim, Irene; Kratzer, Angelika (1998). Semantics in Generative Grammar. Malden, MA: Blackwell. pp. 93–125. ISBN 978-0-631-19713-3.
- ^ a b c d Büring, Daniel (2005). Binding Theory. Cambridge Textbooks in Linguistics. Cambridge: Cambridge University Press. pp. 1–4. ISBN 9780521812801.
- ^ In the terminology of Heim and Kratzer (1998), pronouns that are not bound are associated with an assignment function g provided by the context, which assigns them a referent. See Heim, Irene; Kratzer, Angelika (1998). Semantics in Generative Grammar. Malden, MA: Blackwell. p. 243. ISBN 978-0-631-19713-3.
- ^ Partee, Barbara H. (1978). "Bound variables and other anaphors". Proceedings of the 2nd Conference on Theoretical Issues in Natural Language Processing: 79–85. doi:10.3115/980228.980245.
- ^ a b c d e f g h Chomsky, Noam (1981). Lectures on Government and Binding. Dordrecht: Foris Publications. p. 188. ISBN 90-70176-28-9.
- ^ Haspelmath, Martin (2008). Haspelmath, Martin; Dryer, Matthew S.; Gil, David; Comrie, Bernard (eds.). "Chapter 105: Ditransitive Constructions". The World Atlas of Language Structures Online. Leipzig: Max Planck Institute for Evolutionary Anthropology.
- ^ Reinhart, Tanya; Reuland, Eric (1993). "Reflexivity". Linguistic Inquiry. 24 (4): 657–720. JSTOR 4178843.
- ^ a b c d e f Heim, Irene; Kratzer, Angelika (1998). Semantics in Generative Grammar. Malden, MA: Blackwell. pp. 184–186. ISBN 978-0-631-19713-3.
- ^ a b c d Reinhart, Tanya (2016). Anaphora and Semantic Interpretation. London: Routledge. ISBN 9781134993604.
- ^ Lasnik, Howard (1989). Essays on Anaphora. Studies in Natural Language and Linguistic Theory. Vol. 16. Dordrecht: Springer Netherlands. pp. 100–104. ISBN 9781556080906.
- ^ a b May, Robert (1985). Logical Form: Its Structure and Derivation. Linguistic inquiry monographs. Vol. 12. Cambridge, MA: MIT Press. pp. 64–70. ISBN 9780262631020.
- ^ Haegeman, Liliane (1994). Introduction to Government and Binding Theory (2nd ed.). Oxford: Blackwell. pp. 395–400. ISBN 978-0-631-19067-7.
- ^ Chomsky, Noam (1977). "On Wh-Movement". In Culicover, Peter W.; Wasow, Thomas; Akmajian, Adrian (eds.). Formal Syntax. New York: Academic Press. pp. 71–132. ISBN 978-0121992408.
- ^ Sag, Ivan (1976). Deletion and Logical Form. MIT dissertation.
- ^ Williams, Edwin S. (1977). "Discourse and Logical Form". MIT Press. 8 (1): 101–39 – via JSTOR.
- ^ Dalrymple, Mary; Shieber, Stuart M.; Pereira, Fernando C. N. (1991). "Ellipsis and Higher-Order Unification". Linguistics and Philosophy. 14 (4): 399–452. doi:10.1007/BF00627759.
- Thompson, Simon (1991). Type theory and functional programming. Wokingham, England: Addison-Wesley. ISBN 0201416670. OCLC 23287456.
- Wolf, Robert S. (2005). A Tour through Mathematical Logic. Vol. 30. Mathematical Association of America. ISBN 978-0-88385-042-8. JSTOR 10.4169/j.ctt5hh94h.
Further reading
[edit]- Gowers, Timothy; Barrow-Green, June; Leader, Imre, eds. (2008). The Princeton Companion to Mathematics. Princeton, New Jersey: Princeton University Press. pp. 15–16. doi:10.1515/9781400830398. ISBN 978-0-691-11880-2. JSTOR j.ctt7sd01. LCCN 2008020450. MR 2467561. OCLC 227205932. OL 19327100M. Zbl 1242.00016.