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/ql-documentation/learn-ql/advanced/abstract-classes.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ A classic example where this approach is useful is when modeling ASTs (Abstract
10
10
11
11
Each value in a concrete class satisfies a particular logical property - the *characteristic predicate* (or *character* for short) of that class. This characteristic predicate consists of the conjunction (``and``) of its own body (if any) and the characteristic predicates of its superclasses.
12
12
13
-
For example, we could derive a subclass ``MainMethod`` from the standard QL class ``Method`` that contains precisely those Java functions called "main":
13
+
For example, we could derive a subclass ``MainMethod`` from the standard QL class ``Method`` that contains precisely those Java functions called ``"main"``:
14
14
15
15
.. code-block:: ql
16
16
@@ -33,7 +33,7 @@ Letting ``cp(C)`` denote the characteristic predicate of class ``C``, it is clea
33
33
34
34
cp(MainMethod) = cp(Method) and hasName("main")
35
35
36
-
That is, entities are "main" methods if and only if they are methods that are also called "main".
36
+
That is, entities are *main* methods if and only if they are methods that are also called ``"main"``.
Here we are doing some lookups on ``Element``\ s. Going from ``Element -> File`` and ``Element -> Location -> StartLine`` are linear: there is only one ``File`` for each ``Element``, and one ``Location`` for each ``Element``, etc. However, as written it is difficult for the optimizer to pick out the best ordering here. We want to do the quick, linear parts first, and then join on the resultant larger tables, rather than joining first and then doing the linear lookups. We can precipitate this kind of ordering by rewriting the above predicate as follows:
19
+
Here we explore some lookups on ``Element``\ s. Going from ``Element -> File`` and ``Element -> Location -> StartLine`` are linear: there is only one ``File`` for each ``Element``, and one ``Location`` for each ``Element``, etc. However, as written it is difficult for the optimizer to pick out the best ordering here. We want to do the quick, linear parts first, and then join on the resultant larger tables, rather than joining first and then doing the linear lookups. We can precipitate this kind of ordering by rewriting the above predicate as follows:
Copy file name to clipboardExpand all lines: docs/ql-documentation/learn-ql/advanced/monotonic-aggregates.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ For most usages, aggregates have very straightforward behavior. They can be thou
42
42
43
43
For every combination of values for the declared **variables**, for which the **range** holds, take one value of the **expression** and apply the **aggregation function** to the resulting values.
44
44
45
-
How does this work? Let us take the simple example given above of calculating the sum of your employees' salaries. Suppose that your employees are Alice, Ben and Charles, whose salaries are $30k, $40k, and $50k respectively. Then to calculate ``result``, we follow our recipe:
45
+
How does this work? Let us take the simple example given above of calculating the sum of your employees' salaries. Suppose that your employees are Alice, Ben, and Charles, whose salaries are $30k, $40k, and $50k respectively. Then to calculate ``result``, we follow our recipe:
| For every combination of values for the declared **variables** | Alice, Ben, Charles, Denis, Edna... |
@@ -192,7 +192,7 @@ Rank is a slightly unusual aggregate. It takes the possible values of the expres
192
192
where salary = rank[salaryRank](Employee e | managedByMe(e) | e.getSalary())
193
193
select salary, salaryRank
194
194
195
-
assigns, for each of my managees, their salary to ``salary``, and the rank of their salary to ``salaryRank``. In our running example, the results would be:
195
+
assigns, for each person I manage, their salary to ``salary``, and the rank of their salary to ``salaryRank``. In our running example, the results would be:
Copy file name to clipboardExpand all lines: docs/ql-documentation/learn-ql/beginner/find-thief-1.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ There is too much information to search through by hand, so you decide to use yo
45
45
#. Select a language and a demo project. For this tutorial, any language and project will do.
46
46
#. Delete the default code ``import <language> select "hello world"``.
47
47
48
-
QL Libraries
48
+
QL libraries
49
49
------------
50
50
51
51
We've defined a number of QL `predicates <https://help.semmle.com/QL/ql-handbook/predicates.html>`__ to help you extract data from your table. A QL predicate is a mini-query that expresses a relation between various pieces of data and describes some of their properties. In this case, the predicates give you information about a person, for example their height or age.
Copy file name to clipboardExpand all lines: docs/ql-documentation/learn-ql/beginner/find-thief-2.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Find the thief: Start the search
2
2
================================
3
3
4
-
The villagers answered "yes" to the question "Is the thief taller than 150cm?". To use this information, you can write the following query to list all villagers taller than 150cm. These are all possible suspects.
4
+
The villagers answered "yes" to the question "Is the thief taller than 150cm?" To use this information, you can write the following query to list all villagers taller than 150cm. These are all possible suspects.
Copy file name to clipboardExpand all lines: docs/ql-documentation/learn-ql/beginner/fire-1.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ The expression ``southern(this)`` defines the logical property represented by th
55
55
56
56
Note
57
57
58
-
If you are familiar with object-oriented programming languages, you might be tempted to think of the characteristic predicate as a "constructor". However, this is **not** the case - it is a logical property which does not create any objects.
58
+
If you are familiar with object-oriented programming languages, you might be tempted to think of the characteristic predicate as a *constructor*. However, this is **not** the case - it is a logical property which does not create any objects.
59
59
60
60
You always need to define a class in QL in terms of an existing (larger) class. In our example, a ``Southerner`` is a special kind of ``Person``, so we say that ``Southerner`` *extends* ("is a subset of") ``Person``.
Copy file name to clipboardExpand all lines: docs/ql-documentation/learn-ql/beginner/heir.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ This is getting complicated. Ideally, you want to define a predicate ``relativeO
89
89
90
90
How could you do that?
91
91
92
-
It helps to think of a precise definition of "relative". A possible definition is that two people are related if they have a common ancestor.
92
+
It helps to think of a precise definition of *relative*. A possible definition is that two people are related if they have a common ancestor.
93
93
94
94
You can introduce a predicate ``ancestorOf(Person p)`` that lists all ancestors of ``p``. An ancestor of ``p`` is just a parent of ``p``, or a parent of a parent of ``p``, or a parent of a parent of a parent of ``p``, and so on. Unfortunately, this leads to an endless list of parents. You can't write an infinite QL query, so there must be an easier approach.
Copy file name to clipboardExpand all lines: docs/ql-documentation/learn-ql/cpp/dataflow.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ For a more general introduction to modeling data flow in QL, see :doc:`Introduct
12
12
Local data flow
13
13
---------------
14
14
15
-
Local data flow is data flow within a single function. Local data flow is usually easier, faster and more precise than global data flow, and is sufficient for many queries.
15
+
Local data flow is data flow within a single function. Local data flow is usually easier, faster, and more precise than global data flow, and is sufficient for many queries.
Copy file name to clipboardExpand all lines: docs/ql-documentation/learn-ql/cpp/introduce-libraries-cpp.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ Symbol table
49
49
- ``TypedefType`` — typedefs
50
50
- ``ArrayType`` — arrays
51
51
- ``PointerType`` — pointers
52
-
- ``SpecifiedType`` — qualifiers such as const, volatile, or restrict
52
+
- ``SpecifiedType`` — qualifiers such as ``const``, ``volatile``, or ``restrict``
53
53
54
54
- ``Namespace`` — namespaces (defined in the `Namespace.qll <https://help.semmle.com/qldoc/cpp/semmle/code/cpp/Namespace.qll/module.Namespace.html>`__ library)
0 commit comments