@eagleoutice/flowr 2.6.3 → 2.7.0
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 +13 -13
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/data-frame/absint-visitor.js +3 -3
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +4 -7
- package/abstract-interpretation/data-frame/dataframe-domain.js +5 -11
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +3 -2
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +3 -2
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +8 -8
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +3 -2
- package/abstract-interpretation/data-frame/semantics.js +47 -42
- package/abstract-interpretation/data-frame/shape-inference.d.ts +1 -1
- package/abstract-interpretation/domains/abstract-domain.d.ts +1 -0
- package/abstract-interpretation/domains/abstract-domain.js +3 -2
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +2 -2
- package/abstract-interpretation/domains/interval-domain.js +3 -6
- package/abstract-interpretation/domains/lattice.d.ts +2 -0
- package/abstract-interpretation/domains/lattice.js +3 -1
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -1
- package/abstract-interpretation/domains/positive-interval-domain.js +1 -1
- package/abstract-interpretation/domains/satisfiable-domain.d.ts +2 -2
- package/abstract-interpretation/domains/satisfiable-domain.js +2 -2
- package/abstract-interpretation/domains/set-range-domain.d.ts +98 -0
- package/abstract-interpretation/domains/set-range-domain.js +400 -0
- package/abstract-interpretation/domains/set-upper-bound-domain.js +2 -2
- package/abstract-interpretation/domains/singleton-domain.js +2 -2
- package/benchmark/slicer.d.ts +2 -1
- package/benchmark/slicer.js +37 -15
- package/benchmark/stats/print.js +8 -5
- package/benchmark/stats/stats.d.ts +3 -2
- package/benchmark/summarizer/data.d.ts +11 -8
- package/benchmark/summarizer/first-phase/process.js +11 -8
- package/benchmark/summarizer/second-phase/process.js +24 -18
- package/control-flow/cfg-dead-code.js +3 -2
- package/control-flow/useless-loop.js +4 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +3 -0
- package/core/steps/all/static-slicing/00-slice.js +2 -1
- package/core/steps/pipeline/default-pipelines.d.ts +42 -42
- package/dataflow/cluster.js +2 -2
- package/dataflow/environments/append.d.ts +5 -0
- package/dataflow/environments/append.js +6 -20
- package/dataflow/environments/built-in.d.ts +2 -1
- package/dataflow/environments/clone.d.ts +1 -1
- package/dataflow/environments/clone.js +3 -27
- package/dataflow/environments/define.d.ts +7 -3
- package/dataflow/environments/define.js +9 -56
- package/dataflow/environments/diff.js +1 -1
- package/dataflow/environments/environment.d.ts +48 -28
- package/dataflow/environments/environment.js +187 -62
- package/dataflow/environments/overwrite.js +2 -45
- package/dataflow/environments/reference-to-maybe.d.ts +13 -0
- package/dataflow/environments/reference-to-maybe.js +54 -0
- package/dataflow/environments/resolve-by-name.d.ts +6 -1
- package/dataflow/environments/resolve-by-name.js +56 -4
- package/dataflow/environments/scoping.d.ts +2 -2
- package/dataflow/environments/scoping.js +7 -7
- package/dataflow/eval/resolve/alias-tracking.d.ts +10 -4
- package/dataflow/eval/resolve/alias-tracking.js +15 -13
- package/dataflow/eval/resolve/resolve-argument.d.ts +2 -1
- package/dataflow/eval/resolve/resolve-argument.js +8 -8
- package/dataflow/eval/resolve/resolve.d.ts +13 -11
- package/dataflow/eval/resolve/resolve.js +16 -15
- package/dataflow/extractor.js +1 -7
- package/dataflow/fn/higher-order-function.d.ts +2 -1
- package/dataflow/fn/higher-order-function.js +4 -4
- package/dataflow/graph/dataflowgraph-builder.d.ts +9 -5
- package/dataflow/graph/dataflowgraph-builder.js +21 -11
- package/dataflow/graph/diff-dataflow-graph.js +2 -2
- package/dataflow/graph/graph.d.ts +10 -2
- package/dataflow/graph/graph.js +41 -12
- package/dataflow/graph/invert-dfg.d.ts +3 -2
- package/dataflow/graph/invert-dfg.js +3 -3
- package/dataflow/graph/resolve-graph.d.ts +2 -1
- package/dataflow/graph/resolve-graph.js +2 -2
- package/dataflow/graph/vertex.d.ts +3 -3
- package/dataflow/graph/vertex.js +3 -3
- package/dataflow/info.d.ts +1 -1
- package/dataflow/internal/linker.js +3 -7
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +7 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +12 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +9 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -7
- 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.d.ts +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +9 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +8 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -5
- package/dataflow/internal/process/functions/call/common.js +2 -3
- package/dataflow/internal/process/functions/call/known-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
- package/dataflow/internal/process/functions/process-argument.js +1 -1
- package/dataflow/internal/process/process-symbol.js +1 -1
- package/dataflow/internal/process/process-value.d.ts +1 -1
- package/dataflow/internal/process/process-value.js +7 -7
- package/dataflow/processor.d.ts +1 -5
- package/documentation/doc-util/doc-dfg.js +3 -2
- package/documentation/doc-util/doc-normalized-ast.js +3 -2
- package/documentation/doc-util/doc-types.d.ts +1 -1
- package/documentation/doc-util/doc-types.js +2 -2
- package/documentation/wiki-analyzer.js +14 -1
- package/documentation/wiki-dataflow-graph.js +4 -5
- package/documentation/wiki-faq.js +0 -1
- package/documentation/wiki-linter.js +1 -1
- package/documentation/wiki-mk/doc-maker.js +2 -1
- package/linter/linter-rules.d.ts +2 -2
- package/linter/rules/absolute-path.js +4 -4
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +1 -1
- package/linter/rules/function-finder-util.d.ts +2 -2
- package/linter/rules/function-finder-util.js +1 -1
- package/linter/rules/network-functions.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +1 -1
- package/linter/rules/seeded-randomness.js +5 -5
- package/package.json +1 -2
- package/project/context/flowr-analyzer-context.d.ts +7 -0
- package/project/context/flowr-analyzer-context.js +3 -0
- package/project/context/flowr-analyzer-environment-context.d.ts +47 -0
- package/project/context/flowr-analyzer-environment-context.js +50 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +1 -4
- package/queries/catalog/control-flow-query/control-flow-query-format.js +3 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -4
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +4 -4
- package/queries/catalog/df-shape-query/df-shape-query-format.js +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
- package/slicing/static/slice-call.d.ts +3 -2
- package/slicing/static/slice-call.js +4 -4
- package/slicing/static/static-slicer.d.ts +3 -1
- package/slicing/static/static-slicer.js +6 -7
- package/statistics/features/supported/control-flow/control-flow.js +1 -1
- package/statistics/features/supported/used-functions/used-functions.js +1 -1
- package/statistics/features/supported/variables/variables.js +2 -1
- package/util/containers.js +1 -1
- package/util/mermaid/dfg.d.ts +1 -0
- package/util/mermaid/dfg.js +3 -3
- package/util/simple-df/dfg-view.d.ts +2 -1
- package/util/simple-df/dfg-view.js +2 -2
- package/util/version.js +1 -1
- package/dataflow/environments/remove.d.ts +0 -12
- package/dataflow/environments/remove.js +0 -52
|
@@ -7,6 +7,7 @@ const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/vi
|
|
|
7
7
|
const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
8
|
const r_symbol_1 = require("../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
|
|
9
9
|
const statistics_file_1 = require("../../../output/statistics-file");
|
|
10
|
+
const vertex_1 = require("../../../../dataflow/graph/vertex");
|
|
10
11
|
const initialVariableInfo = {
|
|
11
12
|
numberOfVariableUses: 0,
|
|
12
13
|
numberOfDefinitions: 0,
|
|
@@ -30,7 +31,7 @@ function visitVariables(info, input) {
|
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
33
|
const [dfNode] = mayNode;
|
|
33
|
-
if (dfNode.tag ===
|
|
34
|
+
if (dfNode.tag === vertex_1.VertexType.VariableDefinition) {
|
|
34
35
|
info.numberOfDefinitions++;
|
|
35
36
|
const lexeme = node.info.fullLexeme ?? node.lexeme;
|
|
36
37
|
(0, statistics_file_1.appendStatisticsFile)(exports.variables.name, 'definedVariables', [[
|
package/util/containers.js
CHANGED
|
@@ -26,7 +26,7 @@ function getAccessOperands(args) {
|
|
|
26
26
|
* @returns The indicesCollection of the resolved definitions
|
|
27
27
|
*/
|
|
28
28
|
function resolveIndicesByName(name, environment) {
|
|
29
|
-
const definitions = (0, resolve_by_name_1.
|
|
29
|
+
const definitions = (0, resolve_by_name_1.resolveByNameAnyType)(name, environment);
|
|
30
30
|
return definitions?.flatMap(def => def?.indicesCollection ?? []);
|
|
31
31
|
}
|
|
32
32
|
/**
|
package/util/mermaid/dfg.d.ts
CHANGED
package/util/mermaid/dfg.js
CHANGED
|
@@ -108,7 +108,7 @@ function encodeEdge(from, to, types) {
|
|
|
108
108
|
function mermaidNodeBrackets(tag) {
|
|
109
109
|
let open;
|
|
110
110
|
let close;
|
|
111
|
-
if (tag ===
|
|
111
|
+
if (tag === vertex_1.VertexType.FunctionDefinition || tag === vertex_1.VertexType.VariableDefinition) {
|
|
112
112
|
open = '[';
|
|
113
113
|
close = ']';
|
|
114
114
|
}
|
|
@@ -209,7 +209,7 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
if (info.tag ===
|
|
212
|
+
if (info.tag === vertex_1.VertexType.FunctionDefinition) {
|
|
213
213
|
subflowToMermaid(id, info.exitPoints, info.subflow, mermaid, idPrefix);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -227,7 +227,7 @@ function graphToMermaidGraph(rootIds, { simplified, graph, prefix = 'flowchart B
|
|
|
227
227
|
* Converts a dataflow graph to mermaid graph code that visualizes the graph.
|
|
228
228
|
*/
|
|
229
229
|
function graphToMermaid(config) {
|
|
230
|
-
const mermaid = graphToMermaidGraph(config.graph.rootIds(), config);
|
|
230
|
+
const mermaid = graphToMermaidGraph(config.includeOnlyIds ? config.includeOnlyIds : config.graph.rootIds(), config);
|
|
231
231
|
return { string: `${mermaid.nodeLines.join('\n')}\n${mermaid.edgeLines.join('\n')}`, mermaid };
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
@@ -2,6 +2,7 @@ import { DataflowGraph } from '../../dataflow/graph/graph';
|
|
|
2
2
|
import { VertexType } from '../../dataflow/graph/vertex';
|
|
3
3
|
import { type MergeableRecord } from '../objects';
|
|
4
4
|
import type { DeepPartial } from 'ts-essentials';
|
|
5
|
+
import type { REnvironmentInformation } from '../../dataflow/environments/environment';
|
|
5
6
|
export interface ReduceVertexOptions extends MergeableRecord {
|
|
6
7
|
tags: VertexType[];
|
|
7
8
|
nameRegex: string;
|
|
@@ -16,4 +17,4 @@ export interface ReduceOptions extends MergeableRecord {
|
|
|
16
17
|
/**
|
|
17
18
|
* Produces a reduced version of the given dataflow graph according to the given options.
|
|
18
19
|
*/
|
|
19
|
-
export declare function reduceDfg(dfg: DataflowGraph, options: DeepPartial<ReduceOptions
|
|
20
|
+
export declare function reduceDfg(dfg: DataflowGraph, options: DeepPartial<ReduceOptions>, cleanEnv: REnvironmentInformation): DataflowGraph;
|
|
@@ -36,7 +36,7 @@ function makeFilter(options, idMap) {
|
|
|
36
36
|
/**
|
|
37
37
|
* Produces a reduced version of the given dataflow graph according to the given options.
|
|
38
38
|
*/
|
|
39
|
-
function reduceDfg(dfg, options) {
|
|
39
|
+
function reduceDfg(dfg, options, cleanEnv) {
|
|
40
40
|
const newDfg = new graph_1.DataflowGraph(dfg.idMap);
|
|
41
41
|
const applyOptions = (0, objects_1.deepMergeObject)(defaultReduceOptions, options);
|
|
42
42
|
// overwrite the tag set if possible
|
|
@@ -48,7 +48,7 @@ function reduceDfg(dfg, options) {
|
|
|
48
48
|
for (const [id, info] of dfg.vertices(!applyOptions)) {
|
|
49
49
|
const result = applyFilter(info);
|
|
50
50
|
if (result) {
|
|
51
|
-
newDfg.addVertex(result, dfg.isRoot(id));
|
|
51
|
+
newDfg.addVertex(result, cleanEnv, dfg.isRoot(id));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
for (const [from, out] of dfg.edges()) {
|
package/util/version.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.printVersionInformation = printVersionInformation;
|
|
|
6
6
|
const semver_1 = require("semver");
|
|
7
7
|
const assert_1 = require("./assert");
|
|
8
8
|
// this is automatically replaced with the current version by release-it
|
|
9
|
-
const version = '2.
|
|
9
|
+
const version = '2.7.0';
|
|
10
10
|
/**
|
|
11
11
|
* Retrieves the current flowR version as a new {@link SemVer} object.
|
|
12
12
|
*/
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { IEnvironment, REnvironmentInformation } from './environment';
|
|
2
|
-
import type { Identifier } from './identifier';
|
|
3
|
-
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
4
|
-
/**
|
|
5
|
-
* Removes all definitions of a given name from the environment.
|
|
6
|
-
*/
|
|
7
|
-
export declare function remove(name: Identifier, environment: REnvironmentInformation, defaultEnvironment: IEnvironment): REnvironmentInformation;
|
|
8
|
-
/** Creates a copy of the original environment but without the definitions of the given ids */
|
|
9
|
-
export declare function removeAll(definitions: readonly {
|
|
10
|
-
nodeId: NodeId;
|
|
11
|
-
name: Identifier | undefined;
|
|
12
|
-
}[], environment: REnvironmentInformation): REnvironmentInformation;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.remove = remove;
|
|
4
|
-
exports.removeAll = removeAll;
|
|
5
|
-
const info_1 = require("../info");
|
|
6
|
-
const clone_1 = require("./clone");
|
|
7
|
-
/**
|
|
8
|
-
* Removes all definitions of a given name from the environment.
|
|
9
|
-
*/
|
|
10
|
-
function remove(name, environment, defaultEnvironment) {
|
|
11
|
-
let current = environment.current;
|
|
12
|
-
do {
|
|
13
|
-
const definition = current.memory.get(name);
|
|
14
|
-
if (definition !== undefined) {
|
|
15
|
-
current.memory.delete(name);
|
|
16
|
-
if (definition.every(d => (0, info_1.happensInEveryBranch)(d.controlDependencies))) {
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
current = current.parent;
|
|
21
|
-
} while (current.id !== defaultEnvironment.id);
|
|
22
|
-
// we never remove built ins
|
|
23
|
-
return environment;
|
|
24
|
-
}
|
|
25
|
-
/** Creates a copy of the original environment but without the definitions of the given ids */
|
|
26
|
-
function removeAll(definitions, environment) {
|
|
27
|
-
environment = (0, clone_1.cloneEnvironmentInformation)(environment, true);
|
|
28
|
-
let current = environment.current;
|
|
29
|
-
do {
|
|
30
|
-
for (const { nodeId, name } of definitions) {
|
|
31
|
-
if (name) {
|
|
32
|
-
current.memory.delete(name);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
// remove all definitions for the node id
|
|
36
|
-
for (const [key, values] of current.memory) {
|
|
37
|
-
const res = values.filter(v => v.nodeId === nodeId);
|
|
38
|
-
if (res.length > 0) {
|
|
39
|
-
current.memory.set(key, values);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
current.memory.delete(key);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
current = current.parent;
|
|
48
|
-
} while (!current.builtInEnv);
|
|
49
|
-
// we never remove built ins so we can stop one early
|
|
50
|
-
return environment;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=remove.js.map
|