Skip to main content

Questions tagged [variable-binding]

Filter by
Sorted by
Tagged with
1 vote
1 answer
337 views

In order to find the recurrence formula for the number of λ-terms of a given size, we make use of the representation of variables in λ-terms by de Bruijn indices. Recall that a de Bruijn index is a ...
Julius Hamilton's user avatar
0 votes
1 answer
164 views

From the wikipedia of Free variables and bound variables In computer programming, the term free variable refers to variables used in a function that are neither local variables nor parameters of that ...
tbhaxor's user avatar
  • 208
1 vote
2 answers
124 views

i can't seem to find much info on the following question: how (if at all) is the fixing of names to values (by binding or assignment) possible in a purely functional system like the lambda calculus? i'...
elsewho's user avatar
  • 11
2 votes
1 answer
59 views

I am currently reading the Crafting Interpreter book and I have a question about the Resolving and Binding chapter The author gave this example to illustrate the problem with the implementation at ...
Finlay Weber's user avatar
2 votes
0 answers
106 views

In lambda calculus, $\lambda xy.\phi$ isn't in general equivalent to $\lambda yx.\phi$. However, it seems possible to imagine a calculus which replaces application with something like specification, ...
SEC's user avatar
  • 241
1 vote
0 answers
336 views

Trying to wrap my head around lambda calculus but am really clueless right now. First of all, I'm really confused WHAT it's actually supposed to be. I've found these definitions: Lambda calculus (...
bcgvvc2's user avatar
  • 19
1 vote
0 answers
124 views

I'm new in programming, I'm currently studying programming languages. I'm trying to implement Shallow Binding with static scope, starting from an abstract syntax (producing a programming language ...
Alexander Pisanoff's user avatar
1 vote
1 answer
187 views

I am having a hard time understanding the concept of what attributes get bound statically instead of dynamically. Below is code and from that code, what gets bound statically? Here is an example (In ...
Zaneisop's user avatar
  • 113
3 votes
0 answers
146 views

Notation: Let $t$ and $u$ be terms in the $\lambda$-calculus, and $x$ be a variable name. Let $[x\mapsto u]t$ be the substitution in $t$ of free variable $x$ for the term $u$. Specifically, I'm ...
Josh Grosso's user avatar
0 votes
1 answer
372 views

Because of the existence of free variables in lambda calculus, the evaluation of open terms (at least as outlined here) is more complicated relative to the evaluation of closed terms since the ...
nicoty's user avatar
  • 111
0 votes
0 answers
61 views

I wonder if there is a formal definition of lexical scope so that people can prove things with respect to it, for example, that an interpreter implements lexical scope. You may ask what level of ...
beroal's user avatar
  • 781
3 votes
0 answers
130 views

Question My use case for what is described below is not a language or compiler implementation, but finding a reasonable semantics for this feature in a an abstract calculus. Ideally, you give me a ...
phipsgabler's user avatar
3 votes
1 answer
479 views

I am trying to understand the difference of assignment, binding, and substitution. I know the three things are related, but to me it's not exactly clear what word refers to what. Example, illustration,...
Vincent's user avatar
  • 221
0 votes
2 answers
63 views

Let's assume I have the following code: declaration of a declaration of b ..a..b { ..a..b declaration of a declaration of b ..a } In this code {} ...
Crazy_39365's user avatar
1 vote
0 answers
109 views

I have this example code, which is an undefined language. We want to know what will be printed if we use static versus dynamic scope. ...
Addem's user avatar
  • 387
2 votes
1 answer
106 views

The hash function should be invariant under alpha-renaming. Using de Bruijn notation seems to be possible, but it requires alpha-converting the whole tree when a binding is created, and has the ...
Trebor's user avatar
  • 230
3 votes
2 answers
274 views

So, using Church numerals, we define $3 = {\lambda} f. {\lambda}x.f(f(f(x)))$, and $4 = {\lambda} f. {\lambda}x.f(f(f(f(x))))$. We can then add with an expression like $3\ g\ (4\ g\ z)$ And ...
Ben I.'s user avatar
  • 1,730
0 votes
1 answer
43 views

I am trying to solve a referee assignment problem, but I simply can't think of a way to relate my variable to one of the parameters, and I hope that someone in here can help. I have the following ...
Niko24's user avatar
  • 45
5 votes
2 answers
456 views

The role of $x$ in $\frac{\mathrm{d}}{\mathrm{d}x} y$ not only confuses my calculus students, it has also puzzled some well known mathematicians. Questions one might ask are: Does the $x$ in the ...
Michael Bächtold's user avatar
2 votes
1 answer
166 views

From Programming Language Pragmatics by Scott, Figure 3.14 Deep binding in Python. At right is a conceptual view of the run-time stack. Referencing environments captured in closures are shown as ...
Tim's user avatar
  • 5,045
3 votes
1 answer
552 views

Recently, I encountered terminologies such as primitive recursion and recursion combinator. One of the sources is here link I googled and read some, but missing the points of them. I know that ...
alim's user avatar
  • 1,034
1 vote
2 answers
535 views

I am currently reading the book "An Introduction to Functional Programming through Lambda Calculus" (the 2011 edition) and am a bit puzzled by the definitions of free and bound variables ...
G_H's user avatar
  • 273
5 votes
0 answers
201 views

Following up on this post denoting $(x \leftrightarrow y)$ the permutation of $x$ and $y$ and $P[x \leftrightarrow y]$ the term obtained from the term $P$ by permuting $x$ and $y$ (so for example if $...
Sven Williamson's user avatar
16 votes
0 answers
3k views

Barendregt's Variable Convention: If $M_1,...,M_n$ occur in a certain mathematical context (e.g. definition, proof), then in these terms all bound variables are chosen to be different from the free ...
alim's user avatar
  • 1,034
1 vote
1 answer
189 views

What would be the problem of running the following scala codes assuming we are working with dynamic scoping and a global stack to store environments as some variants of Lisp do? ...
user1868607's user avatar
  • 2,252
5 votes
2 answers
530 views

On page 7/8, section 1.2, of Practical Foundations of Programming Languages, 2nd edition, Robert Harper gives this initial definition of abstract binding trees: The smallest family of sets closed ...
afsmi's user avatar
  • 307
5 votes
2 answers
2k views

While reading a paper Nominal Unification from a Higher-Order Perspective, in the abstract I noticed something feel bit confusing, Nominal Logic is an extension of first-order logic with equality, ...
alim's user avatar
  • 1,034
34 votes
5 answers
12k views

When a computer stores a variable, when a program needs to get the variable's value, how does the computer know where to look in memory for that variable's value?
MCMastery's user avatar
  • 451
5 votes
4 answers
16k views

My teacher has provided the following pseudo-code, and says that the output using static scope is 1 2 3, but the output using dynamic scope is ...
Maryam Panahi's user avatar
3 votes
2 answers
105 views

Two examples, one in PHP: function adder($i){ static $a = 0; $a += $i; return $a; } A similar effect can be achieved with closures in javascript: ...
Kit Sunde's user avatar
  • 131
2 votes
2 answers
2k views

Suppose I define a global variable and I define an automatic variable within a function definition with the same name as the aforementioned global variable. What would happen to the global variable ...
Ryan J. Shrott's user avatar
10 votes
1 answer
5k views

I read that Name binding assigns some value (data/code/expression) to an identifier. Assignment and valuation seem to do the same thing. It is confusing. Can I just tell that free variable is one, ...
Val's user avatar
  • 857
4 votes
1 answer
557 views

All programming languages have globally defined symbols. While best practices invariably abjure their use as mutable entities the philosophy of what is mutable and what is not mutable is highly ...
James Bowery's user avatar
6 votes
2 answers
718 views

I am familiar with free and bound variables theory , but while learning I somewhere saw this lambda expression ((lambda var ((fn1 var) & (fn2 var))) argument) From what I have learned it seems ...
Totoro's user avatar
  • 184
0 votes
1 answer
313 views

I could describe JQuery as a library that allows you to easily select elements on and traverse the DOM, the DOM would be the name of the tree or organizational structure of the HTML. When you are ...
chris Frisina's user avatar
1 vote
1 answer
413 views

Given the following (arbitrary language, although I think it is close to Algol 60) program: ...
chris Frisina's user avatar
2 votes
0 answers
858 views

I'm wondering about the result of this program as I get confused when it comes to lexical scoping and dynamic scoping. ...
DucCuong's user avatar
  • 161
2 votes
1 answer
115 views

Would it be possible to apply $(\lambda x.\lambda y. x)$ to the argument $y$? It seems to me that this must not be possible as it would give a different answer if applied to a constant, call it $\...
Orest Xherija's user avatar
5 votes
2 answers
4k views

I am perpetually confused when it comes to static scoping and dynamic scoping and their differences and Wikipedia isn't of any help, so here's my question: Given the following pseudo code in a ...
mellartach's user avatar
0 votes
1 answer
278 views

For this term: $\lambda x.(f (g x))$, what are the free and bound variables? I'm confused as to how to expand this so it will be easier to see. If I expand this will it be $\lambda x. \lambda f....
user's user avatar
  • 129