Questions tagged [variable-binding]
40 questions
34
votes
5 answers
How do computers remember where they store things?
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
- 451
- 1
- 4
- 6
16
votes
0 answers
Barendregt's Variable Convention: what does it mean?
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 variables.
This convention appears a lot in papers…
alim
- 1,044
- 7
- 24
10
votes
1 answer
What is the difference between assignment, valuation and name binding?
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, which was not assigned a value whereas bound…
Val
- 857
- 6
- 16
6
votes
2 answers
Free and bound variables
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 to me as var is bounded in both fn1 and fn2. But the…
Totoro
- 184
- 4
5
votes
2 answers
Is the $x$ in $\frac{\mathrm{d}}{\mathrm{d}x}$ a symbol in the sense of Harper's PFPL?
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 denominator bind the $x$ in $y$? (Clearly no, since…
Michael Bächtold
- 171
- 6
5
votes
0 answers
Characterization of alpha-equivalence in languages with bindings
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 $P = \lambda x. \lambda y. x y$ then we have $P[x…
Sven Williamson
- 265
- 1
- 6
5
votes
2 answers
How do I interpret the wording of this passage about abstract binding trees from the book Practical Foundations of Programming Languages
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 under the conditions
If $x \in \mathcal{X}_s$, then…
afsmi
- 307
- 1
- 6
5
votes
2 answers
what is variable capture in nominal logic?
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,
name-binding, name-swapping, and freshness of…
alim
- 1,044
- 7
- 24
5
votes
4 answers
What are differences between Static Scope and Dynamic Scope?
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 2 3 4.
void fun1(void);
void fun2(void);
int a = 1, b = 2, c = 3;
int main() {
c = 4;
fun1();
…
Maryam Panahi
- 391
- 1
- 3
- 12
5
votes
2 answers
Static scope and dynamic scope
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 hypothetical programming environment, what are the…
mellartach
- 81
- 1
- 5
4
votes
1 answer
Is There a Programming Language That Embraces Globals?
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 context dependent. Technologies like JIT compilation…
James Bowery
- 396
- 2
- 10
3
votes
1 answer
what are Structural recursion, primitive recursion, recursion combinator and recursion principles?
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 recursion occurs when a function appears within its…
alim
- 1,044
- 7
- 24
3
votes
2 answers
Is there a formal term for functions that have static state across executions?
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:
var adder = (function(){
var a = 0;
return function(i){
a += i;
return a;
}…
Kit Sunde
- 131
- 3
3
votes
0 answers
Lemma relating variable substitution to de Bruijn substitution
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 using the algorithm given in Functional Pearls:…
Josh Grosso
- 183
- 7
3
votes
0 answers
Semantics of "write-once" variables for complex data structures
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 name for this concept, with references to a language…
phipsgabler
- 370
- 1
- 9