@eagleoutice/flowr 2.2.16 → 2.4.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.
Files changed (147) hide show
  1. package/README.md +48 -20
  2. package/abstract-interpretation/data-frame/absint-info.d.ts +109 -0
  3. package/abstract-interpretation/data-frame/absint-info.js +31 -0
  4. package/abstract-interpretation/data-frame/absint-visitor.d.ts +58 -0
  5. package/abstract-interpretation/data-frame/absint-visitor.js +171 -0
  6. package/abstract-interpretation/data-frame/domain.d.ts +107 -0
  7. package/abstract-interpretation/data-frame/domain.js +315 -0
  8. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +17 -0
  9. package/abstract-interpretation/data-frame/mappers/access-mapper.js +166 -0
  10. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +117 -0
  11. package/abstract-interpretation/data-frame/mappers/arguments.js +188 -0
  12. package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +20 -0
  13. package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +34 -0
  14. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +261 -0
  15. package/abstract-interpretation/data-frame/mappers/function-mapper.js +1219 -0
  16. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +12 -0
  17. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +206 -0
  18. package/abstract-interpretation/data-frame/resolve-args.d.ts +42 -0
  19. package/abstract-interpretation/data-frame/resolve-args.js +118 -0
  20. package/abstract-interpretation/data-frame/semantics.d.ts +213 -0
  21. package/abstract-interpretation/data-frame/semantics.js +363 -0
  22. package/abstract-interpretation/data-frame/shape-inference.d.ts +38 -0
  23. package/abstract-interpretation/data-frame/shape-inference.js +111 -0
  24. package/benchmark/slicer.d.ts +15 -1
  25. package/benchmark/slicer.js +137 -0
  26. package/benchmark/stats/print.js +123 -45
  27. package/benchmark/stats/size-of.d.ts +7 -0
  28. package/benchmark/stats/size-of.js +1 -0
  29. package/benchmark/stats/stats.d.ts +30 -1
  30. package/benchmark/stats/stats.js +4 -2
  31. package/benchmark/summarizer/data.d.ts +33 -2
  32. package/benchmark/summarizer/first-phase/input.js +5 -1
  33. package/benchmark/summarizer/first-phase/process.js +47 -1
  34. package/benchmark/summarizer/second-phase/graph.js +1 -1
  35. package/benchmark/summarizer/second-phase/process.js +102 -4
  36. package/cli/benchmark-app.d.ts +2 -0
  37. package/cli/benchmark-app.js +2 -0
  38. package/cli/benchmark-helper-app.d.ts +2 -0
  39. package/cli/benchmark-helper-app.js +10 -3
  40. package/cli/common/options.js +4 -0
  41. package/cli/repl/commands/repl-query.js +1 -1
  42. package/cli/repl/server/connection.js +14 -5
  43. package/config.d.ts +31 -0
  44. package/config.js +21 -1
  45. package/control-flow/basic-cfg-guided-visitor.d.ts +1 -2
  46. package/control-flow/basic-cfg-guided-visitor.js +0 -6
  47. package/control-flow/cfg-simplification.d.ts +6 -0
  48. package/control-flow/cfg-simplification.js +18 -9
  49. package/control-flow/control-flow-graph.d.ts +3 -8
  50. package/control-flow/control-flow-graph.js +5 -6
  51. package/control-flow/dfg-cfg-guided-visitor.js +1 -1
  52. package/control-flow/extract-cfg.d.ts +2 -2
  53. package/control-flow/extract-cfg.js +52 -63
  54. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  55. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  56. package/core/steps/all/static-slicing/00-slice.d.ts +7 -1
  57. package/core/steps/all/static-slicing/00-slice.js +9 -3
  58. package/core/steps/pipeline/default-pipelines.d.ts +74 -74
  59. package/dataflow/environments/built-in.d.ts +7 -5
  60. package/dataflow/environments/built-in.js +16 -13
  61. package/dataflow/eval/resolve/alias-tracking.js +2 -2
  62. package/dataflow/eval/resolve/resolve.d.ts +53 -9
  63. package/dataflow/eval/resolve/resolve.js +132 -38
  64. package/dataflow/graph/dataflowgraph-builder.js +2 -2
  65. package/dataflow/graph/graph.js +1 -1
  66. package/dataflow/graph/invert-dfg.d.ts +2 -0
  67. package/dataflow/graph/invert-dfg.js +17 -0
  68. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -0
  69. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +4 -0
  70. package/documentation/doc-util/doc-query.js +11 -1
  71. package/documentation/doc-util/doc-search.js +2 -2
  72. package/documentation/print-cfg-wiki.js +3 -4
  73. package/documentation/print-core-wiki.js +2 -2
  74. package/documentation/print-dataflow-graph-wiki.js +7 -0
  75. package/documentation/print-faq-wiki.js +4 -0
  76. package/documentation/print-interface-wiki.js +11 -0
  77. package/documentation/print-linter-wiki.js +36 -4
  78. package/documentation/print-linting-and-testing-wiki.js +13 -1
  79. package/documentation/print-onboarding-wiki.js +4 -0
  80. package/documentation/print-query-wiki.js +29 -3
  81. package/linter/linter-executor.js +1 -2
  82. package/linter/linter-format.d.ts +26 -4
  83. package/linter/linter-format.js +25 -6
  84. package/linter/linter-rules.d.ts +63 -12
  85. package/linter/linter-rules.js +5 -1
  86. package/linter/rules/absolute-path.d.ts +4 -7
  87. package/linter/rules/absolute-path.js +9 -6
  88. package/linter/rules/dataframe-access-validation.d.ts +55 -0
  89. package/linter/rules/dataframe-access-validation.js +118 -0
  90. package/linter/rules/dead-code.d.ts +43 -0
  91. package/linter/rules/dead-code.js +50 -0
  92. package/linter/rules/deprecated-functions.d.ts +3 -2
  93. package/linter/rules/deprecated-functions.js +3 -1
  94. package/linter/rules/file-path-validity.d.ts +4 -4
  95. package/linter/rules/file-path-validity.js +8 -6
  96. package/linter/rules/naming-convention.d.ts +5 -4
  97. package/linter/rules/naming-convention.js +8 -2
  98. package/linter/rules/seeded-randomness.d.ts +4 -3
  99. package/linter/rules/seeded-randomness.js +3 -1
  100. package/linter/rules/unused-definition.d.ts +2 -0
  101. package/linter/rules/unused-definition.js +3 -1
  102. package/package.json +2 -2
  103. package/queries/catalog/dependencies-query/dependencies-query-executor.js +6 -1
  104. package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -0
  105. package/queries/catalog/dependencies-query/function-info/write-functions.js +1 -0
  106. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +3 -0
  107. package/queries/catalog/df-shape-query/df-shape-query-executor.js +46 -0
  108. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +72 -0
  109. package/queries/catalog/df-shape-query/df-shape-query-format.js +31 -0
  110. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  111. package/queries/catalog/location-map-query/location-map-query-executor.js +7 -5
  112. package/queries/catalog/location-map-query/location-map-query-format.d.ts +3 -0
  113. package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
  114. package/queries/catalog/search-query/search-query-executor.js +1 -1
  115. package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -1
  116. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +3 -0
  117. package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -1
  118. package/queries/query-print.d.ts +1 -1
  119. package/queries/query-print.js +0 -1
  120. package/queries/query.d.ts +77 -6
  121. package/queries/query.js +26 -11
  122. package/search/flowr-search-builder.d.ts +6 -6
  123. package/search/flowr-search-executor.d.ts +2 -2
  124. package/search/flowr-search-executor.js +1 -1
  125. package/search/flowr-search.d.ts +13 -8
  126. package/search/flowr-search.js +21 -0
  127. package/search/search-executor/search-enrichers.d.ts +87 -20
  128. package/search/search-executor/search-enrichers.js +44 -5
  129. package/search/search-executor/search-generators.d.ts +4 -4
  130. package/search/search-executor/search-generators.js +12 -7
  131. package/search/search-executor/search-mappers.js +3 -2
  132. package/search/search-executor/search-transformer.d.ts +3 -3
  133. package/search/search-executor/search-transformer.js +2 -2
  134. package/slicing/static/static-slicer.d.ts +4 -2
  135. package/slicing/static/static-slicer.js +10 -4
  136. package/util/collections/arrays.d.ts +2 -0
  137. package/util/collections/arrays.js +9 -0
  138. package/util/files.d.ts +8 -2
  139. package/util/files.js +22 -4
  140. package/util/mermaid/dfg.js +4 -2
  141. package/util/r-value.d.ts +23 -0
  142. package/util/r-value.js +113 -0
  143. package/util/range.d.ts +1 -0
  144. package/util/range.js +5 -1
  145. package/util/version.js +1 -1
  146. package/util/cfg/cfg.d.ts +0 -0
  147. package/util/cfg/cfg.js +0 -2
@@ -52,12 +52,12 @@ function dataflowCfgFolds(dataflowGraph) {
52
52
  };
53
53
  }
54
54
  /**
55
- * Given a normalized AST this approximates the control flow graph of the program.
55
+ * Given a normalized AST, this approximates the control flow graph of the program.
56
56
  * This view is different from the computation of the dataflow graph and may differ,
57
57
  * especially because it focuses on intra-procedural analysis.
58
58
  *
59
59
  * @param ast - the normalized AST
60
- * @param config - the Flowr config
60
+ * @param config - the flowR config
61
61
  * @param graph - additional dataflow facts to consider by the control flow extraction
62
62
  * @param simplifications - a list of simplification passes to apply to the control flow graph
63
63
  *
@@ -92,22 +92,20 @@ function identifyMayStatementType(node) {
92
92
  function cfgIfThenElse(ifNode, condition, then, otherwise) {
93
93
  const ifId = ifNode.info.id;
94
94
  const graph = new control_flow_graph_1.ControlFlowGraph();
95
- graph.addVertex({ id: ifId, type: identifyMayStatementType(ifNode), mid: [ifId + '-condition'], end: [ifId + '-exit'] });
96
- graph.addVertex({ id: ifId + '-condition', kind: 'condition', type: control_flow_graph_1.CfgVertexType.MidMarker, root: ifId });
95
+ graph.addVertex({ id: ifId, type: identifyMayStatementType(ifNode), mid: condition.exitPoints, end: [ifId + '-exit'] });
97
96
  graph.addVertex({ id: ifId + '-exit', type: control_flow_graph_1.CfgVertexType.EndMarker, root: ifId });
98
97
  graph.mergeWith(condition.graph);
99
98
  graph.mergeWith(then.graph);
100
99
  if (otherwise) {
101
100
  graph.mergeWith(otherwise.graph);
102
101
  }
103
- for (const exitPoint of condition.exitPoints) {
104
- graph.addEdge(ifId + '-condition', exitPoint, { label: 0 /* CfgEdgeType.Fd */ });
105
- }
106
- for (const entryPoint of then.entryPoints) {
107
- graph.addEdge(entryPoint, ifId + '-condition', { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RTrue, caused: ifId });
108
- }
109
- for (const entryPoint of otherwise?.entryPoints ?? []) {
110
- graph.addEdge(entryPoint, ifId + '-condition', { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RFalse, caused: ifId });
102
+ for (const e of condition.exitPoints) {
103
+ for (const entryPoint of then.entryPoints) {
104
+ graph.addEdge(entryPoint, e, { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RTrue, caused: ifId });
105
+ }
106
+ for (const entryPoint of otherwise?.entryPoints ?? []) {
107
+ graph.addEdge(entryPoint, e, { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RFalse, caused: ifId });
108
+ }
111
109
  }
112
110
  for (const entryPoint of condition.entryPoints) {
113
111
  graph.addEdge(entryPoint, ifId, { label: 0 /* CfgEdgeType.Fd */ });
@@ -116,7 +114,9 @@ function cfgIfThenElse(ifNode, condition, then, otherwise) {
116
114
  graph.addEdge(ifId + '-exit', exit, { label: 0 /* CfgEdgeType.Fd */ });
117
115
  }
118
116
  if (!otherwise) {
119
- graph.addEdge(ifId + '-exit', ifId + '-condition', { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RFalse, caused: ifId });
117
+ for (const e of condition.exitPoints) {
118
+ graph.addEdge(ifId + '-exit', e, { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RFalse, caused: ifId });
119
+ }
120
120
  }
121
121
  return {
122
122
  graph,
@@ -146,18 +146,16 @@ function cfgRepeat(repeat, body) {
146
146
  function cfgWhile(whileLoop, condition, body) {
147
147
  const whileId = whileLoop.info.id;
148
148
  const graph = condition.graph;
149
- graph.addVertex({ id: whileId, type: identifyMayStatementType(whileLoop), mid: [whileId + '-condition'], end: [whileId + '-exit'] });
150
- graph.addVertex({ id: whileId + '-condition', kind: 'condition', type: control_flow_graph_1.CfgVertexType.MidMarker, root: whileId });
149
+ graph.addVertex({ id: whileId, type: identifyMayStatementType(whileLoop), mid: condition.exitPoints, end: [whileId + '-exit'] });
151
150
  graph.addVertex({ id: whileId + '-exit', type: control_flow_graph_1.CfgVertexType.EndMarker, root: whileId });
152
151
  graph.mergeWith(body.graph);
153
152
  for (const entry of condition.entryPoints) {
154
153
  graph.addEdge(entry, whileId, { label: 0 /* CfgEdgeType.Fd */ });
155
154
  }
156
- for (const exit of condition.exitPoints) {
157
- graph.addEdge(whileId + '-condition', exit, { label: 0 /* CfgEdgeType.Fd */ });
158
- }
159
- for (const entry of body.entryPoints) {
160
- graph.addEdge(entry, whileId + '-condition', { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RTrue, caused: whileId });
155
+ for (const e of condition.exitPoints) {
156
+ for (const entry of body.entryPoints) {
157
+ graph.addEdge(entry, e, { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RTrue, caused: whileId });
158
+ }
161
159
  }
162
160
  for (const next of [...body.nexts, ...body.exitPoints]) {
163
161
  graph.addEdge(whileId, next, { label: 0 /* CfgEdgeType.Fd */ });
@@ -166,13 +164,19 @@ function cfgWhile(whileLoop, condition, body) {
166
164
  graph.addEdge(whileId + '-exit', breakPoint, { label: 0 /* CfgEdgeType.Fd */ });
167
165
  }
168
166
  // while can break on the condition as well
169
- graph.addEdge(whileId + '-exit', whileId + '-condition', { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RFalse, caused: whileId });
167
+ for (const e of condition.exitPoints) {
168
+ graph.addEdge(whileId + '-exit', e, {
169
+ label: 1 /* CfgEdgeType.Cd */,
170
+ when: convert_values_1.RFalse,
171
+ caused: whileId
172
+ });
173
+ }
170
174
  return { graph, breaks: [], nexts: [], returns: body.returns, exitPoints: [whileId + '-exit'], entryPoints: [whileId] };
171
175
  }
172
176
  function cfgFor(forLoop, variable, vector, body) {
173
177
  const forLoopId = forLoop.info.id;
174
178
  const graph = variable.graph;
175
- graph.addVertex({ id: forLoopId, type: identifyMayStatementType(forLoop), end: [forLoopId + '-exit'], mid: [forLoopId + '-head'] });
179
+ graph.addVertex({ id: forLoopId, type: identifyMayStatementType(forLoop), end: [forLoopId + '-exit'], mid: variable.exitPoints });
176
180
  graph.mergeWith(vector.graph);
177
181
  graph.mergeWith(body.graph);
178
182
  for (const entry of vector.entryPoints) {
@@ -183,12 +187,10 @@ function cfgFor(forLoop, variable, vector, body) {
183
187
  graph.addEdge(entry, exit, { label: 0 /* CfgEdgeType.Fd */ });
184
188
  }
185
189
  }
186
- graph.addVertex({ id: forLoopId + '-head', type: control_flow_graph_1.CfgVertexType.MidMarker, root: forLoopId, kind: 'head' });
187
- for (const exit of variable.exitPoints) {
188
- graph.addEdge(forLoopId + '-head', exit, { label: 0 /* CfgEdgeType.Fd */ });
189
- }
190
- for (const entry of body.entryPoints) {
191
- graph.addEdge(entry, forLoopId + '-head', { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RTrue, caused: forLoopId });
190
+ for (const e of variable.exitPoints) {
191
+ for (const entry of body.entryPoints) {
192
+ graph.addEdge(entry, e, { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RTrue, caused: forLoopId });
193
+ }
192
194
  }
193
195
  for (const next of [...body.nexts, ...body.exitPoints]) {
194
196
  graph.addEdge(forLoopId, next, { label: 0 /* CfgEdgeType.Fd */ });
@@ -203,17 +205,19 @@ function cfgFor(forLoop, variable, vector, body) {
203
205
  type: control_flow_graph_1.CfgVertexType.EndMarker,
204
206
  root: forLoopId
205
207
  });
206
- graph.addEdge(forLoopId + '-exit', forLoopId + '-head', { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RFalse, caused: forLoopId });
208
+ for (const e of variable.exitPoints) {
209
+ graph.addEdge(forLoopId + '-exit', e, { label: 1 /* CfgEdgeType.Cd */, when: convert_values_1.RFalse, caused: forLoopId });
210
+ }
207
211
  }
208
212
  return { graph, breaks: [], nexts: [], returns: body.returns, exitPoints: isNotEndless ? [forLoopId + '-exit'] : [], entryPoints: [forLoopId] };
209
213
  }
210
214
  function cfgFunctionDefinition(fn, params, body) {
211
215
  const fnId = fn.info.id;
212
216
  const graph = new control_flow_graph_1.ControlFlowGraph();
213
- const children = [fnId + '-params', fnId + '-exit'];
214
- graph.addVertex({ id: fnId + '-params', kind: 'parameters', type: control_flow_graph_1.CfgVertexType.MidMarker, root: fnId }, false);
217
+ let paramExits = params.flatMap(e => e.exitPoints);
218
+ const children = [...paramExits, fnId + '-exit'];
215
219
  graph.addVertex({ id: fnId + '-exit', type: control_flow_graph_1.CfgVertexType.EndMarker, root: fnId }, false);
216
- graph.addVertex({ id: fnId, children, type: identifyMayStatementType(fn), mid: [fnId + '-params'], end: [fnId + '-exit'] });
220
+ graph.addVertex({ id: fnId, children, type: identifyMayStatementType(fn), mid: paramExits, end: [fnId + '-exit'] });
217
221
  graph.mergeWith(body.graph, true);
218
222
  children.push(...body.graph.rootIds());
219
223
  for (const param of params) {
@@ -222,15 +226,14 @@ function cfgFunctionDefinition(fn, params, body) {
222
226
  for (const entry of param.entryPoints) {
223
227
  graph.addEdge(entry, fnId, { label: 0 /* CfgEdgeType.Fd */ });
224
228
  }
225
- for (const exit of param.exitPoints) {
226
- graph.addEdge(fnId + '-params', exit, { label: 0 /* CfgEdgeType.Fd */ });
227
- }
228
229
  }
229
- if (params.length === 0) {
230
- graph.addEdge(fnId + '-params', fnId, { label: 0 /* CfgEdgeType.Fd */ });
230
+ if (paramExits.length === 0) {
231
+ paramExits = [fnId];
231
232
  }
232
- for (const entry of body.entryPoints) {
233
- graph.addEdge(entry, fnId + '-params', { label: 0 /* CfgEdgeType.Fd */ });
233
+ for (const e of paramExits) {
234
+ for (const entry of body.entryPoints) {
235
+ graph.addEdge(entry, e, { label: 0 /* CfgEdgeType.Fd */ });
236
+ }
234
237
  }
235
238
  // breaks and nexts should be illegal but safe is safe, I guess
236
239
  for (const next of body.returns.concat(body.breaks, body.nexts, body.exitPoints)) {
@@ -242,16 +245,12 @@ function cfgFunctionCall(call, name, args, exit = 'exit') {
242
245
  const callId = call.info.id;
243
246
  const graph = name.graph;
244
247
  const info = { graph, breaks: [...name.breaks], nexts: [...name.nexts], returns: [...name.returns], exitPoints: [callId + '-' + exit], entryPoints: [callId] };
245
- graph.addVertex({ id: callId, type: identifyMayStatementType(call), mid: [callId + '-name'], end: [callId + '-' + exit] });
248
+ graph.addVertex({ id: callId, type: identifyMayStatementType(call), mid: name.exitPoints, end: [callId + '-' + exit] });
246
249
  for (const entryPoint of name.entryPoints) {
247
250
  graph.addEdge(entryPoint, callId, { label: 0 /* CfgEdgeType.Fd */ });
248
251
  }
249
- graph.addVertex({ id: callId + '-name', kind: 'name', type: control_flow_graph_1.CfgVertexType.MidMarker, root: callId });
250
- for (const exitPoint of name.exitPoints) {
251
- graph.addEdge(callId + '-name', exitPoint, { label: 0 /* CfgEdgeType.Fd */ });
252
- }
253
252
  graph.addVertex({ id: callId + '-' + exit, type: control_flow_graph_1.CfgVertexType.EndMarker, root: callId });
254
- let lastArgExits = [callId + '-name'];
253
+ let lastArgExits = name.exitPoints;
255
254
  for (const arg of args) {
256
255
  if (arg === r_function_call_1.EmptyArgument) {
257
256
  continue;
@@ -283,7 +282,7 @@ function cfgFunctionCallWithDataflow(graph) {
283
282
  const callVertex = baseCfg.graph.getVertex(call.info.id);
284
283
  (0, assert_1.guard)(callVertex !== undefined, 'cfgFunctionCallWithDataflow: call vertex not found');
285
284
  for (const target of targets) {
286
- // we have to filter out non func-call targets as the call targets contains names and call ids
285
+ // we have to filter out non-func-call targets as the call targets contains names and call ids
287
286
  if ((0, vertex_1.isFunctionDefinitionVertex)(graph.getVertex(target))) {
288
287
  callVertex.callTargets ??= new Set();
289
288
  callVertex.callTargets.add(target);
@@ -312,8 +311,8 @@ function cfgFunctionCallWithDataflow(graph) {
312
311
  function cfgArgumentOrParameter(node, name, value) {
313
312
  const graph = new control_flow_graph_1.ControlFlowGraph();
314
313
  const info = { graph, breaks: [], nexts: [], returns: [], exitPoints: [node.info.id + '-exit'], entryPoints: [node.info.id] };
315
- graph.addVertex({ id: node.info.id, type: control_flow_graph_1.CfgVertexType.Expression, mid: [node.info.id + '-before-value'], end: [node.info.id + '-exit'] });
316
- let currentExitPoint = [node.info.id];
314
+ let currentExitPoints = name?.exitPoints ?? [node.info.id];
315
+ graph.addVertex({ id: node.info.id, type: control_flow_graph_1.CfgVertexType.Expression, mid: currentExitPoints, end: [node.info.id + '-exit'] });
317
316
  if (name) {
318
317
  graph.mergeWith(name.graph);
319
318
  info.breaks = info.breaks.concat(name.breaks);
@@ -322,27 +321,21 @@ function cfgArgumentOrParameter(node, name, value) {
322
321
  for (const entry of name.entryPoints) {
323
322
  graph.addEdge(entry, node.info.id, { label: 0 /* CfgEdgeType.Fd */ });
324
323
  }
325
- currentExitPoint = name.exitPoints;
326
324
  }
327
- graph.addVertex({ id: node.info.id + '-before-value', kind: 'before-value', type: control_flow_graph_1.CfgVertexType.MidMarker, root: node.info.id });
328
- for (const exitPoints of currentExitPoint) {
329
- graph.addEdge(node.info.id + '-before-value', exitPoints, { label: 0 /* CfgEdgeType.Fd */ });
330
- }
331
- currentExitPoint = [node.info.id + '-before-value'];
332
325
  if (value) {
333
326
  graph.mergeWith(value.graph);
334
327
  info.breaks = info.breaks.concat(value.breaks);
335
328
  info.nexts = info.nexts.concat(value.nexts);
336
329
  info.returns = info.returns.concat(value.returns);
337
- for (const exitPoint of currentExitPoint) {
330
+ for (const exitPoint of currentExitPoints) {
338
331
  for (const entry of value.entryPoints) {
339
332
  graph.addEdge(entry, exitPoint, { label: 0 /* CfgEdgeType.Fd */ });
340
333
  }
341
334
  }
342
- currentExitPoint = value.exitPoints;
335
+ currentExitPoints = value.exitPoints;
343
336
  }
344
337
  graph.addVertex({ id: node.info.id + '-exit', type: control_flow_graph_1.CfgVertexType.EndMarker, root: node.info.id });
345
- for (const exit of currentExitPoint) {
338
+ for (const exit of currentExitPoints) {
346
339
  graph.addEdge(node.info.id + '-exit', exit, { label: 0 /* CfgEdgeType.Fd */ });
347
340
  }
348
341
  return info;
@@ -368,16 +361,12 @@ function cfgBinaryOp(binOp, lhs, rhs) {
368
361
  function cfgAccess(access, name, accessors) {
369
362
  const result = { ...name };
370
363
  const graph = result.graph;
371
- graph.addVertex({ id: access.info.id, type: control_flow_graph_1.CfgVertexType.Expression, mid: [access.info.id + '-after-name'], end: [access.info.id + '-exit'] });
364
+ graph.addVertex({ id: access.info.id, type: control_flow_graph_1.CfgVertexType.Expression, mid: name.exitPoints, end: [access.info.id + '-exit'] });
372
365
  result.entryPoints = [access.info.id];
373
366
  for (const entry of name.entryPoints) {
374
367
  graph.addEdge(entry, access.info.id, { label: 0 /* CfgEdgeType.Fd */ });
375
368
  }
376
- for (const exit of name.exitPoints) {
377
- graph.addEdge(access.info.id + '-after-name', exit, { label: 0 /* CfgEdgeType.Fd */ });
378
- }
379
- graph.addVertex({ id: access.info.id + '-after-name', kind: 'after-name', type: control_flow_graph_1.CfgVertexType.MidMarker, root: access.info.id });
380
- result.exitPoints = [access.info.id + '-after-name'];
369
+ result.exitPoints = name.exitPoints;
381
370
  for (const accessor of accessors) {
382
371
  if (accessor === r_function_call_1.EmptyArgument) {
383
372
  continue;
@@ -45,7 +45,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
45
45
  /**
46
46
  * A helper function to get the normalized AST node for the given id or fail if it does not exist.
47
47
  */
48
- protected getNormalizedAst(id: NodeId): RNode<OtherInfo & ParentInformation> | undefined;
48
+ protected getNormalizedAst(id: NodeId | undefined): RNode<OtherInfo & ParentInformation> | undefined;
49
49
  /**
50
50
  * See {@link DataflowAwareCfgGuidedVisitor#visitValue} for the base implementation.
51
51
  * This now dispatches the value to the appropriate event handler based on its type.
@@ -35,7 +35,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
35
35
  * A helper function to get the normalized AST node for the given id or fail if it does not exist.
36
36
  */
37
37
  getNormalizedAst(id) {
38
- return this.config.normalizedAst.idMap.get(id);
38
+ return id !== undefined ? this.config.normalizedAst.idMap.get(id) : undefined;
39
39
  }
40
40
  /**
41
41
  * See {@link DataflowAwareCfgGuidedVisitor#visitValue} for the base implementation.
@@ -9,11 +9,17 @@ export interface SliceRequiredInput {
9
9
  readonly criterion: SlicingCriteria;
10
10
  /** How many re-visits of the same node are ok? */
11
11
  readonly threshold?: number;
12
+ /** The direction to slice in. Defaults to backward slicing if unset. */
13
+ readonly direction?: SliceDirection;
14
+ }
15
+ export declare enum SliceDirection {
16
+ Backward = "backward",
17
+ Forward = "forward"
12
18
  }
13
19
  declare function processor(results: {
14
20
  dataflow?: DataflowInformation;
15
21
  normalize?: NormalizedAst;
16
- }, input: Partial<SliceRequiredInput>, config: FlowrConfigOptions): Readonly<import("../../../../slicing/static/slicer-types").SliceResult>;
22
+ }, input: Partial<SliceRequiredInput>, _config: FlowrConfigOptions): Readonly<import("../../../../slicing/static/slicer-types").SliceResult>;
17
23
  export declare const STATIC_SLICE: {
18
24
  readonly name: "slice";
19
25
  readonly humanReadableName: "static slice";
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STATIC_SLICE = void 0;
3
+ exports.STATIC_SLICE = exports.SliceDirection = void 0;
4
4
  const print_1 = require("../../../print/print");
5
5
  const static_slicer_1 = require("../../../../slicing/static/static-slicer");
6
- function processor(results, input, config) {
7
- return (0, static_slicer_1.staticSlicing)(results.dataflow.graph, results.normalize, input.criterion, input.threshold ?? config.solver.slicer?.threshold);
6
+ var SliceDirection;
7
+ (function (SliceDirection) {
8
+ SliceDirection["Backward"] = "backward";
9
+ SliceDirection["Forward"] = "forward";
10
+ })(SliceDirection || (exports.SliceDirection = SliceDirection = {}));
11
+ function processor(results, input, _config) {
12
+ const direction = input.direction ?? SliceDirection.Backward;
13
+ return (0, static_slicer_1.staticSlice)(results.dataflow.graph, results.normalize, input.criterion, direction, input.threshold);
8
14
  }
9
15
  exports.STATIC_SLICE = {
10
16
  name: 'slice',
@@ -8,6 +8,20 @@ import type { RShell } from '../../../r-bridge/shell';
8
8
  import type { TreeSitterExecutor } from '../../../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor';
9
9
  import type { FlowrConfigOptions } from '../../../config';
10
10
  export declare const DEFAULT_SLICING_PIPELINE: import("./pipeline").Pipeline<{
11
+ readonly name: "slice";
12
+ readonly humanReadableName: "static slice";
13
+ readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
14
+ readonly processor: (results: {
15
+ dataflow?: import("../../../dataflow/info").DataflowInformation;
16
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
17
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, _config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
18
+ readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
19
+ readonly printer: {
20
+ readonly 0: typeof import("../../print/print").internalPrinter;
21
+ };
22
+ readonly dependencies: readonly ["dataflow"];
23
+ readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
24
+ } | {
11
25
  readonly name: "parse";
12
26
  readonly humanReadableName: "parse with R shell";
13
27
  readonly description: "Parse the given R code into an AST";
@@ -60,20 +74,6 @@ export declare const DEFAULT_SLICING_PIPELINE: import("./pipeline").Pipeline<{
60
74
  readonly 4: typeof import("../../print/dataflow-printer").dataflowGraphToMermaidUrl;
61
75
  };
62
76
  readonly dependencies: readonly ["normalize"];
63
- } | {
64
- readonly name: "slice";
65
- readonly humanReadableName: "static slice";
66
- readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
67
- readonly processor: (results: {
68
- dataflow?: import("../../../dataflow/info").DataflowInformation;
69
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
70
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
71
- readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
72
- readonly printer: {
73
- readonly 0: typeof import("../../print/print").internalPrinter;
74
- };
75
- readonly dependencies: readonly ["dataflow"];
76
- readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
77
77
  } | {
78
78
  readonly name: "reconstruct";
79
79
  readonly humanReadableName: "static code reconstruction";
@@ -90,6 +90,20 @@ export declare const DEFAULT_SLICING_PIPELINE: import("./pipeline").Pipeline<{
90
90
  readonly requiredInput: import("../all/static-slicing/10-reconstruct").ReconstructRequiredInput;
91
91
  }>;
92
92
  export declare const DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipeline").Pipeline<{
93
+ readonly name: "slice";
94
+ readonly humanReadableName: "static slice";
95
+ readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
96
+ readonly processor: (results: {
97
+ dataflow?: import("../../../dataflow/info").DataflowInformation;
98
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
99
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, _config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
100
+ readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
101
+ readonly printer: {
102
+ readonly 0: typeof import("../../print/print").internalPrinter;
103
+ };
104
+ readonly dependencies: readonly ["dataflow"];
105
+ readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
106
+ } | {
93
107
  readonly name: "parse";
94
108
  readonly humanReadableName: "parse with R shell";
95
109
  readonly description: "Parse the given R code into an AST";
@@ -142,20 +156,6 @@ export declare const DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipeline"
142
156
  readonly 4: typeof import("../../print/dataflow-printer").dataflowGraphToMermaidUrl;
143
157
  };
144
158
  readonly dependencies: readonly ["normalize"];
145
- } | {
146
- readonly name: "slice";
147
- readonly humanReadableName: "static slice";
148
- readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
149
- readonly processor: (results: {
150
- dataflow?: import("../../../dataflow/info").DataflowInformation;
151
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
152
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
153
- readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
154
- readonly printer: {
155
- readonly 0: typeof import("../../print/print").internalPrinter;
156
- };
157
- readonly dependencies: readonly ["dataflow"];
158
- readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
159
159
  } | {
160
160
  readonly name: "reconstruct";
161
161
  readonly humanReadableName: "static code reconstruction";
@@ -172,6 +172,20 @@ export declare const DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipeline"
172
172
  readonly requiredInput: import("../all/static-slicing/10-reconstruct").ReconstructRequiredInput;
173
173
  }>;
174
174
  export declare const DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./pipeline").Pipeline<{
175
+ readonly name: "slice";
176
+ readonly humanReadableName: "static slice";
177
+ readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
178
+ readonly processor: (results: {
179
+ dataflow?: import("../../../dataflow/info").DataflowInformation;
180
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
181
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, _config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
182
+ readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
183
+ readonly printer: {
184
+ readonly 0: typeof import("../../print/print").internalPrinter;
185
+ };
186
+ readonly dependencies: readonly ["dataflow"];
187
+ readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
188
+ } | {
175
189
  readonly name: "parse";
176
190
  readonly humanReadableName: "parse with R shell";
177
191
  readonly description: "Parse the given R code into an AST";
@@ -224,22 +238,22 @@ export declare const DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./pipel
224
238
  readonly 4: typeof import("../../print/dataflow-printer").dataflowGraphToMermaidUrl;
225
239
  };
226
240
  readonly dependencies: readonly ["normalize"];
227
- } | {
241
+ }>;
242
+ export declare const TREE_SITTER_SLICING_PIPELINE: import("./pipeline").Pipeline<{
228
243
  readonly name: "slice";
229
244
  readonly humanReadableName: "static slice";
230
245
  readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
231
246
  readonly processor: (results: {
232
247
  dataflow?: import("../../../dataflow/info").DataflowInformation;
233
248
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
234
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
249
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, _config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
235
250
  readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
236
251
  readonly printer: {
237
252
  readonly 0: typeof import("../../print/print").internalPrinter;
238
253
  };
239
254
  readonly dependencies: readonly ["dataflow"];
240
255
  readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
241
- }>;
242
- export declare const TREE_SITTER_SLICING_PIPELINE: import("./pipeline").Pipeline<{
256
+ } | {
243
257
  readonly humanReadableName: "dataflow";
244
258
  readonly processor: (results: {
245
259
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
@@ -259,20 +273,6 @@ export declare const TREE_SITTER_SLICING_PIPELINE: import("./pipeline").Pipeline
259
273
  readonly 4: typeof import("../../print/dataflow-printer").dataflowGraphToMermaidUrl;
260
274
  };
261
275
  readonly dependencies: readonly ["normalize"];
262
- } | {
263
- readonly name: "slice";
264
- readonly humanReadableName: "static slice";
265
- readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
266
- readonly processor: (results: {
267
- dataflow?: import("../../../dataflow/info").DataflowInformation;
268
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
269
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
270
- readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
271
- readonly printer: {
272
- readonly 0: typeof import("../../print/print").internalPrinter;
273
- };
274
- readonly dependencies: readonly ["dataflow"];
275
- readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
276
276
  } | {
277
277
  readonly name: "reconstruct";
278
278
  readonly humanReadableName: "static code reconstruction";
@@ -321,6 +321,20 @@ export declare const TREE_SITTER_SLICING_PIPELINE: import("./pipeline").Pipeline
321
321
  readonly requiredInput: import("../all/core/10-normalize").NormalizeRequiredInput;
322
322
  }>;
323
323
  export declare const TREE_SITTER_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipeline").Pipeline<{
324
+ readonly name: "slice";
325
+ readonly humanReadableName: "static slice";
326
+ readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
327
+ readonly processor: (results: {
328
+ dataflow?: import("../../../dataflow/info").DataflowInformation;
329
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
330
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, _config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
331
+ readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
332
+ readonly printer: {
333
+ readonly 0: typeof import("../../print/print").internalPrinter;
334
+ };
335
+ readonly dependencies: readonly ["dataflow"];
336
+ readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
337
+ } | {
324
338
  readonly humanReadableName: "dataflow";
325
339
  readonly processor: (results: {
326
340
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
@@ -340,20 +354,6 @@ export declare const TREE_SITTER_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipel
340
354
  readonly 4: typeof import("../../print/dataflow-printer").dataflowGraphToMermaidUrl;
341
355
  };
342
356
  readonly dependencies: readonly ["normalize"];
343
- } | {
344
- readonly name: "slice";
345
- readonly humanReadableName: "static slice";
346
- readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
347
- readonly processor: (results: {
348
- dataflow?: import("../../../dataflow/info").DataflowInformation;
349
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
350
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
351
- readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
352
- readonly printer: {
353
- readonly 0: typeof import("../../print/print").internalPrinter;
354
- };
355
- readonly dependencies: readonly ["dataflow"];
356
- readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
357
357
  } | {
358
358
  readonly name: "reconstruct";
359
359
  readonly humanReadableName: "static code reconstruction";
@@ -402,6 +402,20 @@ export declare const TREE_SITTER_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipel
402
402
  readonly requiredInput: import("../all/core/10-normalize").NormalizeRequiredInput;
403
403
  }>;
404
404
  export declare const TREE_SITTER_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./pipeline").Pipeline<{
405
+ readonly name: "slice";
406
+ readonly humanReadableName: "static slice";
407
+ readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
408
+ readonly processor: (results: {
409
+ dataflow?: import("../../../dataflow/info").DataflowInformation;
410
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
411
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, _config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
412
+ readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
413
+ readonly printer: {
414
+ readonly 0: typeof import("../../print/print").internalPrinter;
415
+ };
416
+ readonly dependencies: readonly ["dataflow"];
417
+ readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
418
+ } | {
405
419
  readonly humanReadableName: "dataflow";
406
420
  readonly processor: (results: {
407
421
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
@@ -421,20 +435,6 @@ export declare const TREE_SITTER_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./p
421
435
  readonly 4: typeof import("../../print/dataflow-printer").dataflowGraphToMermaidUrl;
422
436
  };
423
437
  readonly dependencies: readonly ["normalize"];
424
- } | {
425
- readonly name: "slice";
426
- readonly humanReadableName: "static slice";
427
- readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
428
- readonly processor: (results: {
429
- dataflow?: import("../../../dataflow/info").DataflowInformation;
430
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
431
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
432
- readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
433
- readonly printer: {
434
- readonly 0: typeof import("../../print/print").internalPrinter;
435
- };
436
- readonly dependencies: readonly ["dataflow"];
437
- readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
438
438
  } | {
439
439
  readonly name: "parse";
440
440
  readonly humanReadableName: "parse with tree-sitter";
@@ -30,7 +30,7 @@ import { processRm } from '../internal/process/functions/call/built-in/built-in-
30
30
  import { processEvalCall } from '../internal/process/functions/call/built-in/built-in-eval';
31
31
  import type { REnvironmentInformation } from './environment';
32
32
  import type { Value } from '../eval/values/r-value';
33
- import { resolveAsVector } from '../eval/resolve/resolve';
33
+ import { resolveAsVector, resolveAsSeq, resolveAsMinus, resolveAsPlus } from '../eval/resolve/resolve';
34
34
  import type { DataflowGraph } from '../graph/graph';
35
35
  import type { VariableResolve } from '../../config';
36
36
  export type BuiltIn = `built-in:${string}`;
@@ -54,7 +54,7 @@ export interface DefaultBuiltInProcessorConfiguration extends ForceArguments {
54
54
  readonly returnsNthArgument?: number | 'last';
55
55
  readonly cfg?: ExitPointType;
56
56
  readonly readAllArguments?: boolean;
57
- readonly hasUnknownSideEffects?: boolean | LinkTo<RegExp | string>;
57
+ readonly hasUnknownSideEffects?: boolean | LinkTo;
58
58
  /** record mapping the actual function name called to the arguments that should be treated as function calls */
59
59
  readonly treatAsFnCall?: Record<string, readonly string[]>;
60
60
  /** Name that should be used for the origin (useful when needing to differentiate between
@@ -62,8 +62,8 @@ export interface DefaultBuiltInProcessorConfiguration extends ForceArguments {
62
62
  */
63
63
  readonly useAsProcessor?: UseAsProcessors;
64
64
  }
65
- export type BuiltInEvalHandler = (resolve: VariableResolve, a: RNodeWithParent, env: REnvironmentInformation, graph?: DataflowGraph, map?: AstIdMap) => Value;
66
- declare function defaultBuiltInProcessor<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: DefaultBuiltInProcessorConfiguration): DataflowInformation;
65
+ export type BuiltInEvalHandler = (resolve: VariableResolve, a: RNodeWithParent, env?: REnvironmentInformation, graph?: DataflowGraph, map?: AstIdMap) => Value;
66
+ declare function defaultBuiltInProcessor<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, { returnsNthArgument, useAsProcessor, forceArgs, readAllArguments, cfg, hasUnknownSideEffects, treatAsFnCall }: DefaultBuiltInProcessorConfiguration): DataflowInformation;
67
67
  export declare function registerBuiltInFunctions<Config extends object, Proc extends BuiltInIdentifierProcessorWithConfig<Config>>(both: boolean, names: readonly Identifier[], processor: Proc, config: Config): void;
68
68
  export declare const BuiltInProcessorMapper: {
69
69
  readonly 'builtin:default': typeof defaultBuiltInProcessor;
@@ -90,7 +90,9 @@ export declare const BuiltInProcessorMapper: {
90
90
  };
91
91
  export declare const BuiltInEvalHandlerMapper: {
92
92
  readonly 'built-in:c': typeof resolveAsVector;
93
- readonly 'builtin:vector': typeof resolveAsVector;
93
+ readonly 'built-in::': typeof resolveAsSeq;
94
+ readonly 'built-in:+': typeof resolveAsPlus;
95
+ readonly 'built-in:-': typeof resolveAsMinus;
94
96
  };
95
97
  export type BuiltInMappingName = keyof typeof BuiltInProcessorMapper;
96
98
  export type ConfigOfBuiltInMappingName<N extends BuiltInMappingName> = Parameters<typeof BuiltInProcessorMapper[N]>[4];