A `Scope' keeps track of one or more syntactic elements that represent bound names.
The elements it contains share the same scope and must all be distinct (wrt. ==)
A `NameElement' `n' in the AST that is conceptually bound by a `Scope' `s', is replaced by a
`BoundElement(n, s)'. (For example, in `val x:Int=x+1', the first `x' is modelled by a
Scope `s' that contains `x' and the second `x' is represented by a `BoundElement(`x', s)')
The term (`x+1') in scope of the Scope becomes an `UnderBinder(s, `x+1').
A `NameElement' `n' is bound by a `Scope' `s' if it is wrapped as a `BoundElement(`n', s)', and
`s' has a binder element that is semantically equal (`equals' or `==') to `n'.
A `Scope' is represented textually by its list of binder elements, followed by the scope's `id'.
For example: `[x, y]!1' represents the scope with `id' `1' and binder elements `x' and `y'.
(`id' is solely used for this textual representation.)

`canAddElement' indicates whether `b' may be added to this scope.
TODO: strengthen this condition so that no binders may be added after this scope has been
linked to its `UnderBinder' (i.e., while parsing, BoundElements may be added to the Scope
associated to the UnderBinder, but after that, no changes are allowed, except for substitution)?

Return a nested scope -- binders entered into it won't be visible in this scope, but if this scope allows forward references,
the binding in the returned scope also does, and thus the check that all variables are bound is deferred until this scope is left

``Replaces'' the bound occurrences of a contained binder by their new value.
The bound occurrences of `b' are not actually replaced; the scope keeps track
of a substitution that maps every binder to its current value. Since a `BoundElement' is
a proxy for the element it is bound to by its binder, `substitute' may thus be thought of
as replacing all the bound occurrences of the given binder `b' by their new value `value'.

`canAddElement' indicates whether `b' may be added to this scope.
TODO: strengthen this condition so that no binders may be added after this scope has been
linked to its `UnderBinder' (i.e., while parsing, BoundElements may be added to the Scope
associated to the UnderBinder, but after that, no changes are allowed, except for substitution)?

``Replaces'' the bound occurrences of a contained binder by their new value.
The bound occurrences of `b' are not actually replaced; the scope keeps track
of a substitution that maps every binder to its current value. Since a `BoundElement' is
a proxy for the element it is bound to by its binder, `substitute' may thus be thought of
as replacing all the bound occurrences of the given binder `b' by their new value `value'.

Return a nested scope -- binders entered into it won't be visible in this scope, but if this scope allows forward references,
the binding in the returned scope also does, and thus the check that all variables are bound is deferred until this scope is left