Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Free variables and bound variables

From Wikipedia, the free encyclopedia
Concept in mathematics or computer science
For bound variables in computer programming, seeName binding.
For free variables in systems of linear equations, seeFree variables (system of linear equations).
"Free variable" redirects here; not to be confused withFree parameter orDummy variable (statistics).
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Free variables and bound variables" – news ·newspapers ·books ·scholar ·JSTOR
(December 2008) (Learn how and when to remove this message)

Inmathematics, and in other disciplines involvingformal languages, includingmathematical logic andcomputer science, a variable may be said to be either free or bound. Some older books use the termsreal variable andapparent variable forfree variable andbound variable, respectively. Afree variable is anotation (symbol) that specifies places in anexpression wheresubstitution may take place and is not a parameter of this or any container expression. The idea is related to aplaceholder (asymbol that will later be replaced by some value), or awildcard character that stands for an unspecified symbol.

Incomputer programming, the term free variable refers tovariables used in afunction that are neitherlocal variables norparameters of that function. The termnon-local variable is often a synonym in this context.

An instance of a variable symbol isbound, in contrast, if the value of that variable symbol has been bound to a specific value or range of values in thedomain of discourse oruniverse. 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, "...wheren{\displaystyle n} is a positive integer".) A variable symbol overall isbound if at least one occurrence of it is bound.[1] 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]: 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 animage 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:

yx(x=y){\displaystyle \forall y\,\exists x\,\left(x={\sqrt {y}}\right)}

This expression evaluates tofalse if thedomain ofx{\displaystyle x} andy{\displaystyle y} is thereal numbers, buttrue if the domain is thecomplex 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 ofdummy variable as used in statistics, most commonly inregression 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:
k=110f(k,n),{\displaystyle \sum _{k=1}^{10}f(k,n),}
n{\displaystyle n} is a free variable andk{\displaystyle k} is a bound variable; consequently the value of this expression depends on the value ofn{\displaystyle n}, but there is nothing calledk{\displaystyle k} on which it could depend.
  • In the expression:
0xy1exdx,{\displaystyle \int _{0}^{\infty }x^{y-1}e^{-x}\,dx,}
y{\displaystyle y} is a free variable andx{\displaystyle x} is a bound variable; consequently the value of this expression depends on the value ofy{\displaystyle y}, but there is nothing calledx{\displaystyle x} on which it could depend.
  • In the expression:
limh0f(x+h)f(x)h,{\displaystyle \lim _{h\rightarrow 0}{\frac {f(x+h)-f(x)}{h}},}
x{\displaystyle x} is a free variable andh{\displaystyle h} is a bound variable; consequently the value of this expression depends on the value ofx{\displaystyle x}, but there is nothing calledh{\displaystyle h} on which it could depend.
  • In the expression:
x y [φ(x,y,z)],{\displaystyle \forall x\ \exists y\ {\Big [}\varphi (x,y,z){\Big ]},}
z{\displaystyle z} is a free variable andx{\displaystyle x} andy{\displaystyle y} are bound variables, associated withlogical quantifiers; consequently thelogical value of this expression depends on the value ofz{\displaystyle z}, but there is nothing calledx{\displaystyle x} ory{\displaystyle y} on which it could depend.

In proofs

[edit]

In a broader context, bound variables are fundamental to the structure ofmathematical proofs. For example, the following proof shows that the square of any positive eveninteger is divisible by 4:

Letn{\displaystyle n} be an arbitrary positive even integer. By definition, there exists an integerk{\displaystyle k} such thatn=2k{\displaystyle n=2k}. Substituting this into the expression for the square givesn2=(2k)2=4k2{\displaystyle n^{2}=(2k)^{2}=4k^{2}}. Sincek{\displaystyle k} is an integer,k2{\displaystyle k^{2}} is also an integer. Therefore,n2{\displaystyle n^{2}} is divisible by 4.

In this proof, bothn{\displaystyle n} andk{\displaystyle k} function as bound variables, but they are bound in different ways.[3]

The variablen{\displaystyle n} is introduced as anarbitrary but particular element of a set. The statement "Letn{\displaystyle n} be..." implicitly functions as auniversal quantifier, bindingn{\displaystyle n} for the scope of the proof. The proof establishes a property for this single, arbitraryn{\displaystyle n}, which licenses the general conclusion that the property holds for all positive even integers.[4]

The variablek{\displaystyle k}, on the other hand, is bound by anexistential quantifier ("there exists an integerk{\displaystyle k}"). It is introduced to represent a specific, though unnamed, integer whose existence is guaranteed by the definition ofn{\displaystyle n} being even. The scope ofk{\displaystyle k} is limited to the reasoning that follows its introduction.[5]

Thus, neither variable is free; their meaning is entirely determined by their role within the logical structure of the proof.

Variable-binding operators

[edit]

Inmathematics andlogic, a number of symbols function asvariable-binding operators. These operators take afunction or an open formula as an argument and bind a free variable within that expression to a specificdomain or range of values, creating a new expression whose meaning does not depend on the bound variable.[6]

Common variable-binding operators include:

xSf(x)xSf(x){\displaystyle \sum _{x\in S}f(x)\quad \quad \quad \prod _{x\in S}f(x)}
abf(x)dxlimxcf(x){\displaystyle \int _{a}^{b}f(x)\,dx\quad \quad \lim _{x\to c}f(x)}
x,P(x)x,P(x){\displaystyle \forall x,P(x)\quad \quad \quad \exists x,P(x)}

In each case, the variablex is bound within the expression that follows the operator (e.g.,f(x){\displaystyle f(x)} orP(x){\displaystyle P(x)}). Many of these operators act on a function of the bound variable. While standard notation is often sufficient, complex expressions withnested operators can become ambiguous, particularly if the same variable name is reused. This can lead to a problem known asvariable capture, where a variable intended to be free is incorrectly bound by an operator in a different scope.[7]

To avoid such ambiguity, it can be useful to switch to a notation that makes the binding explicit, treating the operators ashigher-order functions. This approach, rooted in the principles oflambda calculus, clearly separates the function being operated on from the operator itself.[8]

For example:

{1,,10}(kf(k,n)){\displaystyle \sum _{\{1,\ldots ,10\}}(k\mapsto f(k,n))}

Here, the operatorSf{\displaystyle \sum _{S}f} applies to the setS and the functionf.

  • Thederivative operator can also be represented clearly as taking a function as its argument:
D(xx2+2x+1){\displaystyle D(x\mapsto x^{2}+2x+1)}

This notation clarifies that the operatorD{\displaystyle D} is applied to the entire functionxx2+2x+1{\displaystyle x\mapsto x^{2}+2x+1}, rather than just an expression in whichx{\displaystyle x} happens to be a variable.

Formal explanation

[edit]
Tree summarizing the syntax of the expressionx((yA(x))B(z)){\displaystyle \forall x\,((\exists y\,A(x))\vee B(z))}

Variable-binding mechanisms occur in different contexts in mathematics, logic and computer science. In all cases, however, they are purelysyntactic properties of expressions and variables in them. For this section we can summarize syntax by identifying an expression with atree 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 anin-order traversal of the tree. Variable-binding operators arelogical operators that occur in almost every formal language. A binding operatorQ{\displaystyle Q} takes two arguments: a variablev{\displaystyle v} and an expressionP{\displaystyle P}, and when applied to its arguments produces a new expressionQ(v,P){\displaystyle Q(v,P)}. The meaning of binding operators is supplied by thesemantics of the language and does not concern us here.

Variable binding relates three things: a variablev{\displaystyle v}, a locationa{\displaystyle a} for that variable in an expression and a non-leaf noden{\displaystyle n} of the formQ(v,P){\displaystyle Q(v,P)}. It worth noting that we define a location in an expression as a leaf node in the syntax tree. Variable binding occurs when that location is below the noden{\displaystyle n}.

In thelambda calculus,x is a bound variable in the termM = λx. T and a free variable in the termT. We sayx is bound inM and free inT. IfT contains a subtermλx. U thenx is rebound in this term. This nested, inner binding ofx is said to "shadow" the outer binding. Occurrences ofx inU are free occurrences of the newx.[9]

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 arecursive function is also technically a free variable within its own body but is treated specially.

Aclosed term is one containing no free variables.

Function definition and operators as binders

[edit]

A clear example of a variable-binding operator from mathematics isfunction definition. An expression that defines a function, such as the right-hand side of:

f=[(x1,,xn)t],{\displaystyle f=\left[(x_{1},\ldots ,x_{n})\mapsto t\right]\,,}

binds the variablesx1,,xn{\displaystyle x_{1},\ldots ,x_{n}}. The expressiont{\displaystyle t}, which forms the body of the function, may contain some, all, or none of the variablesx1,,xn{\displaystyle x_{1},\ldots ,x_{n}}, which are its formal parameters. Any occurrence of these variables withint{\displaystyle t} is bound by the function definition. The bodyt{\displaystyle t} may also contain other variables, which would be considered free variables whose values must be determined from a wider context.[6]

The expression[(x1,,xn)t]{\displaystyle \left[(x_{1},\ldots ,x_{n})\mapsto t\right]} is directly analogous to lambda expressions inlambda calculus, where theλ{\displaystyle \lambda } symbol is the fundamental variable-binding operator. For instance, the function definition(xx2){\displaystyle (x\mapsto x^{2})} is equivalent to the lambda abstractionλx.x2{\displaystyle \lambda x.x^{2}}.[8]

The same definition, binding the function being defined to the namef{\displaystyle f}, is more commonly written in mathematical texts in the form

f(x1,,xn)=t.{\displaystyle f(x_{1},\ldots ,x_{n})=t\,.}

Other mathematical operators can be understood ashigher-order functions that bind variables. For example, thesummation operator,Σ{\displaystyle \Sigma }, can be analyzed as an operator that takes a function and a set to evaluate that function over. The expression:

xSx2{\displaystyle \sum _{x\in S}{x^{2}}}

binds the variablex within the termx2{\displaystyle x^{2}}. The scope of the binding is the term that follows the summation symbol. This expression can be treated as a more compact notation for:

S(xx2){\displaystyle \sum _{S}{(x\mapsto x^{2})}}

Here,Sf{\displaystyle \sum _{S}{f}} is an operator with two parameters: a one-parameter functionf{\displaystyle f} (in this case,xx2{\displaystyle x\mapsto x^{2}}) and a setS{\displaystyle S} to evaluate that function over.

Other operators can be expressed in a similar manner. Theuniversal quantifierxS,P(x){\displaystyle \forall x\in S,P(x)} can be understood as an operator that evaluates to thelogical conjunction of theBoolean-valued functionP{\displaystyle P} applied to each element in the (possibly infinite) setS{\displaystyle S}. Likewise, theproduct operator ({\textstyle \prod }), thelimit operator (limn{\displaystyle \lim _{n\to \infty }}), and theintegral operator (abf(x)dx{\displaystyle \int _{a}^{b}f(x)\,dx}) all function as variable binders, binding the variablesn{\displaystyle n} andx{\displaystyle x} respectively over a specified domain.[10]

Natural language

[edit]

When analyzed through the lens offormal semantics,natural languages exhibit a system of variable binding that is analogous to what is found informal logic andcomputer science.[11] This system governs how referring expressions, particularlypronouns, are interpreted within a sentence or discourse.[12]

Pronouns as free variables

[edit]

In English,personal pronouns such ashe,she,they, and their variants (e.g.,her,him) can function asfree variables.[13] A free variable is a term whosereferent 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).[14]

Consider the following sentence:

Lisa found her book.

Thepossessive pronounher is a free variable. Its interpretation is flexible; it can refer toLisa, an entity within the sentence, or to some other female individual salient in the context of the utterance.[12] This ambiguity leads to two primary interpretations, which can be formally represented using co-indexing subscripts.[15] An identical subscript indicatescoreference, while different subscripts signal that the expressions refer to different entities.

  1. Lisai foundheri 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 itsantecedent.)
  2. Lisai foundherj 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 andSwedish use the reflexive possessivesin for the coreferential reading (heri) and a non-reflexive form likehennes (in Swedish) for the non-coreferential reading (herj).[16]

While English does not have this explicit distinction in its standard pronouns, it can force a coreferential reading by using the emphatic possessiveown.[17]

  • Lisai foundheri own book. (Coreference is required)
  • *Lisai foundherj own book. (This interpretation is ungrammatical)

Anaphors as bound variables

[edit]

In contrast to personal pronouns,reflexive pronouns (e.g.,himself,herself,themselves) andreciprocal pronouns (e.g.,each other) act asbound variables, also known in linguistics asanaphors.[15] A bound variable is an expression that must be co-indexed with, andc-commanded by, an antecedent within a specific syntactic domain.[15]

Consider the sentence:

Jane hurt herself.

The reflexive pronounherself must refer to the subject of the clause,Jane. It cannot refer to any other individual.[12] This obligatory coreference is a hallmark of a bound variable.

  • Janei hurtherselfi. (Grammatical interpretation:herself =Jane)
  • *Janei hurtherselfj. (Ungrammatical interpretation:herselfJane)

This binding relationship can be formally captured using a lambda expression, a tool fromlambda calculus used in formal semantics to model function abstraction and application.[18] The sentence can be represented as:

(λx.x hurt x)(Jane)

In this notation:

  • λx is the lambda operator that binds the variablex.
  • x hurt x is thepredicate, 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.[18]

Binding theory

[edit]

The distinct behavior of pronouns and anaphors is systematically explained by thebinding theory, a central component of Noam Chomsky'sGovernment and Binding Theory.[15] This theory proposes three principles that govern the interpretation of different types ofnoun phrases:

  • Principle A: An anaphor (reflexive, reciprocal) must be bound in its governing category (roughly, the localclause).[15] This explains whyherself in "Jane hurt herself" must be bound byJane.
  • Principle B: A pronoun must be free in its governing category.[15] This explains why a personal pronoun often cannot be bound by a local antecedent. For example, in "Ashley hit her," the pronounher cannot refer toAshley.[19]
    • *Ashleyi hitheri. (Ungrammatical due to Principle B)
    • Ashleyi hitherj. (Grammatical;her refers to someone other than Ashley)
  • Principle C: AnR-expression (a referring expression like a proper name, e.g.,Jane, or a definite description, e.g.,the woman) must be free everywhere.[15] This prevents an R-expression from being co-indexed with a c-commanding pronoun, as in *Hei said thatJohni was tired*.[20]

Quantificational noun phrases

[edit]

The concept of variable binding is essential for understandingquantificationalnoun phrases (QNPs), such asevery student,some politician, orno one.[18] Unlike proper names, these phrases do not refer to a specific entity. Instead, they express a quantity over a set of individuals.[18] A QNP can bind a pronoun that falls within itsscope, making the pronoun a bound variable.

Every studenti thinks hei is smart.

In this sentence, the pronounhe is most naturally interpreted as a bound variable.[21] 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 studentx{\displaystyle x},x{\displaystyle x} thinks thatx{\displaystyle x} is smart. In syntactic theories, this is often analyzed via a process ofquantifier raising (QR), where the QNP moves at the abstract syntactic level oflogical form to a position where it c-commands and binds the pronoun.[21]

Wh-questions and relative clauses

[edit]

Variable binding is also central to the analysis ofwh-movement, which occurs in the formation of questions andrelative clauses.[22]Wh-words likewho,what, andwhich function as operators that bind a variable in the main clause.[23]

  • Question: Whoi does John liketi?
  • Relative Clause: The man [whoi Mary sawti] is my brother.

In these structures, thewh-word is said to move from an underlying position, leaving behind a "trace"(t){\displaystyle (t)}, which is treated as a bound variable.[15] The meaning of the question can be paraphrased as "For which personx{\displaystyle x}, does John likex{\displaystyle x}?".[18] Similarly, the relative clause denotes a set of individualsx{\displaystyle x} such that "Mary sawx{\displaystyle x}".[18]

Sloppy versus strict identity in ellipsis

[edit]

The distinction between free and bound variables provides a powerful explanation for certain ambiguities that arise underVP-ellipsis.[24][25] Consider the following sentence:

John loves his mother, and Bill does too.

This sentence has two distinct interpretations:

  1. Strict identity: Bill lovesJohn's mother.
  2. Sloppy identity: Bill lovesBill's mother.

This ambiguity can be explained by the status of the pronounhis in the first clause.[19]

  • Ifhis is treated as afree 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 thestrict reading.[19]
  • Ifhis is treated as abound 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 thesloppy reading.[19]

The existence of the sloppy identity reading is considered strong evidence for the psychological reality of bound variable interpretations in thegrammar ofnatural languages.[26]

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.[12]

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]

References

[edit]
  1. ^abQuine, Willard Van Orman (1982).Mathematical Logic (Revised ed.).Harvard University Press. pp. 142–143.ISBN 978-0674554511.
  2. ^Robert S. Wolf (2005)A Tour through Mathematical LogicISBN 978-0-88385-036-7
  3. ^Velleman, Daniel J. (2006).How to Prove It: A Structured Approach (2nd ed.). Cambridge: Cambridge University Press. pp. 99–103,129–131.ISBN 978-0-521-67599-4.
  4. ^Hammack, Richard (2013).Book of Proof (2nd ed.). Richmond, VA: Virginia Commonwealth University. pp. 89–92.ISBN 978-0-9894721-0-4.
  5. ^Enderton, Herbert B. (2001).A Mathematical Introduction to Logic (2nd ed.). Burlington, MA: Harcourt/Academic Press. pp. 70–73.ISBN 978-0-12-238452-3.
  6. ^abForster, Thomas (2003).Logic, Induction and Sets. Cambridge: Cambridge University Press. pp. 13–15.ISBN 978-0-521-53361-4.
  7. ^Pierce, Benjamin C. (2002).Types and Programming Languages. Cambridge, MA: MIT Press. pp. 59–62.ISBN 978-0-262-16209-8.
  8. ^abBarendregt, Hendrik P. (1984).The Lambda Calculus: Its Syntax and Semantics. Amsterdam: North-Holland. pp. 26–28.ISBN 978-0-444-87508-2.
  9. ^Thompson 1991, p. 33.
  10. ^Frege, Gottlob (1893). "§8–10".Grundgesetze der Arithmetik [Basic Laws of Arithmetic] (in German). Vol. I. Jena: Verlag Hermann Pohle.
  11. ^Heim, Irene; Kratzer, Angelika (1998).Semantics in Generative Grammar. Malden, MA: Blackwell. pp. 93–125.ISBN 978-0-631-19713-3.
  12. ^abcdBüring, Daniel (2005).Binding Theory. Cambridge Textbooks in Linguistics. Cambridge:Cambridge University Press. pp. 1–4.ISBN 9780521812801.
  13. ^In the terminology of Heim and Kratzer (1998), pronouns that are not bound are associated with an assignment functiong provided by the context, which assigns them a referent. SeeHeim, Irene; Kratzer, Angelika (1998).Semantics in Generative Grammar. Malden, MA: Blackwell. p. 243.ISBN 978-0-631-19713-3.
  14. ^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 (inactive 5 August 2025).{{cite journal}}: CS1 maint: DOI inactive as of August 2025 (link)
  15. ^abcdefghChomsky, Noam (1981).Lectures on Government and Binding. Dordrecht: Foris Publications. p. 188.ISBN 90-70176-28-9.
  16. ^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.
  17. ^Reinhart, Tanya; Reuland, Eric (1993). "Reflexivity".Linguistic Inquiry.24 (4):657–720.JSTOR 4178843.
  18. ^abcdefHeim, Irene; Kratzer, Angelika (1998).Semantics in Generative Grammar. Malden, MA: Blackwell. pp. 184–186.ISBN 978-0-631-19713-3.
  19. ^abcdReinhart, Tanya (2016).Anaphora and Semantic Interpretation. London: Routledge.ISBN 9781134993604.
  20. ^Lasnik, Howard (1989).Essays on Anaphora. Studies in Natural Language and Linguistic Theory. Vol. 16. Dordrecht: Springer Netherlands. pp. 100–104.ISBN 9781556080906.
  21. ^abMay, Robert (1985).Logical Form: Its Structure and Derivation. Linguistic inquiry monographs. Vol. 12. Cambridge, MA:MIT Press. pp. 64–70.ISBN 9780262631020.
  22. ^Haegeman, Liliane (1994).Introduction to Government and Binding Theory (2nd ed.). Oxford: Blackwell. pp. 395–400.ISBN 978-0-631-19067-7.
  23. ^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.
  24. ^Sag, Ivan (1976).Deletion and Logical Form. MIT dissertation.
  25. ^Williams, Edwin S. (1977)."Discourse and Logical Form".Linguistic Inquiry.8 (1):101–39.JSTOR 4177974 – via JSTOR.
  26. ^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.

Further reading

[edit]
Precalculus
Limits
Differential calculus
Integral calculus
Vector calculus
Multivariable calculus
Sequences and series
Special functions
and numbers
History of calculus
Lists
Integrals
Miscellaneous topics
Retrieved from "https://en.wikipedia.org/w/index.php?title=Free_variables_and_bound_variables&oldid=1317994414"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp