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/modules.rst
+68-1Lines changed: 68 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -273,4 +273,71 @@ The ``<module_expression>`` itself can be a module name, a selection, or a quali
273
273
reference. For more information, see ":ref:`name-resolution`."
274
274
275
275
For information about how import statements are looked up, see "`Module resolution <https://codeql.github.com/docs/ql-language-reference/ql-language-specification/#module-resolution>`__"
276
-
in the QL language specification.
276
+
in the QL language specification.
277
+
278
+
Built-in modules
279
+
****************
280
+
281
+
QL defines a ``QlBuiltins`` module that is always in scope.
282
+
Currently, it defines a single parameterized sub-module
283
+
``EquivalenceRelation``, that provides an efficient abstraction for working with
284
+
(partial) equivalence relations in QL.
285
+
286
+
Equivalence relations
287
+
=====================
288
+
289
+
The built-in ``EquivalenceRelation`` module is parameterized by a type ``T`` and a
290
+
binary base relation ``base`` on ``T``. The symmetric and transitive closure of ``base``
291
+
induces a partial equivalence relation on ``T``. If every value of ``T`` appears in
292
+
``base``, then the induced relation is an equivalence relation on ``T``.
293
+
294
+
The ``EquivalenceRelation`` module exports a ``getEquivalenceClass`` predicate that
295
+
gets the equivalence class, if any, associated with a given ``T`` element by the
296
+
(partial) equivalence relation induced by ``base``.
297
+
298
+
The following example illustrates an application of the ``EquivalenceRelation``
0 commit comments