Skip to content

Commit 805e9d8

Browse files
committed
documentation: weak and strong aliases in the specification
1 parent 225aff4 commit 805e9d8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/codeql/ql-language-reference/ql-language-specification.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ The grammar given in this section is disambiguated first by precedence, and seco
17631763
Aliases
17641764
-------
17651765

1766-
Aliases define new names for existing QL entities.
1766+
Aliases define new names for existing QL bindings.
17671767

17681768
::
17691769

@@ -1772,7 +1772,19 @@ Aliases define new names for existing QL entities.
17721772
| qldoc? annotations "module" modulename "=" moduleExpr ";"
17731773

17741774

1775-
An alias introduces a binding from the new name to the entity referred to by the right-hand side in the current module's declared predicate, type, or module environment respectively.
1775+
An alias introduces a binding from the new name to the binding referred to by the right-hand side in the current module's declared predicate, type, or module environment respectively.
1776+
1777+
An alias is called *strong alias* if and only if it has the ``final`` annotation. Otherwise, it is called a *weak alias*.
1778+
1779+
Two bindings `A`, `B` are called *equal modulo weak aliasing* if and only if one of the following conditions are satisfied:
1780+
1781+
- `A` and `B` are the same binding or
1782+
1783+
- `A`` is introduced by a *weak alias* for `C`, where `B` and `C` are *equal modulo weak aliasing* (or vice versa) or
1784+
1785+
- `A` and `B` are introduced by the same strong alias and they are aliases for bindings that are *equal modulo weak aliasing*.
1786+
1787+
Note that the third condition is only relevant in :ref:`Parameterized modules`, where the binding introduced by the alias can depend on instantiation parameters.
17761788

17771789
Built-ins
17781790
---------

0 commit comments

Comments
 (0)