@eagleoutice/flowr 2.17.5 → 2.17.6
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 -51
- package/abstract-interpretation/absint-inference.d.ts +4 -4
- package/abstract-interpretation/absint-inference.js +11 -11
- package/abstract-interpretation/abstract-semantics.d.ts +2 -1
- package/abstract-interpretation/branch-paths-interpreter.d.ts +1 -0
- package/abstract-interpretation/branch-paths-interpreter.js +60 -0
- package/abstract-interpretation/branch-paths.d.ts +60 -0
- package/abstract-interpretation/branch-paths.js +120 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +6 -1
- package/abstract-interpretation/data-frame/dataframe-semantics.js +60 -1
- package/abstract-interpretation/data-frame/semantics.js +4 -10
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
- package/cli/repl/core.js +51 -0
- package/control-flow/cfg-dead-code.js +12 -7
- package/data/packed.d.ts +10 -0
- package/data/packed.js +33 -0
- package/data/r-base-guards.generated.d.ts +7 -0
- package/data/r-base-guards.generated.js +12 -0
- package/data/r-datasets.generated.d.ts +4 -0
- package/data/r-datasets.generated.js +10 -0
- package/data/r-formals.generated.d.ts +4 -0
- package/data/r-formals.generated.js +10 -0
- package/data/r-group-method-guards.generated.d.ts +3 -0
- package/data/r-group-method-guards.generated.js +8 -0
- package/dataflow/environments/ambient-effect.d.ts +1000 -0
- package/dataflow/environments/ambient-effect.js +234 -0
- package/dataflow/environments/ambient-state-name.d.ts +45 -2
- package/dataflow/environments/ambient-state-name.js +61 -3
- package/dataflow/environments/apply-kill.js +11 -4
- package/dataflow/environments/built-in-kinds.d.ts +4 -46
- package/dataflow/environments/built-in-kinds.js +6 -2
- package/dataflow/environments/built-in-props.d.ts +16 -4
- package/dataflow/environments/built-in-props.js +11 -3
- package/dataflow/environments/built-in.d.ts +6 -1
- package/dataflow/environments/built-in.js +13 -36
- package/dataflow/environments/default-builtin-config/base-functions.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/base-functions.js +110 -52
- package/dataflow/environments/default-builtin-config/base-language.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/base-language.js +11 -8
- package/dataflow/environments/default-builtin-config/dev-tooling.js +1 -1
- package/dataflow/environments/default-builtin-config/file-io.js +6 -4
- package/dataflow/environments/default-builtin-config/graphics-devices.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/graphics-devices.js +24 -14
- package/dataflow/environments/default-builtin-config/guard-builders.d.ts +16 -0
- package/dataflow/environments/default-builtin-config/guard-builders.js +29 -0
- package/dataflow/environments/default-builtin-config/guards-primitive-lang.d.ts +15 -0
- package/dataflow/environments/default-builtin-config/guards-primitive-lang.js +228 -0
- package/dataflow/environments/default-builtin-config/guards-primitive-ops.d.ts +11 -0
- package/dataflow/environments/default-builtin-config/guards-primitive-ops.js +154 -0
- package/dataflow/environments/default-builtin-config/guards.d.ts +9 -0
- package/dataflow/environments/default-builtin-config/guards.js +211 -0
- package/dataflow/environments/default-builtin-config/index.d.ts +3 -3
- package/dataflow/environments/default-builtin-config/index.js +22 -7
- package/dataflow/environments/default-builtin-config/media-formats.js +4 -4
- package/dataflow/environments/default-builtin-config/package-spatial.js +2 -1
- package/dataflow/environments/default-builtin-config/package-tidyverse.js +3 -2
- package/dataflow/environments/default-builtin-config/package-utils.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/package-utils.js +5 -2
- package/dataflow/environments/default-builtin-config/parallel-execution.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/parallel-execution.js +3 -1
- package/dataflow/environments/default-builtin-config/r-formals.d.ts +13 -0
- package/dataflow/environments/default-builtin-config/r-formals.js +110 -0
- package/dataflow/environments/default-builtin-config/shared-configs.d.ts +138 -77
- package/dataflow/environments/default-builtin-config/shared-configs.js +52 -88
- package/dataflow/environments/default-builtin-config/statistics.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/statistics.js +4 -1
- package/dataflow/environments/diff.js +5 -2
- package/dataflow/environments/environment.d.ts +20 -0
- package/dataflow/environments/environment.js +39 -4
- package/dataflow/environments/group-generics.d.ts +5 -1
- package/dataflow/environments/group-generics.js +13 -3
- package/dataflow/environments/guard-facts.d.ts +169 -0
- package/dataflow/environments/guard-facts.js +26 -0
- package/dataflow/environments/identifier.d.ts +9 -1
- package/dataflow/environments/identifier.js +5 -0
- package/dataflow/environments/pkg-name.d.ts +1 -0
- package/dataflow/environments/query-fn-props.d.ts +3 -5
- package/dataflow/environments/query-fn-props.js +44 -21
- package/dataflow/environments/removal-marker.d.ts +2 -0
- package/dataflow/environments/removal-marker.js +5 -0
- package/dataflow/eval/resolve/resolve-strings.d.ts +2 -5
- package/dataflow/eval/resolve/resolve-strings.js +2 -2
- package/dataflow/extractor.js +24 -15
- package/dataflow/fn/condition-handlers.d.ts +2 -0
- package/dataflow/fn/condition-handlers.js +3 -1
- package/dataflow/fn/frame-reflection.d.ts +4 -2
- package/dataflow/fn/frame-reflection.js +16 -0
- package/dataflow/fn/function-props.js +15 -22
- package/dataflow/fn/function-semantics.d.ts +31 -1
- package/dataflow/fn/function-semantics.js +15 -0
- package/dataflow/fn/guards/built-in-guards.d.ts +112 -0
- package/dataflow/fn/guards/built-in-guards.js +199 -0
- package/dataflow/fn/guards/call-contracts.d.ts +97 -0
- package/dataflow/fn/guards/call-contracts.js +331 -0
- package/dataflow/fn/guards/condition-grouping.d.ts +20 -0
- package/dataflow/fn/guards/condition-grouping.js +135 -0
- package/dataflow/fn/guards/function-guards.d.ts +112 -0
- package/dataflow/fn/guards/function-guards.js +1549 -0
- package/dataflow/fn/guards/group-method-guards.d.ts +28 -0
- package/dataflow/fn/guards/group-method-guards.js +56 -0
- package/dataflow/fn/guards/guard-claims.d.ts +125 -0
- package/dataflow/fn/guards/guard-claims.js +678 -0
- package/dataflow/fn/guards/guard-knowledge.d.ts +41 -0
- package/dataflow/fn/guards/guard-knowledge.js +180 -0
- package/dataflow/fn/guards/guard-term-syntax.d.ts +9 -0
- package/dataflow/fn/guards/guard-term-syntax.js +210 -0
- package/dataflow/fn/guards/guard-term.d.ts +136 -0
- package/dataflow/fn/guards/guard-term.js +550 -0
- package/dataflow/fn/guards/stated-guards.d.ts +13 -0
- package/dataflow/fn/guards/stated-guards.js +35 -0
- package/dataflow/fn/higher-order-function.d.ts +2 -0
- package/dataflow/fn/higher-order-function.js +1 -0
- package/dataflow/fn/strict-function.d.ts +4 -0
- package/dataflow/fn/strict-function.js +66 -17
- package/dataflow/graph/ambient-access.d.ts +4 -1
- package/dataflow/graph/ambient-access.js +8 -2
- package/dataflow/graph/closure-frames.js +1 -1
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/df-helper.d.ts +6 -0
- package/dataflow/graph/df-helper.js +15 -0
- package/dataflow/graph/graph.d.ts +12 -6
- package/dataflow/graph/graph.js +21 -28
- package/dataflow/info.d.ts +2 -1
- package/dataflow/info.js +3 -1
- package/dataflow/internal/dispatch-linking.d.ts +3 -1
- package/dataflow/internal/dispatch-linking.js +1 -0
- package/dataflow/internal/linker.d.ts +2 -0
- package/dataflow/internal/linker.js +115 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +19 -57
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +471 -295
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +13 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +106 -19
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +24 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.js +33 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +23 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +19 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +347 -46
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +110 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +9 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +28 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +16 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +37 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +19 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +55 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +11 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +8 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +64 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +160 -20
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +6 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +142 -4
- package/dataflow/internal/process/functions/call/quoted.d.ts +2 -0
- package/dataflow/internal/process/functions/call/quoted.js +23 -4
- package/dataflow/processor.d.ts +2 -0
- package/documentation/data/dfg/doc-ambient.d.ts +4 -0
- package/documentation/data/dfg/doc-ambient.js +74 -0
- package/documentation/wiki-dataflow-graph.js +10 -4
- package/documentation/wiki-linter.js +12 -0
- package/documentation/wiki-query.js +112 -1
- package/linter/linter-rules.d.ts +41 -1
- package/linter/linter-rules.js +5 -1
- package/linter/rules/call-contracts.d.ts +40 -0
- package/linter/rules/call-contracts.js +56 -0
- package/linter/rules/cmd-check/bogus-return.js +1 -1
- package/linter/rules/cmd-check/call-arguments.js +5 -6
- package/linter/rules/cmd-check/cmd-check-util.d.ts +0 -6
- package/linter/rules/cmd-check/cmd-check-util.js +0 -28
- package/linter/rules/cmd-check/package-hooks.js +2 -1
- package/linter/rules/cmd-check/s-three-method-consistency.js +1 -1
- package/linter/rules/interactive-functions.d.ts +30 -0
- package/linter/rules/interactive-functions.js +87 -0
- package/linter/rules/process-state-in-session.js +1 -1
- package/linter/rules/undefined-symbol-util.d.ts +1 -1
- package/linter/rules/undefined-symbol-util.js +8 -2
- package/linter/rules/undefined-symbol.js +18 -7
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +1 -1
- package/project/context/flowr-analyzer-dependencies-context.js +2 -1
- package/project/flowr-analyzer.d.ts +1 -0
- package/project/flowr-analyzer.js +5 -5
- package/project/sigdb/build.js +14 -4
- package/project/sigdb/decode.d.ts +3 -0
- package/project/sigdb/decode.js +10 -1
- package/project/sigdb/guarded-source.d.ts +6 -0
- package/project/sigdb/guarded-source.js +29 -0
- package/project/sigdb/reader.d.ts +5 -0
- package/project/sigdb/reader.js +27 -1
- package/project/sigdb/schema.d.ts +24 -2
- package/queries/catalog/absint-query/absint-query-format.d.ts +6 -3
- package/queries/catalog/absint-query/absint-query-format.js +57 -2
- package/queries/catalog/ambient-access-query/ambient-access-query-format.d.ts +6 -2
- package/queries/catalog/ambient-access-query/ambient-access-query-format.js +48 -3
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +5 -2
- package/queries/catalog/cluster-query/cluster-query-format.js +19 -2
- package/queries/catalog/code-clones-query/code-clones-query-format.d.ts +5 -2
- package/queries/catalog/code-clones-query/code-clones-query-format.js +34 -2
- package/queries/catalog/config-query/config-query-format.d.ts +5 -2
- package/queries/catalog/config-query/config-query-format.js +41 -2
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +5 -2
- package/queries/catalog/control-flow-query/control-flow-query-format.js +19 -2
- package/queries/catalog/data-columns-query/data-columns-query-format.d.ts +72 -0
- package/queries/catalog/data-columns-query/data-columns-query-format.js +215 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +5 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +38 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +5 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.js +18 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +8 -3
- package/queries/catalog/dependencies-query/function-info/other-path-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/tagged-functions.d.ts +11 -0
- package/queries/catalog/dependencies-query/function-info/tagged-functions.js +18 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +7 -2
- package/queries/catalog/dice-query/dice-query-format.js +34 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -4
- package/queries/catalog/does-call-query/does-call-query-format.js +114 -2
- package/queries/catalog/files-query/files-query-format.d.ts +5 -2
- package/queries/catalog/files-query/files-query-format.js +45 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +6 -3
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +303 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +8 -4
- package/queries/catalog/happens-before-query/happens-before-query-format.js +37 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +5 -2
- package/queries/catalog/id-map-query/id-map-query-format.js +18 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +5 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +29 -2
- package/queries/catalog/inspect-fn-guards-query/inspect-fn-guards-query-format.d.ts +37 -0
- package/queries/catalog/inspect-fn-guards-query/inspect-fn-guards-query-format.js +125 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +3 -2
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +54 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +6 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +23 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +6 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +15 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +8 -2
- package/queries/catalog/linter-query/linter-query-format.js +69 -4
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +7 -3
- package/queries/catalog/location-map-query/location-map-query-format.js +70 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +5 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +18 -2
- package/queries/catalog/origin-query/origin-query-format.d.ts +6 -3
- package/queries/catalog/origin-query/origin-query-format.js +29 -2
- package/queries/catalog/project-query/project-query-format.d.ts +6 -3
- package/queries/catalog/project-query/project-query-format.js +98 -2
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +6 -3
- package/queries/catalog/provenance-query/provenance-query-format.js +30 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +9 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +38 -2
- package/queries/catalog/search-query/search-query-format.d.ts +5 -2
- package/queries/catalog/search-query/search-query-format.js +23 -2
- package/queries/catalog/signature-query/signature-query-executor.js +3 -1
- package/queries/catalog/signature-query/signature-query-format.d.ts +3 -0
- package/queries/catalog/signature-query/signature-query-render.js +23 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +13 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +55 -2
- package/queries/catalog/taint-query/taint-query-format.d.ts +6 -3
- package/queries/catalog/taint-query/taint-query-format.js +28 -2
- package/queries/query.d.ts +48 -27
- package/queries/query.js +6 -4
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -0
- package/r-bridge/shell.js +7 -2
- package/reconstruct/reconstruct.js +18 -3
- package/slicing/static/removal-slice.js +4 -3
- package/slicing/static/slice-call.d.ts +11 -0
- package/slicing/static/slice-call.js +43 -2
- package/slicing/static/static-slicer.d.ts +2 -0
- package/slicing/static/static-slicer.js +137 -21
- package/slicing/static/visiting-queue.d.ts +2 -0
- package/slicing/static/visiting-queue.js +4 -0
- package/util/flowr-version.d.ts +1 -1
- package/util/flowr-version.js +2 -2
- package/util/objects.d.ts +2 -0
- package/util/objects.js +5 -0
- package/util/r-datasets.d.ts +27 -0
- package/util/r-datasets.js +45 -0
- package/util/text/playground-link.d.ts +2 -0
- package/util/text/playground-link.js +2 -0
- package/queries/catalog/absint-query/absint-query-executor.d.ts +0 -6
- package/queries/catalog/absint-query/absint-query-executor.js +0 -61
- package/queries/catalog/ambient-access-query/ambient-access-query-executor.d.ts +0 -6
- package/queries/catalog/ambient-access-query/ambient-access-query-executor.js +0 -50
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +0 -6
- package/queries/catalog/cluster-query/cluster-query-executor.js +0 -21
- package/queries/catalog/code-clones-query/code-clones-query-executor.d.ts +0 -6
- package/queries/catalog/code-clones-query/code-clones-query-executor.js +0 -38
- package/queries/catalog/config-query/config-query-executor.d.ts +0 -6
- package/queries/catalog/config-query/config-query-executor.js +0 -45
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +0 -6
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +0 -21
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +0 -6
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +0 -40
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +0 -6
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +0 -20
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +0 -9
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +0 -18
- package/queries/catalog/dice-query/dice-query-executor.d.ts +0 -8
- package/queries/catalog/dice-query/dice-query-executor.js +0 -37
- package/queries/catalog/does-call-query/does-call-query-executor.d.ts +0 -6
- package/queries/catalog/does-call-query/does-call-query-executor.js +0 -116
- package/queries/catalog/files-query/files-query-executor.d.ts +0 -6
- package/queries/catalog/files-query/files-query-executor.js +0 -47
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +0 -6
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +0 -307
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +0 -7
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +0 -40
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +0 -6
- package/queries/catalog/id-map-query/id-map-query-executor.js +0 -20
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +0 -6
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +0 -31
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +0 -4
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +0 -58
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +0 -7
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +0 -25
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.d.ts +0 -7
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +0 -17
- package/queries/catalog/linter-query/linter-query-executor.d.ts +0 -9
- package/queries/catalog/linter-query/linter-query-executor.js +0 -62
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +0 -7
- package/queries/catalog/location-map-query/location-map-query-executor.js +0 -73
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +0 -6
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +0 -20
- package/queries/catalog/origin-query/origin-query-executor.d.ts +0 -6
- package/queries/catalog/origin-query/origin-query-executor.js +0 -31
- package/queries/catalog/project-query/project-query-executor.d.ts +0 -6
- package/queries/catalog/project-query/project-query-executor.js +0 -103
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +0 -6
- package/queries/catalog/provenance-query/provenance-query-executor.js +0 -33
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +0 -10
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +0 -40
- package/queries/catalog/search-query/search-query-executor.d.ts +0 -6
- package/queries/catalog/search-query/search-query-executor.js +0 -25
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +0 -14
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +0 -59
- package/queries/catalog/taint-query/taint-query-executor.d.ts +0 -7
- package/queries/catalog/taint-query/taint-query-executor.js +0 -30
|
@@ -10,6 +10,8 @@ const identifier_1 = require("../environments/identifier");
|
|
|
10
10
|
const info_1 = require("../info");
|
|
11
11
|
const strict_function_1 = require("./strict-function");
|
|
12
12
|
const argument_roles_1 = require("./argument-roles");
|
|
13
|
+
const frame_reflection_1 = require("./frame-reflection");
|
|
14
|
+
const function_guards_1 = require("./guards/function-guards");
|
|
13
15
|
const logic_1 = require("../../util/logic");
|
|
14
16
|
const df_helper_1 = require("../graph/df-helper");
|
|
15
17
|
const fixpoint_1 = require("../../util/fixpoint");
|
|
@@ -19,13 +21,11 @@ const fixpoint_1 = require("../../util/fixpoint");
|
|
|
19
21
|
*/
|
|
20
22
|
function inferFunctions(definitions, graph, options = {}) {
|
|
21
23
|
const { ctx, only } = options;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
});
|
|
24
|
+
const strict = (0, strict_function_1.strictnessOfEach)(definitions, graph, { ctx });
|
|
25
|
+
return {
|
|
26
|
+
props: only === 'arguments' ? {} : callProps(definitions, { graph, info: (0, query_fn_props_1.builtInLookup)(ctx) }, strict),
|
|
27
|
+
roles: only === 'function' ? {} : rolesOfDefinitions(definitions, graph, strict, options)
|
|
28
|
+
};
|
|
29
29
|
}
|
|
30
30
|
/** The {@link CallProp} mask of each definition, `Strict` included and what its callees carry mixed in. */
|
|
31
31
|
function callProps(definitions, state, strict) {
|
|
@@ -52,6 +52,13 @@ function sameProps(a, b) {
|
|
|
52
52
|
/** The {@link ArgProp} mask of each formal, `Forced`/`Lazy` included. */
|
|
53
53
|
function rolesOfDefinitions(definitions, graph, strict, options) {
|
|
54
54
|
const all = { ...(0, argument_roles_1.argumentRolesOfFunctions)(definitions, graph, options) };
|
|
55
|
+
for (const [id, bits] of Object.entries((0, function_guards_1.guardRoles)(definitions, graph, options))) {
|
|
56
|
+
const roles = { ...all[id] };
|
|
57
|
+
for (const [formal, bit] of Object.entries(bits)) {
|
|
58
|
+
roles[formal] = (roles[formal] ?? 0) | bit;
|
|
59
|
+
}
|
|
60
|
+
all[id] = roles;
|
|
61
|
+
}
|
|
55
62
|
for (const [id, { parameters }] of Object.entries(strict)) {
|
|
56
63
|
const roles = { ...all[id] };
|
|
57
64
|
for (const [formal, forced] of Object.entries(parameters)) {
|
|
@@ -78,7 +85,7 @@ function propsOf(id, state) {
|
|
|
78
85
|
const info = state.info(vertex.name);
|
|
79
86
|
const carried = filter(info, built_in_props_1.PropagatedProps);
|
|
80
87
|
stated = join(stated, {
|
|
81
|
-
props: (carried.props ?? 0) & (bindsOutside(vertex, info) ? ~0 : ~built_in_props_1.CallProp.Scope),
|
|
88
|
+
props: (carried.props ?? 0) & ((0, frame_reflection_1.bindsOutside)(vertex, info) ? ~0 : ~built_in_props_1.CallProp.Scope),
|
|
82
89
|
tags: carried.tags
|
|
83
90
|
});
|
|
84
91
|
if (built_in_props_1.DispatchCallees.has(identifier_1.Identifier.getName(vertex.name))) {
|
|
@@ -91,20 +98,6 @@ function propsOf(id, state) {
|
|
|
91
98
|
}
|
|
92
99
|
return { stated, callees };
|
|
93
100
|
}
|
|
94
|
-
/** the assignments binding in the frame they run in, which is a scope of the function's own */
|
|
95
|
-
const FrameLocalBinders = new Set(['<-', '=', '->', ':=', 'assign']);
|
|
96
|
-
/** Whether the name is a replacement function binding in its own frame (`names(x) <- v`); the `<<-` twin does not. */
|
|
97
|
-
function isFrameLocalReplacement(name) {
|
|
98
|
-
return name.endsWith('<-') && !name.endsWith('<<-');
|
|
99
|
-
}
|
|
100
|
-
/** Whether the call binds a name beyond its own frame ({@link CallProp.Scope}): `y <<- 1`, `library(x)`, `assign` to an env do; `y <- 1` does not. */
|
|
101
|
-
function bindsOutside(vertex, info) {
|
|
102
|
-
const name = identifier_1.Identifier.getName(vertex.name);
|
|
103
|
-
if (!FrameLocalBinders.has(name) && !isFrameLocalReplacement(name)) {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
return info?.sig !== undefined && built_in_props_1.FnSig.posWith(built_in_props_1.FnSig.layout(info.sig), vertex.args.length, built_in_props_1.ArgProp.Written).length > 0;
|
|
107
|
-
}
|
|
108
101
|
/** Whether every unconditional exit ends in a call returning invisibly; a bare value result (`function() 1`) never does. */
|
|
109
102
|
function exitsInvisibly(definition, state) {
|
|
110
103
|
const unconditional = definition.exitPoints.filter(e => (0, info_1.happensInEveryBranch)(e.cds)).map(e => e.nodeId);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { inferFunctions } from './function-props';
|
|
2
2
|
import { exceptionsOfFunction } from './exceptions-of-function';
|
|
3
|
-
import { promiseDependencies, promiseForcing, settleDefinitionsInPromises, settleJumpsInPromises, strictnessOfEach } from './strict-function';
|
|
3
|
+
import { promiseDependencies, promiseForcing, promiseForcingPoints, promiseRaises, 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';
|
|
7
|
+
import { guardsOfFunctions, summarizeClauses } from './guards/function-guards';
|
|
8
|
+
import { builtInGuards } from './guards/built-in-guards';
|
|
7
9
|
import { argForImpl, classDeclarationOfImpl, declaredClassesImpl, superClassesOfImpl, toSigClassesImpl } from './class-declaration';
|
|
8
10
|
import { ArgProps, CallProps, FnSig } from '../environments/built-in-props';
|
|
9
11
|
import type { DataflowGraphVertexInfo } from '../graph/vertex';
|
|
@@ -25,12 +27,39 @@ export declare const FunctionSemantics: {
|
|
|
25
27
|
readonly settleDefinitionsInPromises: typeof settleDefinitionsInPromises;
|
|
26
28
|
/** What a node within promises depends on for running at all. */
|
|
27
29
|
readonly promiseDependencies: typeof promiseDependencies;
|
|
30
|
+
/** Where a promise bound to a variable may be forced. */
|
|
31
|
+
readonly promiseForcingPoints: typeof promiseForcingPoints;
|
|
28
32
|
/** How surely the holder of a promise forces it. */
|
|
29
33
|
readonly promiseForcing: typeof promiseForcing;
|
|
34
|
+
/** Whether an error within a promise surely leaves its holder. */
|
|
35
|
+
readonly promiseRaises: typeof promiseRaises;
|
|
30
36
|
/** Whether one definition is higher-order, i.e. whether it calls what it is handed. */
|
|
31
37
|
readonly isHigherOrder: typeof isHigherOrder;
|
|
32
38
|
/** The roles of several definitions' formals, sharing the built-in lookups. */
|
|
33
39
|
readonly argumentRoles: typeof argumentRolesOfFunctions;
|
|
40
|
+
/** What several definitions ask of the calls they return from. */
|
|
41
|
+
readonly guards: typeof guardsOfFunctions;
|
|
42
|
+
/** The conditions of some clauses of a definition in R syntax. */
|
|
43
|
+
readonly guardSummary: typeof summarizeClauses;
|
|
44
|
+
/** What a function of the base packages asks for, what the signature database answers as {@link DecodedFunction.guards} as well. */
|
|
45
|
+
readonly builtInGuards: typeof builtInGuards;
|
|
46
|
+
/** What a function asks of its calls by name, definition, or call, and what a call breaks of it, see {@link CallContracts}. */
|
|
47
|
+
readonly contracts: {
|
|
48
|
+
readonly name: "CallContracts";
|
|
49
|
+
readonly of: (this: void, graph: import("../..").DataflowGraph, ctx: import("../../project/context/flowr-analyzer-context").ReadOnlyFlowrAnalyzerContext, idMap?: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").AstIdMap) => import("./guards/call-contracts").ContractScope;
|
|
50
|
+
readonly statedOf: (this: void, name: import("../..").Identifier, ctx?: import("../../project/context/flowr-analyzer-context").ReadOnlyFlowrAnalyzerContext) => import("./guards/built-in-guards").StatedGuards | undefined;
|
|
51
|
+
readonly ofFunction: (this: void, name: import("../..").Identifier, scope: import("./guards/call-contracts").ContractScope) => import("./guards/call-contracts").FunctionContract | undefined;
|
|
52
|
+
readonly ofDefinition: (this: void, definition: import("../..").NodeId, scope: import("./guards/call-contracts").ContractScope) => import("./guards/call-contracts").FunctionContract | undefined;
|
|
53
|
+
readonly ofCall: (this: void, call: import("../..").NodeId, scope: import("./guards/call-contracts").ContractScope) => import("./guards/call-contracts").FunctionContract | undefined;
|
|
54
|
+
readonly stated: (this: void, contract: import("./guards/call-contracts").FunctionContract, idMap: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").AstIdMap) => import("./guards/built-in-guards").StatedGuards | undefined;
|
|
55
|
+
readonly breaches: (this: void, call: import("../..").NodeId, contract: import("./guards/call-contracts").FunctionContract, scope: import("./guards/call-contracts").ContractScope) => import("./guards/call-contracts").ContractBreach[];
|
|
56
|
+
readonly check: (this: void, call: import("../..").NodeId, scope: import("./guards/call-contracts").ContractScope) => {
|
|
57
|
+
readonly contract: import("./guards/call-contracts").FunctionContract;
|
|
58
|
+
readonly breaches: readonly import("./guards/call-contracts").ContractBreach[];
|
|
59
|
+
} | undefined;
|
|
60
|
+
readonly describe: (this: void, breach: import("./guards/call-contracts").ContractBreach) => string;
|
|
61
|
+
readonly FormalsRewriters: ReadonlySet<import("../environments/identifier").BrandedIdentifier>;
|
|
62
|
+
};
|
|
34
63
|
/** The reflective argument bits of one definition. */
|
|
35
64
|
readonly frameReflection: typeof reflectiveRolesOf;
|
|
36
65
|
/** 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. */
|
|
@@ -96,6 +125,7 @@ export declare const FunctionSemantics: {
|
|
|
96
125
|
readonly capturedBy: (this: void, graph: import("../..").DataflowGraph, id: import("../..").NodeId) => readonly import("../..").NodeId[];
|
|
97
126
|
readonly sourcesOf: (this: void, graph: import("../..").DataflowGraph, id: import("../..").NodeId) => readonly import("../internal/process/functions/call/quoted").CapturedExpression[];
|
|
98
127
|
readonly evaluationDependencies: (this: void, graph: import("../..").DataflowGraph, id: import("../..").NodeId) => import("../..").NodeId[];
|
|
128
|
+
readonly promisedBinding: (this: void, graph: import("../..").DataflowGraph, id: import("../..").NodeId) => import("../..").NodeId | undefined;
|
|
99
129
|
readonly evaluateIn: typeof import("../internal/linker").linkExpressionIn;
|
|
100
130
|
readonly finalize: <Info>(this: void, graph: import("../..").DataflowGraph, environment: import("../environments/environment").REnvironmentInformation, idMap: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").AstIdMap<Info & import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>, controlFlow: () => import("../../control-flow/control-flow-graph").ControlFlowGraph | undefined) => void;
|
|
101
131
|
};
|
|
@@ -7,6 +7,9 @@ const strict_function_1 = require("./strict-function");
|
|
|
7
7
|
const higher_order_function_1 = require("./higher-order-function");
|
|
8
8
|
const argument_roles_1 = require("./argument-roles");
|
|
9
9
|
const frame_reflection_1 = require("./frame-reflection");
|
|
10
|
+
const function_guards_1 = require("./guards/function-guards");
|
|
11
|
+
const built_in_guards_1 = require("./guards/built-in-guards");
|
|
12
|
+
const call_contracts_1 = require("./guards/call-contracts");
|
|
10
13
|
const class_declaration_1 = require("./class-declaration");
|
|
11
14
|
const vertex_1 = require("../graph/vertex");
|
|
12
15
|
const built_in_props_1 = require("../environments/built-in-props");
|
|
@@ -33,12 +36,24 @@ exports.FunctionSemantics = {
|
|
|
33
36
|
settleDefinitionsInPromises: strict_function_1.settleDefinitionsInPromises,
|
|
34
37
|
/** What a node within promises depends on for running at all. */
|
|
35
38
|
promiseDependencies: strict_function_1.promiseDependencies,
|
|
39
|
+
/** Where a promise bound to a variable may be forced. */
|
|
40
|
+
promiseForcingPoints: strict_function_1.promiseForcingPoints,
|
|
36
41
|
/** How surely the holder of a promise forces it. */
|
|
37
42
|
promiseForcing: strict_function_1.promiseForcing,
|
|
43
|
+
/** Whether an error within a promise surely leaves its holder. */
|
|
44
|
+
promiseRaises: strict_function_1.promiseRaises,
|
|
38
45
|
/** Whether one definition is higher-order, i.e. whether it calls what it is handed. */
|
|
39
46
|
isHigherOrder: higher_order_function_1.isHigherOrder,
|
|
40
47
|
/** The roles of several definitions' formals, sharing the built-in lookups. */
|
|
41
48
|
argumentRoles: argument_roles_1.argumentRolesOfFunctions,
|
|
49
|
+
/** What several definitions ask of the calls they return from. */
|
|
50
|
+
guards: function_guards_1.guardsOfFunctions,
|
|
51
|
+
/** The conditions of some clauses of a definition in R syntax. */
|
|
52
|
+
guardSummary: function_guards_1.summarizeClauses,
|
|
53
|
+
/** What a function of the base packages asks for, what the signature database answers as {@link DecodedFunction.guards} as well. */
|
|
54
|
+
builtInGuards: built_in_guards_1.builtInGuards,
|
|
55
|
+
/** What a function asks of its calls by name, definition, or call, and what a call breaks of it, see {@link CallContracts}. */
|
|
56
|
+
contracts: call_contracts_1.CallContracts,
|
|
42
57
|
/** The reflective argument bits of one definition. */
|
|
43
58
|
frameReflection: frame_reflection_1.reflectiveRolesOf,
|
|
44
59
|
/** 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. */
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { BrandedIdentifier, BrandedNamespace } from '../../environments/identifier';
|
|
2
|
+
import { type FunctionGuards, type GuardClause } from './function-guards';
|
|
3
|
+
import type { AstIdMap } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
+
import { type FormalClaim } from './guard-claims';
|
|
5
|
+
import type { GuardFactsLookup } from '../../environments/guard-facts';
|
|
6
|
+
import { GuardTerm } from './guard-term';
|
|
7
|
+
import type { Column } from '../../../util/range';
|
|
8
|
+
/**
|
|
9
|
+
* Where a {@link StatedGuards} comes from: read off the closure of a function (by `scripts/gen-base-guards.ts` into the base table, or when the signature
|
|
10
|
+
* database was built), or stated by flowR for a function written in C. Another version of R may check less or more.
|
|
11
|
+
*/
|
|
12
|
+
export interface GuardOrigin {
|
|
13
|
+
readonly source: 'base-table' | 'sigdb' | 'builtin';
|
|
14
|
+
/** the R version the closure was read off, or for `builtin` the one the stated facts are taken for */
|
|
15
|
+
readonly r: string;
|
|
16
|
+
/** when it was read off, as an ISO date, absent if unknown */
|
|
17
|
+
readonly date?: string;
|
|
18
|
+
/** the package the function is of, and its version */
|
|
19
|
+
readonly pkg?: BrandedNamespace;
|
|
20
|
+
readonly version?: string;
|
|
21
|
+
}
|
|
22
|
+
/** What is known about a function without a program to read it from: {@link FunctionGuards} without the clauses, which point at code. */
|
|
23
|
+
export interface StatedGuards extends Pick<FunctionGuards, 'requires'>, Partial<Pick<FunctionGuards, 'relations' | 'conditional' | 'returns' | 'passes'>> {
|
|
24
|
+
/** see {@link FunctionGuards.required} */
|
|
25
|
+
readonly required?: readonly BrandedIdentifier[];
|
|
26
|
+
/** see {@link FunctionGuards.formals} */
|
|
27
|
+
readonly formals?: Readonly<Record<BrandedIdentifier, FormalClaim>>;
|
|
28
|
+
/** where they come from and which R they hold for, see {@link GuardOrigin} */
|
|
29
|
+
readonly origin?: GuardOrigin;
|
|
30
|
+
/** why each part of {@link StatedGuards.requires} is in effect */
|
|
31
|
+
readonly because?: readonly GuardReason[];
|
|
32
|
+
/** the S3 generic it is a method of, written `pkg::name`, and the class it is the method for */
|
|
33
|
+
readonly methodOf?: {
|
|
34
|
+
readonly generic: string;
|
|
35
|
+
readonly class: string;
|
|
36
|
+
};
|
|
37
|
+
/** for an S3 generic, the formal it dispatches on */
|
|
38
|
+
readonly dispatches?: BrandedIdentifier;
|
|
39
|
+
/** for an S3 generic, its methods, each written `pkg::name` */
|
|
40
|
+
readonly methods?: readonly string[];
|
|
41
|
+
/** every function the conditions call, written `pkg::name` where the package is known, the base packages R attaches on startup included, which the conditions leave out */
|
|
42
|
+
readonly calls?: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
/** The functions the terms call, see {@link StatedGuards.calls}. */
|
|
45
|
+
export declare function callsOfTerms(this: void, terms: readonly GuardTerm[]): string[];
|
|
46
|
+
/** Why a condition is in effect: the code that fails if it does not hold, see {@link GuardClause}. */
|
|
47
|
+
export interface GuardReason {
|
|
48
|
+
/** the condition in R syntax */
|
|
49
|
+
readonly requires: string;
|
|
50
|
+
/** see {@link GuardClause.kind} */
|
|
51
|
+
readonly kind: GuardClause['kind'];
|
|
52
|
+
/** the code that fails, as it is written */
|
|
53
|
+
readonly fails: string;
|
|
54
|
+
/** the same, shortened to what a reader needs next to the message: `stop(...)` for a call raising it, or the `if (cond) ...` whose condition R rejects */
|
|
55
|
+
readonly brief?: string;
|
|
56
|
+
/** the condition in words, where it uses notation of flowR's own, see {@link readingOf} */
|
|
57
|
+
readonly reads?: string;
|
|
58
|
+
/** the formals the condition speaks of */
|
|
59
|
+
readonly formals?: readonly BrandedIdentifier[];
|
|
60
|
+
/** the calls the condition is inherited through, outermost first, by the function they call, written `pkg::name` where the package is known */
|
|
61
|
+
readonly via?: readonly string[];
|
|
62
|
+
/** see {@link GuardClause.message} */
|
|
63
|
+
readonly message?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Where the failing code is: the function it is written in (`pkg::name` where the package is known, a helper for a condition inherited
|
|
66
|
+
* through {@link GuardReason.via}) and its line and column counted from the line that function's definition starts on, in the code
|
|
67
|
+
* analyzed. For the base table that is the closure as R prints it, since base R keeps no source references.
|
|
68
|
+
*/
|
|
69
|
+
readonly loc?: {
|
|
70
|
+
readonly fn: string;
|
|
71
|
+
readonly line: number;
|
|
72
|
+
readonly column: Column;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The {@link GuardReason} of each of the clauses, reading the code they point at from `idMap`.
|
|
77
|
+
* @param ownerOf - the package defining a function of the program, to qualify {@link GuardReason.via} with
|
|
78
|
+
*/
|
|
79
|
+
export declare function reasonsOf(this: void, clauses: readonly GuardClause[], idMap: AstIdMap, ownerOf?: (name: string) => string | undefined): GuardReason[];
|
|
80
|
+
/**
|
|
81
|
+
* {@link StatedGuards} as the table of the base packages stores them, kept small: `requires` is left out where it is the
|
|
82
|
+
* conjunction of the reasons, see {@link joinedReasons}, and a location is `line:column`, prefixed by `pkg::name:` for one in another function.
|
|
83
|
+
*/
|
|
84
|
+
export type StoredGuards = Omit<StatedGuards, 'requires' | 'because'> & {
|
|
85
|
+
readonly requires?: string;
|
|
86
|
+
readonly because?: readonly (Omit<GuardReason, 'loc'> & {
|
|
87
|
+
readonly loc?: string;
|
|
88
|
+
})[];
|
|
89
|
+
};
|
|
90
|
+
/** {@link StoredGuards} per package and name. */
|
|
91
|
+
export type BaseGuards = Readonly<Record<string, Readonly<Record<string, StoredGuards>>>>;
|
|
92
|
+
/** The {@link StoredGuards} of `guards`, those of the function `self` (`pkg::name`). */
|
|
93
|
+
export declare function storedGuardsOf(this: void, guards: StatedGuards, self: string): StoredGuards;
|
|
94
|
+
/** The {@link StatedGuards} that {@link storedGuardsOf} stored. */
|
|
95
|
+
export declare function statedGuardsOfStored(this: void, stored: StoredGuards, self: string): StatedGuards;
|
|
96
|
+
/** One condition R checks for a function written in C, on the formal it is about, with what R says if it does not hold. */
|
|
97
|
+
export interface BuiltInClause {
|
|
98
|
+
readonly formal: BrandedIdentifier;
|
|
99
|
+
readonly requires: GuardTerm;
|
|
100
|
+
readonly message: string;
|
|
101
|
+
}
|
|
102
|
+
/** What R fails on for a function written in C, as the built-in definitions `facts` state it, `undefined` if they state nothing. */
|
|
103
|
+
export declare function builtInClauses(this: void, name: BrandedIdentifier, facts: GuardFactsLookup): BuiltInClause[] | undefined;
|
|
104
|
+
/** Everything with stated guards, as `[package, name]`. */
|
|
105
|
+
export declare function namesWithGuards(this: void): [pkg: BrandedNamespace, name: BrandedIdentifier][];
|
|
106
|
+
/**
|
|
107
|
+
* What a function of the base packages asks of the calls returning from it: what its closure checks, and else what is known of it being written in C.
|
|
108
|
+
* Like any guard this says nothing of the defaults of its formals: `n = 5L` does not make `n` an integer.
|
|
109
|
+
* @param name - the function
|
|
110
|
+
* @param pkg - the package providing it, by default the one R finds the name in
|
|
111
|
+
*/
|
|
112
|
+
export declare function builtInGuards(this: void, name: BrandedIdentifier, pkg?: BrandedNamespace | undefined): StatedGuards | undefined;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callsOfTerms = callsOfTerms;
|
|
4
|
+
exports.reasonsOf = reasonsOf;
|
|
5
|
+
exports.storedGuardsOf = storedGuardsOf;
|
|
6
|
+
exports.statedGuardsOfStored = statedGuardsOfStored;
|
|
7
|
+
exports.builtInClauses = builtInClauses;
|
|
8
|
+
exports.namesWithGuards = namesWithGuards;
|
|
9
|
+
exports.builtInGuards = builtInGuards;
|
|
10
|
+
const objects_1 = require("../../../util/objects");
|
|
11
|
+
const identifier_1 = require("../../environments/identifier");
|
|
12
|
+
const r_base_packages_1 = require("../../../util/r-base-packages");
|
|
13
|
+
const function_guards_1 = require("./function-guards");
|
|
14
|
+
const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
|
|
15
|
+
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
16
|
+
const r_if_then_else_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-if-then-else");
|
|
17
|
+
const r_while_loop_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-while-loop");
|
|
18
|
+
const r_function_definition_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
19
|
+
const r_binary_op_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-binary-op");
|
|
20
|
+
const guard_claims_1 = require("./guard-claims");
|
|
21
|
+
const guard_knowledge_1 = require("./guard-knowledge");
|
|
22
|
+
const guards_1 = require("../../environments/default-builtin-config/guards");
|
|
23
|
+
const r_base_guards_generated_1 = require("../../../data/r-base-guards.generated");
|
|
24
|
+
const guard_term_1 = require("./guard-term");
|
|
25
|
+
const guard_term_syntax_1 = require("./guard-term-syntax");
|
|
26
|
+
const group_method_guards_1 = require("./group-method-guards");
|
|
27
|
+
const group_generics_1 = require("../../environments/group-generics");
|
|
28
|
+
const arrays_1 = require("../../../util/collections/arrays");
|
|
29
|
+
/** The functions the terms call, see {@link StatedGuards.calls}. */
|
|
30
|
+
function callsOfTerms(terms) {
|
|
31
|
+
return (0, arrays_1.uniqueArray)(terms.flatMap(term => guard_term_1.GuardTerm.callsOf(term).map(id => identifier_1.Identifier.toString(id))));
|
|
32
|
+
}
|
|
33
|
+
/** {@link GuardReason.loc} of `node`, by the outermost function definition around it and the name it is assigned to. */
|
|
34
|
+
function locationOf(node, idMap, qualified) {
|
|
35
|
+
let definition;
|
|
36
|
+
for (let at = node; at !== undefined; at = model_1.RNode.directParent(at, idMap)) {
|
|
37
|
+
definition = r_function_definition_1.RFunctionDefinition.is(at) ? at : definition;
|
|
38
|
+
}
|
|
39
|
+
const assigned = definition === undefined ? undefined : model_1.RNode.directParent(definition, idMap);
|
|
40
|
+
const name = assigned !== undefined && r_binary_op_1.RBinaryOp.is(assigned) ? assigned.lhs.lexeme?.replaceAll('`', '') : undefined;
|
|
41
|
+
if (node?.location === undefined || definition?.location === undefined || name === undefined) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return { fn: qualified(name), line: node.location[0] - definition.location[0] + 1, column: node.location[1] };
|
|
45
|
+
}
|
|
46
|
+
const MaxReasonLength = 160;
|
|
47
|
+
function written(node) {
|
|
48
|
+
const text = model_1.RNode.lexeme(node)?.split('\n')[0] ?? '';
|
|
49
|
+
return text.length > MaxReasonLength ? `${text.slice(0, MaxReasonLength)}...` : text;
|
|
50
|
+
}
|
|
51
|
+
/** The failing code shortened, see {@link GuardReason.brief}. */
|
|
52
|
+
function briefOf(node, message, idMap) {
|
|
53
|
+
if (node === undefined) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
else if (r_function_call_1.RFunctionCall.isNamed(node) && message !== undefined && (0, function_guards_1.messageOf)(node) === message) {
|
|
57
|
+
return `${model_1.RNode.ownLexeme(node) ?? ''}(...)`;
|
|
58
|
+
}
|
|
59
|
+
const parent = model_1.RNode.directParent(node, idMap);
|
|
60
|
+
return (r_if_then_else_1.RIfThenElse.is(parent) || r_while_loop_1.RWhileLoop.is(parent)) && parent.condition === node ? `${r_if_then_else_1.RIfThenElse.is(parent) ? 'if' : 'while'} (${written(node)}) ...` : undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The {@link GuardReason} of each of the clauses, reading the code they point at from `idMap`.
|
|
64
|
+
* @param ownerOf - the package defining a function of the program, to qualify {@link GuardReason.via} with
|
|
65
|
+
*/
|
|
66
|
+
function reasonsOf(clauses, idMap, ownerOf = () => undefined) {
|
|
67
|
+
const qualified = (name) => {
|
|
68
|
+
const owner = ownerOf(name);
|
|
69
|
+
return owner === undefined ? name : `${owner}::${name}`;
|
|
70
|
+
};
|
|
71
|
+
return clauses.map(({ requires, rendered, kind, at, via, message }) => {
|
|
72
|
+
const node = idMap.get(at);
|
|
73
|
+
const brief = briefOf(node, message, idMap);
|
|
74
|
+
const called = model_1.RNode.ownLexeme(node);
|
|
75
|
+
const reads = (0, guard_claims_1.readingOf)(requires, (0, guard_knowledge_1.defaultGuardFacts)(), called === undefined ? undefined : (0, group_generics_1.s3GroupGenericOf)(called));
|
|
76
|
+
const formals = [...guard_term_1.GuardTerm.formalsOf(requires)];
|
|
77
|
+
const loc = locationOf(node, idMap, qualified);
|
|
78
|
+
return (0, objects_1.compactRecord)({
|
|
79
|
+
requires: rendered,
|
|
80
|
+
kind,
|
|
81
|
+
fails: written(node),
|
|
82
|
+
brief, reads,
|
|
83
|
+
formals: (0, objects_1.nonEmpty)(formals),
|
|
84
|
+
via: (0, objects_1.nonEmpty)(via)?.map(id => qualified(model_1.RNode.ownLexeme(idMap.get(id)) ?? '')),
|
|
85
|
+
message, loc
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/** The conjunction of what the reasons require, as {@link StatedGuards.requires} writes it. */
|
|
90
|
+
function joinedReasons(because) {
|
|
91
|
+
return because.map(r => because.length > 1 && r.requires.includes('||') ? `(${r.requires})` : r.requires).join(' && ');
|
|
92
|
+
}
|
|
93
|
+
/** The calls the reasons' conditions make, as {@link StatedGuards.calls} lists them, read back from their R syntax. */
|
|
94
|
+
function callsOfReasons(because) {
|
|
95
|
+
const formals = (0, arrays_1.uniqueArray)(because.flatMap(r => r.formals ?? []));
|
|
96
|
+
const terms = because.map(r => (0, guard_term_syntax_1.parseGuardTerm)(r.requires, formals, (0, guard_knowledge_1.defaultGuardFacts)()));
|
|
97
|
+
return terms.every(t => t !== undefined) ? callsOfTerms(terms) : undefined;
|
|
98
|
+
}
|
|
99
|
+
/** The {@link StoredGuards} of `guards`, those of the function `self` (`pkg::name`). */
|
|
100
|
+
function storedGuardsOf(guards, self) {
|
|
101
|
+
const { requires, because, calls, ...rest } = guards;
|
|
102
|
+
const derived = because === undefined ? undefined : callsOfReasons(because);
|
|
103
|
+
return {
|
|
104
|
+
...(because !== undefined && joinedReasons(because) === requires ? {} : { requires }),
|
|
105
|
+
...(calls === undefined || (derived !== undefined && derived.join() === calls.join()) ? {} : { calls }),
|
|
106
|
+
...rest,
|
|
107
|
+
...(because === undefined ? {} : { because: because.map(({ loc, ...reason }) => ({ ...reason, ...(loc === undefined ? {} : { loc: `${loc.fn === self ? '' : loc.fn + ':'}${loc.line}:${loc.column}` }) })) })
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** The {@link StatedGuards} that {@link storedGuardsOf} stored. */
|
|
111
|
+
function statedGuardsOfStored(stored, self) {
|
|
112
|
+
const { requires, because, calls, ...rest } = stored;
|
|
113
|
+
const derived = calls ?? (because === undefined ? undefined : callsOfReasons(because));
|
|
114
|
+
return {
|
|
115
|
+
requires: requires ?? joinedReasons(because ?? []),
|
|
116
|
+
...(derived === undefined || derived.length === 0 ? {} : { calls: derived }),
|
|
117
|
+
...rest,
|
|
118
|
+
...(because === undefined ? {} : { because: because.map(({ loc, ...reason }) => {
|
|
119
|
+
if (loc === undefined) {
|
|
120
|
+
return reason;
|
|
121
|
+
}
|
|
122
|
+
const [line, column] = loc.split(':').slice(-2).map(Number);
|
|
123
|
+
const fn = loc.split(':').slice(0, -2).join(':');
|
|
124
|
+
return { ...reason, loc: { fn: fn === '' ? self : fn, line, column: column } };
|
|
125
|
+
}) })
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** What R fails on for a function written in C, as the built-in definitions `facts` state it, `undefined` if they state nothing. */
|
|
129
|
+
function builtInClauses(name, facts) {
|
|
130
|
+
const asks = facts(name)?.asks;
|
|
131
|
+
if (asks === undefined) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const formals = Object.keys(asks);
|
|
135
|
+
return Object.entries(asks).flatMap(([formal, failures]) => {
|
|
136
|
+
/* what the dots hold is several values, none of which a formal of the name `...` could stand for in R code */
|
|
137
|
+
const other = formals.find(f => f !== formal);
|
|
138
|
+
const of = guard_term_1.GuardTerm.formal(formal);
|
|
139
|
+
return formal === '...' ? [] : failures.map(f => ({ formal, requires: (0, guard_knowledge_1.passes)(f, of, () => false, other === undefined ? undefined : guard_term_1.GuardTerm.formal(other), guard_term_1.GuardTerm.formal), message: (0, guard_knowledge_1.messageFor)(f, of) }));
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/** What R fails on for a function written in C, and what it returns, as the built-in definitions state it, `undefined` if flowR does not know of any. */
|
|
143
|
+
function requirementsOf(name) {
|
|
144
|
+
const facts = (0, guard_knowledge_1.defaultGuardFacts)()(name);
|
|
145
|
+
const formals = Object.keys(facts?.asks ?? {});
|
|
146
|
+
const stated = builtInClauses(name, (0, guard_knowledge_1.defaultGuardFacts)()) ?? [];
|
|
147
|
+
const returns = facts?.returns === undefined || facts.returns === 'argument' ? undefined : (0, guard_claims_1.returnedClaimOf)(facts.returns);
|
|
148
|
+
const passed = facts?.returns === 'argument' ? formals[0] : undefined;
|
|
149
|
+
if (stated.length === 0 && returns === undefined && passed === undefined && (facts?.required ?? []).length === 0) {
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
const required = facts?.required ?? [];
|
|
153
|
+
const dispatched = formals.filter(f => f !== '...');
|
|
154
|
+
const terms = [...stated.map(c => c.requires), ...(0, group_method_guards_1.groupMethodConditions)(name, dispatched.map(guard_term_1.GuardTerm.formal), new Set(), (0, guard_knowledge_1.defaultGuardFacts)())];
|
|
155
|
+
const claims = (0, guard_claims_1.claimsOf)(terms, (0, arrays_1.uniqueArrayMerge)(stated.map(c => c.formal), required), (0, guard_knowledge_1.defaultGuardFacts)());
|
|
156
|
+
const relations = (0, guard_claims_1.relationsOf)(terms, (0, guard_knowledge_1.defaultGuardFacts)());
|
|
157
|
+
const conditional = (0, guard_claims_1.conditionalClaimsOf)(terms, formals.filter(f => f !== '...'), (0, guard_knowledge_1.defaultGuardFacts)());
|
|
158
|
+
const calls = callsOfTerms(terms);
|
|
159
|
+
return (0, objects_1.compactRecord)({
|
|
160
|
+
requires: terms.length === 0 ? '' : guard_term_1.GuardTerm.render(guard_term_1.GuardTerm.all(...terms)),
|
|
161
|
+
required: (0, objects_1.nonEmpty)(required),
|
|
162
|
+
formals: Object.keys(claims).length > 0 ? claims : undefined,
|
|
163
|
+
relations: (0, objects_1.nonEmpty)(relations),
|
|
164
|
+
conditional: (0, objects_1.nonEmpty)(conditional),
|
|
165
|
+
returns,
|
|
166
|
+
passes: passed,
|
|
167
|
+
calls: (0, objects_1.nonEmpty)(calls),
|
|
168
|
+
origin: { source: 'builtin', r: r_base_guards_generated_1.RBaseGuardsVersion }
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/** Everything with stated guards, as `[package, name]`. */
|
|
172
|
+
function namesWithGuards() {
|
|
173
|
+
const table = (0, r_base_guards_generated_1.RBaseGuards)();
|
|
174
|
+
const inTable = Object.entries(table).flatMap(([pkg, names]) => Object.keys(names).map(name => [pkg, name]));
|
|
175
|
+
const known = new Set(inTable.map(([pkg, name]) => `${pkg}::${name}`));
|
|
176
|
+
return [...inTable, ...(0, guards_1.namesWithGuardFacts)().filter(([, name]) => requirementsOf(name) !== undefined).map(([, name]) => [(0, r_base_packages_1.baseRExportOwner)(name) ?? "base" /* PkgName.Base */, name]).filter(([pkg, name]) => !known.has(`${pkg}::${name}`))];
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* What a function of the base packages asks of the calls returning from it: what its closure checks, and else what is known of it being written in C.
|
|
180
|
+
* Like any guard this says nothing of the defaults of its formals: `n = 5L` does not make `n` an integer.
|
|
181
|
+
* @param name - the function
|
|
182
|
+
* @param pkg - the package providing it, by default the one R finds the name in
|
|
183
|
+
*/
|
|
184
|
+
function builtInGuards(name, pkg = (0, r_base_packages_1.baseRExportOwner)(name)) {
|
|
185
|
+
const owner = pkg ?? "base" /* PkgName.Base */;
|
|
186
|
+
const key = `${String(owner)}::${String(name)}`;
|
|
187
|
+
if (!builtInGuardsCache.has(key)) {
|
|
188
|
+
builtInGuardsCache.set(key, readBuiltInGuards(name, owner));
|
|
189
|
+
}
|
|
190
|
+
return builtInGuardsCache.get(key);
|
|
191
|
+
}
|
|
192
|
+
/** {@link builtInGuards} per `pkg::name`, as the table and the facts do not change while flowR runs */
|
|
193
|
+
const builtInGuardsCache = new Map();
|
|
194
|
+
function readBuiltInGuards(name, owner) {
|
|
195
|
+
const stored = (0, r_base_guards_generated_1.RBaseGuards)()[String(owner)]?.[String(name)];
|
|
196
|
+
const read = stored === undefined ? undefined : statedGuardsOfStored(stored, `${String(owner)}::${String(name)}`);
|
|
197
|
+
return read !== undefined ? { ...read, origin: { source: 'base-table', r: r_base_guards_generated_1.RBaseGuardsVersion, date: r_base_guards_generated_1.RBaseGuardsDate, pkg: owner, version: r_base_guards_generated_1.RBaseGuardsVersion } } : ((0, r_base_packages_1.baseRExportOwner)(name) === owner || owner === "base" /* PkgName.Base */ ? requirementsOf(name) : undefined);
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=built-in-guards.js.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Identifier, type BrandedIdentifier } from '../../environments/identifier';
|
|
2
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
|
+
import type { AstIdMap } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
+
import type { DataflowGraph } from '../../graph/graph';
|
|
5
|
+
import type { ReadOnlyFlowrAnalyzerContext } from '../../../project/context/flowr-analyzer-context';
|
|
6
|
+
import { GuardTerm } from './guard-term';
|
|
7
|
+
import { type GuardOrigin, type StatedGuards } from './built-in-guards';
|
|
8
|
+
import { type FunctionGuards } from './function-guards';
|
|
9
|
+
import type { GuardFactsLookup } from '../../environments/guard-facts';
|
|
10
|
+
/** What a function asks of its calls: the conditions of its guards over its formals, and the formals a call has to give. */
|
|
11
|
+
export interface FunctionContract {
|
|
12
|
+
readonly formals: readonly BrandedIdentifier[];
|
|
13
|
+
readonly required: readonly BrandedIdentifier[];
|
|
14
|
+
readonly clauses: readonly GuardTerm[];
|
|
15
|
+
/** `program` if inferred from a definition of the analyzed code, else where the stated guards come from, see {@link GuardOrigin} */
|
|
16
|
+
readonly source: 'program' | GuardOrigin['source'];
|
|
17
|
+
/** the definition the contract is inferred from, for a `program` contract */
|
|
18
|
+
readonly definition?: NodeId;
|
|
19
|
+
/** the guards inferred for {@link FunctionContract.definition} */
|
|
20
|
+
readonly guards?: FunctionGuards;
|
|
21
|
+
/** the guards stated without a program, for any other contract */
|
|
22
|
+
readonly stated?: StatedGuards;
|
|
23
|
+
}
|
|
24
|
+
/** What a call breaks of a contract: a formal it does not give, or a condition that fails for every value the arguments may hold. */
|
|
25
|
+
export type ContractBreach = {
|
|
26
|
+
readonly kind: 'missing';
|
|
27
|
+
readonly formal: BrandedIdentifier;
|
|
28
|
+
} | {
|
|
29
|
+
readonly kind: 'fails';
|
|
30
|
+
readonly condition: string;
|
|
31
|
+
readonly values: readonly (readonly [formal: BrandedIdentifier, shown: string])[];
|
|
32
|
+
};
|
|
33
|
+
/** What the contracts of one program are worked out against, see {@link CallContracts.of}. */
|
|
34
|
+
export interface ContractScope {
|
|
35
|
+
readonly graph: DataflowGraph;
|
|
36
|
+
readonly idMap: AstIdMap;
|
|
37
|
+
readonly ctx: ReadOnlyFlowrAnalyzerContext;
|
|
38
|
+
readonly facts: GuardFactsLookup;
|
|
39
|
+
/** whether code other than the program may bring S3 methods of the given generic */
|
|
40
|
+
readonly mayAddMethods: (generic: BrandedIdentifier) => boolean;
|
|
41
|
+
/** whether the program rewrites a function (`formals(f) <- ...`), after which the contract of its definition no longer holds */
|
|
42
|
+
readonly rewritesFormals: boolean;
|
|
43
|
+
readonly definitions: Map<NodeId, FunctionContract | undefined>;
|
|
44
|
+
readonly functions: Map<string, FunctionContract | undefined>;
|
|
45
|
+
}
|
|
46
|
+
/** The scope to work out the contracts of the calls of the analyzed program in, sharing what they have in common. */
|
|
47
|
+
declare function of(this: void, graph: DataflowGraph, ctx: ReadOnlyFlowrAnalyzerContext, idMap?: AstIdMap): ContractScope;
|
|
48
|
+
/** What is stated of a function by name: what the signature database answers (given a context to ask it in), or else flowR's table of the base packages. */
|
|
49
|
+
declare function statedOf(this: void, name: Identifier, ctx?: ReadOnlyFlowrAnalyzerContext): StatedGuards | undefined;
|
|
50
|
+
/** The contract of a function by name: what its closure checks as the base table or the signature database states it, or else what R checks of the function written in C. */
|
|
51
|
+
declare function ofFunction(this: void, name: Identifier, scope: ContractScope): FunctionContract | undefined;
|
|
52
|
+
/** The contract inferred for a definition of the program, none once the program rewrites functions. */
|
|
53
|
+
declare function ofDefinition(this: void, definition: NodeId, scope: ContractScope): FunctionContract | undefined;
|
|
54
|
+
/** The contract of what the call reaches: the one definition of the program it calls, or a function of R flowR knows the guards of. */
|
|
55
|
+
declare function ofCall(this: void, call: NodeId, scope: ContractScope): FunctionContract | undefined;
|
|
56
|
+
/** The contract in the form the signature database stores and the browsers show, see {@link StatedGuards}. */
|
|
57
|
+
declare function stated(this: void, contract: FunctionContract, idMap: AstIdMap): StatedGuards | undefined;
|
|
58
|
+
/** What of the contract the call breaks for sure, each condition with the values it fails for. */
|
|
59
|
+
declare function breaches(this: void, call: NodeId, contract: FunctionContract, scope: ContractScope): ContractBreach[];
|
|
60
|
+
/** The breach in words, as `m >= 0 fails for m = -1`. */
|
|
61
|
+
declare function describe(this: void, breach: ContractBreach): string;
|
|
62
|
+
/** The contract the call reaches and what of it the call breaks for sure, `undefined` if flowR knows no contract of what it calls. */
|
|
63
|
+
declare function check(this: void, call: NodeId, scope: ContractScope): {
|
|
64
|
+
readonly contract: FunctionContract;
|
|
65
|
+
readonly breaches: readonly ContractBreach[];
|
|
66
|
+
} | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* The one layer to ask what a function asks of its calls, its *contract*, and whether a call keeps it: stated by the signature database or
|
|
69
|
+
* flowR's tables for a function by name, or inferred from a definition of the program by the guards analysis, see {@link FunctionGuards}.
|
|
70
|
+
* The conditions of the guards of the callee are taken to the call as the guard analysis takes them to a caller, and a call only breaks
|
|
71
|
+
* a condition if it fails for every value the arguments may hold.
|
|
72
|
+
* @helper api
|
|
73
|
+
*/
|
|
74
|
+
export declare const CallContracts: {
|
|
75
|
+
readonly name: "CallContracts";
|
|
76
|
+
/** The scope to ask for the contracts of one analyzed program in. */
|
|
77
|
+
readonly of: typeof of;
|
|
78
|
+
/** What is stated of a function by name, without a program. */
|
|
79
|
+
readonly statedOf: typeof statedOf;
|
|
80
|
+
/** The contract of a function by name. */
|
|
81
|
+
readonly ofFunction: typeof ofFunction;
|
|
82
|
+
/** The contract inferred for a definition of the program. */
|
|
83
|
+
readonly ofDefinition: typeof ofDefinition;
|
|
84
|
+
/** The contract of what a call reaches. */
|
|
85
|
+
readonly ofCall: typeof ofCall;
|
|
86
|
+
/** The contract in the form the signature database stores and the browsers show. */
|
|
87
|
+
readonly stated: typeof stated;
|
|
88
|
+
/** What of a contract a call breaks for sure. */
|
|
89
|
+
readonly breaches: typeof breaches;
|
|
90
|
+
/** The contract of what a call reaches and what of it the call breaks. */
|
|
91
|
+
readonly check: typeof check;
|
|
92
|
+
/** A breach in words. */
|
|
93
|
+
readonly describe: typeof describe;
|
|
94
|
+
/** The replacement functions that rewrite a function, after which its contract no longer holds. */
|
|
95
|
+
readonly FormalsRewriters: ReadonlySet<BrandedIdentifier>;
|
|
96
|
+
};
|
|
97
|
+
export {};
|