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: wiki/Control Flow Graph.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
_This document was generated from '[src/documentation/wiki-cfg.ts](https://github.com/flowr-analysis/flowr/tree/main//src/documentation/wiki-cfg.ts)' on 2026-01-14, 16:35:27 UTC presenting an overview of flowR's control flow graph (v2.8.6, using R v4.5.0). Please do not edit this file/wiki page directly._
1
+
_This document was generated from '[src/documentation/wiki-cfg.ts](https://github.com/flowr-analysis/flowr/tree/main//src/documentation/wiki-cfg.ts)' on 2026-01-15, 19:46:03 UTC presenting an overview of flowR's control flow graph (v2.8.6, using R v4.5.0). Please do not edit this file/wiki page directly._
2
2
3
3
_flowR_ produces three main perspectives of the program: 1) a [normalized version of the AST](https://github.com/flowr-analysis/flowr/wiki/Normalized-AST)
4
4
and 2) a [dataflow graph](https://github.com/flowr-analysis/flowr/wiki/Dataflow%20Graph), and 3) a control flow graph (CFG).
@@ -81,7 +81,7 @@ flowchart RL
81
81
```
82
82
83
83
84
-
_(The analysis required _2.2 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
84
+
_(The analysis required _2.7 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
85
85
We used the following simplification: `unique-cf-sets` .
86
86
)_
87
87
@@ -140,7 +140,7 @@ flowchart RL
140
140
141
141
<summarystyle="color:gray">R Code of the CFG</summary>
142
142
143
-
The analysis required _1.4 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
143
+
The analysis required _1.5 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
144
144
We used the following simplification: `unique-cf-sets` .
145
145
146
146
@@ -372,7 +372,7 @@ flowchart RL
372
372
373
373
<summarystyle="color:gray">R Code of the CFG</summary>
374
374
375
-
The analysis required _2.0 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
375
+
The analysis required _1.7 ms_ (including the dataflow analysis, normalization, and parsing with the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
376
376
We used the following simplification: `unique-cf-sets` .
377
377
378
378
@@ -389,7 +389,7 @@ f()
389
389
390
390
<h2id="cfg-structure">Structure of the Control Flow Graph</h2>
391
391
392
-
You can produce your very own control flow graph with <ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L91"><code><spantitle="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a>.
392
+
You can produce your very own control flow graph with <ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L90"><code><spantitle="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a>.
393
393
The <ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/control-flow-graph.ts#L211"><code><spantitle="This class represents the control flow graph of an R program. The control flow may be hierarchical when confronted with function definitions (see CfgSimpleVertex and rootVertexIds() ). There are two very simple visitors to traverse a CFG: - visitCfgInOrder visits the graph in the order of the vertices - visitCfgInReverseOrder visits the graph in reverse order If you want to prohibit modification, ...">ControlFlowGraph</span></code></a> class describes everything required to model the control flow graph, with its edge types described by
394
394
<ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/control-flow-graph.ts#L129"><code>CfgEdge</code></a> and its vertices by <ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/control-flow-graph.ts#L86"><code><spantitle="A vertex in the ControlFlowGraph .">CfgSimpleVertex</span></code></a>.
395
395
However, you should be aware of the <ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/control-flow-graph.ts#L466"><code><spantitle="Summarizes the control information of a program">ControlFlowInformation</span></code></a> interface which adds some additional information the CFG
@@ -430,7 +430,7 @@ However, you should be aware of the <a href="https://github.com/flowr-analysis/f
430
430
To check whether the CFG has the expected shape, you can use the test function <ahref="https://github.com/flowr-analysis/flowr/tree/main//test/functionality/_helper/controlflow/assert-control-flow-graph.ts#L35"><code><spantitle="Assert that the given code produces the expected CFG">assertCfg</span></code></a> which supports testing for
431
431
sub-graphs as well (it provides diffing capabilities similar to <ahref="https://github.com/flowr-analysis/flowr/tree/main//test/functionality/_helper/shell.ts#L394"><code><spantitle="Your best friend whenever you want to test whether the dataflow graph produced by flowR is as expected. You may want to have a look at the DataflowTestConfiguration to see what you can configure. Especially the resolveIdsAsCriterion and the expectIsSubgraph are interesting as they allow you for rather flexible matching of the expected graph. Pleas note, that if you pass context: 'call-graph' in th...">assertDataflow</span></code></a>).
432
432
As the CFG may become unhandy for larger programs, there are simplifications available with <ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/cfg-simplification.ts#L39"><code><spantitle="Simplify the control flow information by applying the given passes. This may reduce the vertex count, in- and outgoing edges, entry and exit points, etc.">simplifyControlFlowInformation</span></code></a>
433
-
(these can be passed on to the <ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L91"><code><spantitle="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a> function as well).
433
+
(these can be passed on to the <ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L90"><code><spantitle="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a> function as well).
434
434
435
435
<h3id="cfg-structure-vertices">CFG Vertices</h3>
436
436
@@ -601,7 +601,7 @@ flowchart RL
601
601
```
602
602
603
603
604
-
_(Theanalysisrequired_1.6ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
604
+
_(Theanalysisrequired_1.3ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
Theanalysisrequired_3.0ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
684
+
Theanalysisrequired_1.3ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
Theanalysisrequired_1.7ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
738
+
Theanalysisrequired_1.6ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
Theanalysisrequired_1.9ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
795
+
Theanalysisrequired_1.8ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
Theanalysisrequired_1.6ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
935
+
Theanalysisrequired_1.7ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
IfyougeneratetheCFGwiththe<ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L91"><code><spantitle="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a> function you can (and, ifyouwanttogaininter-proceduralinformation, should)
954
+
IfyougeneratetheCFGwiththe<ahref="https://github.com/flowr-analysis/flowr/tree/main//src/control-flow/extract-cfg.ts#L90"><code><spantitle="Given a normalized AST, this approximates the control flow graph of the program. This view is different from the computation of the dataflow graph and may differ, especially because it focuses on intra-procedural analysis.">extractCfg</span></code></a> function you can (and, ifyouwanttogaininter-proceduralinformation, should)
955
955
pass a matching [dataflow graph](https://github.com/flowr-analysis/flowr/wiki/Dataflow%20Graph) to it to incorporate the dataflow perspective into the CFG.
Theanalysisrequired_1.6ms_ (includingthenormalizationandparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1005
+
Theanalysisrequired_1.4ms_ (includingthenormalizationandparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
Theanalysisrequired_1.4ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1127
+
Theanalysisrequired_1.7ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
Theanalysisrequired_1.3ms_ (includingparseandnormalize, usingthe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1169
+
Theanalysisrequired_1.4ms_ (includingparseandnormalize, usingthe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
Theanalysisrequired_3.2ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1208
+
Theanalysisrequired_1.9ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
_(Theanalysisrequired_1.7ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1264
+
_(Theanalysisrequired_1.8ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
_(Theanalysisrequired_1.6ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1316
+
_(Theanalysisrequired_2.0ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
_(Theanalysisrequired_10.4ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1396
+
_(Theanalysisrequired_10.5ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
_(Theanalysisrequired_6.7ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
1655
+
_(Theanalysisrequired_5.7ms_ (includingthedataflowanalysis, normalization, andparsingwiththe [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.
0 commit comments