@eagleoutice/flowr 2.9.13 → 2.10.1
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 +52 -28
- package/abstract-interpretation/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/absint-visitor.js +20 -20
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -2
- package/benchmark/slicer.d.ts +1 -1
- package/benchmark/slicer.js +7 -5
- package/benchmark/stats/stats.d.ts +2 -2
- package/cli/repl/commands/repl-dataflow.js +5 -5
- package/cli/repl/parser/slice-query-parser.d.ts +3 -3
- package/cli/repl/parser/slice-query-parser.js +2 -2
- package/cli/repl/server/connection.js +2 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/repl/server/messages/message-slice.js +2 -2
- package/config.d.ts +12 -8
- package/config.js +5 -3
- package/control-flow/extract-cfg.js +2 -2
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +43 -43
- package/control-flow/useless-loop.d.ts +1 -1
- package/control-flow/useless-loop.js +3 -3
- package/core/print/dataflow-printer.d.ts +0 -14
- package/core/print/dataflow-printer.js +0 -21
- package/core/steps/all/core/20-dataflow.d.ts +3 -3
- package/core/steps/all/core/20-dataflow.js +3 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +2 -5
- package/core/steps/all/static-slicing/00-slice.js +6 -8
- package/core/steps/pipeline/default-pipelines.d.ts +89 -89
- package/dataflow/environments/built-in-proc-name.d.ts +83 -0
- package/dataflow/environments/built-in-proc-name.js +88 -0
- package/dataflow/environments/built-in.d.ts +1 -83
- package/dataflow/environments/built-in.js +37 -120
- package/dataflow/environments/default-builtin-config.d.ts +1 -1
- package/dataflow/environments/default-builtin-config.js +75 -75
- package/dataflow/environments/identifier.d.ts +5 -0
- package/dataflow/environments/identifier.js +18 -0
- package/dataflow/eval/resolve/resolve.js +2 -2
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +2 -2
- package/dataflow/graph/call-graph.d.ts +46 -19
- package/dataflow/graph/call-graph.js +95 -114
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/df-helper.d.ts +133 -0
- package/dataflow/graph/df-helper.js +138 -0
- package/dataflow/graph/diff-dataflow-graph.d.ts +5 -10
- package/dataflow/graph/diff-dataflow-graph.js +3 -28
- package/dataflow/graph/edge.d.ts +1 -0
- package/dataflow/graph/edge.js +1 -0
- package/dataflow/graph/graph-helper.d.ts +60 -0
- package/dataflow/graph/graph-helper.js +128 -0
- package/dataflow/graph/graph.d.ts +19 -3
- package/dataflow/graph/graph.js +32 -5
- package/dataflow/graph/vertex.d.ts +3 -1
- package/dataflow/info.d.ts +14 -4
- package/dataflow/info.js +28 -16
- package/dataflow/internal/linker.d.ts +14 -10
- package/dataflow/internal/linker.js +29 -32
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +8 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +5 -5
- 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 +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +6 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +2 -2
- package/dataflow/internal/process/functions/call/common.js +2 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.d.ts +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -1
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.js +6 -6
- package/documentation/doc-readme.js +2 -1
- package/documentation/doc-util/doc-dfg.d.ts +3 -0
- package/documentation/doc-util/doc-dfg.js +5 -7
- package/documentation/doc-util/doc-normalized-ast.d.ts +0 -6
- package/documentation/doc-util/doc-normalized-ast.js +0 -23
- package/documentation/doc-util/doc-structure.js +3 -3
- package/documentation/doc-util/doc-types.js +3 -3
- package/documentation/wiki-core.js +5 -4
- package/documentation/wiki-dataflow-graph.js +14 -12
- package/documentation/wiki-interface.js +3 -3
- package/documentation/wiki-linter.js +6 -0
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/linter/linter-rules.d.ts +49 -1
- package/linter/linter-rules.js +5 -1
- package/linter/rules/problematic-eval.d.ts +44 -0
- package/linter/rules/problematic-eval.js +83 -0
- package/linter/rules/seeded-randomness.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +35 -0
- package/linter/rules/stop-with-call-arg.js +72 -0
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +7 -7
- package/project/cache/flowr-analyzer-cache.d.ts +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/flowr-analyzer-builder.d.ts +3 -0
- package/project/flowr-analyzer.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +2 -2
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +3 -3
- package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +6 -0
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +66 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +36 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +63 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +90 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.js +308 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +2 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +3 -3
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +6 -0
- package/queries/catalog/provenance-query/provenance-query-executor.js +34 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +35 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +62 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
- package/queries/query.d.ts +17 -1
- package/queries/query.js +4 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/model.js +10 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +2 -0
- 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 +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +29 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +29 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +2 -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 +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +2 -0
- 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 +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +2 -0
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-printer.js +3 -3
- package/search/search-executor/search-enrichers.js +2 -2
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/parse.d.ts +43 -18
- package/slicing/criterion/parse.js +68 -63
- package/slicing/static/slicer-types.d.ts +2 -3
- package/slicing/static/static-slicer.d.ts +3 -4
- package/slicing/static/static-slicer.js +32 -12
- package/util/collections/arrays.d.ts +4 -0
- package/util/collections/arrays.js +7 -0
- package/util/diff.d.ts +2 -2
- package/util/mermaid/ast.js +4 -4
- package/util/mermaid/cfg.js +5 -5
- package/util/mermaid/dfg.d.ts +33 -18
- package/util/mermaid/dfg.js +47 -31
- package/util/mermaid/mermaid.d.ts +57 -12
- package/util/mermaid/mermaid.js +74 -67
- package/util/range.d.ts +8 -0
- package/util/range.js +13 -1
- package/util/slice-direction.d.ts +7 -0
- package/util/slice-direction.js +12 -0
- package/util/version.js +1 -1
- package/dataflow/graph/invert-dfg.d.ts +0 -6
- package/dataflow/graph/invert-dfg.js +0 -20
- package/dataflow/graph/resolve-graph.d.ts +0 -8
- package/dataflow/graph/resolve-graph.js +0 -59
package/config.d.ts
CHANGED
|
@@ -159,6 +159,10 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
159
159
|
* The maximum number of iterations to perform on a single function call during slicing
|
|
160
160
|
*/
|
|
161
161
|
readonly threshold?: number;
|
|
162
|
+
/**
|
|
163
|
+
* If set, the slicer will gain an additional post-pass
|
|
164
|
+
*/
|
|
165
|
+
readonly autoExtend?: boolean;
|
|
162
166
|
};
|
|
163
167
|
};
|
|
164
168
|
/**
|
|
@@ -231,7 +235,7 @@ export declare const FlowrConfig: {
|
|
|
231
235
|
* The default configuration for flowR, used when no config file is found or when a config file is missing some options.
|
|
232
236
|
* You can use this as a base for your own config and only specify the options you want to change.
|
|
233
237
|
*/
|
|
234
|
-
readonly default: () => FlowrConfig;
|
|
238
|
+
readonly default: (this: void) => FlowrConfig;
|
|
235
239
|
/**
|
|
236
240
|
* The Joi schema for validating a config file, use this to validate your config file before using it. You can also use this to generate documentation for the config file format.
|
|
237
241
|
*/
|
|
@@ -239,26 +243,26 @@ export declare const FlowrConfig: {
|
|
|
239
243
|
/**
|
|
240
244
|
* Parses the given JSON string as a flowR config file, returning the resulting config object if the parsing and validation were successful, or `undefined` if there was an error.
|
|
241
245
|
*/
|
|
242
|
-
readonly parse: (jsonString: string) => FlowrConfig | undefined;
|
|
246
|
+
readonly parse: (this: void, jsonString: string) => FlowrConfig | undefined;
|
|
243
247
|
/**
|
|
244
248
|
* Creates a new flowr config that has the updated values.
|
|
245
249
|
*/
|
|
246
|
-
readonly amend: (config: FlowrConfig, amendmentFunc: (config: DeepWritable<FlowrConfig>) => FlowrConfig | void) => FlowrConfig;
|
|
250
|
+
readonly amend: (this: void, config: FlowrConfig, amendmentFunc: (config: DeepWritable<FlowrConfig>) => FlowrConfig | void) => FlowrConfig;
|
|
247
251
|
/**
|
|
248
252
|
* Clones the given flowr config object.
|
|
249
253
|
*/
|
|
250
|
-
readonly clone: (config: FlowrConfig) => FlowrConfig;
|
|
254
|
+
readonly clone: (this: void, config: FlowrConfig) => FlowrConfig;
|
|
251
255
|
/**
|
|
252
256
|
* Loads the flowr config from the given file or the default locations.
|
|
253
257
|
* Please note that you can also use this without a path parameter to
|
|
254
258
|
* infer the config from flowR's default locations.
|
|
255
259
|
* This is mostly useful for user-facing features.
|
|
256
260
|
*/
|
|
257
|
-
readonly fromFile: (configFile?: string, configWorkingDirectory?: string) => FlowrConfig;
|
|
261
|
+
readonly fromFile: (this: void, configFile?: string, configWorkingDirectory?: string) => FlowrConfig;
|
|
258
262
|
/**
|
|
259
263
|
* Gets the configuration for the given engine type from the config.
|
|
260
264
|
*/
|
|
261
|
-
readonly getForEngine: <T extends EngineConfig["type"]>(config: FlowrConfig, engine: T) => (EngineConfig & {
|
|
265
|
+
readonly getForEngine: <T extends EngineConfig["type"]>(this: void, config: FlowrConfig, engine: T) => (EngineConfig & {
|
|
262
266
|
type: T;
|
|
263
267
|
}) | undefined;
|
|
264
268
|
/**
|
|
@@ -272,10 +276,10 @@ export declare const FlowrConfig: {
|
|
|
272
276
|
* console.log(newConfig.solver.variables); // Output: "builtin"
|
|
273
277
|
* ```
|
|
274
278
|
*/
|
|
275
|
-
readonly setInConfig: <Path extends ValidFlowrConfigPaths>(config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => FlowrConfig;
|
|
279
|
+
readonly setInConfig: <Path extends ValidFlowrConfigPaths>(this: void, config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => FlowrConfig;
|
|
276
280
|
/**
|
|
277
281
|
* Modifies the given config object in place by setting the given value at the given key, where the key is a dot-separated path to the value in the config object.
|
|
278
282
|
* @see {@link setInConfig} for a version that returns a new config object instead of modifying the given one in place.
|
|
279
283
|
*/
|
|
280
|
-
readonly setInConfigInPlace: <Path extends ValidFlowrConfigPaths>(config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => void;
|
|
284
|
+
readonly setInConfigInPlace: <Path extends ValidFlowrConfigPaths>(this: void, config: FlowrConfig, key: Path, value: PathValue<FlowrConfig, Path>) => void;
|
|
281
285
|
};
|
package/config.js
CHANGED
|
@@ -93,7 +93,8 @@ exports.FlowrConfig = {
|
|
|
93
93
|
dataflowExtractors: undefined
|
|
94
94
|
},
|
|
95
95
|
slicer: {
|
|
96
|
-
threshold: 50
|
|
96
|
+
threshold: 50,
|
|
97
|
+
autoExtend: false
|
|
97
98
|
}
|
|
98
99
|
},
|
|
99
100
|
abstractInterpretation: {
|
|
@@ -153,7 +154,8 @@ exports.FlowrConfig = {
|
|
|
153
154
|
applyReplacements: joi_1.default.array().items(joi_1.default.object()).description('Provide name replacements for loaded files')
|
|
154
155
|
}).optional().description('If lax source calls are active, flowR searches for sourced files much more freely, based on the configurations you give it. This option is only in effect if `ignoreSourceCalls` is set to false.'),
|
|
155
156
|
slicer: joi_1.default.object({
|
|
156
|
-
threshold: joi_1.default.number().optional().description('The maximum number of iterations to perform on a single function call during slicing.')
|
|
157
|
+
threshold: joi_1.default.number().optional().description('The maximum number of iterations to perform on a single function call during slicing.'),
|
|
158
|
+
autoExtend: joi_1.default.boolean().optional().description('If set, the slicer will gain an additional post-pass.')
|
|
157
159
|
}).optional().description('The configuration for the slicer.')
|
|
158
160
|
}).description('How to resolve constants, constraints, cells, ...'),
|
|
159
161
|
abstractInterpretation: joi_1.default.object({
|
|
@@ -250,7 +252,7 @@ exports.FlowrConfig = {
|
|
|
250
252
|
*/
|
|
251
253
|
setInConfigInPlace(config, key, value) {
|
|
252
254
|
object_path_1.default.set(config, key, value);
|
|
253
|
-
}
|
|
255
|
+
},
|
|
254
256
|
};
|
|
255
257
|
function loadConfigFromFile(configFile, workingDirectory) {
|
|
256
258
|
if (configFile !== undefined) {
|
|
@@ -13,9 +13,9 @@ const vertex_1 = require("../dataflow/graph/vertex");
|
|
|
13
13
|
const control_flow_graph_1 = require("./control-flow-graph");
|
|
14
14
|
const cfg_simplification_1 = require("./cfg-simplification");
|
|
15
15
|
const assert_1 = require("../util/assert");
|
|
16
|
-
const built_in_1 = require("../dataflow/environments/built-in");
|
|
17
16
|
const stateful_fold_1 = require("../r-bridge/lang-4.x/ast/model/processing/stateful-fold");
|
|
18
17
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
18
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
19
19
|
const cfgFolds = {
|
|
20
20
|
down: (n, down) => {
|
|
21
21
|
if (r_function_definition_1.RFunctionDefinition.is(n)) {
|
|
@@ -382,7 +382,7 @@ function cfgFunctionCall(call, name, args, down) {
|
|
|
382
382
|
}
|
|
383
383
|
exports.ResolvedCallSuffix = control_flow_graph_1.CfgVertex.toExitId('-resolved-call');
|
|
384
384
|
const OriginToFoldTypeMap = {
|
|
385
|
-
[
|
|
385
|
+
[built_in_proc_name_1.BuiltInProcName.IfThenElse]: (folds, call, args, down) => {
|
|
386
386
|
// arguments are in order!
|
|
387
387
|
return folds.foldIfThenElse(call, // we will have to this more sophisticated if we rewrite the dfg based generation
|
|
388
388
|
args[0] === r_function_call_1.EmptyArgument ? (0, control_flow_graph_1.emptyControlFlowInformation)() : args[0], args[1] === r_function_call_1.EmptyArgument ? (0, control_flow_graph_1.emptyControlFlowInformation)() : args[1], args[2] === r_function_call_1.EmptyArgument ? (0, control_flow_graph_1.emptyControlFlowInformation)() : args[2], down);
|
|
@@ -11,10 +11,10 @@ import type { RLogical } from '../r-bridge/lang-4.x/ast/model/nodes/r-logical';
|
|
|
11
11
|
import type { DataflowGraph, FunctionArgument } from '../dataflow/graph/graph';
|
|
12
12
|
import type { NoInfo, RNode } from '../r-bridge/lang-4.x/ast/model/model';
|
|
13
13
|
import type { RSymbol } from '../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
14
|
-
import { BuiltInProcName } from '../dataflow/environments/built-in';
|
|
15
14
|
import type { RExpressionList } from '../r-bridge/lang-4.x/ast/model/nodes/r-expression-list';
|
|
16
15
|
import type { ReadOnlyFlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
17
16
|
import { RNull } from '../r-bridge/lang-4.x/convert-values';
|
|
17
|
+
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
18
18
|
export interface SemanticCfgGuidedVisitorConfiguration<OtherInfo = NoInfo, ControlFlow extends ControlFlowInformation = ControlFlowInformation, Ast extends NormalizedAst<OtherInfo> = NormalizedAst<OtherInfo>, Dfg extends DataflowGraph = DataflowGraph> extends DataflowCfgGuidedVisitorConfiguration<ControlFlow, Dfg>, SyntaxCfgGuidedVisitorConfiguration<OtherInfo, ControlFlow, Ast> {
|
|
19
19
|
readonly ctx: ReadOnlyFlowrAnalyzerContext;
|
|
20
20
|
}
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SemanticCfgGuidedVisitor = void 0;
|
|
4
4
|
const control_flow_graph_1 = require("./control-flow-graph");
|
|
5
5
|
const dfg_cfg_guided_visitor_1 = require("./dfg-cfg-guided-visitor");
|
|
6
|
-
const dfg_get_origin_1 = require("../dataflow/origin/dfg-get-origin");
|
|
7
6
|
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
8
7
|
const edge_1 = require("../dataflow/graph/edge");
|
|
9
8
|
const assert_1 = require("../util/assert");
|
|
10
|
-
const built_in_1 = require("../dataflow/environments/built-in");
|
|
11
9
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
12
10
|
const convert_values_1 = require("../r-bridge/lang-4.x/convert-values");
|
|
11
|
+
const df_helper_1 = require("../dataflow/graph/df-helper");
|
|
12
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
13
13
|
/**
|
|
14
14
|
* This visitor extends on the {@link DataflowAwareCfgGuidedVisitor} by dispatching visitors for separate function calls as well,
|
|
15
15
|
* providing more information!
|
|
@@ -117,7 +117,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
117
117
|
*/
|
|
118
118
|
visitFunctionCall(vertex) {
|
|
119
119
|
super.visitFunctionCall(vertex);
|
|
120
|
-
if (vertex.origin ===
|
|
120
|
+
if (vertex.origin === built_in_proc_name_1.BuiltInProcName.Unnamed) {
|
|
121
121
|
this.onUnnamedCall({ call: vertex });
|
|
122
122
|
}
|
|
123
123
|
else {
|
|
@@ -160,17 +160,17 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
160
160
|
*/
|
|
161
161
|
onDispatchFunctionCallOrigin(call, origin) {
|
|
162
162
|
switch (origin) {
|
|
163
|
-
case
|
|
163
|
+
case built_in_proc_name_1.BuiltInProcName.Eval:
|
|
164
164
|
return this.onEvalFunctionCall({ call });
|
|
165
|
-
case
|
|
165
|
+
case built_in_proc_name_1.BuiltInProcName.Apply:
|
|
166
166
|
return this.onApplyFunctionCall({ call });
|
|
167
|
-
case
|
|
167
|
+
case built_in_proc_name_1.BuiltInProcName.ExpressionList:
|
|
168
168
|
return this.onExpressionList({ call });
|
|
169
|
-
case
|
|
169
|
+
case built_in_proc_name_1.BuiltInProcName.Source:
|
|
170
170
|
return this.onSourceCall({ call });
|
|
171
|
-
case
|
|
171
|
+
case built_in_proc_name_1.BuiltInProcName.Access:
|
|
172
172
|
return this.onAccessCall({ call });
|
|
173
|
-
case
|
|
173
|
+
case built_in_proc_name_1.BuiltInProcName.IfThenElse: {
|
|
174
174
|
// recover dead arguments from ast
|
|
175
175
|
const ast = this.getNormalizedAst(call.id);
|
|
176
176
|
if (!ast || ast.type !== type_1.RType.IfThenElse) {
|
|
@@ -190,24 +190,24 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
case
|
|
193
|
+
case built_in_proc_name_1.BuiltInProcName.Get:
|
|
194
194
|
return this.onGetCall({ call });
|
|
195
|
-
case
|
|
195
|
+
case built_in_proc_name_1.BuiltInProcName.Rm:
|
|
196
196
|
return this.onRmCall({ call });
|
|
197
|
-
case
|
|
197
|
+
case built_in_proc_name_1.BuiltInProcName.List:
|
|
198
198
|
return this.onListCall({ call });
|
|
199
|
-
case
|
|
199
|
+
case built_in_proc_name_1.BuiltInProcName.Vector:
|
|
200
200
|
return this.onVectorCall({ call });
|
|
201
|
-
case
|
|
202
|
-
case
|
|
203
|
-
case
|
|
201
|
+
case built_in_proc_name_1.BuiltInProcName.Assignment:
|
|
202
|
+
case built_in_proc_name_1.BuiltInProcName.AssignmentLike:
|
|
203
|
+
case built_in_proc_name_1.BuiltInProcName.TableAssignment: {
|
|
204
204
|
const outgoing = this.config.dfg.outgoingEdges(call.id);
|
|
205
205
|
if (outgoing) {
|
|
206
206
|
const target = outgoing.entries().filter(([, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Returns)).toArray();
|
|
207
207
|
if (target.length === 1) {
|
|
208
208
|
const targetOut = this.config.dfg.outgoingEdges(target[0][0]);
|
|
209
209
|
if (targetOut) {
|
|
210
|
-
const source =
|
|
210
|
+
const source = targetOut.entries().filter(([t, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedBy) && t !== call.id).toArray();
|
|
211
211
|
if (source.length === 1) {
|
|
212
212
|
return this.onAssignmentCall({ call, target: target[0][0], source: source[0][0] });
|
|
213
213
|
}
|
|
@@ -216,25 +216,25 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
216
216
|
}
|
|
217
217
|
return this.onAssignmentCall({ call, target: undefined, source: undefined });
|
|
218
218
|
}
|
|
219
|
-
case
|
|
219
|
+
case built_in_proc_name_1.BuiltInProcName.SpecialBinOp:
|
|
220
220
|
if (call.args.length !== 2) {
|
|
221
221
|
return this.onSpecialBinaryOpCall({ call });
|
|
222
222
|
}
|
|
223
223
|
return this.onSpecialBinaryOpCall({ call, lhs: call.args[0], rhs: call.args[1] });
|
|
224
|
-
case
|
|
224
|
+
case built_in_proc_name_1.BuiltInProcName.Pipe:
|
|
225
225
|
if (call.args.length !== 2) {
|
|
226
226
|
return this.onPipeCall({ call });
|
|
227
227
|
}
|
|
228
228
|
return this.onPipeCall({ call, lhs: call.args[0], rhs: call.args[1] });
|
|
229
|
-
case
|
|
229
|
+
case built_in_proc_name_1.BuiltInProcName.Quote:
|
|
230
230
|
return this.onQuoteCall({ call });
|
|
231
|
-
case
|
|
231
|
+
case built_in_proc_name_1.BuiltInProcName.ForLoop:
|
|
232
232
|
return this.onForLoopCall({ call, variable: call.args[0], vector: call.args[1], body: call.args[2] });
|
|
233
|
-
case
|
|
233
|
+
case built_in_proc_name_1.BuiltInProcName.RepeatLoop:
|
|
234
234
|
return this.onRepeatLoopCall({ call, body: call.args[0] });
|
|
235
|
-
case
|
|
235
|
+
case built_in_proc_name_1.BuiltInProcName.WhileLoop:
|
|
236
236
|
return this.onWhileLoopCall({ call, condition: call.args[0], body: call.args[1] });
|
|
237
|
-
case
|
|
237
|
+
case built_in_proc_name_1.BuiltInProcName.Replacement: {
|
|
238
238
|
const outgoing = this.config.dfg.outgoingEdges(call.id);
|
|
239
239
|
if (outgoing) {
|
|
240
240
|
const target = outgoing.entries().filter(([, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Returns)).toArray();
|
|
@@ -250,38 +250,38 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
250
250
|
}
|
|
251
251
|
return this.onReplacementCall({ call, target: undefined, source: undefined });
|
|
252
252
|
}
|
|
253
|
-
case
|
|
253
|
+
case built_in_proc_name_1.BuiltInProcName.Library:
|
|
254
254
|
return this.onLibraryCall({ call });
|
|
255
|
-
case
|
|
255
|
+
case built_in_proc_name_1.BuiltInProcName.Try:
|
|
256
256
|
return this.onTryCall({ call });
|
|
257
|
-
case
|
|
257
|
+
case built_in_proc_name_1.BuiltInProcName.Stop:
|
|
258
258
|
return this.onStopCall({ call });
|
|
259
|
-
case
|
|
259
|
+
case built_in_proc_name_1.BuiltInProcName.StopIfNot:
|
|
260
260
|
return this.onStopIfNotCall({ call });
|
|
261
|
-
case
|
|
261
|
+
case built_in_proc_name_1.BuiltInProcName.RegisterHook:
|
|
262
262
|
return this.onRegisterHookCall({ call });
|
|
263
|
-
case
|
|
263
|
+
case built_in_proc_name_1.BuiltInProcName.Local:
|
|
264
264
|
return this.onLocalCall({ call });
|
|
265
|
-
case
|
|
265
|
+
case built_in_proc_name_1.BuiltInProcName.S3Dispatch:
|
|
266
266
|
return this.onS3DispatchCall({ call });
|
|
267
|
-
case
|
|
267
|
+
case built_in_proc_name_1.BuiltInProcName.S3DispatchNext:
|
|
268
268
|
return this.onS3DispatchNextCall({ call });
|
|
269
|
-
case
|
|
269
|
+
case built_in_proc_name_1.BuiltInProcName.S7NewGeneric:
|
|
270
270
|
return this.onS7NewGenericCall({ call });
|
|
271
|
-
case
|
|
271
|
+
case built_in_proc_name_1.BuiltInProcName.S7Dispatch:
|
|
272
272
|
return this.onS7DispatchCall({ call });
|
|
273
|
-
case
|
|
273
|
+
case built_in_proc_name_1.BuiltInProcName.Break:
|
|
274
274
|
return this.onBreakCall({ call });
|
|
275
|
-
case
|
|
275
|
+
case built_in_proc_name_1.BuiltInProcName.Return:
|
|
276
276
|
return this.onReturnCall({ call });
|
|
277
|
-
case
|
|
277
|
+
case built_in_proc_name_1.BuiltInProcName.Unnamed:
|
|
278
278
|
return this.onUnnamedCall({ call });
|
|
279
|
-
case
|
|
279
|
+
case built_in_proc_name_1.BuiltInProcName.Recall:
|
|
280
280
|
return this.onRecallCall({ call });
|
|
281
|
-
case
|
|
282
|
-
case
|
|
283
|
-
case
|
|
284
|
-
case
|
|
281
|
+
case built_in_proc_name_1.BuiltInProcName.Default:
|
|
282
|
+
case built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs:
|
|
283
|
+
case built_in_proc_name_1.BuiltInProcName.Function:
|
|
284
|
+
case built_in_proc_name_1.BuiltInProcName.FunctionDefinition:
|
|
285
285
|
return this.onDefaultFunctionCall({ call });
|
|
286
286
|
default:
|
|
287
287
|
(0, assert_1.assertUnreachable)(origin);
|
|
@@ -296,7 +296,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
296
296
|
* A helper function to request the {@link getOriginInDfg|origins} of the given node.
|
|
297
297
|
*/
|
|
298
298
|
getOrigins(id) {
|
|
299
|
-
return
|
|
299
|
+
return df_helper_1.Dataflow.origin(this.config.dfg, id);
|
|
300
300
|
}
|
|
301
301
|
/**
|
|
302
302
|
* Called for every occurrence of a `NULL` in the program.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BuiltInProcName } from '../dataflow/environments/built-in';
|
|
2
1
|
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
3
2
|
import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
3
|
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
5
4
|
import type { ControlFlowInformation } from './control-flow-graph';
|
|
6
5
|
import type { ReadOnlyFlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
6
|
+
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
7
7
|
export declare const loopyFunctions: Set<BuiltInProcName>;
|
|
8
8
|
/**
|
|
9
9
|
* Checks whether a loop only loops once
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loopyFunctions = void 0;
|
|
4
4
|
exports.onlyLoopsOnce = onlyLoopsOnce;
|
|
5
|
-
const built_in_1 = require("../dataflow/environments/built-in");
|
|
6
5
|
const alias_tracking_1 = require("../dataflow/eval/resolve/alias-tracking");
|
|
7
6
|
const general_1 = require("../dataflow/eval/values/general");
|
|
8
7
|
const r_value_1 = require("../dataflow/eval/values/r-value");
|
|
@@ -12,7 +11,8 @@ const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-functi
|
|
|
12
11
|
const assert_1 = require("../util/assert");
|
|
13
12
|
const control_flow_graph_1 = require("./control-flow-graph");
|
|
14
13
|
const semantic_cfg_guided_visitor_1 = require("./semantic-cfg-guided-visitor");
|
|
15
|
-
|
|
14
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
15
|
+
exports.loopyFunctions = new Set([built_in_proc_name_1.BuiltInProcName.ForLoop, built_in_proc_name_1.BuiltInProcName.WhileLoop, built_in_proc_name_1.BuiltInProcName.RepeatLoop]);
|
|
16
16
|
/**
|
|
17
17
|
* Checks whether a loop only loops once
|
|
18
18
|
* @param loop - nodeid of the loop to analyse
|
|
@@ -30,7 +30,7 @@ function onlyLoopsOnce(loop, dataflow, controlflow, ast, ctx) {
|
|
|
30
30
|
(0, assert_1.guard)(vertex.tag === vertex_1.VertexType.FunctionCall, 'invalid vertex type for onlyLoopsOnce');
|
|
31
31
|
(0, assert_1.guard)(vertex.origin !== 'unnamed' && exports.loopyFunctions.has(vertex.origin[0]), 'onlyLoopsOnce can only be called with loops');
|
|
32
32
|
// 1. In case of for loop, check if vector has only one element
|
|
33
|
-
if (vertex.origin[0] ===
|
|
33
|
+
if (vertex.origin[0] === built_in_proc_name_1.BuiltInProcName.ForLoop) {
|
|
34
34
|
if (vertex.args.length < 2) {
|
|
35
35
|
return undefined;
|
|
36
36
|
}
|
|
@@ -2,20 +2,6 @@ import type { DataflowInformation } from '../../dataflow/info';
|
|
|
2
2
|
import type { QuadSerializationConfiguration } from '../../util/quads';
|
|
3
3
|
/** Should work with larger things as well */
|
|
4
4
|
export declare function dataflowGraphToJson(df: DataflowInformation): string;
|
|
5
|
-
/**
|
|
6
|
-
* Convert the dataflow graph to a mermaid string.
|
|
7
|
-
* @see {@link graphToMermaid}
|
|
8
|
-
* @see {@link dataflowGraphToMermaidUrl}
|
|
9
|
-
* @see {@link dataflowGraphToJson}
|
|
10
|
-
*/
|
|
11
|
-
export declare function dataflowGraphToMermaid(df: DataflowInformation): string;
|
|
12
|
-
/**
|
|
13
|
-
* Convert the dataflow graph to a mermaid URL.
|
|
14
|
-
* @see {@link graphToMermaidUrl}
|
|
15
|
-
* @see {@link dataflowGraphToMermaid}
|
|
16
|
-
* @see {@link dataflowGraphToJson}
|
|
17
|
-
*/
|
|
18
|
-
export declare function dataflowGraphToMermaidUrl(df: DataflowInformation): string;
|
|
19
5
|
/**
|
|
20
6
|
* Transforms the dataflow graph into a quad serialization.
|
|
21
7
|
* @see {@link df2quads}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dataflowGraphToJson = dataflowGraphToJson;
|
|
4
|
-
exports.dataflowGraphToMermaid = dataflowGraphToMermaid;
|
|
5
|
-
exports.dataflowGraphToMermaidUrl = dataflowGraphToMermaidUrl;
|
|
6
4
|
exports.dataflowGraphToQuads = dataflowGraphToQuads;
|
|
7
5
|
const json_1 = require("../../util/json");
|
|
8
6
|
const quads_1 = require("../../dataflow/graph/quads");
|
|
9
|
-
const dfg_1 = require("../../util/mermaid/dfg");
|
|
10
7
|
function mayObjectJson(d) {
|
|
11
8
|
if (typeof d === 'object') {
|
|
12
9
|
return objectJson(d);
|
|
@@ -52,24 +49,6 @@ function objectJson(df) {
|
|
|
52
49
|
function dataflowGraphToJson(df) {
|
|
53
50
|
return objectJson(df);
|
|
54
51
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Convert the dataflow graph to a mermaid string.
|
|
57
|
-
* @see {@link graphToMermaid}
|
|
58
|
-
* @see {@link dataflowGraphToMermaidUrl}
|
|
59
|
-
* @see {@link dataflowGraphToJson}
|
|
60
|
-
*/
|
|
61
|
-
function dataflowGraphToMermaid(df) {
|
|
62
|
-
return (0, dfg_1.graphToMermaid)({ graph: df.graph }).string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Convert the dataflow graph to a mermaid URL.
|
|
66
|
-
* @see {@link graphToMermaidUrl}
|
|
67
|
-
* @see {@link dataflowGraphToMermaid}
|
|
68
|
-
* @see {@link dataflowGraphToJson}
|
|
69
|
-
*/
|
|
70
|
-
function dataflowGraphToMermaidUrl(df) {
|
|
71
|
-
return (0, dfg_1.graphToMermaidUrl)(df.graph);
|
|
72
|
-
}
|
|
73
52
|
/**
|
|
74
53
|
* Transforms the dataflow graph into a quad serialization.
|
|
75
54
|
* @see {@link df2quads}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { internalPrinter } from '../../../print/print';
|
|
2
2
|
import { PipelineStepStage } from '../../pipeline-step';
|
|
3
|
-
import { dataflowGraphToJson,
|
|
3
|
+
import { dataflowGraphToJson, dataflowGraphToQuads } from '../../../print/dataflow-printer';
|
|
4
4
|
import type { NormalizedAst } from '../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
5
|
import type { KnownParserType, Parser } from '../../../../r-bridge/parser';
|
|
6
6
|
import type { FlowrAnalyzerContext } from '../../../../project/context/flowr-analyzer-context';
|
|
@@ -23,8 +23,8 @@ export declare const STATIC_DATAFLOW: {
|
|
|
23
23
|
readonly 0: typeof internalPrinter;
|
|
24
24
|
readonly 2: typeof dataflowGraphToJson;
|
|
25
25
|
readonly 5: typeof dataflowGraphToQuads;
|
|
26
|
-
readonly 3:
|
|
27
|
-
readonly 4:
|
|
26
|
+
readonly 3: (this: void, graph: import("../../../../dataflow/graph/graph").DataflowGraph | import("../../../../dataflow/info").DataflowInformation, includeEnvironments?: boolean, mark?: ReadonlySet<import("../../../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId>, simplified?: boolean) => string;
|
|
27
|
+
readonly 4: (this: void, graph: import("../../../../dataflow/graph/graph").DataflowGraph | import("../../../../dataflow/info").DataflowInformation, includeEnvironments?: boolean, mark?: ReadonlySet<import("../../../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId>, simplified?: boolean) => string;
|
|
28
28
|
};
|
|
29
29
|
readonly dependencies: readonly ["normalize"];
|
|
30
30
|
};
|
|
@@ -4,6 +4,7 @@ exports.STATIC_DATAFLOW = void 0;
|
|
|
4
4
|
const print_1 = require("../../../print/print");
|
|
5
5
|
const dataflow_printer_1 = require("../../../print/dataflow-printer");
|
|
6
6
|
const extractor_1 = require("../../../../dataflow/extractor");
|
|
7
|
+
const df_helper_1 = require("../../../../dataflow/graph/df-helper");
|
|
7
8
|
const staticDataflowCommon = {
|
|
8
9
|
name: 'dataflow',
|
|
9
10
|
description: 'Construct the dataflow graph',
|
|
@@ -12,8 +13,8 @@ const staticDataflowCommon = {
|
|
|
12
13
|
[0 /* StepOutputFormat.Internal */]: print_1.internalPrinter,
|
|
13
14
|
[2 /* StepOutputFormat.Json */]: dataflow_printer_1.dataflowGraphToJson,
|
|
14
15
|
[5 /* StepOutputFormat.RdfQuads */]: dataflow_printer_1.dataflowGraphToQuads,
|
|
15
|
-
[3 /* StepOutputFormat.Mermaid */]:
|
|
16
|
-
[4 /* StepOutputFormat.MermaidUrl */]:
|
|
16
|
+
[3 /* StepOutputFormat.Mermaid */]: df_helper_1.Dataflow.visualize.mermaid.raw,
|
|
17
|
+
[4 /* StepOutputFormat.MermaidUrl */]: df_helper_1.Dataflow.visualize.mermaid.url
|
|
17
18
|
},
|
|
18
19
|
dependencies: ['normalize'],
|
|
19
20
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { internalPrinter } from '../../../print/print';
|
|
2
2
|
import { PipelineStepStage } from '../../pipeline-step';
|
|
3
3
|
import type { DataflowInformation } from '../../../../dataflow/info';
|
|
4
|
-
import
|
|
4
|
+
import { SlicingCriteria } from '../../../../slicing/criterion/parse';
|
|
5
5
|
import type { NormalizedAst } from '../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
6
|
import type { ReadOnlyFlowrAnalyzerContext } from '../../../../project/context/flowr-analyzer-context';
|
|
7
|
+
import { SliceDirection } from '../../../../util/slice-direction';
|
|
7
8
|
export interface SliceRequiredInput {
|
|
8
9
|
/** The slicing criterion is only of interest if you actually want to slice the R code */
|
|
9
10
|
readonly criterion: SlicingCriteria;
|
|
@@ -14,10 +15,6 @@ export interface SliceRequiredInput {
|
|
|
14
15
|
/** The context of the analysis */
|
|
15
16
|
readonly context?: ReadOnlyFlowrAnalyzerContext;
|
|
16
17
|
}
|
|
17
|
-
export declare enum SliceDirection {
|
|
18
|
-
Backward = "backward",
|
|
19
|
-
Forward = "forward"
|
|
20
|
-
}
|
|
21
18
|
declare function processor(results: {
|
|
22
19
|
dataflow?: DataflowInformation;
|
|
23
20
|
normalize?: NormalizedAst;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STATIC_SLICE =
|
|
3
|
+
exports.STATIC_SLICE = void 0;
|
|
4
4
|
const print_1 = require("../../../print/print");
|
|
5
|
+
const parse_1 = require("../../../../slicing/criterion/parse");
|
|
5
6
|
const static_slicer_1 = require("../../../../slicing/static/static-slicer");
|
|
6
|
-
|
|
7
|
-
(function (SliceDirection) {
|
|
8
|
-
SliceDirection["Backward"] = "backward";
|
|
9
|
-
SliceDirection["Forward"] = "forward";
|
|
10
|
-
})(SliceDirection || (exports.SliceDirection = SliceDirection = {}));
|
|
7
|
+
const slice_direction_1 = require("../../../../util/slice-direction");
|
|
11
8
|
function processor(results, input) {
|
|
12
|
-
const direction = input.direction ?? SliceDirection.Backward;
|
|
9
|
+
const direction = input.direction ?? slice_direction_1.SliceDirection.Backward;
|
|
13
10
|
const threshold = input.threshold ?? input.context?.config.solver.slicer?.threshold;
|
|
14
|
-
|
|
11
|
+
const n = results.normalize;
|
|
12
|
+
return (0, static_slicer_1.staticSlice)(input.context, results.dataflow, n, parse_1.SlicingCriteria.convertAll(input.criterion, n.idMap), direction, threshold);
|
|
15
13
|
}
|
|
16
14
|
exports.STATIC_SLICE = {
|
|
17
15
|
name: 'slice',
|