@eagleoutice/flowr 2.9.9 → 2.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -54
- package/abstract-interpretation/absint-visitor.d.ts +16 -14
- package/abstract-interpretation/absint-visitor.js +93 -47
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
- package/abstract-interpretation/data-frame/shape-inference.d.ts +2 -5
- package/abstract-interpretation/data-frame/shape-inference.js +4 -5
- package/abstract-interpretation/domains/abstract-domain.d.ts +4 -4
- package/abstract-interpretation/domains/abstract-domain.js +8 -8
- package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +12 -5
- package/abstract-interpretation/domains/mapped-abstract-domain.js +47 -23
- package/abstract-interpretation/domains/set-range-domain.js +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +30 -1
- package/abstract-interpretation/domains/state-abstract-domain.js +130 -4
- package/abstract-interpretation/normalized-ast-fold.d.ts +2 -2
- package/abstract-interpretation/normalized-ast-fold.js +4 -3
- package/benchmark/slicer.js +5 -5
- package/benchmark/summarizer/first-phase/process.js +4 -4
- package/cli/repl/commands/repl-normalize.js +2 -2
- package/cli/repl/core.js +2 -2
- package/config.js +1 -1
- package/control-flow/cfg-simplification.d.ts +1 -0
- package/control-flow/cfg-simplification.js +1 -0
- package/control-flow/control-flow-graph.d.ts +1 -1
- package/control-flow/control-flow-graph.js +1 -2
- package/control-flow/extract-cfg.js +34 -15
- package/control-flow/semantic-cfg-guided-visitor.js +1 -0
- package/dataflow/cluster.js +1 -1
- package/dataflow/environments/built-in.d.ts +6 -15
- package/dataflow/environments/built-in.js +25 -33
- package/dataflow/environments/default-builtin-config.d.ts +4 -8
- package/dataflow/environments/default-builtin-config.js +8 -5
- package/dataflow/environments/reference-to-maybe.d.ts +8 -0
- package/dataflow/environments/reference-to-maybe.js +46 -3
- package/dataflow/eval/resolve/alias-tracking.d.ts +2 -2
- package/dataflow/eval/resolve/alias-tracking.js +6 -6
- package/dataflow/eval/resolve/resolve.js +12 -10
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +2 -1
- package/dataflow/graph/call-graph.d.ts +1 -1
- package/dataflow/graph/call-graph.js +4 -3
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +21 -21
- package/dataflow/graph/graph.d.ts +5 -5
- package/dataflow/graph/graph.js +36 -32
- package/dataflow/graph/unknown-side-effect.js +3 -1
- package/dataflow/info.d.ts +4 -0
- package/dataflow/info.js +2 -2
- package/dataflow/internal/linker.d.ts +4 -4
- package/dataflow/internal/linker.js +59 -33
- package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +2 -1
- package/dataflow/internal/process/functions/call/argument/make-argument.js +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +15 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +22 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +22 -19
- package/dataflow/internal/process/functions/call/common.d.ts +1 -1
- package/dataflow/internal/process/functions/call/common.js +43 -35
- package/dataflow/internal/process/functions/call/known-call-handling.js +0 -2
- package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/process-argument.js +3 -3
- package/dataflow/internal/process/functions/process-parameter.js +2 -2
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-origin.js +2 -2
- package/documentation/doc-util/doc-types.js +1 -1
- package/documentation/wiki-absint.js +7 -8
- package/documentation/wiki-cfg.js +3 -3
- package/documentation/wiki-mk/doc-context.d.ts +8 -0
- package/documentation/wiki-mk/doc-context.js +4 -0
- package/documentation/wiki-normalized-ast.d.ts +1 -1
- package/documentation/wiki-normalized-ast.js +9 -6
- package/linter/linter-format.d.ts +10 -0
- package/linter/linter-format.js +15 -0
- package/linter/rules/absolute-path.js +3 -3
- package/linter/rules/dead-code.js +1 -1
- package/linter/rules/file-path-validity.js +1 -1
- package/linter/rules/seeded-randomness.js +1 -1
- package/linter/rules/unused-definition.js +1 -1
- package/package.json +7 -7
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +9 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +12 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +4 -5
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +6 -5
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-format.js +3 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +3 -3
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -1
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +1 -1
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
- package/queries/query-print.d.ts +1 -1
- package/queries/query-print.js +4 -3
- package/r-bridge/lang-4.x/ast/model/model.d.ts +151 -4
- package/r-bridge/lang-4.x/ast/model/model.js +249 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +13 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +19 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +26 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +36 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +48 -13
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +21 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +8 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +11 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +23 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +32 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +19 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +26 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +12 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +20 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +26 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +12 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +8 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +11 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +17 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +22 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +22 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +45 -8
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +57 -16
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +12 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +15 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +21 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +21 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +22 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +21 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +14 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +23 -17
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +39 -2
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +52 -9
- package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +18 -17
- package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +8 -7
- package/r-bridge/lang-4.x/ast/model/processing/visitor.js +6 -13
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +4 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +2 -2
- package/r-bridge/lang-4.x/convert-values.d.ts +14 -5
- package/r-bridge/lang-4.x/convert-values.js +76 -72
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -15
- package/r-bridge/roxygen2/roxygen-parse.js +1 -1
- package/r-bridge/shell-executor.js +1 -1
- package/reconstruct/auto-select/magic-comments.js +4 -4
- package/reconstruct/reconstruct.js +2 -1
- package/search/search-executor/search-generators.js +2 -2
- package/slicing/criterion/filters/all-variables.js +1 -1
- package/slicing/criterion/parse.d.ts +1 -1
- package/slicing/criterion/parse.js +5 -3
- package/slicing/static/slice-call.d.ts +1 -1
- package/slicing/static/slice-call.js +2 -2
- package/statistics/features/supported/assignments/assignments.js +2 -2
- package/statistics/features/supported/control-flow/control-flow.js +2 -2
- package/statistics/features/supported/data-access/data-access.js +6 -5
- package/statistics/features/supported/defined-functions/defined-functions.js +9 -8
- package/statistics/features/supported/expression-list/statistics-expression-list.js +2 -2
- package/statistics/features/supported/loops/loops.js +6 -5
- package/statistics/features/supported/used-functions/used-functions.js +2 -2
- package/statistics/features/supported/variables/variables.js +8 -8
- package/util/mermaid/ast.js +3 -3
- package/util/mermaid/cfg.js +3 -4
- package/util/mermaid/dfg.d.ts +1 -1
- package/util/mermaid/dfg.js +13 -12
- package/util/simple-df/dfg-ascii.js +1 -1
- package/util/version.js +1 -1
- package/r-bridge/lang-4.x/ast/model/collect.d.ts +0 -10
- package/r-bridge/lang-4.x/ast/model/collect.js +0 -25
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ It offers a wide variety of features, for example:
|
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
26
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
27
|
-
flowR repl using flowR v2.9.
|
|
27
|
+
flowR repl using flowR v2.9.10, R grammar v14 (tree-sitter engine)
|
|
28
28
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -53,7 +53,7 @@ It offers a wide variety of features, for example:
|
|
|
53
53
|
╰ Network Functions (network-functions):
|
|
54
54
|
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0
|
|
55
55
|
╰ Dataframe Access Validation (dataframe-access-validation):
|
|
56
|
-
╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs:
|
|
56
|
+
╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 1
|
|
57
57
|
╰ Dead Code (dead-code):
|
|
58
58
|
╰ Metadata: consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0
|
|
59
59
|
╰ Useless Loops (useless-loop):
|
|
@@ -82,17 +82,17 @@ It offers a wide variety of features, for example:
|
|
|
82
82
|
|
|
83
83
|
Query: **linter** (3 ms)\
|
|
84
84
|
╰ **Deprecated Functions** (deprecated-functions):\
|
|
85
|
-
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs:
|
|
85
|
+
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
86
86
|
╰ **File Path Validity** (file-path-validity):\
|
|
87
87
|
╰ certain:\
|
|
88
88
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
89
|
-
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
89
|
+
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
90
90
|
╰ **Seeded Randomness** (seeded-randomness):\
|
|
91
|
-
╰ _Metadata_: <code>consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs:
|
|
91
|
+
╰ _Metadata_: <code>consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
92
92
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
93
93
|
╰ certain:\
|
|
94
94
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
95
|
-
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
95
|
+
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
96
96
|
╰ **Unused Definitions** (unused-definitions):\
|
|
97
97
|
╰ _Metadata_: <code>totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
98
98
|
╰ **Naming Convention** (naming-convention):\
|
|
@@ -100,16 +100,16 @@ It offers a wide variety of features, for example:
|
|
|
100
100
|
╰ **Network Functions** (network-functions):\
|
|
101
101
|
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
102
102
|
╰ **Dataframe Access Validation** (dataframe-access-validation):\
|
|
103
|
-
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs:
|
|
103
|
+
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
104
104
|
╰ **Dead Code** (dead-code):\
|
|
105
|
-
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs: 0, processTimeMs:
|
|
105
|
+
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs: 0, processTimeMs: 1</code>\
|
|
106
106
|
╰ **Useless Loops** (useless-loop):\
|
|
107
107
|
╰ _Metadata_: <code>numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
108
108
|
_All queries together required ≈3 ms (1ms accuracy, total 3 ms)_
|
|
109
109
|
|
|
110
110
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
111
111
|
|
|
112
|
-
The analysis required
|
|
112
|
+
The analysis required _2.5 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
113
113
|
|
|
114
114
|
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
|
|
115
115
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -126,7 +126,7 @@ It offers a wide variety of features, for example:
|
|
|
126
126
|
".meta": {
|
|
127
127
|
"totalCalls": 0,
|
|
128
128
|
"totalFunctionDefinitions": 0,
|
|
129
|
-
"searchTimeMs":
|
|
129
|
+
"searchTimeMs": 1,
|
|
130
130
|
"processTimeMs": 0
|
|
131
131
|
}
|
|
132
132
|
},
|
|
@@ -149,7 +149,7 @@ It offers a wide variety of features, for example:
|
|
|
149
149
|
"totalUnknown": 0,
|
|
150
150
|
"totalWritesBeforeAlways": 0,
|
|
151
151
|
"totalValid": 0,
|
|
152
|
-
"searchTimeMs":
|
|
152
|
+
"searchTimeMs": 0,
|
|
153
153
|
"processTimeMs": 0
|
|
154
154
|
}
|
|
155
155
|
},
|
|
@@ -161,7 +161,7 @@ It offers a wide variety of features, for example:
|
|
|
161
161
|
"callsWithAssignmentProducers": 0,
|
|
162
162
|
"callsWithNonConstantProducers": 0,
|
|
163
163
|
"callsWithOtherBranchProducers": 0,
|
|
164
|
-
"searchTimeMs":
|
|
164
|
+
"searchTimeMs": 1,
|
|
165
165
|
"processTimeMs": 0
|
|
166
166
|
}
|
|
167
167
|
},
|
|
@@ -181,7 +181,7 @@ It offers a wide variety of features, for example:
|
|
|
181
181
|
".meta": {
|
|
182
182
|
"totalConsidered": 1,
|
|
183
183
|
"totalUnknown": 0,
|
|
184
|
-
"searchTimeMs":
|
|
184
|
+
"searchTimeMs": 0,
|
|
185
185
|
"processTimeMs": 0
|
|
186
186
|
}
|
|
187
187
|
},
|
|
@@ -218,7 +218,7 @@ It offers a wide variety of features, for example:
|
|
|
218
218
|
"numAccesses": 0,
|
|
219
219
|
"totalAccessed": 0,
|
|
220
220
|
"searchTimeMs": 0,
|
|
221
|
-
"processTimeMs":
|
|
221
|
+
"processTimeMs": 0
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
224
|
"dead-code": {
|
|
@@ -226,7 +226,7 @@ It offers a wide variety of features, for example:
|
|
|
226
226
|
".meta": {
|
|
227
227
|
"consideredNodes": 5,
|
|
228
228
|
"searchTimeMs": 0,
|
|
229
|
-
"processTimeMs":
|
|
229
|
+
"processTimeMs": 1
|
|
230
230
|
}
|
|
231
231
|
},
|
|
232
232
|
"useless-loop": {
|
|
@@ -308,7 +308,7 @@ It offers a wide variety of features, for example:
|
|
|
308
308
|
|
|
309
309
|
```shell
|
|
310
310
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
311
|
-
flowR repl using flowR v2.9.
|
|
311
|
+
flowR repl using flowR v2.9.10, R grammar v14 (tree-sitter engine)
|
|
312
312
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
313
313
|
```
|
|
314
314
|
|
|
@@ -322,7 +322,7 @@ It offers a wide variety of features, for example:
|
|
|
322
322
|
N <- 10
|
|
323
323
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
324
324
|
sum
|
|
325
|
-
All queries together required ≈
|
|
325
|
+
All queries together required ≈2 ms (1ms accuracy, total 3 ms)
|
|
326
326
|
```
|
|
327
327
|
|
|
328
328
|
|
|
@@ -356,7 +356,7 @@ It offers a wide variety of features, for example:
|
|
|
356
356
|
|
|
357
357
|
|
|
358
358
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
359
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
359
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">104.5 ms</span></i> (as of Feb 13, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
360
360
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
361
361
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/wiki/dataflow-graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/wiki/dataflow-graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/wiki/dataflow-graph#perspectives-cg).
|
|
362
362
|
|
|
@@ -392,7 +392,7 @@ It offers a wide variety of features, for example:
|
|
|
392
392
|
|
|
393
393
|
```shell
|
|
394
394
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
395
|
-
flowR repl using flowR v2.9.
|
|
395
|
+
flowR repl using flowR v2.9.10, R grammar v14 (tree-sitter engine)
|
|
396
396
|
R> :dataflow* test/testfiles/example.R
|
|
397
397
|
```
|
|
398
398
|
|
|
@@ -401,7 +401,7 @@ It offers a wide variety of features, for example:
|
|
|
401
401
|
|
|
402
402
|
|
|
403
403
|
```text
|
|
404
|
-
https://mermaid.live/view#base64:
|
|
404
|
+
https://mermaid.live/view#base64:eyJjb2RlIjoiZmxvd2NoYXJ0IEJUXG4gICAgMChbXCJgIzkxO1JTeW1ib2wjOTM7IHRlc3RcbiAgICAgICgwKVxuICAgICAgKjEuMS00KmBcIl0pXG4gICAlJSBObyBlZGdlcyBmb3VuZCBmb3IgMFxuICAgIDEoW1wiYCM5MTtSU3ltYm9sIzkzOyB0ZXN0ZmlsZXNcbiAgICAgICgxKVxuICAgICAgKjEuNi0xNCpgXCJdKVxuICAgJSUgTm8gZWRnZXMgZm91bmQgZm9yIDFcbiAgICAyW1tcImAjOTE7UkJpbmFyeU9wIzkzOyAvXG4gICAgICAoMilcbiAgICAgICoxLjEtMTQqXG4gICAgKDAsIDEpYFwiXV1cbiAgICBidWlsdC1pbjpfW1wiYEJ1aWx0LUluOlxuL2BcIl1cbiAgICBzdHlsZSBidWlsdC1pbjpfIHN0cm9rZTpncmF5LGZpbGw6Z3JheSxzdHJva2Utd2lkdGg6MnB4LG9wYWNpdHk6Ljg7XG4gICAgMyhbXCJgIzkxO1JTeW1ib2wjOTM7IGV4YW1wbGUuUlxuICAgICAgKDMpXG4gICAgICAqMS4xNi0yNCpgXCJdKVxuICAgJSUgTm8gZWRnZXMgZm91bmQgZm9yIDNcbiAgICA0W1tcImAjOTE7UkJpbmFyeU9wIzkzOyAvXG4gICAgICAoNClcbiAgICAgICoxLjEtMjQqXG4gICAgKDIsIDMpYFwiXV1cbiAgICAyIC0tPnxcInJlYWRzLCBhcmd1bWVudFwifCAwXG4gICAgMiAtLT58XCJyZWFkcywgYXJndW1lbnRcInwgMVxuICAgIDIgLS4tPnxcInJlYWRzLCBjYWxsc1wifCBidWlsdC1pbjpfXG4gICAgbGlua1N0eWxlIDIgc3Ryb2tlOmdyYXk7XG4gICAgNCAtLT58XCJyZWFkcywgYXJndW1lbnRcInwgMlxuICAgIDQgLS0+fFwicmVhZHMsIGFyZ3VtZW50XCJ8IDNcbiAgICA0IC0uLT58XCJyZWFkcywgY2FsbHNcInwgYnVpbHQtaW46X1xuICAgIGxpbmtTdHlsZSA1IHN0cm9rZTpncmF5OyIsIm1lcm1haWQiOnsiYXV0b1N5bmMiOnRydWV9fQ==
|
|
405
405
|
```
|
|
406
406
|
|
|
407
407
|
|
|
@@ -416,6 +416,7 @@ It offers a wide variety of features, for example:
|
|
|
416
416
|
1{{"`#91;RNumber#93; 0
|
|
417
417
|
(1)
|
|
418
418
|
*1.8*`"}}
|
|
419
|
+
%% No edges found for 1
|
|
419
420
|
0["`#91;RSymbol#93; sum
|
|
420
421
|
(0)
|
|
421
422
|
*1.1-3*`"]
|
|
@@ -429,6 +430,7 @@ It offers a wide variety of features, for example:
|
|
|
429
430
|
4{{"`#91;RNumber#93; 1
|
|
430
431
|
(4)
|
|
431
432
|
*2.12*`"}}
|
|
433
|
+
%% No edges found for 4
|
|
432
434
|
3["`#91;RSymbol#93; product
|
|
433
435
|
(3)
|
|
434
436
|
*2.1-7*`"]
|
|
@@ -439,6 +441,7 @@ It offers a wide variety of features, for example:
|
|
|
439
441
|
7{{"`#91;RNumber#93; 7
|
|
440
442
|
(7)
|
|
441
443
|
*3.6*`"}}
|
|
444
|
+
%% No edges found for 7
|
|
442
445
|
6["`#91;RSymbol#93; w
|
|
443
446
|
(6)
|
|
444
447
|
*3.1*`"]
|
|
@@ -449,6 +452,7 @@ It offers a wide variety of features, for example:
|
|
|
449
452
|
10{{"`#91;RNumber#93; 10
|
|
450
453
|
(10)
|
|
451
454
|
*4.6-7*`"}}
|
|
455
|
+
%% No edges found for 10
|
|
452
456
|
9["`#91;RSymbol#93; N
|
|
453
457
|
(9)
|
|
454
458
|
*4.1*`"]
|
|
@@ -462,12 +466,14 @@ It offers a wide variety of features, for example:
|
|
|
462
466
|
13{{"`#91;RNumber#93; 1
|
|
463
467
|
(13)
|
|
464
468
|
*6.11*`"}}
|
|
469
|
+
%% No edges found for 13
|
|
465
470
|
16(["`#91;RSymbol#93; N
|
|
466
471
|
(16)
|
|
467
472
|
*6.14*`"])
|
|
468
473
|
17{{"`#91;RNumber#93; 1
|
|
469
474
|
(17)
|
|
470
475
|
*6.16*`"}}
|
|
476
|
+
%% No edges found for 17
|
|
471
477
|
18[["`#91;RBinaryOp#93; #45;
|
|
472
478
|
(18)
|
|
473
479
|
*6.14-16*
|
|
@@ -479,9 +485,6 @@ It offers a wide variety of features, for example:
|
|
|
479
485
|
(19)
|
|
480
486
|
*6.13*
|
|
481
487
|
(18)`"]]
|
|
482
|
-
built-in:_["`Built-In:
|
|
483
|
-
(`"]
|
|
484
|
-
style built-in:_ stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
|
|
485
488
|
20[["`#91;RBinaryOp#93; #58;
|
|
486
489
|
(20)
|
|
487
490
|
*6.11-17*
|
|
@@ -499,6 +502,9 @@ It offers a wide variety of features, for example:
|
|
|
499
502
|
(26, :may:36+)
|
|
500
503
|
*7.10-16*
|
|
501
504
|
(24, 25)`"]]
|
|
505
|
+
built-in:_["`Built-In:
|
|
506
|
+
#43;`"]
|
|
507
|
+
style built-in:_ stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
|
|
502
508
|
27(["`#91;RSymbol#93; w
|
|
503
509
|
(27, :may:36+)
|
|
504
510
|
*7.20*`"])
|
|
@@ -544,16 +550,15 @@ It offers a wide variety of features, for example:
|
|
|
544
550
|
38{{"`#91;RString#93; #34;Sum#58;#34;
|
|
545
551
|
(38)
|
|
546
552
|
*11.5-10*`"}}
|
|
553
|
+
%% No edges found for 38
|
|
547
554
|
40(["`#91;RSymbol#93; sum
|
|
548
555
|
(40)
|
|
549
556
|
*11.13-15*`"])
|
|
550
|
-
built-in:sum["`Built-In:
|
|
551
|
-
sum`"]
|
|
552
|
-
style built-in:sum stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
|
|
553
557
|
42{{"`#91;RString#93; #34;
|
|
554
558
|
#34;
|
|
555
559
|
(42)
|
|
556
560
|
*11.18-21*`"}}
|
|
561
|
+
%% No edges found for 42
|
|
557
562
|
44[["`#91;RFunctionCall#93; cat
|
|
558
563
|
(44)
|
|
559
564
|
*11.1-22*
|
|
@@ -564,6 +569,7 @@ It offers a wide variety of features, for example:
|
|
|
564
569
|
46{{"`#91;RString#93; #34;Product#58;#34;
|
|
565
570
|
(46)
|
|
566
571
|
*12.5-14*`"}}
|
|
572
|
+
%% No edges found for 46
|
|
567
573
|
48(["`#91;RSymbol#93; product
|
|
568
574
|
(48)
|
|
569
575
|
*12.17-23*`"])
|
|
@@ -571,6 +577,7 @@ It offers a wide variety of features, for example:
|
|
|
571
577
|
#34;
|
|
572
578
|
(50)
|
|
573
579
|
*12.26-29*`"}}
|
|
580
|
+
%% No edges found for 50
|
|
574
581
|
52[["`#91;RFunctionCall#93; cat
|
|
575
582
|
(52)
|
|
576
583
|
*12.1-30*
|
|
@@ -606,98 +613,94 @@ It offers a wide variety of features, for example:
|
|
|
606
613
|
18 -.->|"reads, calls"| built-in:-
|
|
607
614
|
linkStyle 24 stroke:gray;
|
|
608
615
|
19 -->|"returns, argument"| 18
|
|
609
|
-
19 -.->|"reads"| built-in:_
|
|
610
|
-
linkStyle 26 stroke:gray;
|
|
611
616
|
20 -->|"reads, argument"| 13
|
|
612
617
|
20 -->|"reads, argument"| 19
|
|
613
618
|
20 -.->|"reads, calls"| built-in::
|
|
614
|
-
linkStyle
|
|
619
|
+
linkStyle 28 stroke:gray;
|
|
615
620
|
24 -->|"reads"| 0
|
|
616
621
|
24 -->|"reads"| 23
|
|
617
622
|
24 -->|"CD-True"| 36
|
|
618
|
-
linkStyle
|
|
623
|
+
linkStyle 31 stroke:gray,color:gray;
|
|
619
624
|
25 -->|"reads"| 12
|
|
620
625
|
25 -->|"CD-True"| 36
|
|
621
|
-
linkStyle
|
|
626
|
+
linkStyle 33 stroke:gray,color:gray;
|
|
622
627
|
26 -->|"reads, argument"| 24
|
|
623
628
|
26 -->|"reads, argument"| 25
|
|
624
629
|
26 -.->|"reads, calls"| built-in:_
|
|
625
|
-
linkStyle
|
|
630
|
+
linkStyle 36 stroke:gray;
|
|
626
631
|
26 -->|"CD-True"| 36
|
|
627
|
-
linkStyle
|
|
632
|
+
linkStyle 37 stroke:gray,color:gray;
|
|
628
633
|
27 -->|"reads"| 6
|
|
629
634
|
27 -->|"CD-True"| 36
|
|
630
|
-
linkStyle
|
|
635
|
+
linkStyle 39 stroke:gray,color:gray;
|
|
631
636
|
28 -->|"reads, argument"| 26
|
|
632
637
|
28 -->|"reads, argument"| 27
|
|
633
638
|
28 -.->|"reads, calls"| built-in:_
|
|
634
|
-
linkStyle
|
|
639
|
+
linkStyle 42 stroke:gray;
|
|
635
640
|
28 -->|"CD-True"| 36
|
|
636
|
-
linkStyle
|
|
641
|
+
linkStyle 43 stroke:gray,color:gray;
|
|
637
642
|
23 -->|"defined-by"| 28
|
|
638
643
|
23 -->|"defined-by"| 29
|
|
639
644
|
23 -->|"CD-True"| 36
|
|
640
|
-
linkStyle
|
|
645
|
+
linkStyle 46 stroke:gray,color:gray;
|
|
641
646
|
29 -->|"reads, argument"| 28
|
|
642
647
|
29 -->|"returns, argument"| 23
|
|
643
648
|
29 -.->|"reads, calls"| built-in:_-
|
|
644
|
-
linkStyle
|
|
649
|
+
linkStyle 49 stroke:gray;
|
|
645
650
|
29 -->|"CD-True"| 36
|
|
646
|
-
linkStyle
|
|
651
|
+
linkStyle 50 stroke:gray,color:gray;
|
|
647
652
|
31 -->|"reads"| 3
|
|
648
653
|
31 -->|"reads"| 30
|
|
649
654
|
31 -->|"CD-True"| 36
|
|
650
|
-
linkStyle
|
|
655
|
+
linkStyle 53 stroke:gray,color:gray;
|
|
651
656
|
32 -->|"reads"| 12
|
|
652
657
|
32 -->|"CD-True"| 36
|
|
653
|
-
linkStyle
|
|
658
|
+
linkStyle 55 stroke:gray,color:gray;
|
|
654
659
|
33 -->|"reads, argument"| 31
|
|
655
660
|
33 -->|"reads, argument"| 32
|
|
656
661
|
33 -.->|"reads, calls"| built-in:_
|
|
657
|
-
linkStyle
|
|
662
|
+
linkStyle 58 stroke:gray;
|
|
658
663
|
33 -->|"CD-True"| 36
|
|
659
|
-
linkStyle
|
|
664
|
+
linkStyle 59 stroke:gray,color:gray;
|
|
660
665
|
30 -->|"defined-by"| 33
|
|
661
666
|
30 -->|"defined-by"| 34
|
|
662
667
|
30 -->|"CD-True"| 36
|
|
663
|
-
linkStyle
|
|
668
|
+
linkStyle 62 stroke:gray,color:gray;
|
|
664
669
|
34 -->|"reads, argument"| 33
|
|
665
670
|
34 -->|"returns, argument"| 30
|
|
666
671
|
34 -.->|"reads, calls"| built-in:_-
|
|
667
|
-
linkStyle
|
|
672
|
+
linkStyle 65 stroke:gray;
|
|
668
673
|
34 -->|"CD-True"| 36
|
|
669
|
-
linkStyle
|
|
674
|
+
linkStyle 66 stroke:gray,color:gray;
|
|
670
675
|
35 -->|"argument"| 29
|
|
671
676
|
35 -->|"returns, argument"| 34
|
|
672
677
|
35 -.->|"reads, calls"| built-in:_
|
|
673
|
-
linkStyle
|
|
678
|
+
linkStyle 69 stroke:gray;
|
|
674
679
|
35 -->|"CD-True"| 36
|
|
675
|
-
linkStyle
|
|
680
|
+
linkStyle 70 stroke:gray,color:gray;
|
|
676
681
|
36 -->|"argument"| 12
|
|
677
682
|
36 -->|"reads, argument"| 20
|
|
678
683
|
36 -->|"argument, non-standard-evaluation"| 35
|
|
679
684
|
36 -.->|"reads, calls"| built-in:for
|
|
680
|
-
linkStyle
|
|
685
|
+
linkStyle 74 stroke:gray;
|
|
681
686
|
40 -->|"reads"| 0
|
|
682
687
|
40 -->|"reads"| 23
|
|
683
|
-
40 -.->|"reads"| built-in:sum
|
|
684
|
-
linkStyle 78 stroke:gray;
|
|
685
688
|
44 -->|"argument"| 38
|
|
686
689
|
44 -->|"reads, argument"| 40
|
|
687
690
|
44 -->|"argument"| 42
|
|
688
691
|
44 -.->|"reads, calls"| built-in:cat
|
|
689
|
-
linkStyle
|
|
692
|
+
linkStyle 80 stroke:gray;
|
|
690
693
|
48 -->|"reads"| 3
|
|
691
694
|
48 -->|"reads"| 30
|
|
692
695
|
52 -->|"argument"| 46
|
|
693
696
|
52 -->|"reads, argument"| 48
|
|
694
697
|
52 -->|"argument"| 50
|
|
695
698
|
52 -.->|"reads, calls"| built-in:cat
|
|
696
|
-
linkStyle
|
|
699
|
+
linkStyle 86 stroke:gray;
|
|
697
700
|
```
|
|
698
701
|
|
|
699
702
|
|
|
700
|
-
(The analysis required
|
|
703
|
+
(The analysis required _2.2 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
701
704
|
|
|
702
705
|
|
|
703
706
|
|
|
@@ -10,31 +10,37 @@ import type { NormalizedAst, ParentInformation } from '../r-bridge/lang-4.x/ast/
|
|
|
10
10
|
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
11
11
|
import { type AnyAbstractDomain } from './domains/abstract-domain';
|
|
12
12
|
import type { StateAbstractDomain } from './domains/state-abstract-domain';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
13
|
+
import { MutableStateAbstractDomain } from './domains/state-abstract-domain';
|
|
14
|
+
export type AbsintVisitorConfiguration = Omit<SemanticCfgGuidedVisitorConfiguration<NoInfo, ControlFlowInformation, NormalizedAst>, 'defaultVisitingOrder' | 'defaultVisitingType'>;
|
|
16
15
|
/**
|
|
17
16
|
* A control flow graph visitor to perform abstract interpretation.
|
|
18
17
|
*
|
|
19
18
|
* However, the visitor does not yet support inter-procedural abstract interpretation and abstract condition semantics.
|
|
20
19
|
*/
|
|
21
|
-
export declare abstract class AbstractInterpretationVisitor<Domain extends AnyAbstractDomain, Config extends AbsintVisitorConfiguration
|
|
20
|
+
export declare abstract class AbstractInterpretationVisitor<Domain extends AnyAbstractDomain, Config extends AbsintVisitorConfiguration = AbsintVisitorConfiguration> extends SemanticCfgGuidedVisitor<NoInfo, ControlFlowInformation, NormalizedAst, DataflowGraph, Config & {
|
|
22
21
|
defaultVisitingOrder: 'forward';
|
|
23
22
|
defaultVisitingType: 'exit';
|
|
24
23
|
}> {
|
|
25
24
|
/**
|
|
26
25
|
* The abstract trace of the abstract interpretation visitor mapping node IDs to the abstract state at the respective node.
|
|
27
26
|
*/
|
|
28
|
-
protected readonly trace: Map<NodeId,
|
|
27
|
+
protected readonly trace: Map<NodeId, MutableStateAbstractDomain<Domain>>;
|
|
29
28
|
/**
|
|
30
29
|
* The current abstract state domain at the currently processed AST node.
|
|
31
30
|
*/
|
|
32
|
-
|
|
31
|
+
private _currentState;
|
|
33
32
|
/**
|
|
34
33
|
* A set of nodes representing variable definitions that have already been visited but whose assignment has not yet been processed.
|
|
35
34
|
*/
|
|
36
35
|
private readonly unassigned;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the current abstract state has been copied/cloned and is save to modify in place.
|
|
38
|
+
*/
|
|
39
|
+
private stateCopied;
|
|
37
40
|
constructor(config: Config);
|
|
41
|
+
get currentState(): StateAbstractDomain<Domain>;
|
|
42
|
+
removeState(node: NodeId): void;
|
|
43
|
+
updateState(node: NodeId, value: Domain): void;
|
|
38
44
|
/**
|
|
39
45
|
* Resolves the inferred abstract value of an AST node.
|
|
40
46
|
* This requires that the abstract interpretation visitor has been completed, or at least started.
|
|
@@ -62,6 +68,7 @@ export declare abstract class AbstractInterpretationVisitor<Domain extends AnyAb
|
|
|
62
68
|
*/
|
|
63
69
|
getAbstractTrace(): ReadonlyMap<NodeId, StateAbstractDomain<Domain>>;
|
|
64
70
|
start(): void;
|
|
71
|
+
protected startVisitor(start: readonly NodeId[]): void;
|
|
65
72
|
protected visitNode(vertexId: NodeId): boolean;
|
|
66
73
|
protected onDispatchFunctionCallOrigin(call: DataflowGraphVertexFunctionCall, origin: BuiltInProcName): void;
|
|
67
74
|
protected onVariableDefinition({ vertex }: {
|
|
@@ -93,21 +100,16 @@ export declare abstract class AbstractInterpretationVisitor<Domain extends AnyAb
|
|
|
93
100
|
protected getPredecessorNodes(vertexId: NodeId): NodeId[];
|
|
94
101
|
/** Gets each variable origin that has already been visited and whose assignment has already been processed */
|
|
95
102
|
protected getVariableOrigins(nodeId: NodeId): NodeId[];
|
|
96
|
-
/** We only perform widening at `for`, `while`, or `repeat` loops with more than one
|
|
103
|
+
/** We only perform widening at `for`, `while`, or `repeat` loops with more than one ingoing CFG edge */
|
|
97
104
|
protected isWideningPoint(nodeId: NodeId): boolean;
|
|
98
|
-
/**
|
|
99
|
-
* Checks whether to continue visiting the control flow graph after a widening point.
|
|
100
|
-
* By default, we only continue visiting if the widening point is visited for the first time or the abstract state at the widening point changed.
|
|
101
|
-
*/
|
|
102
|
-
protected shouldContinueVisiting(wideningPoint: CfgVertex, oldState: StateAbstractDomain<Domain>): boolean;
|
|
103
105
|
/**
|
|
104
106
|
* Checks whether a control flow graph vertex should be skipped during visitation.
|
|
105
|
-
* By default, we only process vertices of leaf nodes and exit vertices (no entry nodes of complex nodes).
|
|
107
|
+
* By default, we only process entry vertices of widening points, vertices of leaf nodes, and exit vertices (no entry nodes of complex nodes).
|
|
106
108
|
*/
|
|
107
109
|
protected shouldSkipVertex(vertex: CfgVertex): boolean;
|
|
108
110
|
/**
|
|
109
111
|
* Whether widening should be performed at a widening point.
|
|
110
|
-
* By default, we perform widening when the number of
|
|
112
|
+
* By default, we perform widening when the number of visits of the widening point reaches the widening threshold of the config.
|
|
111
113
|
*/
|
|
112
114
|
protected shouldWiden(wideningPoint: CfgVertex): boolean;
|
|
113
115
|
}
|