You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/codeql/ql-language-reference/ql-language-specification.rst
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,12 +122,19 @@ Global environments
122
122
123
123
The global module environment has a single entry ``QlBuiltins``.
124
124
125
-
The global type environment has entries for the primitive types ``int``, ``float``, ``string``, ``boolean``, and ``date``, as well as any types defined in the database schema.
125
+
The global type environment has entries for the primitive types ``int``, ``float``, ``string``, ``boolean``, and ``date``.
126
126
127
-
The global predicate environment includes all the built-in classless predicates, as well as any extensional predicates declared in the database schema.
127
+
The global predicate environment includes all the built-in classless predicates.
128
128
129
129
The three global signature environments are empty.
130
130
131
+
Database schema environments
132
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133
+
134
+
The database schema type environment has entries for types declared in the database schema.
135
+
136
+
The database schema predicate environment has entries for extensional predicates declared in the database schema.
137
+
131
138
The program is invalid if any of these environments is not definite.
132
139
133
140
Module environments
@@ -146,7 +153,7 @@ These are defined as follows (with X denoting the type of entity we are currentl
146
153
147
154
2. for each module which the current module directly imports (excluding ``private`` imports - see "`Import directives <#import-directives>`__"): all entries from the *exported X environment* that have a key not present in the *publically declared X environment* of the current module, and
148
155
149
-
3. if X is ``predicates``, then for each module signature ``S`` that is implemented by the current module: an entry for each module signature default predicate in ``S`` that does not have the same name and arity as any of the entries in the **publically declared predicate environment** of the current module.
156
+
3. if X is ``predicate``, then for each module signature ``S`` that is implemented by the current module: an entry for each module signature default predicate in ``S`` that does not have the same name and arity as any of the entries in the **publically declared predicate environment** of the current module.
150
157
151
158
- The *visible X environment* of a module is the union of
152
159
@@ -160,7 +167,9 @@ These are defined as follows (with X denoting the type of entity we are currentl
160
167
161
168
5. if there is an enclosing module: all entries from the *visible X environment* of the enclosing module that have a key not present in the *publically declared X environment* of the current module, and
162
169
163
-
6. all parameters of the current module that are of type X.
170
+
6. if there is no enclosing module and X is either ``type`` or ``predicate``: all entries from the *database schema X environment* that have a key not present in the *publically declared X environment* of the current module, and
171
+
172
+
7. all parameters of the current module that are of type X.
164
173
165
174
The program is invalid if any of these environments is not definite.
0 commit comments