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
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Architecture
36
36
37
37
A *QL program* consists of a query module defined in a QL file and a number of library modules defined in QLL files that it imports (see "`Import directives <#import-directives>`__"). The module in the QL file includes one or more queries (see "`Queries <#queries>`__"). A module may also include *import directives* (see "`Import directives <#import-directives>`__"), non-member predicates (see "`Non-member predicates <#non-member-predicates>`__"), class definitions (see "`Classes <#classes>`__"), and module definitions (see "`Modules <#modules>`__").
38
38
39
-
QL programs are interpreted in the context of a *database* and a *library path* . The database provides a number of definitions: database types (see "`Types <#types>`__"), entities (see "`Values <#values>`__"), built-in predicates (see "`Built-ins <#built-ins>`__"), and the *database content* of built-in predicatesand external predicates (see "`Evaluation <#evaluation>`__"). The library path is a sequence of file-system directories that hold QLL files.
39
+
QL programs are interpreted in the context of a *database* and a *library path* . The database provides a number of definitions: database types (see "`Types <#types>`__"), entities (see "`Values <#values>`__"), built-in predicates (see "`Built-ins <#built-ins>`__"), and the *database content* of built-in predicates, external predicates, and extensible predicates (see "`Evaluation <#evaluation>`__"). The library path is a sequence of file-system directories that hold QLL files.
40
40
41
41
A QL program can be *evaluated* (see "`Evaluation <#evaluation>`__") to produce a set of tuples of values (see "`Values <#values>`__").
42
42
@@ -935,6 +935,7 @@ When a predicate is a top-level clause in a module, it is called a non-member pr
935
935
936
936
A valid non-member predicate can be annotated with ``additional``, ``cached``, ``deprecated``, ``extensible``, ``external``, ``transient``, ``private``, and ``query``.
937
937
Note, the ``transient`` annotation can only be applied if the non-member predicate is also annotated with ``external``.
938
+
Note, the annotations ``extensible`` and ``external`` cannot both be used on the same non-member predicate.
938
939
939
940
The head of the predicate gives a name, an optional *result type*, and a sequence of variables declarations that are *arguments*:
940
941
@@ -952,7 +953,7 @@ The body of a predicate is of one of three forms:
952
953
953
954
In the first form, with just a semicolon, the predicate is said to not have a body. In the second form, the body of the predicate is the given formula (see "`Formulas <#formulas>`__"). In the third form, the body is a higher-order relation.
954
955
955
-
A valid non-member predicate must have a body, either a formula or a higher-order relation, unless it is external, in which case it must not have a body.
956
+
A valid non-member predicate must have a body, either a formula or a higher-order relation, unless it is external or extensible, in which case it must not have a body.
956
957
957
958
The typing environment for the body of the formula, if present, maps the variables in the head of the predicate to their associated types. If the predicate has a result type, then the typing environment also maps ``result`` to the result type.
958
959
@@ -1053,7 +1054,7 @@ A member predicate ``p`` with enclosing class ``C`` *shadows* a member predicate
1053
1054
1054
1055
Member predicates have one or more *root definitions*. If a member predicate overrides no other member predicate, then it is its own root definition. Otherwise, its root definitions are those of any member predicate that it overrides.
1055
1056
1056
-
A valid member predicate must have a body unless it is abstract or external, in which case it must not have a body.
1057
+
A valid member predicate must have a body unless it is abstract, in which case it must not have a body.
1057
1058
1058
1059
A valid member predicate must override another member predicate if it is annotated override.
1059
1060
@@ -2180,7 +2181,7 @@ If a QL program has no valid stratification, then the program itself is not vali
2180
2181
Layer evaluation
2181
2182
~~~~~~~~~~~~~~~~
2182
2183
2183
-
The store is first initialized with the *database content* of all built-in predicatesand external predicates. The database content of a predicate is a set of ordered tuples that are included in the database.
2184
+
The store is first initialized with the *database content* of all built-in predicates, external predicates, and extensible predicates. The database content of a predicate is a set of ordered tuples that are included in the database.
2184
2185
2185
2186
Each layer of the stratification is *populated* in order. To populate a layer, each predicate in the layer is repeatedly populated until the store stops changing. The way that a predicate is populated is as follows:
0 commit comments