Skip to content

Commit bbc3cfb

Browse files
committed
Dataflow: Fix documentation.
1 parent a2e3b37 commit bbc3cfb

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

docs/codeql/writing-codeql-queries/debugging-data-flow-queries-using-partial-flow.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Partial flow
5959

6060
A naive next step could be to change the sink definition to ``any()``. This would mean that we would get a lot of flow to all the places that are reachable from the sources. While this approach may work in some cases, you might find that it produces so many results that it's very hard to explore the findings. It can also dramatically affect query performance. More importantly, you might not even see all the partial flow paths. This is because the data-flow library tries very hard to prune impossible paths and, since field stores and reads must be evenly matched along a path, we will never see paths going through a store that fail to reach a corresponding read. This can make it hard to see where flow actually stops.
6161

62-
To avoid these problems, the data-flow library comes with a mechanism for exploring partial flow that tries to deal with these caveats. This is the ``MyFlow::FlowExploration<explorationLimit/0>::partialFlow`` predicate:
62+
To avoid these problems, the data-flow library comes with a mechanism for exploring partial flow that tries to deal with these caveats. This is the ``MyFlow::FlowExplorationFwd<explorationLimit/0>::partialFlow`` predicate:
6363

6464
.. code-block:: ql
6565
@@ -77,21 +77,19 @@ To avoid these problems, the data-flow library comes with a mechanism for explor
7777
*/
7878
predicate partialFlow(PartialPathNode source, PartialPathNode node, int dist) {
7979
80-
There is also a ``partialFlowRev`` for exploring flow backwards from a sink.
80+
There is also a ``MyFlow::FlowExplorationRev<explorationLimit/0>::partialFlow`` for exploring flow backwards from a sink.
8181

82-
To get access to these predicates you must instantiate the ``MyFlow::FlowExploration<>`` module with an exploration limit. For example:
82+
To get access to these predicates you must instantiate the ``MyFlow::FlowExplorationFwd<>`` module with an exploration limit (or the ``MyFlow::FlowExplorationRev<>`` module for reverse flow). For example:
8383

8484
.. code-block:: ql
8585
8686
int explorationLimit() { result = 5 }
8787
88-
module MyPartialFlow = MyFlow::FlowExploration<explorationLimit/0>;
88+
module MyPartialFlow = MyFlow::FlowExplorationFwd<explorationLimit/0>;
8989
9090
This defines the exploration radius within which ``partialFlow`` returns results.
9191

92-
To get good performance when using ``partialFlow`` it is important to ensure the ``isSink`` predicate of the configuration has no results. Likewise, when using ``partialFlowRev`` the ``isSource`` predicate of the configuration should have no results.
93-
94-
It is also useful to focus on a single source at a time as the starting point for the flow exploration. This is most easily done by adding a temporary restriction in the ``isSource`` predicate.
92+
It is useful to focus on a single source at a time as the starting point for the flow exploration. This is most easily done by adding a temporary restriction in the ``isSource`` predicate.
9593

9694
To do quick evaluations of partial flow it is often easiest to add a predicate to the query that is solely intended for quick evaluation (right-click the predicate name and choose "CodeQL: Quick Evaluation"). A good starting point is something like:
9795

0 commit comments

Comments
 (0)