@eagleoutice/flowr 2.14.4 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -63
- package/abstract-interpretation/absint-inference.d.ts +347 -0
- package/abstract-interpretation/{absint-visitor.js → absint-inference.js} +327 -97
- package/abstract-interpretation/abstract-semantics.d.ts +246 -0
- package/abstract-interpretation/abstract-semantics.js +3 -0
- package/abstract-interpretation/data-frame/{mappers/arguments.d.ts → arguments.d.ts} +18 -16
- package/abstract-interpretation/data-frame/{mappers/arguments.js → arguments.js} +20 -21
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +52 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.js +1656 -0
- package/abstract-interpretation/data-frame/resolve-args.js +4 -4
- package/abstract-interpretation/data-frame/semantics.d.ts +15 -21
- package/abstract-interpretation/data-frame/semantics.js +27 -29
- package/abstract-interpretation/data-frame/shape-inference.d.ts +28 -24
- package/abstract-interpretation/data-frame/shape-inference.js +14 -79
- package/abstract-interpretation/domains/interval-domain.d.ts +5 -1
- package/abstract-interpretation/domains/interval-domain.js +25 -33
- package/abstract-interpretation/domains/multi-value-state-domain.d.ts +6 -3
- package/abstract-interpretation/domains/multi-value-state-domain.js +24 -4
- package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -6
- package/abstract-interpretation/domains/partial-product-domain.js +26 -43
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -6
- package/abstract-interpretation/domains/positive-interval-domain.js +3 -29
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.d.ts +6 -0
- package/abstract-interpretation/domains/set-range-domain.js +29 -62
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +9 -2
- package/abstract-interpretation/domains/state-abstract-domain.js +26 -37
- package/abstract-interpretation/domains/{state-domain-like.d.ts → state-domain.d.ts} +10 -6
- package/abstract-interpretation/domains/{state-domain-like.js → state-domain.js} +1 -1
- package/abstract-interpretation/value-semantics.d.ts +113 -0
- package/abstract-interpretation/value-semantics.js +115 -0
- package/benchmark/slicer.js +12 -6
- package/benchmark/stats/feature-counts.d.ts +2 -1
- package/benchmark/stats/feature-counts.js +25 -1
- package/benchmark/stats/stats.d.ts +4 -0
- package/benchmark/summarizer/second-phase/graph.js +7 -0
- package/cli/repl/commands/repl-parse.js +11 -22
- package/cli/repl/parser/slice-query-parser.d.ts +2 -0
- package/cli/repl/parser/slice-query-parser.js +1 -0
- package/config.d.ts +30 -205
- package/config.js +37 -3
- package/control-flow/cfg-properties.d.ts +5 -0
- package/control-flow/cfg-properties.js +25 -7
- package/control-flow/control-flow-graph.d.ts +11 -37
- package/control-flow/control-flow-graph.js +33 -77
- package/control-flow/semantic-cfg-guided-visitor.d.ts +63 -320
- package/control-flow/semantic-cfg-guided-visitor.js +65 -320
- package/dataflow/environments/built-in-config.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +4 -0
- package/dataflow/environments/built-in-props.d.ts +192 -82
- package/dataflow/environments/built-in-props.js +336 -106
- package/dataflow/environments/built-in.d.ts +21 -9
- package/dataflow/environments/built-in.js +43 -12
- package/dataflow/environments/default-builtin-config.d.ts +3219 -313
- package/dataflow/environments/default-builtin-config.js +803 -1012
- package/dataflow/environments/environment.d.ts +26 -49
- package/dataflow/environments/environment.js +34 -47
- package/dataflow/environments/group-generics.d.ts +11 -2
- package/dataflow/environments/group-generics.js +22 -3
- package/dataflow/environments/identifier.d.ts +106 -6
- package/dataflow/environments/identifier.js +19 -1
- package/dataflow/environments/query-fn-props.d.ts +16 -8
- package/dataflow/environments/query-fn-props.js +45 -21
- package/dataflow/environments/resolve-by-name.js +9 -2
- package/dataflow/environments/scoping.d.ts +5 -0
- package/dataflow/environments/scoping.js +11 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
- package/dataflow/eval/resolve/alias-tracking.js +20 -2
- package/dataflow/eval/resolve/resolve-numbers.d.ts +182 -7
- package/dataflow/eval/resolve/resolve-numbers.js +44 -9
- package/dataflow/eval/resolve/resolve-strings.d.ts +79 -2
- package/dataflow/eval/resolve/resolve-strings.js +16 -7
- package/dataflow/eval/resolve/resolve.d.ts +5 -22
- package/dataflow/eval/resolve/resolve.js +24 -34
- package/dataflow/eval/values/general.d.ts +7 -1
- package/dataflow/eval/values/general.js +17 -3
- package/dataflow/eval/values/string/string-constants.d.ts +16 -15
- package/dataflow/eval/values/string/string-constants.js +59 -27
- package/dataflow/extractor.d.ts +2 -1
- package/dataflow/extractor.js +16 -4
- package/dataflow/fn/argument-roles.d.ts +35 -0
- package/dataflow/fn/argument-roles.js +252 -0
- package/dataflow/fn/class-declaration.d.ts +148 -0
- package/dataflow/fn/class-declaration.js +317 -0
- package/dataflow/fn/condition-handlers.d.ts +5 -0
- package/dataflow/fn/condition-handlers.js +13 -0
- package/dataflow/fn/exceptions-of-function.d.ts +21 -7
- package/dataflow/fn/exceptions-of-function.js +74 -43
- package/dataflow/fn/frame-reflection.d.ts +46 -0
- package/dataflow/fn/frame-reflection.js +169 -0
- package/dataflow/fn/function-props.d.ts +32 -0
- package/dataflow/fn/function-props.js +160 -0
- package/dataflow/fn/higher-order-function.d.ts +23 -5
- package/dataflow/fn/higher-order-function.js +64 -18
- package/dataflow/fn/strict-function.d.ts +24 -2
- package/dataflow/fn/strict-function.js +49 -19
- package/dataflow/graph/call-graph.js +10 -2
- package/dataflow/graph/df-helper.d.ts +1 -12
- package/dataflow/graph/df-helper.js +2 -19
- package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
- package/dataflow/graph/diff-dataflow-graph.js +2 -2
- package/dataflow/graph/graph.d.ts +39 -188
- package/dataflow/graph/graph.js +46 -163
- package/dataflow/graph/match-args.d.ts +34 -2
- package/dataflow/graph/match-args.js +45 -12
- package/dataflow/graph/vertex.d.ts +8 -0
- package/dataflow/info.d.ts +7 -5
- package/dataflow/info.js +1 -5
- package/dataflow/internal/control-flow.js +20 -17
- package/dataflow/internal/linker.d.ts +8 -37
- package/dataflow/internal/linker.js +22 -55
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +8 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +43 -50
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +23 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.js +24 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +0 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +73 -27
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +131 -92
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +17 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +187 -99
- package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +0 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +31 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +101 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +23 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +22 -1
- package/dataflow/internal/process/functions/call/common.d.ts +4 -6
- package/dataflow/internal/process/functions/call/common.js +2 -2
- package/dataflow/internal/process/functions/call/deferred.d.ts +1 -1
- package/dataflow/internal/process/functions/call/deferred.js +2 -2
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +5 -3
- package/dataflow/internal/process/functions/call/known-call-handling.js +6 -4
- package/dataflow/internal/process/functions/call/named-call-handling.js +19 -13
- package/dataflow/internal/process/functions/call/quoted.d.ts +2 -2
- package/dataflow/internal/process/functions/call/quoted.js +144 -28
- package/dataflow/origin/dfg-get-origin.js +23 -10
- package/dataflow/processor.d.ts +2 -1
- package/dataflow/processor.js +6 -0
- package/documentation/data/interface/doc-writing-code.js +2 -0
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/wiki-absint.d.ts +11 -14
- package/documentation/wiki-absint.js +73 -59
- package/documentation/wiki-core.js +64 -24
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-query.js +82 -264
- package/documentation/wiki-signature-database.js +17 -5
- package/gas.d.ts +91 -47
- package/gas.js +97 -13
- package/index.d.ts +31 -0
- package/index.js +52 -0
- package/linter/linter-rules.d.ts +87 -23
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +10 -8
- package/linter/rules/dead-code.d.ts +1 -1
- package/linter/rules/deprecated-functions.js +14 -5
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +13 -2
- package/linter/rules/network-functions.d.ts +10 -5
- package/linter/rules/network-functions.js +48 -36
- package/linter/rules/no-leaked-credentials.d.ts +1 -1
- package/linter/rules/problematic-inputs.d.ts +1 -1
- package/linter/rules/problematic-inputs.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +3 -2
- package/linter/rules/seeded-randomness.js +7 -3
- package/linter/rules/software-has-license.d.ts +1 -1
- package/linter/rules/software-has-tests.d.ts +1 -1
- package/linter/rules/stop-with-call-arg.d.ts +1 -1
- package/linter/rules/syntactically-valid.d.ts +1 -1
- package/linter/rules/unclosed-connection.d.ts +3 -3
- package/linter/rules/unclosed-connection.js +3 -4
- package/linter/rules/undefined-symbol.d.ts +1 -1
- package/linter/rules/unescaped-arguments.d.ts +161 -0
- package/linter/rules/unescaped-arguments.js +293 -0
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/unused-definition.js +49 -4
- package/linter/rules/unused-import.d.ts +1 -1
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +3 -198
- package/project/context/flowr-analyzer-environment-context.d.ts +12 -1
- package/project/context/flowr-analyzer-environment-context.js +33 -1
- package/project/context/flowr-analyzer-files-context.d.ts +24 -1
- package/project/context/flowr-analyzer-files-context.js +42 -21
- package/project/context/flowr-analyzer-functions-context.d.ts +8 -0
- package/project/context/flowr-analyzer-functions-context.js +2 -0
- package/project/context/flowr-analyzer-gas-context.d.ts +9 -1
- package/project/context/flowr-analyzer-gas-context.js +21 -0
- package/project/context/flowr-file.d.ts +16 -1
- package/project/context/flowr-file.js +26 -2
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +19 -20
- package/project/plugins/file-plugins/files/flowr-description-file.js +55 -41
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +9 -4
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +11 -3
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +6 -9
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +5 -21
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +11 -12
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +48 -61
- package/project/plugins/file-plugins/files/flowr-news-file.d.ts +3 -12
- package/project/plugins/file-plugins/files/flowr-news-file.js +2 -19
- package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +145 -0
- package/project/plugins/file-plugins/files/flowr-rd-file.js +676 -0
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +122 -422
- package/project/plugins/file-plugins/files/flowr-rda-file.js +517 -1005
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +8 -2
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +10 -1
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +7 -2
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +9 -1
- package/project/plugins/file-plugins/files/flowr-sysdata-file.d.ts +17 -0
- package/project/plugins/file-plugins/files/flowr-sysdata-file.js +40 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +3 -1
- package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.d.ts +58 -0
- package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.js +95 -0
- package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.d.ts +23 -0
- package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +33 -72
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +17 -15
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +20 -37
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +29 -53
- package/project/plugins/package-version-plugins/package.js +2 -1
- package/project/plugins/plugin-registry.d.ts +3 -1
- package/project/plugins/plugin-registry.js +11 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +20 -4
- package/project/sigdb/build.d.ts +9 -15
- package/project/sigdb/build.js +63 -42
- package/project/sigdb/decode.d.ts +10 -4
- package/project/sigdb/decode.js +60 -21
- package/project/sigdb/memory-source.d.ts +4 -0
- package/project/sigdb/memory-source.js +8 -0
- package/project/sigdb/reader.d.ts +50 -100
- package/project/sigdb/reader.js +84 -105
- package/project/sigdb/schema.d.ts +90 -26
- package/project/sigdb/schema.js +12 -6
- package/queries/base-query-format.d.ts +7 -0
- package/queries/base-query-format.js +29 -0
- package/queries/catalog/absint-query/absint-query-executor.js +8 -6
- package/queries/catalog/absint-query/absint-query-format.d.ts +20 -9
- package/queries/catalog/absint-query/absint-query-format.js +32 -19
- package/queries/catalog/call-context-query/call-context-query-executor.js +3 -3
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +33 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +2 -2
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +14 -4
- package/queries/catalog/dependencies-query/function-info/read-functions.js +7 -121
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +4 -46
- package/queries/catalog/dependencies-query/function-info/write-functions.js +3 -76
- package/queries/catalog/dependencies-query/implicit-echo.js +2 -2
- package/queries/catalog/dependencies-query/link-devices.d.ts +2 -2
- package/queries/catalog/dependencies-query/link-devices.js +6 -7
- package/queries/catalog/dice-query/dice-query-executor.js +1 -1
- package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
- package/queries/catalog/does-call-query/does-call-query-executor.js +4 -0
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -1
- package/queries/catalog/files-query/files-query-format.d.ts +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-source-functions.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -17
- package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -27
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +3 -8
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -11
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +4 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +60 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +35 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +63 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -6
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +3 -8
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -11
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +3 -8
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -12
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +3 -8
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -14
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -10
- package/queries/catalog/signature-query/signature-query-executor.js +87 -93
- package/queries/catalog/signature-query/signature-query-format.d.ts +20 -5
- package/queries/catalog/signature-query/signature-query-format.js +16 -4
- package/queries/catalog/signature-query/signature-query-render.js +18 -4
- package/queries/catalog/slice-query-options.d.ts +14 -0
- package/queries/catalog/slice-query-options.js +15 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.js +7 -5
- package/queries/query-function-filter.d.ts +8 -3
- package/queries/query-function-filter.js +16 -6
- package/queries/query.d.ts +38 -38
- package/queries/query.js +30 -4
- package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/model.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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/node-id.d.ts +17 -9
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +35 -27
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -22
- package/reconstruct/reconstruct.d.ts +9 -20
- package/reconstruct/reconstruct.js +66 -28
- package/search/flowr-search-filters.d.ts +7 -6
- package/search/flowr-search-filters.js +6 -4
- package/search/search-executor/search-enrichers.d.ts +10 -10
- package/search/search-executor/search-enrichers.js +32 -3
- package/search/search-executor/search-transformer.js +15 -23
- package/slicing/criterion/parse.js +2 -12
- package/slicing/static/slice-call.js +1 -8
- package/slicing/static/static-slicer.js +1 -1
- package/util/collections/bimap.js +14 -6
- package/util/objects.js +16 -17
- package/util/r-value.d.ts +5 -4
- package/util/record.d.ts +38 -3
- package/util/record.js +48 -1
- package/util/simple-df/dfg-ascii.js +1 -1
- package/util/text/strings.d.ts +5 -0
- package/util/text/strings.js +10 -0
- package/util/version.js +2 -2
- package/abstract-interpretation/absint-visitor.d.ts +0 -223
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -19
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -151
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +0 -287
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +0 -1096
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -15
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -207
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +0 -6
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +0 -25
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +0 -31
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +0 -56
|
@@ -105,11 +105,88 @@ export declare const PasteLikeCalls: ReadonlySet<string>;
|
|
|
105
105
|
* when the name is not one of them, an argument does not resolve, or the call does not match what the entry
|
|
106
106
|
* declares. Shared by the value solver ({@link resolveAsStringFn}) and construction-time name resolution.
|
|
107
107
|
*/
|
|
108
|
-
|
|
108
|
+
declare function foldStringCall<Info>(this: void, node: RNamedFunctionCall<Info>, resolveArg: (arg: RNode<Info>) => string | undefined): string | number | undefined;
|
|
109
109
|
/**
|
|
110
110
|
* Resolves any call of a {@link StringFns} entry to a {@link Value}, with its arguments in any order R accepts:
|
|
111
111
|
* a join like `paste0("cfg_", k)` when every part resolves to a single string constant, and a transformation
|
|
112
112
|
* like `basename(p)` when its argument does. Anything that does not resolve stays `Top`.
|
|
113
113
|
*/
|
|
114
|
-
|
|
114
|
+
declare function resolveAsStringFn(this: void, args: BuiltInEvalHandlerArgs): Value;
|
|
115
|
+
/**
|
|
116
|
+
* Folding the string built-ins, from `paste` to `basename`.
|
|
117
|
+
*/
|
|
118
|
+
export declare const StringFold: {
|
|
119
|
+
readonly name: "StringFold";
|
|
120
|
+
/** every string built-in that is folded, see {@link StringFns} */
|
|
121
|
+
readonly fns: {
|
|
122
|
+
readonly paste: {
|
|
123
|
+
readonly pkg: PkgName.Base;
|
|
124
|
+
readonly params: readonly ["...", "sep"];
|
|
125
|
+
readonly defaults: {
|
|
126
|
+
readonly sep: " ";
|
|
127
|
+
};
|
|
128
|
+
readonly ignored: readonly ["collapse"];
|
|
129
|
+
readonly fold: (parts: string[], sep: string) => string;
|
|
130
|
+
};
|
|
131
|
+
readonly paste0: {
|
|
132
|
+
readonly pkg: PkgName.Base;
|
|
133
|
+
readonly params: readonly ["...", "sep"];
|
|
134
|
+
readonly defaults: {
|
|
135
|
+
readonly sep: "";
|
|
136
|
+
};
|
|
137
|
+
readonly ignored: readonly ["collapse"];
|
|
138
|
+
readonly fold: (parts: string[], sep: string) => string;
|
|
139
|
+
};
|
|
140
|
+
readonly 'file.path': {
|
|
141
|
+
readonly pkg: PkgName.Base;
|
|
142
|
+
readonly params: readonly ["...", "fsep"];
|
|
143
|
+
readonly defaults: {
|
|
144
|
+
readonly fsep: "/";
|
|
145
|
+
};
|
|
146
|
+
readonly fold: (parts: string[], fsep: string) => string;
|
|
147
|
+
};
|
|
148
|
+
readonly here: {
|
|
149
|
+
readonly pkg: PkgName.Here;
|
|
150
|
+
readonly params: readonly ["..."];
|
|
151
|
+
readonly fold: (parts: string[]) => string;
|
|
152
|
+
};
|
|
153
|
+
readonly basename: {
|
|
154
|
+
readonly pkg: PkgName.Base;
|
|
155
|
+
readonly params: readonly ["path"];
|
|
156
|
+
readonly fold: typeof basename;
|
|
157
|
+
};
|
|
158
|
+
readonly dirname: {
|
|
159
|
+
readonly pkg: PkgName.Base;
|
|
160
|
+
readonly params: readonly ["path"];
|
|
161
|
+
readonly fold: typeof dirname;
|
|
162
|
+
};
|
|
163
|
+
readonly toupper: {
|
|
164
|
+
readonly pkg: PkgName.Base;
|
|
165
|
+
readonly params: readonly ["x"];
|
|
166
|
+
readonly fold: (s: string) => string;
|
|
167
|
+
};
|
|
168
|
+
readonly tolower: {
|
|
169
|
+
readonly pkg: PkgName.Base;
|
|
170
|
+
readonly params: readonly ["x"];
|
|
171
|
+
readonly fold: (s: string) => string;
|
|
172
|
+
};
|
|
173
|
+
readonly trimws: {
|
|
174
|
+
readonly pkg: PkgName.Base;
|
|
175
|
+
readonly params: readonly ["x"];
|
|
176
|
+
readonly fold: (s: string) => string;
|
|
177
|
+
};
|
|
178
|
+
/** R counts characters, so we count code points rather than UTF-16 units */
|
|
179
|
+
readonly nchar: {
|
|
180
|
+
readonly pkg: PkgName.Base;
|
|
181
|
+
readonly params: readonly ["x"];
|
|
182
|
+
readonly fold: (s: string) => number;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
/** the calls pasting their arguments together, see {@link PasteLikeCalls} */
|
|
186
|
+
readonly pasteLike: ReadonlySet<string>;
|
|
187
|
+
/** What a string call amounts to; see {@link resolveAsStringFn}. */
|
|
188
|
+
readonly call: typeof resolveAsStringFn;
|
|
189
|
+
/** The string a call in the AST folds to; see {@link foldStringCall}. */
|
|
190
|
+
readonly fold: typeof foldStringCall;
|
|
191
|
+
};
|
|
115
192
|
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PasteLikeCalls = exports.StringFns = void 0;
|
|
4
|
-
exports.foldStringCall = foldStringCall;
|
|
5
|
-
exports.resolveAsStringFn = resolveAsStringFn;
|
|
3
|
+
exports.StringFold = exports.PasteLikeCalls = exports.StringFns = void 0;
|
|
6
4
|
const identifier_1 = require("../../environments/identifier");
|
|
7
5
|
const r_value_1 = require("../values/r-value");
|
|
8
6
|
const string_constants_1 = require("../values/string/string-constants");
|
|
@@ -74,9 +72,6 @@ function foldStringCall(node, resolveArg) {
|
|
|
74
72
|
if (matched === undefined) {
|
|
75
73
|
return undefined;
|
|
76
74
|
}
|
|
77
|
-
/* a fold that reads the characters cannot run on source text with an escape still in it (`\t` is two chars
|
|
78
|
-
* there); joining does not read them, so the entries collecting a `...` are exempt */
|
|
79
|
-
const literal = !known.params.includes('...');
|
|
80
75
|
const args = [];
|
|
81
76
|
for (const [at, slot] of matched.entries()) {
|
|
82
77
|
if (Array.isArray(slot)) {
|
|
@@ -97,7 +92,7 @@ function foldStringCall(node, resolveArg) {
|
|
|
97
92
|
}
|
|
98
93
|
// the argument *was* given, so failing to resolve it means we do not know the result, defaults do not apply
|
|
99
94
|
const value = resolveArg(slot);
|
|
100
|
-
if (value === undefined
|
|
95
|
+
if (value === undefined) {
|
|
101
96
|
return undefined;
|
|
102
97
|
}
|
|
103
98
|
args.push(value);
|
|
@@ -120,4 +115,18 @@ function resolveAsStringFn(args) {
|
|
|
120
115
|
}
|
|
121
116
|
return typeof folded === 'number' ? (0, interval_constants_1.intervalFrom)(folded, folded) : (0, string_constants_1.stringFrom)(folded);
|
|
122
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Folding the string built-ins, from `paste` to `basename`.
|
|
120
|
+
*/
|
|
121
|
+
exports.StringFold = {
|
|
122
|
+
name: 'StringFold',
|
|
123
|
+
/** every string built-in that is folded, see {@link StringFns} */
|
|
124
|
+
fns: exports.StringFns,
|
|
125
|
+
/** the calls pasting their arguments together, see {@link PasteLikeCalls} */
|
|
126
|
+
pasteLike: exports.PasteLikeCalls,
|
|
127
|
+
/** What a string call amounts to; see {@link resolveAsStringFn}. */
|
|
128
|
+
call: resolveAsStringFn,
|
|
129
|
+
/** The string a call in the AST folds to; see {@link foldStringCall}. */
|
|
130
|
+
fold: foldStringCall
|
|
131
|
+
};
|
|
123
132
|
//# sourceMappingURL=resolve-strings.js.map
|
|
@@ -1,29 +1,12 @@
|
|
|
1
1
|
import type { BuiltInEvalHandlerArgs } from '../../environments/built-in';
|
|
2
2
|
import { type Lift, Top, type Value, type ValueNumber, type ValueVector } from '../values/r-value';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* This function converts an RNode to its Value, either directly for a constant or by handing the node
|
|
8
|
-
* to the {@link BuiltInEvalHandler} its built-in declares, which may resolve further nodes recursively.
|
|
9
|
-
* @returns resolved value or top/bottom
|
|
4
|
+
* Converts an RNode to its Value, either directly for a constant or by handing the node to the
|
|
5
|
+
* {@link BuiltInEvalHandler} its built-in declares, which may resolve further nodes recursively.
|
|
6
|
+
* Helper of {@link Resolve.toValue}; use that instead to resolve the value of an identifier or node.
|
|
10
7
|
*/
|
|
11
8
|
export declare function resolveNode(args: BuiltInEvalHandlerArgs): Value;
|
|
12
|
-
/**
|
|
13
|
-
* Helper function used by {@link Resolve.toValue}, please use that instead, if
|
|
14
|
-
* you want to resolve the value of an identifier / node
|
|
15
|
-
*
|
|
16
|
-
* This function resolves a vector function call `c` to a {@link ValueVector}
|
|
17
|
-
* by recursively resolving the values of the arguments by calling {@link Resolve.toValue}
|
|
18
|
-
* @returns ValueVector or Top
|
|
19
|
-
*/
|
|
9
|
+
/** Resolves a vector call `c` to a {@link ValueVector}; helper of {@link resolveNode|resolveNode}. */
|
|
20
10
|
export declare function resolveAsVector(args: BuiltInEvalHandlerArgs): ValueVector | typeof Top;
|
|
21
|
-
/**
|
|
22
|
-
* Helper function used by {@link Resolve.toValue}, please use that instead, if
|
|
23
|
-
* you want to resolve the value of an identifier / node
|
|
24
|
-
*
|
|
25
|
-
* This function resolves a binary sequence operator `:` to a {@link ValueVector} of {@link ValueNumber}s
|
|
26
|
-
* by recursively resolving the values of the arguments by calling {@link Resolve.toValue}
|
|
27
|
-
* @returns ValueVector of ValueNumbers or Top
|
|
28
|
-
*/
|
|
11
|
+
/** Resolves the sequence operator `:` to a {@link ValueVector} of {@link ValueNumber}s; helper of {@link resolveNode}. */
|
|
29
12
|
export declare function resolveAsSeq(args: BuiltInEvalHandlerArgs): ValueVector<Lift<ValueNumber[]>> | typeof Top;
|
|
@@ -6,11 +6,11 @@ exports.resolveAsSeq = resolveAsSeq;
|
|
|
6
6
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
7
7
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
8
|
const r_value_1 = require("../../../util/r-value");
|
|
9
|
-
const interval_constants_1 = require("../values/intervals/interval-constants");
|
|
10
9
|
const logical_constants_1 = require("../values/logical/logical-constants");
|
|
11
10
|
const r_value_2 = require("../values/r-value");
|
|
12
11
|
const string_constants_1 = require("../values/string/string-constants");
|
|
13
12
|
const vector_constants_1 = require("../values/vectors/vector-constants");
|
|
13
|
+
const general_1 = require("../values/general");
|
|
14
14
|
const scalar_constants_1 = require("../values/scalar/scalar-constants");
|
|
15
15
|
const identifier_1 = require("../../environments/identifier");
|
|
16
16
|
const df_helper_1 = require("../../graph/df-helper");
|
|
@@ -25,7 +25,9 @@ const r_binary_op_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-bina
|
|
|
25
25
|
function evalHandlerOf(name, environment, ctx) {
|
|
26
26
|
const defs = environment ?
|
|
27
27
|
resolve_helper_1.Resolve.byNameAndType(name, environment, identifier_1.ReferenceType.BuiltInFunction)
|
|
28
|
-
|
|
28
|
+
/* without an environment the search path is unknown, so what a package states about the name has its say */
|
|
29
|
+
: ctx.env.builtInEnvironment.memory.get(identifier_1.Identifier.getName(name))
|
|
30
|
+
?? ctx.env.statedDefinitionsOf(name);
|
|
29
31
|
const def = defs?.length === 1 ? defs[0] : undefined;
|
|
30
32
|
return def?.type === identifier_1.ReferenceType.BuiltInFunction ? def.evalHandler : undefined;
|
|
31
33
|
}
|
|
@@ -55,26 +57,24 @@ function evalNameOf({ node, graph }) {
|
|
|
55
57
|
if (name !== undefined && identifier_1.Identifier.getName(name) !== identifier_1.Identifier.getName(named)) {
|
|
56
58
|
return undefined;
|
|
57
59
|
}
|
|
58
|
-
|
|
60
|
+
/* the same call is named bare by one origin and qualified by another; the qualified one says whose it is */
|
|
61
|
+
name = name !== undefined && identifier_1.Identifier.getNamespace(named) === undefined ? name : named;
|
|
59
62
|
}
|
|
60
63
|
return name;
|
|
61
64
|
}
|
|
62
65
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* This function converts an RNode to its Value, either directly for a constant or by handing the node
|
|
67
|
-
* to the {@link BuiltInEvalHandler} its built-in declares, which may resolve further nodes recursively.
|
|
68
|
-
* @returns resolved value or top/bottom
|
|
66
|
+
* Converts an RNode to its Value, either directly for a constant or by handing the node to the
|
|
67
|
+
* {@link BuiltInEvalHandler} its built-in declares, which may resolve further nodes recursively.
|
|
68
|
+
* Helper of {@link Resolve.toValue}; use that instead to resolve the value of an identifier or node.
|
|
69
69
|
*/
|
|
70
70
|
function resolveNode(args) {
|
|
71
71
|
const { node, environment, ctx } = args;
|
|
72
72
|
const nt = node.type;
|
|
73
73
|
if (nt === type_1.RType.String) {
|
|
74
|
-
return
|
|
74
|
+
return string_constants_1.RStringLiteral.value(node.content) ?? r_value_2.Top;
|
|
75
75
|
}
|
|
76
76
|
else if (nt === type_1.RType.Number) {
|
|
77
|
-
return (0,
|
|
77
|
+
return (0, general_1.valueFromRNumber)(node.content);
|
|
78
78
|
}
|
|
79
79
|
else if (nt === type_1.RType.Logical) {
|
|
80
80
|
return node.content.valueOf() ? logical_constants_1.ValueLogicalTrue : logical_constants_1.ValueLogicalFalse;
|
|
@@ -86,14 +86,7 @@ function resolveNode(args) {
|
|
|
86
86
|
const handler = name === undefined ? undefined : evalHandlerOf(name, environment, ctx);
|
|
87
87
|
return handler?.(args) ?? r_value_2.Top;
|
|
88
88
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Helper function used by {@link Resolve.toValue}, please use that instead, if
|
|
91
|
-
* you want to resolve the value of an identifier / node
|
|
92
|
-
*
|
|
93
|
-
* This function resolves a vector function call `c` to a {@link ValueVector}
|
|
94
|
-
* by recursively resolving the values of the arguments by calling {@link Resolve.toValue}
|
|
95
|
-
* @returns ValueVector or Top
|
|
96
|
-
*/
|
|
89
|
+
/** Resolves a vector call `c` to a {@link ValueVector}; helper of {@link resolveNode|resolveNode}. */
|
|
97
90
|
function resolveAsVector(args) {
|
|
98
91
|
const node = args.node;
|
|
99
92
|
if (!r_function_call_1.RFunctionCall.is(node)) {
|
|
@@ -101,14 +94,7 @@ function resolveAsVector(args) {
|
|
|
101
94
|
}
|
|
102
95
|
return (0, vector_constants_1.vectorFrom)((0, vector_constants_1.flattenVectorElements)(node.arguments.map(arg => arg !== r_function_call_1.EmptyArgument ? resolve_helper_1.Resolve.toValue(arg.value, args) : r_value_2.Top)));
|
|
103
96
|
}
|
|
104
|
-
/**
|
|
105
|
-
* Helper function used by {@link Resolve.toValue}, please use that instead, if
|
|
106
|
-
* you want to resolve the value of an identifier / node
|
|
107
|
-
*
|
|
108
|
-
* This function resolves a binary sequence operator `:` to a {@link ValueVector} of {@link ValueNumber}s
|
|
109
|
-
* by recursively resolving the values of the arguments by calling {@link Resolve.toValue}
|
|
110
|
-
* @returns ValueVector of ValueNumbers or Top
|
|
111
|
-
*/
|
|
97
|
+
/** Resolves the sequence operator `:` to a {@link ValueVector} of {@link ValueNumber}s; helper of {@link resolveNode}. */
|
|
112
98
|
function resolveAsSeq(args) {
|
|
113
99
|
const operator = args.node;
|
|
114
100
|
if (!r_binary_op_1.RBinaryOp.is(operator)) {
|
|
@@ -117,20 +103,24 @@ function resolveAsSeq(args) {
|
|
|
117
103
|
const leftValue = (0, r_value_1.unliftRValue)(resolve_helper_1.Resolve.toValue(operator.lhs, args));
|
|
118
104
|
const rightValue = (0, r_value_1.unliftRValue)(resolve_helper_1.Resolve.toValue(operator.rhs, args));
|
|
119
105
|
if ((0, r_value_1.isRNumberValue)(leftValue) && (0, r_value_1.isRNumberValue)(rightValue)) {
|
|
120
|
-
|
|
106
|
+
const sequence = createNumberSequence(leftValue, rightValue);
|
|
107
|
+
return sequence === undefined ? r_value_2.Top : (0, vector_constants_1.vectorFrom)(sequence.map(scalar_constants_1.liftScalar));
|
|
121
108
|
}
|
|
122
109
|
return r_value_2.Top;
|
|
123
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* The elements `from:to` runs over, counting down whenever `to` is the smaller one, and stopping before it
|
|
113
|
+
* would pass `to` (`1:3.5` ends at `3`). `undefined` for a bound that names no position to count from or to.
|
|
114
|
+
*/
|
|
124
115
|
function createNumberSequence(start, end) {
|
|
116
|
+
if (!Number.isFinite(start.num) || !Number.isFinite(end.num)) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
const step = start.num <= end.num ? 1 : -1;
|
|
125
120
|
const sequence = [];
|
|
126
|
-
|
|
127
|
-
const max = Math.max(start.num, end.num);
|
|
128
|
-
for (let i = min; i <= max; i++) {
|
|
121
|
+
for (let i = start.num; step > 0 ? i <= end.num : i >= end.num; i += step) {
|
|
129
122
|
sequence.push({ ...start, num: i });
|
|
130
123
|
}
|
|
131
|
-
if (start > end) {
|
|
132
|
-
sequence.reverse();
|
|
133
|
-
}
|
|
134
124
|
return sequence;
|
|
135
125
|
}
|
|
136
126
|
//# sourceMappingURL=resolve.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RNodeWithParent } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
2
|
-
import { type Lift, type Value, type ValueSet, Bottom, Top } from './r-value';
|
|
2
|
+
import { type Lift, type Value, type ValueInterval, type ValueSet, Bottom, Top } from './r-value';
|
|
3
|
+
import type { RNumberValue } from '../../../r-bridge/lang-4.x/convert-values';
|
|
3
4
|
/**
|
|
4
5
|
* Takes n potentially lifted ops and returns `Top` or `Bottom` if any is `Top` or `Bottom`.
|
|
5
6
|
*/
|
|
@@ -24,6 +25,11 @@ export declare function soleValue<T extends Value['type']>(this: void, set: Valu
|
|
|
24
25
|
* @returns abstract value
|
|
25
26
|
*/
|
|
26
27
|
export declare function valueFromTsValue(a: unknown): Value;
|
|
28
|
+
/**
|
|
29
|
+
* The interval a number literal stands for. A complex literal keeps its flag, so that nothing folds `2i` as
|
|
30
|
+
* the real number its lexeme starts with.
|
|
31
|
+
*/
|
|
32
|
+
export declare function valueFromRNumber(value: RNumberValue): ValueInterval;
|
|
27
33
|
/**
|
|
28
34
|
* Converts a constant from an RNode into an abstract value
|
|
29
35
|
* @param a - RNode constant
|
|
@@ -4,6 +4,7 @@ exports.bottomTopGuard = bottomTopGuard;
|
|
|
4
4
|
exports.valueSetGuard = valueSetGuard;
|
|
5
5
|
exports.soleValue = soleValue;
|
|
6
6
|
exports.valueFromTsValue = valueFromTsValue;
|
|
7
|
+
exports.valueFromRNumber = valueFromRNumber;
|
|
7
8
|
exports.valueFromRNodeConstant = valueFromRNodeConstant;
|
|
8
9
|
const interval_constants_1 = require("./intervals/interval-constants");
|
|
9
10
|
const logical_constants_1 = require("./logical/logical-constants");
|
|
@@ -14,6 +15,7 @@ const r_function_definition_1 = require("../../../r-bridge/lang-4.x/ast/model/no
|
|
|
14
15
|
const r_logical_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-logical");
|
|
15
16
|
const r_number_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-number");
|
|
16
17
|
const r_string_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
18
|
+
const scalar_constants_1 = require("./scalar/scalar-constants");
|
|
17
19
|
/**
|
|
18
20
|
* Takes n potentially lifted ops and returns `Top` or `Bottom` if any is `Top` or `Bottom`.
|
|
19
21
|
*/
|
|
@@ -50,7 +52,11 @@ function soleValue(set, type) {
|
|
|
50
52
|
* @returns abstract value
|
|
51
53
|
*/
|
|
52
54
|
function valueFromTsValue(a) {
|
|
53
|
-
if (a ===
|
|
55
|
+
if (a === r_value_1.Top || a === r_value_1.Bottom) {
|
|
56
|
+
/* what a definition states outright, as `NA` does: R has a value there, flowR has no way to hold it */
|
|
57
|
+
return a;
|
|
58
|
+
}
|
|
59
|
+
else if (a === undefined) {
|
|
54
60
|
return r_value_1.Bottom;
|
|
55
61
|
}
|
|
56
62
|
else if (a === null) {
|
|
@@ -70,6 +76,14 @@ function valueFromTsValue(a) {
|
|
|
70
76
|
}
|
|
71
77
|
return r_value_1.Top;
|
|
72
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* The interval a number literal stands for. A complex literal keeps its flag, so that nothing folds `2i` as
|
|
81
|
+
* the real number its lexeme starts with.
|
|
82
|
+
*/
|
|
83
|
+
function valueFromRNumber(value) {
|
|
84
|
+
const scalar = (0, scalar_constants_1.getScalarFromInteger)(value.num, !value.complexNumber && Number.isInteger(value.num), value.complexNumber);
|
|
85
|
+
return (0, interval_constants_1.intervalFromValues)(scalar, scalar);
|
|
86
|
+
}
|
|
73
87
|
/**
|
|
74
88
|
* Converts a constant from an RNode into an abstract value
|
|
75
89
|
* @param a - RNode constant
|
|
@@ -77,10 +91,10 @@ function valueFromTsValue(a) {
|
|
|
77
91
|
*/
|
|
78
92
|
function valueFromRNodeConstant(a) {
|
|
79
93
|
if (r_string_1.RString.is(a)) {
|
|
80
|
-
return
|
|
94
|
+
return string_constants_1.RStringLiteral.value(a.content) ?? r_value_1.Top;
|
|
81
95
|
}
|
|
82
96
|
else if (r_number_1.RNumber.is(a)) {
|
|
83
|
-
return (
|
|
97
|
+
return valueFromRNumber(a.content);
|
|
84
98
|
}
|
|
85
99
|
else if (r_logical_1.RLogical.is(a)) {
|
|
86
100
|
return a.content.valueOf() ? logical_constants_1.ValueLogicalTrue : logical_constants_1.ValueLogicalFalse;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import type { RStringValue } from '../../../../r-bridge/lang-4.x/convert-values';
|
|
2
2
|
import { type Lift, type Value, type ValueString } from '../r-value';
|
|
3
|
-
/**
|
|
4
|
-
* Lift a raw string or R string value into a ValueString.
|
|
5
|
-
* @see {@link liftString} - for lifting a Lift<RStringValue>
|
|
6
|
-
*/
|
|
3
|
+
/** lift a raw string or R string value into a ValueString; see {@link liftString} for lifting a Lift<RStringValue> */
|
|
7
4
|
export declare function stringFrom(str: RStringValue | string): ValueString;
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
/** the characters an R string literal stands for (`"a\tb"` is three characters, not the four its source is written with); undefined for an escape R would reject */
|
|
6
|
+
declare function unescapeRString(this: void, str: string): string | undefined;
|
|
7
|
+
/** the {@link ValueString} an R string literal stands for, escapes resolved (a raw string has none, so it stands for its characters as written); undefined for an escape R would reject */
|
|
8
|
+
declare function stringFromLiteral(this: void, value: RStringValue): ValueString | undefined;
|
|
9
|
+
/** lift a Lift<RStringValue> into a ValueString; see {@link stringFrom} for lifting a raw string or R string value */
|
|
12
10
|
export declare function liftString(str: Lift<RStringValue>): ValueString;
|
|
13
|
-
/**
|
|
14
|
-
* Collect strings from an array of ValueString.
|
|
15
|
-
* If any value is not a string, or is Bottom/Top, undefined is returned.
|
|
16
|
-
* @param a - The array of Value to collect strings from.
|
|
17
|
-
* @param withQuotes - Whether to include the quotes in the returned strings.
|
|
18
|
-
* @returns - An array of strings, or undefined if any value is not a string.
|
|
19
|
-
*/
|
|
11
|
+
/** collect strings from an array of ValueString, with quotes if `withQuotes`; undefined if any value is not a string, or is Bottom/Top */
|
|
20
12
|
export declare function collectStrings(a: Value[], withQuotes?: boolean): string[] | undefined;
|
|
13
|
+
/** utility functions for the strings a program writes down, as opposed to the ones it computes */
|
|
14
|
+
export declare const RStringLiteral: {
|
|
15
|
+
readonly name: "RStringLiteral";
|
|
16
|
+
/** What the escapes in a literal stand for; see {@link unescapeRString}. */
|
|
17
|
+
readonly unescape: typeof unescapeRString;
|
|
18
|
+
/** The value a literal stands for, `undefined` when R would not accept it; see {@link stringFromLiteral}. */
|
|
19
|
+
readonly value: typeof stringFromLiteral;
|
|
20
|
+
};
|
|
21
21
|
export declare const ValueEmptyString: ValueString<Lift<RStringValue>>;
|
|
22
22
|
export declare const ValueStringTop: ValueString<Lift<RStringValue>>;
|
|
23
23
|
export declare const ValueStringBot: ValueString<Lift<RStringValue>>;
|
|
24
|
+
export {};
|
|
@@ -1,41 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValueStringBot = exports.ValueStringTop = exports.ValueEmptyString = void 0;
|
|
3
|
+
exports.ValueStringBot = exports.ValueStringTop = exports.ValueEmptyString = exports.RStringLiteral = void 0;
|
|
4
4
|
exports.stringFrom = stringFrom;
|
|
5
5
|
exports.liftString = liftString;
|
|
6
6
|
exports.collectStrings = collectStrings;
|
|
7
7
|
const general_1 = require("../general");
|
|
8
8
|
const r_value_1 = require("../r-value");
|
|
9
|
-
/**
|
|
10
|
-
* Lift a raw string or R string value into a ValueString.
|
|
11
|
-
* @see {@link liftString} - for lifting a Lift<RStringValue>
|
|
12
|
-
*/
|
|
9
|
+
/** lift a raw string or R string value into a ValueString; see {@link liftString} for lifting a Lift<RStringValue> */
|
|
13
10
|
function stringFrom(str) {
|
|
14
|
-
return {
|
|
15
|
-
type: 'string',
|
|
16
|
-
value: typeof str === 'string' ? {
|
|
17
|
-
quotes: '"',
|
|
18
|
-
str: str
|
|
19
|
-
} : str,
|
|
20
|
-
};
|
|
11
|
+
return { type: 'string', value: typeof str === 'string' ? { quotes: '"', str } : str };
|
|
21
12
|
}
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
/** the escapes standing for exactly one character, everything else R writes as a numeric code */
|
|
14
|
+
const SimpleEscapes = {
|
|
15
|
+
n: '\n',
|
|
16
|
+
r: '\r',
|
|
17
|
+
t: '\t',
|
|
18
|
+
b: '\b',
|
|
19
|
+
a: '\x07',
|
|
20
|
+
f: '\f',
|
|
21
|
+
v: '\v',
|
|
22
|
+
'\\': '\\',
|
|
23
|
+
'"': '"',
|
|
24
|
+
'\'': '\'',
|
|
25
|
+
'`': '`'
|
|
26
|
+
};
|
|
27
|
+
/** the largest code point there is, so an `\U` escape naming none of them is rejected instead of throwing */
|
|
28
|
+
const MaxCodePoint = 0x10FFFF;
|
|
29
|
+
/** `\xnn`, `\u{nnnn}`, `\unnnn`, `\U{nnnnnnnn}`, `\Unnnnnnnn`, an octal `\nnn`, or a single-character escape */
|
|
30
|
+
const EscapePattern = /\\(?:x([0-9a-fA-F]{1,2})|u\{([0-9a-fA-F]{1,6})\}|u([0-9a-fA-F]{1,4})|U\{([0-9a-fA-F]{1,8})\}|U([0-9a-fA-F]{1,8})|([0-7]{1,3})|([\s\S]))/g;
|
|
31
|
+
/** the characters an R string literal stands for (`"a\tb"` is three characters, not the four its source is written with); undefined for an escape R would reject */
|
|
32
|
+
function unescapeRString(str) {
|
|
33
|
+
if (!str.includes('\\')) {
|
|
34
|
+
return str;
|
|
35
|
+
}
|
|
36
|
+
let rejected = false;
|
|
37
|
+
const out = str.replace(EscapePattern, (_all, hex, uBraced, u, bigBraced, big, octal, single) => {
|
|
38
|
+
const code = hex ?? uBraced ?? u ?? bigBraced ?? big;
|
|
39
|
+
if (code !== undefined || octal !== undefined) {
|
|
40
|
+
const point = code !== undefined ? parseInt(code, 16) : parseInt(octal, 8);
|
|
41
|
+
rejected ||= point > MaxCodePoint;
|
|
42
|
+
return point > MaxCodePoint ? '' : String.fromCodePoint(point);
|
|
43
|
+
}
|
|
44
|
+
const simple = single === undefined ? undefined : SimpleEscapes[single];
|
|
45
|
+
rejected ||= simple === undefined;
|
|
46
|
+
return simple ?? '';
|
|
47
|
+
});
|
|
48
|
+
return rejected ? undefined : out;
|
|
49
|
+
}
|
|
50
|
+
/** the {@link ValueString} an R string literal stands for, escapes resolved (a raw string has none, so it stands for its characters as written); undefined for an escape R would reject */
|
|
51
|
+
function stringFromLiteral(value) {
|
|
52
|
+
if (value.flag === 'raw') {
|
|
53
|
+
return stringFrom(value);
|
|
54
|
+
}
|
|
55
|
+
const str = unescapeRString(value.str);
|
|
56
|
+
return str === undefined ? undefined : stringFrom({ ...value, str });
|
|
57
|
+
}
|
|
58
|
+
/** lift a Lift<RStringValue> into a ValueString; see {@link stringFrom} for lifting a raw string or R string value */
|
|
26
59
|
function liftString(str) {
|
|
27
|
-
return {
|
|
28
|
-
type: 'string',
|
|
29
|
-
value: str
|
|
30
|
-
};
|
|
60
|
+
return { type: 'string', value: str };
|
|
31
61
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Collect strings from an array of ValueString.
|
|
34
|
-
* If any value is not a string, or is Bottom/Top, undefined is returned.
|
|
35
|
-
* @param a - The array of Value to collect strings from.
|
|
36
|
-
* @param withQuotes - Whether to include the quotes in the returned strings.
|
|
37
|
-
* @returns - An array of strings, or undefined if any value is not a string.
|
|
38
|
-
*/
|
|
62
|
+
/** collect strings from an array of ValueString, with quotes if `withQuotes`; undefined if any value is not a string, or is Bottom/Top */
|
|
39
63
|
function collectStrings(a, withQuotes = false) {
|
|
40
64
|
if ((0, general_1.bottomTopGuard)(a)) {
|
|
41
65
|
return undefined;
|
|
@@ -54,6 +78,14 @@ function collectStrings(a, withQuotes = false) {
|
|
|
54
78
|
}
|
|
55
79
|
return values;
|
|
56
80
|
}
|
|
81
|
+
/** utility functions for the strings a program writes down, as opposed to the ones it computes */
|
|
82
|
+
exports.RStringLiteral = {
|
|
83
|
+
name: 'RStringLiteral',
|
|
84
|
+
/** What the escapes in a literal stand for; see {@link unescapeRString}. */
|
|
85
|
+
unescape: unescapeRString,
|
|
86
|
+
/** The value a literal stands for, `undefined` when R would not accept it; see {@link stringFromLiteral}. */
|
|
87
|
+
value: stringFromLiteral
|
|
88
|
+
};
|
|
57
89
|
exports.ValueEmptyString = stringFrom('');
|
|
58
90
|
exports.ValueStringTop = liftString(r_value_1.Top);
|
|
59
91
|
exports.ValueStringBot = liftString(r_value_1.Bottom);
|
package/dataflow/extractor.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type DataflowProcessors } from './processor';
|
|
|
3
3
|
import type { NormalizedAst, ParentInformation } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import type { KnownParserType, Parser } from '../r-bridge/parser';
|
|
5
5
|
import type { FlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
6
|
+
import { type DataflowBudgetTracker } from '../gas';
|
|
6
7
|
/**
|
|
7
8
|
* The best friend of {@link produceDataFlowGraph} and {@link processDataflowFor}.
|
|
8
9
|
* Maps every {@link RType} in the normalized AST to a processor.
|
|
@@ -14,4 +15,4 @@ export declare const processors: DataflowProcessors<ParentInformation>;
|
|
|
14
15
|
* (e.g., in the event of a `source` call).
|
|
15
16
|
* For the actual, canonical fold entry point, see {@link processDataflowFor}.
|
|
16
17
|
*/
|
|
17
|
-
export declare function produceDataFlowGraph<OtherInfo>(parser: Parser<KnownParserType>, completeAst: NormalizedAst<OtherInfo & ParentInformation>, ctx: FlowrAnalyzerContext): DataflowInformation;
|
|
18
|
+
export declare function produceDataFlowGraph<OtherInfo>(parser: Parser<KnownParserType>, completeAst: NormalizedAst<OtherInfo & ParentInformation>, ctx: FlowrAnalyzerContext, budget?: DataflowBudgetTracker | undefined): DataflowInformation;
|
package/dataflow/extractor.js
CHANGED
|
@@ -23,13 +23,12 @@ const built_in_function_definition_1 = require("./internal/process/functions/cal
|
|
|
23
23
|
const transitive_side_effects_1 = require("./internal/process/functions/call/built-in/transitive-side-effects");
|
|
24
24
|
const flowr_file_1 = require("../project/context/flowr-file");
|
|
25
25
|
const vertex_1 = require("./graph/vertex");
|
|
26
|
-
/** Round cap for the transitive-side-effect fixpoint. */
|
|
27
|
-
const transitiveSideEffectRounds = 32;
|
|
28
26
|
const identifier_1 = require("./environments/identifier");
|
|
29
27
|
const quoted_1 = require("./internal/process/functions/call/quoted");
|
|
30
28
|
const range_1 = require("../util/range");
|
|
31
29
|
const logger_1 = require("./logger");
|
|
32
30
|
const gas_1 = require("../gas");
|
|
31
|
+
const config_1 = require("../config");
|
|
33
32
|
const df_helper_1 = require("./graph/df-helper");
|
|
34
33
|
const arrays_1 = require("../util/collections/arrays");
|
|
35
34
|
/**
|
|
@@ -125,7 +124,19 @@ function resolveLinkToSideEffects(graph, ctx) {
|
|
|
125
124
|
* (e.g., in the event of a `source` call).
|
|
126
125
|
* For the actual, canonical fold entry point, see {@link processDataflowFor}.
|
|
127
126
|
*/
|
|
128
|
-
function produceDataFlowGraph(parser, completeAst, ctx) {
|
|
127
|
+
function produceDataFlowGraph(parser, completeAst, ctx, budget = ctx.gas.budget(gas_1.GasFeatureKey.Dataflow)) {
|
|
128
|
+
return (0, gas_1.withDataflowBudget)(budget, () => {
|
|
129
|
+
const df = extractDataFlowGraph(parser, completeAst, ctx);
|
|
130
|
+
const cut = budget?.exhausted;
|
|
131
|
+
if (cut !== undefined) {
|
|
132
|
+
logger_1.dataflowLogger.warn(`Dataflow analysis was cut short after ${cut.reached} ${cut.dimension} (budget ${cut.limit}); the graph is partial.`);
|
|
133
|
+
df.cutShort = cut;
|
|
134
|
+
}
|
|
135
|
+
return df;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/** The extraction itself, always run inside the {@link withDataflowBudget} scope {@link produceDataFlowGraph} opens. */
|
|
139
|
+
function extractDataFlowGraph(parser, completeAst, ctx) {
|
|
129
140
|
// we freeze the files here to avoid endless modifications during processing
|
|
130
141
|
const files = completeAst.ast.files.slice();
|
|
131
142
|
ctx.files.addConsideredFile(files[0].filePath ? files[0].filePath : flowr_file_1.FlowrFile.INLINE_PATH);
|
|
@@ -158,7 +169,8 @@ function produceDataFlowGraph(parser, completeAst, ctx) {
|
|
|
158
169
|
// resolve linkages and propagate transitive side effects across calls to a fixpoint
|
|
159
170
|
(0, built_in_function_definition_1.updateNestedFunctionCalls)(df.graph, df.environment, ctx);
|
|
160
171
|
const escapedNames = new Set();
|
|
161
|
-
|
|
172
|
+
const rounds = ctx.config.solver.transitiveSideEffectRounds ?? config_1.DefaultTransitiveSideEffectRounds;
|
|
173
|
+
for (let round = 0; round < rounds; round++) {
|
|
162
174
|
const { environment, grew, escapedNames: roundNames } = df_helper_1.Dataflow.sideEffects.propagateTransitive(df.graph, df.environment, ctx);
|
|
163
175
|
df.environment = environment;
|
|
164
176
|
for (const n of roundNames) {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { DataflowGraph } from '../graph/graph';
|
|
2
|
+
import type { ArgProps } from '../environments/built-in-props';
|
|
3
|
+
import { type BuiltInLookup } from './frame-reflection';
|
|
4
|
+
import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
|
|
5
|
+
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
|
+
/** What a function does with its formals, as an {@link ArgProp} bitfield keyed by the id of each formal's name. */
|
|
7
|
+
export type FunctionArgumentRoles = Record<NodeId, ArgProps>;
|
|
8
|
+
/** What to ask for beyond the definitions themselves, see {@link ArgumentRoles.of}. */
|
|
9
|
+
export interface ArgumentRolesOptions {
|
|
10
|
+
/** how to ask what a built-in states, so a configured or overwritten one answers */
|
|
11
|
+
readonly ctx?: ReadOnlyFlowrAnalyzerContext;
|
|
12
|
+
/** how far a value is followed back through names and calls (default {@link DefaultDepth}) */
|
|
13
|
+
readonly maxDepth?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* What each definition in `ids` does with its formals, as {@link ArgProps}. A formal is {@link ArgProp.Alias}
|
|
17
|
+
* only when the result is *always* that formal; every other bit is what the calls in the body state for it.
|
|
18
|
+
* @useInstead {@link ArgumentRoles.of}
|
|
19
|
+
*/
|
|
20
|
+
declare function argumentRolesOfFunctions(this: void, ids: Iterable<NodeId>, graph: DataflowGraph, options?: ArgumentRolesOptions): Record<NodeId, FunctionArgumentRoles>;
|
|
21
|
+
/** What the functions of a program do with the arguments they are handed. */
|
|
22
|
+
export declare const ArgumentRoles: {
|
|
23
|
+
readonly name: "ArgumentRoles";
|
|
24
|
+
/** The roles of several definitions, sharing the built-in lookups; see {@link argumentRolesOfFunctions}. */
|
|
25
|
+
readonly of: typeof argumentRolesOfFunctions;
|
|
26
|
+
/** how far a value is followed back when nothing else is asked for */
|
|
27
|
+
readonly maxDepth: 6;
|
|
28
|
+
};
|
|
29
|
+
/** What one run carries along, so the built-in lookups are shared between the definitions it answers. */
|
|
30
|
+
export interface LookupState {
|
|
31
|
+
readonly graph: DataflowGraph;
|
|
32
|
+
/** what flowR states about a built-in, answered once per name */
|
|
33
|
+
readonly info: BuiltInLookup;
|
|
34
|
+
}
|
|
35
|
+
export {};
|