<p>Looking around on google, I couldn't find much on this topic at all. However, I did find <a href="https://arxiv.org/pdf/1601.03354v1.pdf" rel="nofollow noreferrer">this thesis</a> on arxiv, which I believe addresses this problem, albeit in a semi-roundabout way. As the author states in the conclusion</p>

<blockquote>
  <p>The goal of this work was to discover namespaces in mathematical notation
  given a collection of documents with mathematical formulae. This
  problem could not be performed manually: this task it too time consuming
  and requires a lot of effort. <br>
  To achieve the goal we proposed an automatic method based on cluster
  analysis. We noted that document representation in terms of identifiers is
  similar to the classic Vector Space Model. This allowed us to apply traditional document clustering techniques to the namespace discovery problem.</p>
</blockquote>

<p>So cluster analysis seems to be something to look into here.</p>

<p>Hope this helps; I'll keep looking around for other resources.</p>

CC BY-SA 3.0
2016-12-21T08:18:15.703Z
If you need to Google the answer, and then you find something at random, but you're not reallty sure, do you think you should be answering the question?
Andrej Bauer
CC BY-SA 3.0
2016-12-21T13:37:04.047Z
maybe @heather dosn't directly answer my question but his answer help me anyway for other reasons. I'm waiting for other ideas before accept the answer.  thanks to all.
baudo2048
CC BY-SA 3.0
2016-12-20T22:28:23.603Z
2016-12-20T22:28:23.603Z
auden
<p>TLDR;<br>
What is the mathematics foundation for the namespace problem? Can I reduce namespace problem to set theory or other math concepts/objects (lambda calculus, category theory)?  </p>

<p>I'm doing an essay on concepts like namespaces, packages and modules in programming languages. Among other topics, I'm studing how to avoid names collitions and in particular how programming languages solve the problem. For example:</p>

<p>Given any programming language, suppose that we have following user defined functions (or other language specific "object") named $a$ and $b$:</p>

<pre><code>function a () {
  // do something
} 

function b () {
  // do something
} 
</code></pre>

<p>And a function called $c$ that uses above functions:</p>

<pre><code>function c () {
  a();
  b();
} 
</code></pre>

<p>If in the "context" above we defined another function called $a$, we would have a collision in function $c$ because it doesn't know what $a$-function implementation must use.</p>

<p>So to avoid name collisions a programming languages can implement namespace/package/module systems and let the programmer doing something like the following: </p>

<pre><code>module alpha{
  function a () {
    // do something
  }
  function b () {
    // do something
  }
} 

module beta{
  function a () {
    // do something
  }
} 
</code></pre>

<p>And then doing:</p>

<pre><code>function c () {
  alpha.a();
  alpha.b();
}
</code></pre>

<p>or</p>

<pre><code>function c () {
  beta.a();
  alpha.b();
}
</code></pre>

<p>Thanks.</p>

CC BY-SA 3.0
2016-12-19T08:18:19.897Z
Often namespaces are generalized to be modules with an interface and multiple implementations, and multiple parameterized instantiations (think of objects as namespaces). In that case, you may want to look at existential types: cs.cornell.edu/courses/CS4110/2012fa/lectures/lecture26.pdf
pron
CC BY-SA 3.0
2016-12-20T07:32:26.177Z
This is not a research-level question, please move over to cs.stackexchange.com and it's not clear what you are asking. It looks like you just need to consult a book on principles of programming language and read about type checking and the concept of typing context.
Andrej Bauer
CC BY-SA 3.0
2016-12-23T17:56:21.537Z
"a" is nothing else than a constant that has as value a logic; you can model it as any other constant
pasaba por aqui
<reference-request>
Math foundation for namespace problem
baudo2048
# Math foundation for namespace problem

(Asked by: username_0 on 2016-12-19)

TLDR;
What is the mathematics foundation for the namespace problem? Can I reduce namespace problem to set theory or other math concepts/objects (lambda calculus, category theory)?  
I'm doing an essay on concepts like namespaces, packages and modules in programming languages. Among other topics, I'm studing how to avoid names collitions and in particular how programming languages solve the problem. For example:
Given any programming language, suppose that we have following user defined functions (or other language specific "object") named $a$ and $b$:
function a () {
  // do something
} 

function b () {
  // do something
} 

And a function called $c$ that uses above functions:
function c () {
  a();
  b();
} 

If in the "context" above we defined another function called $a$, we would have a collision in function $c$ because it doesn't know what $a$-function implementation must use.
So to avoid name collisions a programming languages can implement namespace/package/module systems and let the programmer doing something like the following: 
module alpha{
  function a () {
    // do something
  }
  function b () {
    // do something
  }
} 

module beta{
  function a () {
    // do something
  }
} 

And then doing:
function c () {
  alpha.a();
  alpha.b();
}

or
function c () {
  beta.a();
  alpha.b();
}

Thanks.

**Tags:** reference-request

> **Comments:**
> **username_1**: Often namespaces are generalized to be modules with an interface and multiple implementations, and multiple parameterized instantiations (think of objects as namespaces). In that case, you may want to look at existential types: cs.cornell.edu/courses/CS4110/2012fa/lectures/lecture26.pdf  
> **username_2**: This is not a research-level question, please move over to cs.stackexchange.com and it's not clear what you are asking. It looks like you just need to consult a book on principles of programming language and read about type checking and the concept of typing context.  
> **username_3**: "a" is nothing else than a constant that has as value a logic; you can model it as any other constant  

---

## 1 answers

### Answer by username_4 on 2016-12-20. Score: 1

Looking around on google, I couldn't find much on this topic at all. However, I did find [this thesis](https://arxiv.org/pdf/1601.03354v1.pdf) on arxiv, which I believe addresses this problem, albeit in a semi-roundabout way. As the author states in the conclusion

> The goal of this work was to discover namespaces in mathematical notation
> given a collection of documents with mathematical formulae. This
> problem could not be performed manually: this task it too time consuming
> and requires a lot of effort.   
> To achieve the goal we proposed an automatic method based on cluster
> analysis. We noted that document representation in terms of identifiers is
> similar to the classic Vector Space Model. This allowed us to apply traditional document clustering techniques to the namespace discovery problem.

So cluster analysis seems to be something to look into here.

Hope this helps; I'll keep looking around for other resources.

> **Comments:**
> **username_2**: If you need to Google the answer, and then you find something at random, but you're not reallty sure, do you think you should be answering the question?  
> **username_0**: maybe @heather dosn't directly answer my question but his answer help me anyway for other reasons. I'm waiting for other ideas before accept the answer.  thanks to all.  

---

