@eagleoutice/flowr 2.17.4 → 2.17.5
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 -52
- package/abstract-interpretation/absint-inference.js +1 -2
- package/abstract-interpretation/data-frame/arguments.d.ts +14 -3
- package/abstract-interpretation/data-frame/arguments.js +34 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.js +7 -15
- package/abstract-interpretation/data-frame/resolve-args.d.ts +2 -2
- package/abstract-interpretation/data-frame/semantics.d.ts +8 -1
- package/abstract-interpretation/data-frame/semantics.js +14 -6
- package/abstract-interpretation/domains/state-abstract-domain.js +28 -18
- package/abstract-interpretation/domains/state-map.d.ts +43 -0
- package/abstract-interpretation/domains/state-map.js +147 -0
- package/benchmark/slicer.d.ts +1 -1
- package/benchmark/slicer.js +8 -7
- package/cli/repl/commands/repl-dataflow.js +5 -5
- package/cli/repl/commands/repl-execute.js +3 -2
- package/cli/repl/commands/repl-parse.js +2 -1
- package/cli/repl/print-version.d.ts +1 -1
- package/cli/repl/print-version.js +2 -1
- package/cli/repl/server/connection.d.ts +1 -1
- package/cli/repl/server/connection.js +7 -9
- package/cli/slicer-app.js +2 -1
- package/clones/algorithms/baxter-ast.d.ts +33 -0
- package/clones/algorithms/baxter-ast.js +70 -0
- package/clones/algorithms/greedy-string-tiling.d.ts +17 -0
- package/clones/algorithms/greedy-string-tiling.js +56 -0
- package/clones/algorithms/winnowing.d.ts +27 -0
- package/clones/algorithms/winnowing.js +66 -0
- package/clones/clone-ast.d.ts +75 -0
- package/clones/clone-ast.js +174 -0
- package/clones/clone-dataflow.d.ts +11 -0
- package/clones/clone-dataflow.js +83 -0
- package/clones/clone-detector.d.ts +116 -0
- package/clones/clone-detector.js +200 -0
- package/clones/clone-index.d.ts +54 -0
- package/clones/clone-index.js +56 -0
- package/config.d.ts +21 -2
- package/config.js +7 -1
- package/control-flow/basic-cfg-guided-visitor.js +1 -2
- package/control-flow/happens-before.d.ts +2 -0
- package/control-flow/happens-before.js +15 -9
- package/control-flow/simple-visitor.js +2 -4
- package/core/steps/all/core/00-parse.js +2 -1
- package/core/steps/all/core/01-parse-tree-sitter.js +2 -1
- package/core/steps/all/core/10-normalize.js +2 -1
- package/core/steps/all/core/11-normalize-tree-sitter.js +2 -1
- package/core/steps/all/static-slicing/00-slice.js +2 -1
- package/core/steps/all/static-slicing/10-reconstruct.js +2 -1
- package/core/steps/pipeline/create-pipeline.js +1 -2
- package/core/steps/pipeline/default-pipelines.d.ts +1 -1
- package/core/steps/pipeline/default-pipelines.js +5 -4
- package/core/steps/pipeline-step.d.ts +3 -1
- package/core/steps/pipeline-step.js +5 -0
- package/data/r-base-primitives.generated.d.ts +2 -1
- package/dataflow/cluster.js +1 -2
- package/dataflow/environments/ambient-state-name.d.ts +14 -22
- package/dataflow/environments/ambient-state-name.js +4 -18
- package/dataflow/environments/apply-kill.d.ts +9 -20
- package/dataflow/environments/apply-kill.js +51 -25
- package/dataflow/environments/built-in-config.d.ts +7 -15
- package/dataflow/environments/built-in-config.js +15 -16
- package/dataflow/environments/built-in-eval-name.d.ts +5 -6
- package/dataflow/environments/built-in-eval-name.js +4 -5
- package/dataflow/environments/built-in-kinds.d.ts +111 -0
- package/dataflow/environments/built-in-kinds.js +35 -0
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +11 -0
- package/dataflow/environments/built-in-props.d.ts +62 -175
- package/dataflow/environments/built-in-props.js +42 -154
- package/dataflow/environments/built-in.d.ts +37 -73
- package/dataflow/environments/built-in.js +41 -62
- package/dataflow/environments/data-masking-functions.d.ts +2 -2
- package/dataflow/environments/default-builtin-config/base-functions.d.ts +7 -0
- package/dataflow/environments/default-builtin-config/base-functions.js +339 -0
- package/dataflow/environments/default-builtin-config/base-language.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/base-language.js +66 -0
- package/dataflow/environments/default-builtin-config/base-operators.d.ts +58 -0
- package/dataflow/environments/default-builtin-config/base-operators.js +169 -0
- package/dataflow/environments/default-builtin-config/database-access.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/database-access.js +16 -0
- package/dataflow/environments/default-builtin-config/define-helpers.d.ts +45 -0
- package/dataflow/environments/default-builtin-config/define-helpers.js +50 -0
- package/dataflow/environments/default-builtin-config/dev-tooling.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/dev-tooling.js +63 -0
- package/dataflow/environments/default-builtin-config/file-io.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/file-io.js +81 -0
- package/dataflow/environments/default-builtin-config/graphics-devices.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/graphics-devices.js +57 -0
- package/dataflow/environments/default-builtin-config/index.d.ts +18 -0
- package/dataflow/environments/default-builtin-config/index.js +114 -0
- package/dataflow/environments/default-builtin-config/media-formats.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/media-formats.js +41 -0
- package/dataflow/environments/default-builtin-config/misc-packages.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/misc-packages.js +18 -0
- package/dataflow/environments/default-builtin-config/network-access.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/network-access.js +47 -0
- package/dataflow/environments/default-builtin-config/object-systems.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/object-systems.js +39 -0
- package/dataflow/environments/default-builtin-config/package-data-table.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/package-data-table.js +18 -0
- package/dataflow/environments/default-builtin-config/package-spatial.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/package-spatial.js +32 -0
- package/dataflow/environments/default-builtin-config/package-tidyverse.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/package-tidyverse.js +96 -0
- package/dataflow/environments/default-builtin-config/package-utils.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/package-utils.js +35 -0
- package/dataflow/environments/default-builtin-config/package-withr.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/package-withr.js +41 -0
- package/dataflow/environments/default-builtin-config/parallel-execution.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/parallel-execution.js +31 -0
- package/dataflow/environments/default-builtin-config/session-interactive.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/session-interactive.js +31 -0
- package/dataflow/environments/default-builtin-config/shared-configs.d.ts +267 -0
- package/dataflow/environments/default-builtin-config/shared-configs.js +483 -0
- package/dataflow/environments/default-builtin-config/shared-signatures.d.ts +21 -0
- package/dataflow/environments/default-builtin-config/shared-signatures.js +32 -0
- package/dataflow/environments/default-builtin-config/statistics.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/statistics.js +32 -0
- package/dataflow/environments/default-builtin-config/unit-testing.d.ts +3 -0
- package/dataflow/environments/default-builtin-config/unit-testing.js +13 -0
- package/dataflow/environments/environment.d.ts +28 -52
- package/dataflow/environments/environment.js +24 -71
- package/dataflow/environments/group-generics.d.ts +12 -19
- package/dataflow/environments/group-generics.js +17 -14
- package/dataflow/environments/identifier.d.ts +72 -427
- package/dataflow/environments/identifier.js +34 -145
- package/dataflow/environments/pkg-name.d.ts +197 -0
- package/dataflow/environments/pkg-name.js +3 -0
- package/dataflow/environments/query-fn-props.d.ts +27 -76
- package/dataflow/environments/query-fn-props.js +34 -95
- package/dataflow/environments/resolve-by-name.d.ts +6 -16
- package/dataflow/environments/resolve-by-name.js +23 -35
- package/dataflow/environments/scoping.d.ts +5 -5
- package/dataflow/environments/scoping.js +13 -5
- package/dataflow/eval/resolve/alias-tracking.d.ts +31 -68
- package/dataflow/eval/resolve/alias-tracking.js +611 -126
- package/dataflow/eval/resolve/match-arguments.d.ts +5 -3
- package/dataflow/eval/resolve/resolve-argument.d.ts +11 -11
- package/dataflow/eval/resolve/resolve-argument.js +25 -30
- package/dataflow/eval/resolve/resolve-field.d.ts +10 -0
- package/dataflow/eval/resolve/resolve-field.js +127 -0
- package/dataflow/eval/resolve/resolve-replacement.d.ts +10 -0
- package/dataflow/eval/resolve/resolve-replacement.js +80 -0
- package/dataflow/eval/resolve/resolve-strings.d.ts +2 -2
- package/dataflow/eval/resolve/resolve.d.ts +13 -10
- package/dataflow/eval/resolve/resolve.js +81 -32
- package/dataflow/eval/values/general.d.ts +6 -24
- package/dataflow/eval/values/general.js +12 -29
- package/dataflow/eval/values/lists/list-constants.d.ts +11 -0
- package/dataflow/eval/values/lists/list-constants.js +65 -0
- package/dataflow/eval/values/r-value.d.ts +20 -23
- package/dataflow/eval/values/r-value.js +22 -17
- package/dataflow/extractor.d.ts +2 -10
- package/dataflow/extractor.js +100 -46
- package/dataflow/fn/argument-roles.d.ts +2 -4
- package/dataflow/fn/argument-roles.js +49 -23
- package/dataflow/fn/class-declaration.d.ts +36 -52
- package/dataflow/fn/class-declaration.js +22 -56
- package/dataflow/fn/condition-handlers.d.ts +2 -1
- package/dataflow/fn/dispatch.d.ts +70 -0
- package/dataflow/fn/dispatch.js +434 -0
- package/dataflow/fn/exceptions-of-function.d.ts +1 -2
- package/dataflow/fn/exceptions-of-function.js +36 -106
- package/dataflow/fn/frame-reflection.d.ts +1 -3
- package/dataflow/fn/frame-reflection.js +8 -16
- package/dataflow/fn/function-props.d.ts +2 -5
- package/dataflow/fn/function-props.js +27 -36
- package/dataflow/fn/function-semantics.d.ts +14 -26
- package/dataflow/fn/function-semantics.js +4 -18
- package/dataflow/fn/higher-order-function.js +2 -4
- package/dataflow/fn/strict-function.d.ts +10 -35
- package/dataflow/fn/strict-function.js +126 -138
- package/dataflow/graph/ambient-access.d.ts +51 -0
- package/dataflow/graph/ambient-access.js +80 -0
- package/dataflow/graph/call-graph.d.ts +9 -29
- package/dataflow/graph/call-graph.js +17 -41
- package/dataflow/graph/closure-frames.d.ts +46 -0
- package/dataflow/graph/closure-frames.js +225 -0
- package/dataflow/graph/dataflowgraph-builder.d.ts +25 -96
- package/dataflow/graph/dataflowgraph-builder.js +29 -97
- package/dataflow/graph/df-helper.d.ts +48 -188
- package/dataflow/graph/df-helper.js +107 -208
- package/dataflow/graph/diff-dataflow-graph.d.ts +5 -15
- package/dataflow/graph/diff-dataflow-graph.js +25 -25
- package/dataflow/graph/edge.js +1 -1
- package/dataflow/graph/graph-helper.d.ts +10 -46
- package/dataflow/graph/graph-helper.js +16 -50
- package/dataflow/graph/graph.d.ts +44 -97
- package/dataflow/graph/graph.js +83 -79
- package/dataflow/graph/match-args.d.ts +21 -88
- package/dataflow/graph/match-args.js +284 -97
- package/dataflow/graph/vertex.d.ts +101 -128
- package/dataflow/graph/vertex.js +23 -20
- package/dataflow/hooks.d.ts +7 -14
- package/dataflow/hooks.js +15 -13
- package/dataflow/info.d.ts +2 -17
- package/dataflow/internal/dispatch-linking.d.ts +71 -0
- package/dataflow/internal/dispatch-linking.js +332 -0
- package/dataflow/internal/linker.d.ts +48 -50
- package/dataflow/internal/linker.js +457 -155
- package/dataflow/internal/process/functions/call/argument/make-argument.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +2 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +16 -46
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.d.ts +7 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.js +10 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +23 -75
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +263 -97
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +10 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +66 -45
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +15 -19
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +82 -62
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.d.ts +15 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.js +416 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +37 -54
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +192 -111
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +60 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +1 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +80 -76
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +1 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +4 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +4 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +436 -140
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +18 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +90 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +5 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +9 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +12 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +3 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +2 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +9 -24
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +10 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +8 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +20 -28
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +17 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +117 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +5 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +8 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +18 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +7 -25
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +31 -35
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +4 -18
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +13 -19
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +18 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +130 -65
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +38 -30
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +584 -114
- package/dataflow/internal/process/functions/call/common.d.ts +8 -24
- package/dataflow/internal/process/functions/call/common.js +24 -24
- package/dataflow/internal/process/functions/call/deferred.d.ts +7 -27
- package/dataflow/internal/process/functions/call/deferred.js +6 -27
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +6 -26
- package/dataflow/internal/process/functions/call/known-call-handling.js +6 -16
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -4
- package/dataflow/internal/process/functions/call/named-call-handling.js +14 -35
- package/dataflow/internal/process/functions/call/nse.d.ts +2 -9
- package/dataflow/internal/process/functions/call/nse.js +6 -13
- package/dataflow/internal/process/functions/call/quoted.d.ts +4 -15
- package/dataflow/internal/process/functions/call/quoted.js +26 -62
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +3 -6
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +29 -11
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/internal/program-order.d.ts +3 -10
- package/dataflow/internal/program-order.js +19 -10
- package/dataflow/origin/dfg-get-origin.js +2 -1
- package/documentation/data/faq/faqs.js +16 -1
- package/documentation/data/interface/doc-writing-code.js +5 -7
- package/documentation/doc-capabilities.js +3 -3
- package/documentation/doc-readme.js +1 -1
- package/documentation/doc-util/doc-code.d.ts +0 -5
- package/documentation/doc-util/doc-code.js +2 -22
- package/documentation/doc-util/doc-query.d.ts +1 -2
- package/documentation/doc-util/doc-query.js +4 -5
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/wiki-analyzer.js +4 -3
- package/documentation/wiki-core.js +5 -5
- package/documentation/wiki-dataflow-graph.js +6 -0
- package/documentation/wiki-interface.js +2 -1
- package/documentation/wiki-linter.js +15 -3
- package/documentation/wiki-linting-and-testing.js +15 -2
- package/documentation/wiki-query.js +111 -29
- package/index.d.ts +3 -1
- package/index.js +6 -3
- package/linter/linter-executor.js +1 -1
- package/linter/linter-rules.d.ts +37 -8
- package/linter/linter-rules.js +8 -1
- package/linter/linter-util.d.ts +3 -3
- package/linter/linter-util.js +1 -1
- package/linter/rules/cmd-check/bogus-return.d.ts +2 -1
- package/linter/rules/cmd-check/call-arguments.d.ts +3 -2
- package/linter/rules/cmd-check/call-arguments.js +5 -5
- package/linter/rules/cmd-check/cmd-check-util.d.ts +9 -8
- package/linter/rules/cmd-check/dependency-declaration.d.ts +2 -1
- package/linter/rules/cmd-check/dependency-declaration.js +1 -1
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +3 -2
- package/linter/rules/cmd-check/documentation-mismatch.js +2 -1
- package/linter/rules/cmd-check/file-checks.d.ts +2 -2
- package/linter/rules/cmd-check/foreign-function-calls.d.ts +2 -1
- package/linter/rules/cmd-check/global-environment-modification.d.ts +6 -5
- package/linter/rules/cmd-check/namespace-tampering.d.ts +2 -1
- package/linter/rules/cmd-check/non-ascii-code.js +1 -1
- package/linter/rules/cmd-check/package-files.d.ts +2 -2
- package/linter/rules/cmd-check/package-hooks.d.ts +5 -4
- package/linter/rules/cmd-check/package-runtime.js +2 -2
- package/linter/rules/cmd-check/rd-files.js +2 -1
- package/linter/rules/cmd-check/s-three-method-consistency.d.ts +3 -2
- package/linter/rules/cmd-check/s-three-method-consistency.js +2 -1
- package/linter/rules/code-clones.d.ts +57 -0
- package/linter/rules/code-clones.js +53 -0
- package/linter/rules/deprecated-functions.js +3 -6
- package/linter/rules/file-path-validity.js +6 -4
- package/linter/rules/function-finder-util.d.ts +4 -2
- package/linter/rules/naming-convention.d.ts +6 -5
- package/linter/rules/naming-convention.js +2 -3
- package/linter/rules/no-leaked-credentials.d.ts +2 -1
- package/linter/rules/no-leaked-credentials.js +1 -1
- package/linter/rules/overwritten-file.d.ts +2 -1
- package/linter/rules/problematic-inputs.d.ts +2 -1
- package/linter/rules/problematic-inputs.js +3 -3
- package/linter/rules/process-state-in-session.d.ts +7 -6
- package/linter/rules/process-state-in-session.js +1 -1
- package/linter/rules/roxygen-arguments.d.ts +1 -1
- package/linter/rules/secret-exfiltration.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +3 -3
- package/linter/rules/unclosed-connection.js +1 -2
- package/linter/rules/undefined-symbol-util.d.ts +3 -2
- package/linter/rules/undefined-symbol.d.ts +3 -2
- package/linter/rules/unescaped-arguments.d.ts +1 -1
- package/linter/rules/unescaped-arguments.js +6 -8
- package/linter/rules/unused-definition.d.ts +4 -3
- package/linter/rules/unused-definition.js +10 -12
- package/linter/rules/unused-import.d.ts +6 -5
- package/package.json +1 -1
- package/project/attached-packages.d.ts +5 -4
- package/project/cache/flowr-analyzer-cache.d.ts +14 -1
- package/project/cache/flowr-analyzer-cache.js +40 -3
- package/project/context/flowr-analyzer-dependencies-context.d.ts +12 -12
- package/project/context/flowr-analyzer-environment-context.d.ts +3 -3
- package/project/context/flowr-analyzer-environment-context.js +3 -3
- package/project/context/flowr-analyzer-functions-context.d.ts +9 -7
- package/project/context/flowr-analyzer-gas-context.d.ts +25 -0
- package/project/context/flowr-analyzer-gas-context.js +34 -4
- package/project/dependency-version-space.d.ts +30 -29
- package/project/dependency-version-space.js +1 -2
- package/project/flowr-analyzer-builder.d.ts +2 -3
- package/project/flowr-analyzer.d.ts +35 -3
- package/project/flowr-analyzer.js +11 -5
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +15 -14
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-on-demand-plugin.d.ts +5 -4
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-on-demand-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +2 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -3
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +2 -1
- package/project/plugins/package-version-plugins/package.d.ts +6 -5
- package/project/sigdb/build.js +1 -1
- package/project/sigdb/decode.d.ts +8 -7
- package/project/sigdb/decode.js +1 -2
- package/project/sigdb/dict.d.ts +2 -1
- package/project/sigdb/dict.js +2 -2
- package/project/sigdb/index-format.d.ts +2 -1
- package/project/sigdb/manifest.d.ts +1 -1
- package/project/sigdb/memory-source.d.ts +18 -17
- package/project/sigdb/on-demand/package-sources.d.ts +4 -3
- package/project/sigdb/on-demand/recoverer.d.ts +2 -1
- package/project/sigdb/on-demand/remote-sources.d.ts +2 -1
- package/project/sigdb/reader.d.ts +85 -80
- package/project/sigdb/reader.js +0 -4
- package/project/sigdb/schema.d.ts +9 -8
- package/project/sigdb/signature-db.d.ts +6 -6
- package/queries/catalog/ambient-access-query/ambient-access-query-executor.d.ts +6 -0
- package/queries/catalog/ambient-access-query/ambient-access-query-executor.js +50 -0
- package/queries/catalog/ambient-access-query/ambient-access-query-format.d.ts +54 -0
- package/queries/catalog/ambient-access-query/ambient-access-query-format.js +45 -0
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +2 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +2 -2
- package/queries/catalog/call-graph-query/expand-library-internals.d.ts +3 -2
- package/queries/catalog/code-clones-query/code-clones-query-executor.d.ts +6 -0
- package/queries/catalog/code-clones-query/code-clones-query-executor.js +38 -0
- package/queries/catalog/code-clones-query/code-clones-query-format.d.ts +54 -0
- package/queries/catalog/code-clones-query/code-clones-query-format.js +73 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +3 -3
- package/queries/catalog/dependencies-query/data-flow.d.ts +5 -4
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +5 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +5 -5
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +6 -4
- package/queries/catalog/dependencies-query/implicit-echo.js +2 -1
- package/queries/catalog/dice-query/dice-query-format.d.ts +1 -0
- package/queries/catalog/dice-query/dice-query-format.js +1 -0
- package/queries/catalog/does-call-query/does-call-query-executor.js +1 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -0
- package/queries/catalog/does-call-query/does-call-query-format.js +1 -0
- package/queries/catalog/function-info-query/function-info-query-format.d.ts +2 -1
- package/queries/catalog/function-info-query/function-origin.d.ts +3 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +3 -3
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +5 -4
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +7 -3
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +9 -9
- package/queries/catalog/input-sources-query/simple-input-classifier.js +1 -1
- package/queries/catalog/linter-query/linter-query-executor.js +4 -1
- package/queries/catalog/linter-query/linter-query-format.js +3 -2
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -0
- package/queries/catalog/origin-query/origin-query-format.js +1 -0
- package/queries/catalog/project-query/project-query-format.d.ts +2 -1
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +1 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +1 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -0
- package/queries/catalog/signature-query/signature-query-executor.d.ts +9 -6
- package/queries/catalog/signature-query/signature-query-executor.js +14 -15
- package/queries/catalog/signature-query/signature-query-format.d.ts +21 -20
- package/queries/catalog/signature-query/signature-query-render.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +9 -5
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
- package/queries/query-function-filter.d.ts +1 -1
- package/queries/query.d.ts +59 -8
- package/queries/query.js +59 -37
- package/r-bridge/data/data.d.ts +39 -28
- package/r-bridge/data/data.js +37 -28
- package/r-bridge/lang-4.x/ast/model/model.d.ts +10 -1
- package/r-bridge/lang-4.x/ast/model/model.js +30 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +21 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +25 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +4 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +5 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -7
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +4 -5
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +7 -2
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +14 -6
- package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/visitor.js +2 -2
- package/r-bridge/lang-4.x/ast/model/type.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/type.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +3 -2
- package/r-bridge/parser.d.ts +8 -2
- package/r-bridge/parser.js +6 -0
- package/r-bridge/shell-executor.d.ts +2 -2
- package/r-bridge/shell-executor.js +3 -2
- package/r-bridge/shell.d.ts +2 -2
- package/r-bridge/shell.js +3 -2
- package/reconstruct/auto-select/magic-comments.js +1 -1
- package/reconstruct/reconstruct.d.ts +0 -5
- package/reconstruct/reconstruct.js +6 -5
- package/search/flowr-search-builder.d.ts +14 -0
- package/search/flowr-search-builder.js +7 -0
- package/search/flowr-search-executor.js +2 -2
- package/search/flowr-search-filters.js +8 -9
- package/search/flowr-search.js +1 -1
- package/search/search-executor/search-enrichers.d.ts +2 -0
- package/search/search-executor/search-enrichers.js +6 -1
- package/search/search-executor/search-generators.d.ts +2 -2
- package/search/search-executor/search-generators.js +13 -8
- package/search/search-executor/search-mappers.js +1 -1
- package/search/search-executor/search-transformer.d.ts +2 -2
- package/search/search-executor/search-transformer.js +6 -6
- package/slicing/criterion/parse.d.ts +2 -1
- package/slicing/criterion/parse.js +2 -1
- package/slicing/static/removal-slice.js +2 -1
- package/slicing/static/slice-call.d.ts +30 -4
- package/slicing/static/slice-call.js +74 -9
- package/slicing/static/slicer-types.d.ts +2 -1
- package/slicing/static/static-slicer.js +66 -11
- package/slicing/static/visiting-queue.d.ts +2 -0
- package/slicing/static/visiting-queue.js +4 -0
- package/taint-analysis/builder/report-template.d.ts +3 -3
- package/util/arg-matching.d.ts +1 -1
- package/util/collections/relation.d.ts +23 -0
- package/util/collections/relation.js +63 -0
- package/util/fixpoint.d.ts +65 -0
- package/util/fixpoint.js +216 -0
- package/util/flowr-version.d.ts +1 -1
- package/util/flowr-version.js +2 -2
- package/util/json.d.ts +4 -0
- package/util/json.js +12 -3
- package/util/mermaid/cfg.js +1 -2
- package/util/mermaid/dfg.d.ts +1 -1
- package/util/mermaid/dfg.js +1 -1
- package/util/mermaid/mermaid.d.ts +2 -1
- package/util/monoid.d.ts +26 -0
- package/util/monoid.js +31 -0
- package/util/prefix.d.ts +1 -1
- package/util/r-base-packages.d.ts +10 -7
- package/util/r-base-packages.js +11 -6
- package/util/r-package-urls.d.ts +10 -9
- package/util/r-value.js +2 -1
- package/util/r-version-order.d.ts +2 -0
- package/util/r-version-order.js +19 -0
- package/util/r-version.d.ts +2 -1
- package/util/r-version.js +2 -14
- package/util/range.d.ts +38 -29
- package/util/range.js +10 -5
- package/util/simple-df/dfg-ascii.js +2 -2
- package/util/text/ansi.d.ts +13 -9
- package/util/text/ansi.js +4 -6
- package/util/text/strings.d.ts +10 -3
- package/util/text/strings.js +10 -1
- package/util/version.d.ts +1 -1
- package/util/version.js +2 -1
- package/dataflow/environments/default-builtin-config.d.ts +0 -8874
- package/dataflow/environments/default-builtin-config.js +0 -1737
- package/r-bridge/lang-4.x/ast/model/operators.d.ts +0 -33
- package/r-bridge/lang-4.x/ast/model/operators.js +0 -54
- package/taint-analysis/eval/eval.d.ts +0 -1
- package/taint-analysis/eval/eval.js +0 -124
- package/taint-analysis/eval/instrumentation.d.ts +0 -59
- package/taint-analysis/eval/instrumentation.js +0 -124
|
@@ -7,10 +7,10 @@ const edge_1 = require("../graph/edge");
|
|
|
7
7
|
const df_helper_1 = require("../graph/df-helper");
|
|
8
8
|
const vertex_1 = require("../graph/vertex");
|
|
9
9
|
const built_in_props_1 = require("../environments/built-in-props");
|
|
10
|
+
const fixpoint_1 = require("../../util/fixpoint");
|
|
11
|
+
const monoid_1 = require("../../util/monoid");
|
|
10
12
|
/**
|
|
11
|
-
* What `definition`'s body reaches about its own formals through the frame or call it sits in, as the
|
|
12
|
-
* {@link BuiltInFnInfo#frame} bits of the reflective calls it makes (`0` for none). `get("x", envir = e)` and
|
|
13
|
-
* `e$x` are followed to the name directly; `as.list(environment())` and a frame handed elsewhere mean any formal.
|
|
13
|
+
* What `definition`'s body reaches about its own formals through the frame or call it sits in, as the {@link BuiltInFnInfo#frame} bits of the reflective calls it makes (`0` for none).
|
|
14
14
|
* @useInstead {@link FunctionSemantics.frameReflection}
|
|
15
15
|
*/
|
|
16
16
|
function reflectiveRolesOf(definition, graph, { known }) {
|
|
@@ -61,21 +61,13 @@ function isFixedName(node, graph) {
|
|
|
61
61
|
const CarryingEdges = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.Returns | edge_1.EdgeType.Argument;
|
|
62
62
|
/** The nodes carrying what the reflective call handed out: the call itself, the names stored under it, and reads of them. */
|
|
63
63
|
function carriersOf(frame, definition, graph) {
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
for (const node of definition.subflow.graph) {
|
|
64
|
+
const body = definition.subflow.graph;
|
|
65
|
+
const carries = new fixpoint_1.ReachSummaries(node => {
|
|
67
66
|
const vertex = graph.getVertex(node);
|
|
68
67
|
/* a call reading the frame is what uses it, so it is a consumer rather than another name for it, and carries nothing on */
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (carrying.has(id) || !(successors.get(id) ?? []).some(to => carrying.has(to))) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
carrying.add(id);
|
|
76
|
-
return true;
|
|
77
|
-
});
|
|
78
|
-
return carrying;
|
|
68
|
+
return !body.has(node) || node === frame || (vertex_1.DfgVertex.isFunctionCall(vertex) && !passesOn(vertex)) ? [] : df_helper_1.Dataflow.targetsOf(graph, node, CarryingEdges);
|
|
69
|
+
}, node => node === frame, monoid_1.Monoid.any);
|
|
70
|
+
return new Set([frame, ...body.values().filter(node => carries.of(node))]);
|
|
79
71
|
}
|
|
80
72
|
/** Whether the call hands what it was given straight on: storing a frame under a name is no use of it. */
|
|
81
73
|
function passesOn(vertex) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `FunctionSemantics` facade wires these together, so a sibling here has to call the backing function
|
|
3
|
-
* directly; going through `FunctionSemantics` would make `src/dataflow/fn/function-semantics.ts` import its own importers.
|
|
2
|
+
* The `FunctionSemantics` facade wires these together, so a sibling here has to call the backing function directly; going through `FunctionSemantics` would make `src/dataflow/fn/function-semantics.ts` import its own importers.
|
|
4
3
|
* @lintIgnore use-instead
|
|
5
4
|
*/
|
|
6
5
|
import type { DataflowGraph } from '../graph/graph';
|
|
@@ -20,9 +19,7 @@ export interface FunctionPropsOptions extends ArgumentRolesOptions {
|
|
|
20
19
|
readonly only?: 'arguments' | 'function';
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
|
-
* What each of the `definitions` does, stated the way a built-in states it: {@link CallProp} bits for the
|
|
24
|
-
* function ({@link PropagatedProps} bits its callees carry over included) and {@link ArgProp} bits per formal,
|
|
25
|
-
* `Forced`/`Lazy` included. An unset bit reads as "nothing says so", never as "no".
|
|
22
|
+
* What each of the `definitions` does, stated the way a built-in states it: {@link CallProp} bits for the function ({@link PropagatedProps} bits its callees carry over included) and {@link ArgProp} bits per formal, `Forced`/`Lazy` included.
|
|
26
23
|
* @useInstead {@link FunctionSemantics.props}
|
|
27
24
|
*/
|
|
28
25
|
export declare function inferFunctions(this: void, definitions: readonly NodeId[], graph: DataflowGraph, options?: FunctionPropsOptions): InferredFunctions;
|
|
@@ -12,51 +12,42 @@ const strict_function_1 = require("./strict-function");
|
|
|
12
12
|
const argument_roles_1 = require("./argument-roles");
|
|
13
13
|
const logic_1 = require("../../util/logic");
|
|
14
14
|
const df_helper_1 = require("../graph/df-helper");
|
|
15
|
+
const fixpoint_1 = require("../../util/fixpoint");
|
|
15
16
|
/**
|
|
16
|
-
* What each of the `definitions` does, stated the way a built-in states it: {@link CallProp} bits for the
|
|
17
|
-
* function ({@link PropagatedProps} bits its callees carry over included) and {@link ArgProp} bits per formal,
|
|
18
|
-
* `Forced`/`Lazy` included. An unset bit reads as "nothing says so", never as "no".
|
|
17
|
+
* What each of the `definitions` does, stated the way a built-in states it: {@link CallProp} bits for the function ({@link PropagatedProps} bits its callees carry over included) and {@link ArgProp} bits per formal, `Forced`/`Lazy` included.
|
|
19
18
|
* @useInstead {@link FunctionSemantics.props}
|
|
20
19
|
*/
|
|
21
20
|
function inferFunctions(definitions, graph, options = {}) {
|
|
22
21
|
const { ctx, only } = options;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
return graph.sharingTargetWalks(() => {
|
|
23
|
+
const strict = (0, strict_function_1.strictnessOfEach)(definitions, graph, { ctx });
|
|
24
|
+
return {
|
|
25
|
+
props: only === 'arguments' ? {} : callProps(definitions, { graph, info: (0, query_fn_props_1.builtInLookup)(ctx) }, strict),
|
|
26
|
+
roles: only === 'function' ? {} : rolesOfDefinitions(definitions, graph, strict, options)
|
|
27
|
+
};
|
|
28
|
+
});
|
|
28
29
|
}
|
|
29
30
|
/** The {@link CallProp} mask of each definition, `Strict` included and what its callees carry mixed in. */
|
|
30
31
|
function callProps(definitions, state, strict) {
|
|
31
32
|
const { join, filter, hasAny } = function_semantics_1.FunctionSemantics.call.props;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
grown = join(grown, filter(props.get(callee), built_in_props_1.PropagatedProps));
|
|
51
|
-
}
|
|
52
|
-
/* joining only ever adds, so nothing new means the same bits and the same number of tags */
|
|
53
|
-
if ((grown.props ?? 0) === (before?.props ?? 0) && (grown.tags?.length ?? 0) === (before?.tags?.length ?? 0)) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
props.set(id, grown);
|
|
57
|
-
return true;
|
|
58
|
-
});
|
|
59
|
-
return Object.fromEntries(definitions.filter(id => hasAny(props.get(id))).map(id => [id, props.get(id)]));
|
|
33
|
+
const own = new Map();
|
|
34
|
+
/* what a function carries over to its callers: its own propagated props and those of everything it reaches */
|
|
35
|
+
const carried = new fixpoint_1.ReachSummaries(id => {
|
|
36
|
+
/* a callee is asked about as well, whether or not it is one of the definitions to answer for */
|
|
37
|
+
const { stated, callees } = propsOf(id, state);
|
|
38
|
+
own.set(id, strict[id]?.strict === logic_1.Ternary.Always ? join(stated, { props: built_in_props_1.CallProp.Strict }) : stated);
|
|
39
|
+
return callees;
|
|
40
|
+
}, id => filter(own.get(id), built_in_props_1.PropagatedProps), { empty: {}, concat: join });
|
|
41
|
+
return Object.fromEntries(definitions.map(id => {
|
|
42
|
+
const reached = carried.of(id);
|
|
43
|
+
const mine = own.get(id);
|
|
44
|
+
const grown = join(mine, reached);
|
|
45
|
+
return [id, sameProps(grown, mine) ? mine : grown];
|
|
46
|
+
}).filter(([, props]) => hasAny(props)));
|
|
47
|
+
}
|
|
48
|
+
/** Joining only ever adds, so the same bits and the same number of tags mean the same props. */
|
|
49
|
+
function sameProps(a, b) {
|
|
50
|
+
return (a.props ?? 0) === (b.props ?? 0) && (a.tags?.length ?? 0) === (b.tags?.length ?? 0);
|
|
60
51
|
}
|
|
61
52
|
/** The {@link ArgProp} mask of each formal, `Forced`/`Lazy` included. */
|
|
62
53
|
function rolesOfDefinitions(definitions, graph, strict, options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inferFunctions } from './function-props';
|
|
2
2
|
import { exceptionsOfFunction } from './exceptions-of-function';
|
|
3
|
-
import { promiseDependencies, promiseForcing, settleJumpsInPromises, strictnessOfEach } from './strict-function';
|
|
3
|
+
import { promiseDependencies, promiseForcing, settleDefinitionsInPromises, settleJumpsInPromises, strictnessOfEach } from './strict-function';
|
|
4
4
|
import { isHigherOrder } from './higher-order-function';
|
|
5
5
|
import { argumentRolesOfFunctions } from './argument-roles';
|
|
6
6
|
import { reflectiveRolesOf } from './frame-reflection';
|
|
@@ -8,21 +8,8 @@ import { argForImpl, classDeclarationOfImpl, declaredClassesImpl, superClassesOf
|
|
|
8
8
|
import { ArgProps, CallProps, FnSig } from '../environments/built-in-props';
|
|
9
9
|
import type { DataflowGraphVertexInfo } from '../graph/vertex';
|
|
10
10
|
/**
|
|
11
|
-
* The one helper to ask what a function *does*: what it makes of its arguments, what it may raise, which
|
|
12
|
-
* formals it forces, and what it declares as a class. It replaces the seven single-purpose helper objects
|
|
13
|
-
* that used to sit one per file under `src/dataflow/fn/`.
|
|
11
|
+
* The one helper to ask what a function *does*: what it makes of its arguments, what it may raise, which formals it forces, and what it declares as a class.
|
|
14
12
|
* @helper api
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* FunctionSemantics.props(definitions, graph); // what the definitions do with what they get
|
|
18
|
-
* FunctionSemantics.exceptions(definition, callGraph); // what they may raise
|
|
19
|
-
* FunctionSemantics.strictness(definitions, graph); // which formals they force
|
|
20
|
-
* FunctionSemantics.isHigherOrder(definition, graph); // whether they call what they are handed
|
|
21
|
-
* FunctionSemantics.argumentRoles(definitions, graph); // what each formal is used as
|
|
22
|
-
* FunctionSemantics.classes.declared(graph); // the classes the project declares
|
|
23
|
-
* FunctionSemantics.call.props.hasAny(stated, CallProp.Scope); // what flowR states one call does
|
|
24
|
-
* FunctionSemantics.call.match(call, formals); // how R binds its arguments
|
|
25
|
-
* ```
|
|
26
13
|
*/
|
|
27
14
|
export declare const FunctionSemantics: {
|
|
28
15
|
readonly name: "FunctionSemantics";
|
|
@@ -34,6 +21,8 @@ export declare const FunctionSemantics: {
|
|
|
34
21
|
readonly strictness: typeof strictnessOfEach;
|
|
35
22
|
/** Settles what a jump within a promise does, once the calls are linked. */
|
|
36
23
|
readonly settleJumpsInPromises: typeof settleJumpsInPromises;
|
|
24
|
+
/** Settles what a definition within a promise does, once the calls are linked. */
|
|
25
|
+
readonly settleDefinitionsInPromises: typeof settleDefinitionsInPromises;
|
|
37
26
|
/** What a node within promises depends on for running at all. */
|
|
38
27
|
readonly promiseDependencies: typeof promiseDependencies;
|
|
39
28
|
/** How surely the holder of a promise forces it. */
|
|
@@ -44,10 +33,7 @@ export declare const FunctionSemantics: {
|
|
|
44
33
|
readonly argumentRoles: typeof argumentRolesOfFunctions;
|
|
45
34
|
/** The reflective argument bits of one definition. */
|
|
46
35
|
readonly frameReflection: typeof reflectiveRolesOf;
|
|
47
|
-
/**
|
|
48
|
-
* What one *call* of a function means: what flowR states about it, how R binds its arguments, and which of
|
|
49
|
-
* them it does not simply evaluate.
|
|
50
|
-
*/
|
|
36
|
+
/** What one *call* of a function means: what flowR states about it, how R binds its arguments, and which of them it does not simply evaluate. */
|
|
51
37
|
readonly call: {
|
|
52
38
|
/** What flowR states a call does (it reads a file, it asks the user, ...). */
|
|
53
39
|
readonly props: {
|
|
@@ -69,7 +55,7 @@ export declare const FunctionSemantics: {
|
|
|
69
55
|
readonly signature: {
|
|
70
56
|
readonly layout: (this: void, sig: FnSig) => import("../environments/built-in-props").SigLayout;
|
|
71
57
|
readonly propAt: (this: void, { props, rest }: import("../environments/built-in-props").SigLayout, index: number) => ArgProps;
|
|
72
|
-
readonly slots: (this: void, { names, rest }: import("../environments/built-in-props").SigLayout, argNames: readonly (
|
|
58
|
+
readonly slots: (this: void, { names, rest }: import("../environments/built-in-props").SigLayout, argNames: readonly (import("../environments/identifier").BrandedIdentifier | undefined)[]) => number[];
|
|
73
59
|
readonly posWith: (this: void, layout: import("../environments/built-in-props").SigLayout, count: number, prop: ArgProps) => number[];
|
|
74
60
|
readonly forced: (this: void, sig: FnSig | undefined, count: number) => readonly boolean[] | undefined;
|
|
75
61
|
readonly forcing: (this: void, sig: FnSig | undefined, count: number) => readonly import("../../util/logic").Ternary[] | undefined;
|
|
@@ -85,17 +71,19 @@ export declare const FunctionSemantics: {
|
|
|
85
71
|
};
|
|
86
72
|
/** R's argument matching -- exact, then partial, then positional. */
|
|
87
73
|
readonly match: {
|
|
88
|
-
readonly toNames: <Info = object>(this: void, args: readonly import("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call").PotentiallyEmptyRArgument<Info>[], paramNames: readonly
|
|
89
|
-
readonly toSpec: <Targets extends import("../..").NodeId = string>(this: void, args: readonly import("../graph/graph").FunctionArgument[], params: Record<
|
|
74
|
+
readonly toNames: <Info = object>(this: void, args: readonly import("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call").PotentiallyEmptyRArgument<Info>[], paramNames: readonly import("../environments/identifier").BrandedIdentifier[]) => ReadonlyMap<import("../environments/identifier").BrandedIdentifier, import("../../r-bridge/lang-4.x/ast/model/nodes/r-argument").RArgument<Info>>;
|
|
75
|
+
readonly toSpec: <Targets extends import("../..").NodeId | import("../environments/identifier").BrandedIdentifier = string>(this: void, args: readonly import("../graph/graph").FunctionArgument[], params: Record<import("../environments/identifier").BrandedIdentifier, Targets> | readonly import("../../project/sigdb/decode").SigParameter[]) => Map<Targets, import("../..").NodeId[]>;
|
|
90
76
|
readonly onCallAndLink: (this: void, args: readonly import("../graph/graph").FunctionArgument[], params: readonly import("../../r-bridge/lang-4.x/ast/model/nodes/r-parameter").RParameter<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[], graph: import("../..").DataflowGraph) => Map<import("../..").NodeId, import("../..").NodeId>;
|
|
91
|
-
readonly
|
|
92
|
-
readonly
|
|
77
|
+
readonly unforceUnreadDots: (this: void, graph: import("../..").DataflowGraph) => void;
|
|
78
|
+
readonly handsOnDots: (this: void, args: readonly import("../graph/graph").FunctionArgument[], graph: import("../..").DataflowGraph) => boolean;
|
|
79
|
+
readonly toDefinition: <Info extends import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>(this: void, call: import("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call").RFunctionCall<Info>, graph: import("../..").DataflowGraph, ctx: import("../../project/context/flowr-analyzer-context").ReadOnlyFlowrAnalyzerContext) => ReadonlyMap<import("../environments/identifier").BrandedIdentifier, import("../../r-bridge/lang-4.x/ast/model/nodes/r-argument").RArgument<Info>> | undefined;
|
|
80
|
+
readonly formalsOf: <Info extends import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>(this: void, call: import("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call").RFunctionCall<Info>, graph: import("../..").DataflowGraph, ctx: import("../../project/context/flowr-analyzer-context").ReadOnlyFlowrAnalyzerContext) => readonly import("../environments/identifier").BrandedIdentifier[] | undefined;
|
|
93
81
|
readonly findWithProps: (this: void, args: readonly import("../graph/graph").FunctionArgument[], signature: FnSig, props: ArgProps) => import("../..").NodeId[];
|
|
94
82
|
};
|
|
95
83
|
/** The arguments a call does not evaluate. */
|
|
96
84
|
readonly nse: {
|
|
97
|
-
readonly unquoted: <Info extends import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>(this: void, root: import("../..").RNode<Info> | undefined, style: import("../
|
|
98
|
-
readonly isUnquote: <Info>(this: void, node: import("../..").RNode<Info>, style: import("../
|
|
85
|
+
readonly unquoted: <Info extends import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>(this: void, root: import("../..").RNode<Info> | undefined, style: import("../environments/built-in-kinds").Unquote) => ReadonlySet<import("../..").NodeId> | undefined;
|
|
86
|
+
readonly isUnquote: <Info>(this: void, node: import("../..").RNode<Info>, style: import("../environments/built-in-kinds").Unquote) => boolean;
|
|
99
87
|
readonly dropResolvedMask: (this: void, graph: import("../..").DataflowGraph, id: import("../..").NodeId, name: import("../..").Identifier) => import("../internal/process/functions/call/nse").MaskingCall | undefined;
|
|
100
88
|
readonly unmark: (this: void, graph: import("../..").DataflowGraph, id: import("../..").NodeId, which?: (target: import("../..").NodeId) => boolean) => import("../..").NodeId[];
|
|
101
89
|
readonly maskCandidate: (this: void, vertex: DataflowGraphVertexInfo | undefined) => boolean;
|
|
@@ -16,21 +16,8 @@ const quoted_1 = require("../internal/process/functions/call/quoted");
|
|
|
16
16
|
const deferred_1 = require("../internal/process/functions/call/deferred");
|
|
17
17
|
const unsupported_functions_1 = require("../../abstract-interpretation/unsupported-functions");
|
|
18
18
|
/**
|
|
19
|
-
* The one helper to ask what a function *does*: what it makes of its arguments, what it may raise, which
|
|
20
|
-
* formals it forces, and what it declares as a class. It replaces the seven single-purpose helper objects
|
|
21
|
-
* that used to sit one per file under `src/dataflow/fn/`.
|
|
19
|
+
* The one helper to ask what a function *does*: what it makes of its arguments, what it may raise, which formals it forces, and what it declares as a class.
|
|
22
20
|
* @helper api
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* FunctionSemantics.props(definitions, graph); // what the definitions do with what they get
|
|
26
|
-
* FunctionSemantics.exceptions(definition, callGraph); // what they may raise
|
|
27
|
-
* FunctionSemantics.strictness(definitions, graph); // which formals they force
|
|
28
|
-
* FunctionSemantics.isHigherOrder(definition, graph); // whether they call what they are handed
|
|
29
|
-
* FunctionSemantics.argumentRoles(definitions, graph); // what each formal is used as
|
|
30
|
-
* FunctionSemantics.classes.declared(graph); // the classes the project declares
|
|
31
|
-
* FunctionSemantics.call.props.hasAny(stated, CallProp.Scope); // what flowR states one call does
|
|
32
|
-
* FunctionSemantics.call.match(call, formals); // how R binds its arguments
|
|
33
|
-
* ```
|
|
34
21
|
*/
|
|
35
22
|
exports.FunctionSemantics = {
|
|
36
23
|
name: 'FunctionSemantics',
|
|
@@ -42,6 +29,8 @@ exports.FunctionSemantics = {
|
|
|
42
29
|
strictness: strict_function_1.strictnessOfEach,
|
|
43
30
|
/** Settles what a jump within a promise does, once the calls are linked. */
|
|
44
31
|
settleJumpsInPromises: strict_function_1.settleJumpsInPromises,
|
|
32
|
+
/** Settles what a definition within a promise does, once the calls are linked. */
|
|
33
|
+
settleDefinitionsInPromises: strict_function_1.settleDefinitionsInPromises,
|
|
45
34
|
/** What a node within promises depends on for running at all. */
|
|
46
35
|
promiseDependencies: strict_function_1.promiseDependencies,
|
|
47
36
|
/** How surely the holder of a promise forces it. */
|
|
@@ -52,10 +41,7 @@ exports.FunctionSemantics = {
|
|
|
52
41
|
argumentRoles: argument_roles_1.argumentRolesOfFunctions,
|
|
53
42
|
/** The reflective argument bits of one definition. */
|
|
54
43
|
frameReflection: frame_reflection_1.reflectiveRolesOf,
|
|
55
|
-
/**
|
|
56
|
-
* What one *call* of a function means: what flowR states about it, how R binds its arguments, and which of
|
|
57
|
-
* them it does not simply evaluate.
|
|
58
|
-
*/
|
|
44
|
+
/** What one *call* of a function means: what flowR states about it, how R binds its arguments, and which of them it does not simply evaluate. */
|
|
59
45
|
call: {
|
|
60
46
|
/** What flowR states a call does (it reads a file, it asks the user, ...). */
|
|
61
47
|
props: built_in_props_1.CallProps,
|
|
@@ -20,8 +20,7 @@ const built_in_props_1 = require("../environments/built-in-props");
|
|
|
20
20
|
function isAnyReturnAFunction(def, graph) {
|
|
21
21
|
const workingQueue = def.exitPoints.map(d => graph.getVertex(d.nodeId)).filter(assert_1.isNotUndefined);
|
|
22
22
|
const seen = new Set();
|
|
23
|
-
|
|
24
|
-
const current = workingQueue.pop();
|
|
23
|
+
for (let current = workingQueue.pop(); current !== undefined; current = workingQueue.pop()) {
|
|
25
24
|
if (seen.has(current.id)) {
|
|
26
25
|
continue;
|
|
27
26
|
}
|
|
@@ -58,8 +57,7 @@ function definitionsBehind(id, graph) {
|
|
|
58
57
|
const found = new Set();
|
|
59
58
|
const seen = new Set();
|
|
60
59
|
const workingQueue = [id];
|
|
61
|
-
|
|
62
|
-
const current = workingQueue.pop();
|
|
60
|
+
for (let current = workingQueue.pop(); current !== undefined; current = workingQueue.pop()) {
|
|
63
61
|
if (seen.has(current) || node_id_1.NodeId.isBuiltIn(current)) {
|
|
64
62
|
continue;
|
|
65
63
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `FunctionSemantics` facade wires these together, so a sibling here has to call the backing function
|
|
3
|
-
* directly; going through `FunctionSemantics` would make `src/dataflow/fn/function-semantics.ts` import its own importers.
|
|
2
|
+
* The `FunctionSemantics` facade wires these together, so a sibling here has to call the backing function directly; going through `FunctionSemantics` would make `src/dataflow/fn/function-semantics.ts` import its own importers.
|
|
4
3
|
* @lintIgnore use-instead
|
|
5
4
|
*/
|
|
6
5
|
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
@@ -8,10 +7,7 @@ import type { ExitPoint } from '../info';
|
|
|
8
7
|
import type { DataflowGraph } from '../graph/graph';
|
|
9
8
|
import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
|
|
10
9
|
import { Ternary } from '../../util/logic';
|
|
11
|
-
/**
|
|
12
|
-
* How a function treats its parameters: R hands arguments over as promises, so a parameter is strict when
|
|
13
|
-
* calling the function is enough to force it.
|
|
14
|
-
*/
|
|
10
|
+
/** How a function treats its parameters: R hands arguments over as promises, so a parameter is strict when calling the function is enough to force it. */
|
|
15
11
|
export interface FunctionStrictness {
|
|
16
12
|
/** whether every parameter is forced */
|
|
17
13
|
readonly strict: Ternary;
|
|
@@ -20,27 +16,6 @@ export interface FunctionStrictness {
|
|
|
20
16
|
}
|
|
21
17
|
/**
|
|
22
18
|
* Determines whether the function with the given id is strict, i.e., whether calling it forces its arguments.
|
|
23
|
-
* {@link Ternary#Always} says every call forces every parameter, {@link Ternary#Never} that no call forces
|
|
24
|
-
* all of them, and {@link Ternary#Maybe} that it depends on the path taken, on the caller, or on a function
|
|
25
|
-
* flowR could not resolve. A definition without parameters has nothing to leave unforced and is strict.
|
|
26
|
-
*
|
|
27
|
-
* The analysis follows an argument that is handed on into the function receiving it, and treats a read in a
|
|
28
|
-
* default, in a loop, in a branch, or in a nested definition as one that may not happen. What a built-in
|
|
29
|
-
* does with an argument is not guessed from its name: an argument stated {@link ArgProp.Nse} or
|
|
30
|
-
* {@link ArgProp.Presence} is never evaluated, one stated {@link ArgProp.Forced} always is, and the calls
|
|
31
|
-
* reaching an argument only on the way the run takes are the ones flowR hands to the processor that says so
|
|
32
|
-
* (`switch` picking a branch, `try` reaching a handler, a hook running at exit).
|
|
33
|
-
* A body reading its own call or frame ({@link CallProp.Frame}: `match.call()`, `nargs()`,
|
|
34
|
-
* `as.list(environment())`) reaches every parameter without naming one, so none of them is answered `Never`.
|
|
35
|
-
* For a generic, the methods reached by S3 dispatch decide: they agree on a parameter or it is left open,
|
|
36
|
-
* while the object the dispatch is on is forced by the dispatch itself. A `NextMethod` carries the same
|
|
37
|
-
* question on to the methods it reaches, matched by the position the parameter is written in.
|
|
38
|
-
* An argument in `...` is followed to the parameter it binds to, whereas the method of an object flowR
|
|
39
|
-
* cannot resolve (`obj$m(x)`) is one more thing it cannot claim anything about.
|
|
40
|
-
* Cyclic dependencies between functions and calls flowR cannot resolve answer {@link Ternary#Maybe}, so this
|
|
41
|
-
* only claims certainty where the code gives it.
|
|
42
|
-
* What a built-in does with an argument comes from the {@link ArgProp} bits its signature states, so a
|
|
43
|
-
* configured or overwritten built-in is the one that answers when the analyzer context is handed along.
|
|
44
19
|
* @useInstead {@link FunctionSemantics.strictness}
|
|
45
20
|
*/
|
|
46
21
|
export declare function strictnessOfEach(this: void, ids: Iterable<NodeId>, graph: DataflowGraph, { ctx }?: FunctionStrictnessesOptions): Record<NodeId, FunctionStrictness>;
|
|
@@ -48,16 +23,16 @@ export declare function strictnessOfEach(this: void, ids: Iterable<NodeId>, grap
|
|
|
48
23
|
export interface FunctionStrictnessesOptions {
|
|
49
24
|
/** how to ask what a built-in states, so a configured or overwritten one answers */
|
|
50
25
|
readonly ctx?: ReadOnlyFlowrAnalyzerContext;
|
|
26
|
+
/** whether to resolve the condition of an `if` to a constant, which costs a value resolution per branch */
|
|
27
|
+
readonly constantBranches?: boolean;
|
|
28
|
+
/** whether a call of a function flowR states nothing about leaves open whether it evaluates what it is handed, rather than counting as a built-in that does, for answers that must not claim a promise is forced when it is not */
|
|
29
|
+
readonly knownOnly?: boolean;
|
|
51
30
|
}
|
|
52
|
-
/**
|
|
53
|
-
* What a node within promises depends on to run: the holder of each `byPromise` dependency and where that promise may be forced.
|
|
54
|
-
* @example
|
|
55
|
-
* ```r
|
|
56
|
-
* g(print(1)) # the print runs only when `g` forces its argument, so it depends on `g(...)` and on the reads of `g`'s parameter
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
31
|
+
/** What a node within promises depends on to run: the holder of each `byPromise` dependency and where that promise may be forced. */
|
|
59
32
|
export declare function promiseDependencies(this: void, id: NodeId, graph: DataflowGraph): NodeId[];
|
|
60
33
|
/** How surely the holder of a promise forces it, asked for a node `inner` within the promise. */
|
|
61
|
-
export declare function promiseForcing(this: void, graph: DataflowGraph, { ctx }?: FunctionStrictnessesOptions): (holder: NodeId, inner: NodeId) => Ternary;
|
|
34
|
+
export declare function promiseForcing(this: void, graph: DataflowGraph, { ctx, constantBranches, knownOnly }?: FunctionStrictnessesOptions): (holder: NodeId, inner: NodeId) => Ternary;
|
|
35
|
+
/** Settles what a definition within a promise (`f(x <- 5)`) does once the calls are linked. */
|
|
36
|
+
export declare function settleDefinitionsInPromises(this: void, graph: DataflowGraph, { ctx }?: FunctionStrictnessesOptions): void;
|
|
62
37
|
/** Drops the resume of a jump within a promise ({@link ControlFlow.promise}) once the linked holder surely forces it. */
|
|
63
38
|
export declare function settleJumpsInPromises(this: void, graph: DataflowGraph, topLevel: readonly ExitPoint[], { ctx }?: FunctionStrictnessesOptions): void;
|