Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/language/ql-handbook/about-the-ql-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ QL is the powerful query language that underlies CodeQL, which is used to analyz
About query languages and databases
-----------------------------------

This section is aimed at users with a background in general purpose programming as well as in databases. For a basic introduction and information on how to get started, see `Learning CodeQL <https://help.semmle.com/QL/learn-ql/index.html>`__.
This section is aimed at users with a background in general purpose programming as well as in databases. For a basic introduction and information on how to get started, see "`Learning CodeQL <https://help.semmle.com/QL/learn-ql/index.html>`__."

QL is a declarative, object-oriented query language that is optimized to enable efficient analysis of hierarchical data structures, in particular, databases representing software artifacts.

Expand Down Expand Up @@ -39,10 +39,10 @@ When you write this process in QL, it closely resembles the above structure. Not
result = count(getADescendant(p))
}

For more information about the important concepts and syntactic constructs of QL, see the individual reference topics such as :doc:`Expressions <expressions>` and :doc:`Recursion <recursion>`.
For more information about the important concepts and syntactic constructs of QL, see the individual reference topics such as ":doc:`Expressions <expressions>`" and ":doc:`Recursion <recursion>`."
The explanations and examples help you understand how the language works, and how to write more advanced QL code.

For formal specifications of the QL language and QLDoc comments, see the :doc:`QL language specification <language>` and :doc:`QLDoc comment specification <qldoc>`.
For formal specifications of the QL language and QLDoc comments, see the ":doc:`QL language specification <language>`" and ":doc:`QLDoc comment specification <qldoc>`."

QL and object orientation
-------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/language/ql-handbook/annotations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You can also find a summary table in the Annotations section of the

The ``abstract`` annotation is used to define an abstract entity.

For information about **abstract classes**, see :ref:`Classes <abstract-classes>`.
For information about **abstract classes**, see ":ref:`Classes <abstract-classes>`."

**Abstract predicates** are member predicates that have no body. They can be defined on any
class, and should be :ref:`overridden <overriding-member-predicates>` in non-abstract subtypes.
Expand Down Expand Up @@ -359,7 +359,7 @@ Language pragmas
This annotation allows you to use **monotonic aggregates** instead of the standard QL
:ref:`aggregates <aggregations>`.

For more information, see :ref:`monotonic-aggregates`.
For more information, see ":ref:`monotonic-aggregates`."

.. _bindingset:

Expand All @@ -380,7 +380,7 @@ The ``bindingset`` annotation takes a comma-separated list of variables. Each va
an argument of the predicate, possibly including ``this`` (for characteristic predicates and
member predicates) and ``result`` (for predicates that return a result).

See :ref:`predicate-binding` in the :ref:`predicates` topic for examples and more information.
For more information, see ":ref:`predicate-binding`."

.. Links to use in substitutions

Expand Down
8 changes: 4 additions & 4 deletions docs/language/ql-handbook/evaluation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Each evaluation starts from these sets of tuples.
The remaining predicates and types in the program are organized into a number of layers, based
on the dependencies between them.
These layers are evaluated to produce their own sets of tuples, by finding the least fixed point
of each predicate. (For example, see :ref:`recursion`.)
of each predicate. (For example, see ":ref:`recursion`.")

The program's :ref:`queries <query>` determine which of these sets of tuples make up the final
results of the program. The results are sorted according to any ordering directives
(``order by``) in the queries.

For more details about each step of the evaluation process, see the `QL language specification
<https://help.semmle.com/QL/ql-spec/language.html#evaluation>`_.
For more details about each step of the evaluation process, see the "`QL language specification
<https://help.semmle.com/QL/ql-spec/language.html#evaluation>`_."

Validity of programs
********************
Expand Down Expand Up @@ -97,7 +97,7 @@ To do this, you can use the following mechanisms:
.. important:: If a predicate uses non-standard binding sets, then it does **not** always bind
all its arguments. In such a case, whether the predicate call binds a specific argument
depends on which other arguments are bound, and what the binding sets say about the
argument in question. See :ref:`binding-sets` for more information.
argument in question. For more information, see ":ref:`binding-sets`."

#. **Binding operators**: Most operators, such as the :ref:`arithmetic operators <binary-operations>`,
require that all their operands are bound. For example, you can't add two variables in QL
Expand Down
5 changes: 2 additions & 3 deletions docs/language/ql-handbook/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ Calls to predicates (with result)

Calls to :ref:`predicates with results <predicates-with-result>` are themselves expressions,
unlike calls to :ref:`predicates without results <predicates-without-result>` which are
formulas. See :ref:`calls` in the :ref:`formulas` topic for more general information about
calls.
formulas. For more information, see ":ref:`calls`."

A call to a predicate with result evaluates to the values of the ``result`` variable of the
called predicate.
Expand Down Expand Up @@ -350,7 +349,7 @@ Let us apply these steps to the ``sum`` aggregate in the following query:
#. Apply the aggregation function ``sum`` on the above values to get the final result ``60``.

If we change ``<expression>`` to ``i + j`` in the above query, the query result is ``135`` since
applying ``i + j`` on all tuples results in following values: 
applying ``i + j`` on all tuples results in following values:
\ ``0, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9``.

Next, consider the following query:
Expand Down
11 changes: 5 additions & 6 deletions docs/language/ql-handbook/formulas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,13 @@ A call to a predicate can also contain a closure operator, namely ``*`` or ``+``
``a.isChildOf+(b)`` is a call to the :ref:`transitive closure <transitive-closures>` of
``isChildOf()``, so it holds if ``a`` is a descendent of ``b``.

The predicate reference must resolve to exactly one predicate. See :ref:`name-resolution` for
more information about how a predicate reference is resolved.
The predicate reference must resolve to exactly one predicate. For more information about how a predicate
reference is resolved, see ":ref:`name-resolution`."

If the call resolves to a predicate without result, then the call is a formula.

It is also possible to call a predicate with result. This kind of call is an
expression in QL, instead of a formula. See :ref:`calls-with-result` for the corresponding
topic.
expression in QL, instead of a formula. For more information, see ":ref:`calls-with-result`."

.. _parenthesized-formulas:

Expand Down Expand Up @@ -251,7 +250,7 @@ Implicit quantifiers

Implicitly quantified variables can be introduced using "don't care expressions." These are used
when you need to introduce a variable to use as an argument to a predicate call, but don't care
about its value. For further information, see :ref:`Don't-care expressions <dont-care>`.
about its value. For further information, see ":ref:`Don't-care expressions <dont-care>`."

.. _connectives:

Expand Down Expand Up @@ -305,7 +304,7 @@ The following query selects files that are not HTML files.

.. note::
You should be careful when using ``not`` in a recursive definition, as this could lead to
non-monotonic recursion. For more information, see the section on :ref:`non-monotonic-recursion`.
non-monotonic recursion. For more information, ":ref:`non-monotonic-recursion`."

.. index:: if, then, else
.. _conditional:
Expand Down
Loading