@eagleoutice/flowr 2.6.3 → 2.7.2

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.
Files changed (276) hide show
  1. package/README.md +22 -22
  2. package/abstract-interpretation/absint-visitor.d.ts +160 -0
  3. package/abstract-interpretation/absint-visitor.js +279 -0
  4. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +4 -7
  5. package/abstract-interpretation/data-frame/dataframe-domain.js +26 -16
  6. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +6 -4
  7. package/abstract-interpretation/data-frame/mappers/access-mapper.js +11 -14
  8. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +10 -9
  9. package/abstract-interpretation/data-frame/mappers/arguments.js +8 -5
  10. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +18 -18
  11. package/abstract-interpretation/data-frame/mappers/function-mapper.js +53 -58
  12. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +7 -5
  13. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +26 -29
  14. package/abstract-interpretation/data-frame/semantics.js +48 -44
  15. package/abstract-interpretation/data-frame/shape-inference.d.ts +52 -28
  16. package/abstract-interpretation/data-frame/shape-inference.js +67 -90
  17. package/abstract-interpretation/domains/abstract-domain.d.ts +1 -0
  18. package/abstract-interpretation/domains/abstract-domain.js +3 -2
  19. package/abstract-interpretation/domains/bounded-set-domain.d.ts +2 -2
  20. package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
  21. package/abstract-interpretation/domains/interval-domain.d.ts +4 -4
  22. package/abstract-interpretation/domains/interval-domain.js +3 -6
  23. package/abstract-interpretation/domains/lattice.d.ts +2 -0
  24. package/abstract-interpretation/domains/lattice.js +3 -1
  25. package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -1
  26. package/abstract-interpretation/domains/positive-interval-domain.js +1 -1
  27. package/abstract-interpretation/domains/satisfiable-domain.d.ts +2 -2
  28. package/abstract-interpretation/domains/satisfiable-domain.js +2 -2
  29. package/abstract-interpretation/domains/set-range-domain.d.ts +104 -0
  30. package/abstract-interpretation/domains/set-range-domain.js +406 -0
  31. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +2 -2
  32. package/abstract-interpretation/domains/set-upper-bound-domain.js +2 -2
  33. package/abstract-interpretation/domains/singleton-domain.d.ts +2 -2
  34. package/abstract-interpretation/domains/singleton-domain.js +2 -2
  35. package/benchmark/slicer.d.ts +2 -1
  36. package/benchmark/slicer.js +50 -29
  37. package/benchmark/stats/print.js +8 -5
  38. package/benchmark/stats/stats.d.ts +3 -2
  39. package/benchmark/summarizer/data.d.ts +11 -8
  40. package/benchmark/summarizer/first-phase/process.js +11 -8
  41. package/benchmark/summarizer/second-phase/process.js +24 -18
  42. package/cli/common/options.d.ts +431 -8
  43. package/cli/common/options.js +1 -1
  44. package/cli/common/scripts-info.d.ts +431 -7
  45. package/cli/flowr-main-options.d.ts +102 -2
  46. package/cli/flowr.d.ts +102 -2
  47. package/cli/repl/commands/repl-commands.d.ts +25 -0
  48. package/cli/repl/commands/repl-query.js +17 -5
  49. package/cli/wiki.d.ts +13 -0
  50. package/cli/wiki.js +7 -2
  51. package/config.d.ts +4 -4
  52. package/config.js +1 -1
  53. package/control-flow/basic-cfg-guided-visitor.js +7 -8
  54. package/control-flow/cfg-dead-code.js +3 -2
  55. package/control-flow/control-flow-graph.d.ts +1 -1
  56. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  57. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  58. package/control-flow/useless-loop.js +4 -2
  59. package/core/steps/all/static-slicing/00-slice.d.ts +3 -0
  60. package/core/steps/all/static-slicing/00-slice.js +2 -1
  61. package/core/steps/pipeline/default-pipelines.d.ts +42 -42
  62. package/dataflow/cluster.js +2 -2
  63. package/dataflow/environments/append.d.ts +5 -0
  64. package/dataflow/environments/append.js +6 -20
  65. package/dataflow/environments/built-in.d.ts +2 -1
  66. package/dataflow/environments/clone.d.ts +1 -1
  67. package/dataflow/environments/clone.js +3 -27
  68. package/dataflow/environments/define.d.ts +7 -3
  69. package/dataflow/environments/define.js +9 -56
  70. package/dataflow/environments/diff.js +1 -1
  71. package/dataflow/environments/environment.d.ts +48 -28
  72. package/dataflow/environments/environment.js +187 -62
  73. package/dataflow/environments/overwrite.js +2 -45
  74. package/dataflow/environments/reference-to-maybe.d.ts +13 -0
  75. package/dataflow/environments/reference-to-maybe.js +54 -0
  76. package/dataflow/environments/resolve-by-name.d.ts +6 -1
  77. package/dataflow/environments/resolve-by-name.js +56 -4
  78. package/dataflow/environments/scoping.d.ts +2 -2
  79. package/dataflow/environments/scoping.js +7 -7
  80. package/dataflow/eval/resolve/alias-tracking.d.ts +10 -4
  81. package/dataflow/eval/resolve/alias-tracking.js +16 -14
  82. package/dataflow/eval/resolve/resolve-argument.d.ts +2 -1
  83. package/dataflow/eval/resolve/resolve-argument.js +8 -8
  84. package/dataflow/eval/resolve/resolve.d.ts +13 -11
  85. package/dataflow/eval/resolve/resolve.js +16 -15
  86. package/dataflow/extractor.js +1 -7
  87. package/dataflow/fn/higher-order-function.d.ts +2 -1
  88. package/dataflow/fn/higher-order-function.js +4 -4
  89. package/dataflow/graph/dataflowgraph-builder.d.ts +9 -5
  90. package/dataflow/graph/dataflowgraph-builder.js +21 -11
  91. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  92. package/dataflow/graph/graph.d.ts +10 -2
  93. package/dataflow/graph/graph.js +41 -12
  94. package/dataflow/graph/invert-dfg.d.ts +3 -2
  95. package/dataflow/graph/invert-dfg.js +3 -3
  96. package/dataflow/graph/resolve-graph.d.ts +2 -1
  97. package/dataflow/graph/resolve-graph.js +2 -2
  98. package/dataflow/graph/vertex.d.ts +3 -3
  99. package/dataflow/graph/vertex.js +3 -3
  100. package/dataflow/info.d.ts +1 -1
  101. package/dataflow/internal/linker.d.ts +2 -0
  102. package/dataflow/internal/linker.js +13 -19
  103. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +7 -1
  104. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +12 -3
  105. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +2 -2
  107. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -1
  108. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +3 -3
  109. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +9 -9
  110. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -7
  111. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
  112. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
  113. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +9 -13
  114. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +1 -1
  115. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +3 -1
  116. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +8 -6
  117. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +1 -1
  118. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
  120. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  121. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +6 -4
  122. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  123. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -5
  124. package/dataflow/internal/process/functions/call/common.js +2 -3
  125. package/dataflow/internal/process/functions/call/known-call-handling.js +1 -1
  126. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
  127. package/dataflow/internal/process/functions/process-argument.js +1 -1
  128. package/dataflow/internal/process/process-symbol.js +1 -1
  129. package/dataflow/internal/process/process-value.d.ts +1 -1
  130. package/dataflow/internal/process/process-value.js +7 -7
  131. package/dataflow/processor.d.ts +1 -5
  132. package/documentation/doc-capabilities.d.ts +1 -1
  133. package/documentation/doc-readme.d.ts +1 -1
  134. package/documentation/doc-util/doc-cfg.js +1 -1
  135. package/documentation/doc-util/doc-cli-option.d.ts +6 -6
  136. package/documentation/doc-util/doc-cli-option.js +3 -3
  137. package/documentation/doc-util/doc-dfg.d.ts +1 -1
  138. package/documentation/doc-util/doc-dfg.js +3 -2
  139. package/documentation/doc-util/doc-files.d.ts +3 -0
  140. package/documentation/doc-util/doc-files.js +4 -1
  141. package/documentation/doc-util/doc-normalized-ast.js +5 -4
  142. package/documentation/doc-util/doc-types.d.ts +1 -1
  143. package/documentation/doc-util/doc-types.js +2 -2
  144. package/documentation/issue-linting-rule.d.ts +1 -1
  145. package/documentation/wiki-analyzer.d.ts +1 -1
  146. package/documentation/wiki-analyzer.js +14 -1
  147. package/documentation/wiki-cfg.d.ts +1 -1
  148. package/documentation/wiki-core.d.ts +1 -1
  149. package/documentation/wiki-dataflow-graph.d.ts +1 -1
  150. package/documentation/wiki-dataflow-graph.js +10 -11
  151. package/documentation/wiki-engine.d.ts +1 -1
  152. package/documentation/wiki-engine.js +9 -10
  153. package/documentation/wiki-faq.d.ts +1 -1
  154. package/documentation/wiki-faq.js +0 -1
  155. package/documentation/wiki-interface.d.ts +1 -1
  156. package/documentation/wiki-interface.js +12 -13
  157. package/documentation/wiki-linter.d.ts +1 -1
  158. package/documentation/wiki-linter.js +1 -1
  159. package/documentation/wiki-linting-and-testing.d.ts +1 -1
  160. package/documentation/wiki-mk/doc-context.d.ts +54 -1
  161. package/documentation/wiki-mk/doc-context.js +17 -0
  162. package/documentation/wiki-mk/doc-maker.d.ts +5 -5
  163. package/documentation/wiki-mk/doc-maker.js +5 -2
  164. package/documentation/wiki-normalized-ast.d.ts +1 -1
  165. package/documentation/wiki-onboarding.d.ts +1 -1
  166. package/documentation/wiki-overview.d.ts +9 -0
  167. package/documentation/wiki-overview.js +248 -0
  168. package/documentation/wiki-query.d.ts +1 -1
  169. package/documentation/wiki-query.js +17 -1
  170. package/documentation/wiki-search.d.ts +1 -1
  171. package/documentation/wiki-setup.d.ts +9 -0
  172. package/documentation/wiki-setup.js +122 -0
  173. package/linter/linter-rules.d.ts +2 -2
  174. package/linter/rules/absolute-path.js +4 -4
  175. package/linter/rules/dataframe-access-validation.d.ts +2 -2
  176. package/linter/rules/dataframe-access-validation.js +9 -11
  177. package/linter/rules/function-finder-util.d.ts +2 -2
  178. package/linter/rules/function-finder-util.js +1 -1
  179. package/linter/rules/network-functions.js +1 -1
  180. package/linter/rules/seeded-randomness.d.ts +1 -1
  181. package/linter/rules/seeded-randomness.js +5 -5
  182. package/linter/rules/unused-definition.js +1 -1
  183. package/package.json +1 -2
  184. package/project/context/flowr-analyzer-context.d.ts +11 -0
  185. package/project/context/flowr-analyzer-context.js +3 -0
  186. package/project/context/flowr-analyzer-environment-context.d.ts +47 -0
  187. package/project/context/flowr-analyzer-environment-context.js +50 -0
  188. package/project/context/flowr-analyzer-files-context.d.ts +9 -1
  189. package/project/context/flowr-analyzer-files-context.js +4 -0
  190. package/project/context/flowr-file.d.ts +2 -0
  191. package/project/context/flowr-file.js +2 -0
  192. package/project/plugins/file-plugins/{flowr-description-file.d.ts → files/flowr-description-file.d.ts} +1 -1
  193. package/project/plugins/file-plugins/files/flowr-description-file.js +75 -0
  194. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +27 -0
  195. package/project/plugins/file-plugins/files/flowr-news-file.js +152 -0
  196. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
  197. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
  198. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +23 -0
  199. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +35 -0
  200. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +1 -1
  201. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +1 -1
  202. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
  203. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +1 -1
  204. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +1 -1
  205. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +1 -1
  206. package/project/plugins/flowr-analyzer-plugin-defaults.js +2 -0
  207. package/project/plugins/plugin-registry.d.ts +2 -1
  208. package/project/plugins/plugin-registry.js +2 -0
  209. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
  210. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -4
  211. package/queries/catalog/control-flow-query/control-flow-query-format.js +3 -2
  212. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
  213. package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -4
  214. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
  215. package/queries/catalog/df-shape-query/df-shape-query-executor.js +5 -3
  216. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +4 -4
  217. package/queries/catalog/df-shape-query/df-shape-query-format.js +2 -2
  218. package/queries/catalog/files-query/files-query-executor.d.ts +6 -0
  219. package/queries/catalog/files-query/files-query-executor.js +49 -0
  220. package/queries/catalog/files-query/files-query-format.d.ts +36 -0
  221. package/queries/catalog/files-query/files-query-format.js +114 -0
  222. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
  223. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  224. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +1 -1
  225. package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
  226. package/queries/query.d.ts +10 -1
  227. package/queries/query.js +3 -1
  228. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -1
  229. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +8 -8
  230. package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +8 -8
  231. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +0 -1
  232. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +0 -1
  233. package/slicing/static/slice-call.d.ts +3 -2
  234. package/slicing/static/slice-call.js +4 -4
  235. package/slicing/static/static-slicer.d.ts +3 -1
  236. package/slicing/static/static-slicer.js +6 -7
  237. package/statistics/features/supported/control-flow/control-flow.js +1 -1
  238. package/statistics/features/supported/data-access/data-access.js +1 -1
  239. package/statistics/features/supported/used-functions/used-functions.js +1 -1
  240. package/statistics/features/supported/variables/variables.js +2 -1
  241. package/util/containers.js +2 -2
  242. package/util/files.d.ts +0 -7
  243. package/util/files.js +0 -41
  244. package/util/mermaid/ast.d.ts +3 -2
  245. package/util/mermaid/ast.js +13 -7
  246. package/util/mermaid/cfg.d.ts +3 -2
  247. package/util/mermaid/cfg.js +26 -6
  248. package/util/mermaid/dfg.d.ts +2 -7
  249. package/util/mermaid/dfg.js +10 -6
  250. package/util/mermaid/info.d.ts +17 -0
  251. package/util/mermaid/info.js +5 -0
  252. package/util/prefix.d.ts +9 -5
  253. package/util/prefix.js +14 -6
  254. package/util/r-regex.d.ts +21 -0
  255. package/util/r-regex.js +25 -0
  256. package/util/simple-df/dfg-view.d.ts +2 -1
  257. package/util/simple-df/dfg-view.js +2 -2
  258. package/util/text/args.js +12 -3
  259. package/util/version.js +1 -1
  260. package/abstract-interpretation/data-frame/absint-info.d.ts +0 -109
  261. package/abstract-interpretation/data-frame/absint-info.js +0 -31
  262. package/abstract-interpretation/data-frame/absint-visitor.d.ts +0 -57
  263. package/abstract-interpretation/data-frame/absint-visitor.js +0 -176
  264. package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +0 -19
  265. package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +0 -33
  266. package/dataflow/environments/remove.d.ts +0 -12
  267. package/dataflow/environments/remove.js +0 -52
  268. package/documentation/doc-util/doc-print.d.ts +0 -5
  269. package/documentation/doc-util/doc-print.js +0 -36
  270. package/project/plugins/file-plugins/flowr-description-file.js +0 -37
  271. package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
  272. package/project/plugins/file-plugins/notebooks/notebook.js +0 -2
  273. /package/project/plugins/file-plugins/{notebooks → files}/flowr-jupyter-file.d.ts +0 -0
  274. /package/project/plugins/file-plugins/{notebooks → files}/flowr-jupyter-file.js +0 -0
  275. /package/project/plugins/file-plugins/{notebooks → files}/flowr-rmarkdown-file.d.ts +0 -0
  276. /package/project/plugins/file-plugins/{notebooks → files}/flowr-rmarkdown-file.js +0 -0
@@ -1,57 +0,0 @@
1
- import { type CfgBasicBlockVertex, type CfgSimpleVertex, type ControlFlowInformation } from '../../control-flow/control-flow-graph';
2
- import { type SemanticCfgGuidedVisitorConfiguration, SemanticCfgGuidedVisitor } from '../../control-flow/semantic-cfg-guided-visitor';
3
- import type { DataflowGraph } from '../../dataflow/graph/graph';
4
- import type { DataflowGraphVertexFunctionCall, DataflowGraphVertexVariableDefinition } from '../../dataflow/graph/vertex';
5
- import type { NoInfo } from '../../r-bridge/lang-4.x/ast/model/model';
6
- import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
7
- import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
8
- import { type AbstractInterpretationInfo } from './absint-info';
9
- export type DataFrameShapeInferenceVisitorConfiguration<OtherInfo = NoInfo, ControlFlow extends ControlFlowInformation = ControlFlowInformation, Ast extends NormalizedAst<OtherInfo & AbstractInterpretationInfo> = NormalizedAst<OtherInfo & AbstractInterpretationInfo>, Dfg extends DataflowGraph = DataflowGraph> = Omit<SemanticCfgGuidedVisitorConfiguration<OtherInfo & AbstractInterpretationInfo, ControlFlow, Ast, Dfg>, 'defaultVisitingOrder' | 'defaultVisitingType'>;
10
- /**
11
- * The control flow graph visitor to infer the shape of data frames using abstract interpretation
12
- */
13
- export declare class DataFrameShapeInferenceVisitor<OtherInfo = NoInfo, ControlFlow extends ControlFlowInformation = ControlFlowInformation, Ast extends NormalizedAst<OtherInfo & AbstractInterpretationInfo> = NormalizedAst<OtherInfo & AbstractInterpretationInfo>, Dfg extends DataflowGraph = DataflowGraph, Config extends DataFrameShapeInferenceVisitorConfiguration<OtherInfo, ControlFlow, Ast, Dfg> = DataFrameShapeInferenceVisitorConfiguration<OtherInfo, ControlFlow, Ast, Dfg>> extends SemanticCfgGuidedVisitor<OtherInfo & AbstractInterpretationInfo, ControlFlow, Ast, Dfg, Config & {
14
- defaultVisitingOrder: 'forward';
15
- defaultVisitingType: 'exit';
16
- }> {
17
- /**
18
- * The old domain of an AST node before processing the node retrieved from the attached {@link AbstractInterpretationInfo}.
19
- * This is used to check whether the state has changed and successors should be visited again, and is also required for widening.
20
- */
21
- private oldDomain;
22
- /**
23
- * The new domain of an AST node during and after processing the node.
24
- * This information is stored in the {@link AbstractInterpretationInfo} afterward.
25
- */
26
- private newDomain;
27
- constructor(config: Config);
28
- protected visitNode(nodeId: NodeId): boolean;
29
- protected visitDataflowNode(vertex: Exclude<CfgSimpleVertex, CfgBasicBlockVertex>): void;
30
- protected onVariableDefinition({ vertex }: {
31
- vertex: DataflowGraphVertexVariableDefinition;
32
- }): void;
33
- protected onAssignmentCall({ call, target, source }: {
34
- call: DataflowGraphVertexFunctionCall;
35
- target?: NodeId;
36
- source?: NodeId;
37
- }): void;
38
- protected onAccessCall({ call }: {
39
- call: DataflowGraphVertexFunctionCall;
40
- }): void;
41
- protected onDefaultFunctionCall({ call }: {
42
- call: DataflowGraphVertexFunctionCall;
43
- }): void;
44
- protected onReplacementCall({ call, source, target }: {
45
- call: DataflowGraphVertexFunctionCall;
46
- source: NodeId | undefined;
47
- target: NodeId | undefined;
48
- }): void;
49
- private applyDataFrameAssignment;
50
- private applyDataFrameExpression;
51
- /** We only process vertices of leaf nodes and exit vertices (no entry nodes of complex nodes) */
52
- private shouldSkipVertex;
53
- /** Get all AST nodes for the predecessor vertices that are leaf nodes and exit vertices */
54
- private getPredecessorNodes;
55
- private shouldWiden;
56
- private clearUnassignedInfo;
57
- }
@@ -1,176 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataFrameShapeInferenceVisitor = void 0;
4
- const control_flow_graph_1 = require("../../control-flow/control-flow-graph");
5
- const semantic_cfg_guided_visitor_1 = require("../../control-flow/semantic-cfg-guided-visitor");
6
- const assert_1 = require("../../util/assert");
7
- const absint_info_1 = require("./absint-info");
8
- const dataframe_domain_1 = require("./dataframe-domain");
9
- const access_mapper_1 = require("./mappers/access-mapper");
10
- const assignment_mapper_1 = require("./mappers/assignment-mapper");
11
- const function_mapper_1 = require("./mappers/function-mapper");
12
- const replacement_mapper_1 = require("./mappers/replacement-mapper");
13
- const semantics_1 = require("./semantics");
14
- const shape_inference_1 = require("./shape-inference");
15
- /**
16
- * The control flow graph visitor to infer the shape of data frames using abstract interpretation
17
- */
18
- class DataFrameShapeInferenceVisitor extends semantic_cfg_guided_visitor_1.SemanticCfgGuidedVisitor {
19
- /**
20
- * The old domain of an AST node before processing the node retrieved from the attached {@link AbstractInterpretationInfo}.
21
- * This is used to check whether the state has changed and successors should be visited again, and is also required for widening.
22
- */
23
- oldDomain = dataframe_domain_1.DataFrameStateDomain.bottom();
24
- /**
25
- * The new domain of an AST node during and after processing the node.
26
- * This information is stored in the {@link AbstractInterpretationInfo} afterward.
27
- */
28
- newDomain = dataframe_domain_1.DataFrameStateDomain.bottom();
29
- constructor(config) {
30
- super({ ...config, defaultVisitingOrder: 'forward', defaultVisitingType: 'exit' });
31
- }
32
- visitNode(nodeId) {
33
- const vertex = this.getCfgVertex(nodeId);
34
- // skip vertices representing entries of complex nodes
35
- if (vertex === undefined || this.shouldSkipVertex(vertex)) {
36
- return true;
37
- }
38
- const predecessors = this.getPredecessorNodes(vertex.id);
39
- const predecessorDomains = predecessors.map(node => node.info.dataFrame?.domain).filter(assert_1.isNotUndefined);
40
- this.newDomain = dataframe_domain_1.DataFrameStateDomain.bottom().joinAll(predecessorDomains);
41
- this.onVisitNode(nodeId);
42
- const visitedCount = this.visited.get(vertex.id) ?? 0;
43
- this.visited.set(vertex.id, visitedCount + 1);
44
- // only continue visiting if the node has not been visited before or the data frame value of the node changed
45
- return visitedCount === 0 || !this.oldDomain.equals(this.newDomain);
46
- }
47
- visitDataflowNode(vertex) {
48
- const node = this.getNormalizedAst((0, control_flow_graph_1.getVertexRootId)(vertex));
49
- if (node === undefined) {
50
- return;
51
- }
52
- this.oldDomain = node.info.dataFrame?.domain ?? dataframe_domain_1.DataFrameStateDomain.bottom();
53
- super.visitDataflowNode(vertex);
54
- if (this.config.dfg.unknownSideEffects.has((0, control_flow_graph_1.getVertexRootId)(vertex))) {
55
- this.newDomain = this.newDomain.bottom();
56
- }
57
- if (this.shouldWiden(vertex)) {
58
- this.newDomain = this.oldDomain.widen(this.newDomain);
59
- }
60
- node.info.dataFrame ??= {};
61
- node.info.dataFrame.domain = this.newDomain;
62
- }
63
- onVariableDefinition({ vertex }) {
64
- const node = this.getNormalizedAst(vertex.id);
65
- if (node !== undefined) {
66
- // mark variable definitions as "unassigned", as the evaluation of the assigned expression is delayed until processing the assignment
67
- node.info.dataFrame ??= { marker: absint_info_1.DataFrameInfoMarker.Unassigned };
68
- }
69
- }
70
- onAssignmentCall({ call, target, source }) {
71
- const node = this.getNormalizedAst(call.id);
72
- const targetNode = this.getNormalizedAst(target);
73
- const sourceNode = this.getNormalizedAst(source);
74
- if (node !== undefined && (0, assignment_mapper_1.isAssignmentTarget)(targetNode) && sourceNode !== undefined) {
75
- node.info.dataFrame = (0, assignment_mapper_1.mapDataFrameVariableAssignment)(targetNode, sourceNode, this.config.dfg);
76
- this.applyDataFrameAssignment(node);
77
- this.clearUnassignedInfo(targetNode);
78
- }
79
- }
80
- onAccessCall({ call }) {
81
- const node = this.getNormalizedAst(call.id);
82
- if (node !== undefined) {
83
- node.info.dataFrame = (0, access_mapper_1.mapDataFrameAccess)(node, this.config.dfg);
84
- this.applyDataFrameExpression(node);
85
- }
86
- }
87
- onDefaultFunctionCall({ call }) {
88
- const node = this.getNormalizedAst(call.id);
89
- if (node !== undefined) {
90
- node.info.dataFrame = (0, function_mapper_1.mapDataFrameFunctionCall)(node, this.config.dfg, this.config.ctx);
91
- this.applyDataFrameExpression(node);
92
- }
93
- }
94
- onReplacementCall({ call, source, target }) {
95
- const node = this.getNormalizedAst(call.id);
96
- const targetNode = this.getNormalizedAst(target);
97
- const sourceNode = this.getNormalizedAst(source);
98
- if (node !== undefined && targetNode !== undefined && sourceNode !== undefined) {
99
- node.info.dataFrame = (0, replacement_mapper_1.mapDataFrameReplacementFunction)(node, sourceNode, this.config.dfg);
100
- this.applyDataFrameExpression(node);
101
- this.clearUnassignedInfo(targetNode);
102
- }
103
- }
104
- applyDataFrameAssignment(node) {
105
- if (!(0, absint_info_1.hasDataFrameAssignmentInfo)(node)) {
106
- return;
107
- }
108
- const value = (0, shape_inference_1.resolveIdToDataFrameShape)(node.info.dataFrame.expression, this.config.dfg, this.newDomain);
109
- if (value !== undefined) {
110
- this.newDomain.set(node.info.dataFrame.identifier, value);
111
- const identifier = this.getNormalizedAst(node.info.dataFrame.identifier);
112
- if (identifier !== undefined) {
113
- identifier.info.dataFrame ??= {};
114
- identifier.info.dataFrame.domain = this.newDomain.create(this.newDomain.value);
115
- }
116
- }
117
- }
118
- applyDataFrameExpression(node) {
119
- if (!(0, absint_info_1.hasDataFrameExpressionInfo)(node)) {
120
- return;
121
- }
122
- const maxColNames = this.config.ctx.config.abstractInterpretation.dataFrame.maxColNames;
123
- let value = dataframe_domain_1.DataFrameDomain.top(maxColNames);
124
- for (const { operation, operand, type, options, ...args } of node.info.dataFrame.operations) {
125
- const operandValue = operand !== undefined ? (0, shape_inference_1.resolveIdToDataFrameShape)(operand, this.config.dfg, this.newDomain) : value;
126
- value = (0, semantics_1.applyDataFrameSemantics)(operation, operandValue ?? dataframe_domain_1.DataFrameDomain.top(maxColNames), args, options);
127
- const constraintType = type ?? (0, semantics_1.getConstraintType)(operation);
128
- if (operand !== undefined && constraintType === semantics_1.ConstraintType.OperandModification) {
129
- this.newDomain.set(operand, value);
130
- for (const origin of (0, shape_inference_1.getVariableOrigins)(operand, this.config.dfg)) {
131
- this.newDomain.set(origin.info.id, value);
132
- }
133
- }
134
- else if (constraintType === semantics_1.ConstraintType.ResultPostcondition) {
135
- this.newDomain.set(node.info.id, value);
136
- }
137
- }
138
- }
139
- /** We only process vertices of leaf nodes and exit vertices (no entry nodes of complex nodes) */
140
- shouldSkipVertex(vertex) {
141
- return (0, control_flow_graph_1.isMarkerVertex)(vertex) ? vertex.type !== control_flow_graph_1.CfgVertexType.EndMarker : vertex.end !== undefined;
142
- }
143
- /** Get all AST nodes for the predecessor vertices that are leaf nodes and exit vertices */
144
- getPredecessorNodes(vertexId) {
145
- return this.config.controlFlow.graph.outgoingEdges(vertexId)?.keys() // outgoing dependency edges are incoming CFG edges
146
- .map(id => this.getCfgVertex(id))
147
- .flatMap(vertex => {
148
- if (vertex === undefined) {
149
- return [];
150
- }
151
- else if (this.shouldSkipVertex(vertex)) {
152
- return this.getPredecessorNodes(vertex.id);
153
- }
154
- else {
155
- return [this.getNormalizedAst((0, control_flow_graph_1.getVertexRootId)(vertex))];
156
- }
157
- })
158
- .filter(assert_1.isNotUndefined)
159
- .toArray() ?? [];
160
- }
161
- shouldWiden(vertex) {
162
- return (this.visited.get(vertex.id) ?? 0) >= this.config.ctx.config.abstractInterpretation.dataFrame.wideningThreshold;
163
- }
164
- clearUnassignedInfo(node) {
165
- if ((0, absint_info_1.hasDataFrameInfoMarker)(node, absint_info_1.DataFrameInfoMarker.Unassigned)) {
166
- if (node.info.dataFrame?.domain !== undefined) {
167
- node.info.dataFrame = { domain: node.info.dataFrame.domain };
168
- }
169
- else {
170
- delete node.info.dataFrame;
171
- }
172
- }
173
- }
174
- }
175
- exports.DataFrameShapeInferenceVisitor = DataFrameShapeInferenceVisitor;
176
- //# sourceMappingURL=absint-visitor.js.map
@@ -1,19 +0,0 @@
1
- import type { DataflowGraph } from '../../../dataflow/graph/graph';
2
- import type { RNode } from '../../../r-bridge/lang-4.x/ast/model/model';
3
- import type { RString } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-string';
4
- import type { RSymbol } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
5
- import type { ParentInformation } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
6
- import type { DataFrameAssignmentInfo } from '../absint-info';
7
- /**
8
- * Maps a concrete data frame assignment to data frame assignment info containing the ids of the identifier and assigned expression.
9
- * We currently do not support function assignments dealing with data frames.
10
- * @param identifier - The R node of the variable identifier
11
- * @param expression - The R node of the assigned expression
12
- * @param dfg - The data flow graph for resolving the arguments
13
- * @returns Data frame assignment info containing the IDs of the identifier and expression, or `undefined` if the node does not represent a data frame assignment
14
- */
15
- export declare function mapDataFrameVariableAssignment(identifier: RSymbol<ParentInformation> | RString<ParentInformation>, expression: RNode<ParentInformation>, dfg: DataflowGraph): DataFrameAssignmentInfo | undefined;
16
- /**
17
- * Checks whether a R node represents an assignment target, i.e. is a `RSymbol` or `RString`.
18
- */
19
- export declare function isAssignmentTarget(node: RNode<ParentInformation> | undefined): node is RSymbol<ParentInformation> | RString<ParentInformation>;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapDataFrameVariableAssignment = mapDataFrameVariableAssignment;
4
- exports.isAssignmentTarget = isAssignmentTarget;
5
- const config_1 = require("../../../config");
6
- const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
7
- const arguments_1 = require("./arguments");
8
- /**
9
- * Maps a concrete data frame assignment to data frame assignment info containing the ids of the identifier and assigned expression.
10
- * We currently do not support function assignments dealing with data frames.
11
- * @param identifier - The R node of the variable identifier
12
- * @param expression - The R node of the assigned expression
13
- * @param dfg - The data flow graph for resolving the arguments
14
- * @returns Data frame assignment info containing the IDs of the identifier and expression, or `undefined` if the node does not represent a data frame assignment
15
- */
16
- function mapDataFrameVariableAssignment(identifier, expression, dfg) {
17
- const resolveInfo = { graph: dfg, idMap: dfg.idMap, full: true, resolve: config_1.VariableResolve.Alias };
18
- if (!(0, arguments_1.isDataFrameArgument)(expression, resolveInfo)) {
19
- return;
20
- }
21
- return {
22
- type: 'assignment',
23
- identifier: identifier.info.id,
24
- expression: expression.info.id
25
- };
26
- }
27
- /**
28
- * Checks whether a R node represents an assignment target, i.e. is a `RSymbol` or `RString`.
29
- */
30
- function isAssignmentTarget(node) {
31
- return node?.type === type_1.RType.Symbol || node?.type === type_1.RType.String;
32
- }
33
- //# sourceMappingURL=assignment-mapper.js.map
@@ -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
@@ -1,5 +0,0 @@
1
- /**
2
- * Writes the wiki documentation to the specified output path.
3
- * Returns true if the file was updated, false if it was unchanged.
4
- */
5
- export declare function writeWikiTo(text: string, output_path: string, check_change?: boolean): boolean;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.writeWikiTo = writeWikiTo;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- /* eslint-disable */
10
- const IgnoreRegex = /[0-9]+(\.[0-9]+)? ?ms|"timing":\s*[0-9]+(\.0-9)?,?|tmp-[A-Za-z0-9-]+/g;
11
- /* eslint-enable */
12
- /**
13
- * Checks whether the file contains a different content, but ignores timing and some other non-semantic changes.
14
- */
15
- function didFileChange(filePath, content) {
16
- if (!fs_1.default.existsSync(filePath)) {
17
- return true; // If the file does not exist, it is considered changed.
18
- }
19
- const currentContent = fs_1.default.readFileSync(filePath, 'utf-8');
20
- const cleanedCurrentContent = currentContent.replace(IgnoreRegex, '');
21
- const cleanedNewContent = content.replace(IgnoreRegex, '');
22
- return cleanedCurrentContent !== cleanedNewContent;
23
- }
24
- /**
25
- * Writes the wiki documentation to the specified output path.
26
- * Returns true if the file was updated, false if it was unchanged.
27
- */
28
- function writeWikiTo(text, output_path, check_change = true) {
29
- if (!check_change || didFileChange(output_path, text)) {
30
- fs_1.default.mkdirSync(path_1.default.dirname(output_path), { recursive: true });
31
- fs_1.default.writeFileSync(output_path, text, 'utf-8');
32
- return true;
33
- }
34
- return false;
35
- }
36
- //# sourceMappingURL=doc-print.js.map
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowrDescriptionFile = void 0;
4
- const flowr_file_1 = require("../../context/flowr-file");
5
- const files_1 = require("../../../util/files");
6
- /**
7
- * This decorates a text file and provides access to its content as a DCF (Debian Control File)-like structure.
8
- */
9
- class FlowrDescriptionFile extends flowr_file_1.FlowrFile {
10
- wrapped;
11
- /**
12
- * Prefer the static {@link FlowrDescriptionFile.from} method to create instances of this class as it will not re-create if already a description file
13
- * and handle role assignments.
14
- */
15
- constructor(file) {
16
- super(file.path(), file.role);
17
- this.wrapped = file;
18
- }
19
- /**
20
- * Loads and parses the content of the wrapped file as a DCF structure.
21
- * @see {@link parseDCF} for details on the parsing logic.
22
- */
23
- loadContent() {
24
- return (0, files_1.parseDCF)(this.wrapped);
25
- }
26
- /**
27
- * Description file lifter, this does not re-create if already a description file
28
- */
29
- static from(file, role) {
30
- if (role) {
31
- file.assignRole(role);
32
- }
33
- return file instanceof FlowrDescriptionFile ? file : new FlowrDescriptionFile(file);
34
- }
35
- }
36
- exports.FlowrDescriptionFile = FlowrDescriptionFile;
37
- //# sourceMappingURL=flowr-description-file.js.map
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=notebook.js.map