@azx-pbc/axiom-runtime 0.0.0-stage → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +714 -2
- package/dist/cache/index.d.ts +191 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +361 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/canonical/jcs.d.ts +78 -0
- package/dist/canonical/jcs.d.ts.map +1 -0
- package/dist/canonical/jcs.js +500 -0
- package/dist/canonical/jcs.js.map +1 -0
- package/dist/canonical/restricted-json.d.ts +7 -0
- package/dist/canonical/restricted-json.d.ts.map +1 -0
- package/dist/canonical/restricted-json.js +318 -0
- package/dist/canonical/restricted-json.js.map +1 -0
- package/dist/canonical/restricted-value.d.ts +59 -0
- package/dist/canonical/restricted-value.d.ts.map +1 -0
- package/dist/canonical/restricted-value.js +156 -0
- package/dist/canonical/restricted-value.js.map +1 -0
- package/dist/canonical/restricted.d.ts +85 -0
- package/dist/canonical/restricted.d.ts.map +1 -0
- package/dist/canonical/restricted.js +163 -0
- package/dist/canonical/restricted.js.map +1 -0
- package/dist/canonical/signature.d.ts +38 -0
- package/dist/canonical/signature.d.ts.map +1 -0
- package/dist/canonical/signature.js +47 -0
- package/dist/canonical/signature.js.map +1 -0
- package/dist/eval/access/delivery.d.ts +63 -0
- package/dist/eval/access/delivery.d.ts.map +1 -0
- package/dist/eval/access/delivery.js +98 -0
- package/dist/eval/access/delivery.js.map +1 -0
- package/dist/eval/access/overlay.d.ts +72 -0
- package/dist/eval/access/overlay.d.ts.map +1 -0
- package/dist/eval/access/overlay.js +402 -0
- package/dist/eval/access/overlay.js.map +1 -0
- package/dist/eval/access/projection.d.ts +159 -0
- package/dist/eval/access/projection.d.ts.map +1 -0
- package/dist/eval/access/projection.js +211 -0
- package/dist/eval/access/projection.js.map +1 -0
- package/dist/eval/access/window.d.ts +128 -0
- package/dist/eval/access/window.d.ts.map +1 -0
- package/dist/eval/access/window.js +254 -0
- package/dist/eval/access/window.js.map +1 -0
- package/dist/eval/access/write.d.ts +113 -0
- package/dist/eval/access/write.d.ts.map +1 -0
- package/dist/eval/access/write.js +119 -0
- package/dist/eval/access/write.js.map +1 -0
- package/dist/eval/addressing.d.ts +131 -0
- package/dist/eval/addressing.d.ts.map +1 -0
- package/dist/eval/addressing.js +270 -0
- package/dist/eval/addressing.js.map +1 -0
- package/dist/eval/budget.d.ts +143 -0
- package/dist/eval/budget.d.ts.map +1 -0
- package/dist/eval/budget.js +387 -0
- package/dist/eval/budget.js.map +1 -0
- package/dist/eval/computed.d.ts +46 -0
- package/dist/eval/computed.d.ts.map +1 -0
- package/dist/eval/computed.js +89 -0
- package/dist/eval/computed.js.map +1 -0
- package/dist/eval/denials.d.ts +64 -0
- package/dist/eval/denials.d.ts.map +1 -0
- package/dist/eval/denials.js +87 -0
- package/dist/eval/denials.js.map +1 -0
- package/dist/eval/engine/cancellation.d.ts +12 -0
- package/dist/eval/engine/cancellation.d.ts.map +1 -0
- package/dist/eval/engine/cancellation.js +56 -0
- package/dist/eval/engine/cancellation.js.map +1 -0
- package/dist/eval/engine/delta.d.ts +104 -0
- package/dist/eval/engine/delta.d.ts.map +1 -0
- package/dist/eval/engine/delta.js +466 -0
- package/dist/eval/engine/delta.js.map +1 -0
- package/dist/eval/engine/deps.d.ts +136 -0
- package/dist/eval/engine/deps.d.ts.map +1 -0
- package/dist/eval/engine/deps.js +345 -0
- package/dist/eval/engine/deps.js.map +1 -0
- package/dist/eval/engine/identity.d.ts +128 -0
- package/dist/eval/engine/identity.d.ts.map +1 -0
- package/dist/eval/engine/identity.js +398 -0
- package/dist/eval/engine/identity.js.map +1 -0
- package/dist/eval/engine/index.d.ts +200 -0
- package/dist/eval/engine/index.d.ts.map +1 -0
- package/dist/eval/engine/index.js +1242 -0
- package/dist/eval/engine/index.js.map +1 -0
- package/dist/eval/engine/measurement.d.ts +23 -0
- package/dist/eval/engine/measurement.d.ts.map +1 -0
- package/dist/eval/engine/measurement.js +42 -0
- package/dist/eval/engine/measurement.js.map +1 -0
- package/dist/eval/engine/naive.d.ts +19 -0
- package/dist/eval/engine/naive.d.ts.map +1 -0
- package/dist/eval/engine/naive.js +59 -0
- package/dist/eval/engine/naive.js.map +1 -0
- package/dist/eval/engine/ops.d.ts +214 -0
- package/dist/eval/engine/ops.d.ts.map +1 -0
- package/dist/eval/engine/ops.js +1422 -0
- package/dist/eval/engine/ops.js.map +1 -0
- package/dist/eval/engine/patches.d.ts +40 -0
- package/dist/eval/engine/patches.d.ts.map +1 -0
- package/dist/eval/engine/patches.js +125 -0
- package/dist/eval/engine/patches.js.map +1 -0
- package/dist/eval/engine/ports.d.ts +71 -0
- package/dist/eval/engine/ports.d.ts.map +1 -0
- package/dist/eval/engine/ports.js +2 -0
- package/dist/eval/engine/ports.js.map +1 -0
- package/dist/eval/engine/session.d.ts +116 -0
- package/dist/eval/engine/session.d.ts.map +1 -0
- package/dist/eval/engine/session.js +653 -0
- package/dist/eval/engine/session.js.map +1 -0
- package/dist/eval/engine/snapshot.d.ts +97 -0
- package/dist/eval/engine/snapshot.d.ts.map +1 -0
- package/dist/eval/engine/snapshot.js +221 -0
- package/dist/eval/engine/snapshot.js.map +1 -0
- package/dist/eval/engine/subscriptions.d.ts +47 -0
- package/dist/eval/engine/subscriptions.d.ts.map +1 -0
- package/dist/eval/engine/subscriptions.js +103 -0
- package/dist/eval/engine/subscriptions.js.map +1 -0
- package/dist/eval/engine/trace.d.ts +77 -0
- package/dist/eval/engine/trace.d.ts.map +1 -0
- package/dist/eval/engine/trace.js +140 -0
- package/dist/eval/engine/trace.js.map +1 -0
- package/dist/eval/error-diagnostic.d.ts +26 -0
- package/dist/eval/error-diagnostic.d.ts.map +1 -0
- package/dist/eval/error-diagnostic.js +63 -0
- package/dist/eval/error-diagnostic.js.map +1 -0
- package/dist/eval/evaluate-expr.d.ts +44 -0
- package/dist/eval/evaluate-expr.d.ts.map +1 -0
- package/dist/eval/evaluate-expr.js +149 -0
- package/dist/eval/evaluate-expr.js.map +1 -0
- package/dist/eval/evaluate.d.ts +282 -0
- package/dist/eval/evaluate.d.ts.map +1 -0
- package/dist/eval/evaluate.js +391 -0
- package/dist/eval/evaluate.js.map +1 -0
- package/dist/eval/evolution/relocate.d.ts +72 -0
- package/dist/eval/evolution/relocate.d.ts.map +1 -0
- package/dist/eval/evolution/relocate.js +427 -0
- package/dist/eval/evolution/relocate.js.map +1 -0
- package/dist/eval/evolution/select.d.ts +11 -0
- package/dist/eval/evolution/select.d.ts.map +1 -0
- package/dist/eval/evolution/select.js +53 -0
- package/dist/eval/evolution/select.js.map +1 -0
- package/dist/eval/evolution/upcast.d.ts +13 -0
- package/dist/eval/evolution/upcast.d.ts.map +1 -0
- package/dist/eval/evolution/upcast.js +88 -0
- package/dist/eval/evolution/upcast.js.map +1 -0
- package/dist/eval/expr/aggregates.d.ts +75 -0
- package/dist/eval/expr/aggregates.d.ts.map +1 -0
- package/dist/eval/expr/aggregates.js +991 -0
- package/dist/eval/expr/aggregates.js.map +1 -0
- package/dist/eval/expr/arithmetic.d.ts +26 -0
- package/dist/eval/expr/arithmetic.d.ts.map +1 -0
- package/dist/eval/expr/arithmetic.js +387 -0
- package/dist/eval/expr/arithmetic.js.map +1 -0
- package/dist/eval/expr/between.d.ts +17 -0
- package/dist/eval/expr/between.d.ts.map +1 -0
- package/dist/eval/expr/between.js +46 -0
- package/dist/eval/expr/between.js.map +1 -0
- package/dist/eval/expr/binder.d.ts +96 -0
- package/dist/eval/expr/binder.d.ts.map +1 -0
- package/dist/eval/expr/binder.js +253 -0
- package/dist/eval/expr/binder.js.map +1 -0
- package/dist/eval/expr/call-dispatch.d.ts +28 -0
- package/dist/eval/expr/call-dispatch.d.ts.map +1 -0
- package/dist/eval/expr/call-dispatch.js +114 -0
- package/dist/eval/expr/call-dispatch.js.map +1 -0
- package/dist/eval/expr/collections.d.ts +20 -0
- package/dist/eval/expr/collections.d.ts.map +1 -0
- package/dist/eval/expr/collections.js +66 -0
- package/dist/eval/expr/collections.js.map +1 -0
- package/dist/eval/expr/compare.d.ts +36 -0
- package/dist/eval/expr/compare.d.ts.map +1 -0
- package/dist/eval/expr/compare.js +115 -0
- package/dist/eval/expr/compare.js.map +1 -0
- package/dist/eval/expr/datasets.d.ts +28 -0
- package/dist/eval/expr/datasets.d.ts.map +1 -0
- package/dist/eval/expr/datasets.js +304 -0
- package/dist/eval/expr/datasets.js.map +1 -0
- package/dist/eval/expr/digest.d.ts +23 -0
- package/dist/eval/expr/digest.d.ts.map +1 -0
- package/dist/eval/expr/digest.js +89 -0
- package/dist/eval/expr/digest.js.map +1 -0
- package/dist/eval/expr/domains.d.ts +19 -0
- package/dist/eval/expr/domains.d.ts.map +1 -0
- package/dist/eval/expr/domains.js +18 -0
- package/dist/eval/expr/domains.js.map +1 -0
- package/dist/eval/expr/host.d.ts +152 -0
- package/dist/eval/expr/host.d.ts.map +1 -0
- package/dist/eval/expr/host.js +36 -0
- package/dist/eval/expr/host.js.map +1 -0
- package/dist/eval/expr/lists.d.ts +24 -0
- package/dist/eval/expr/lists.d.ts.map +1 -0
- package/dist/eval/expr/lists.js +155 -0
- package/dist/eval/expr/lists.js.map +1 -0
- package/dist/eval/expr/member.d.ts +15 -0
- package/dist/eval/expr/member.d.ts.map +1 -0
- package/dist/eval/expr/member.js +32 -0
- package/dist/eval/expr/member.js.map +1 -0
- package/dist/eval/expr/money-ops.d.ts +10 -0
- package/dist/eval/expr/money-ops.d.ts.map +1 -0
- package/dist/eval/expr/money-ops.js +17 -0
- package/dist/eval/expr/money-ops.js.map +1 -0
- package/dist/eval/expr/operands.d.ts +27 -0
- package/dist/eval/expr/operands.d.ts.map +1 -0
- package/dist/eval/expr/operands.js +167 -0
- package/dist/eval/expr/operands.js.map +1 -0
- package/dist/eval/expr/presence.d.ts +27 -0
- package/dist/eval/expr/presence.d.ts.map +1 -0
- package/dist/eval/expr/presence.js +140 -0
- package/dist/eval/expr/presence.js.map +1 -0
- package/dist/eval/expr/records.d.ts +22 -0
- package/dist/eval/expr/records.d.ts.map +1 -0
- package/dist/eval/expr/records.js +101 -0
- package/dist/eval/expr/records.js.map +1 -0
- package/dist/eval/expr/rule-refs.d.ts +25 -0
- package/dist/eval/expr/rule-refs.d.ts.map +1 -0
- package/dist/eval/expr/rule-refs.js +60 -0
- package/dist/eval/expr/rule-refs.js.map +1 -0
- package/dist/eval/expr/sequences.d.ts +26 -0
- package/dist/eval/expr/sequences.d.ts.map +1 -0
- package/dist/eval/expr/sequences.js +151 -0
- package/dist/eval/expr/sequences.js.map +1 -0
- package/dist/eval/expr/value.d.ts +99 -0
- package/dist/eval/expr/value.d.ts.map +1 -0
- package/dist/eval/expr/value.js +14 -0
- package/dist/eval/expr/value.js.map +1 -0
- package/dist/eval/expression.d.ts +142 -0
- package/dist/eval/expression.d.ts.map +1 -0
- package/dist/eval/expression.js +446 -0
- package/dist/eval/expression.js.map +1 -0
- package/dist/eval/firing.d.ts +68 -0
- package/dist/eval/firing.d.ts.map +1 -0
- package/dist/eval/firing.js +222 -0
- package/dist/eval/firing.js.map +1 -0
- package/dist/eval/gate.d.ts +110 -0
- package/dist/eval/gate.d.ts.map +1 -0
- package/dist/eval/gate.js +278 -0
- package/dist/eval/gate.js.map +1 -0
- package/dist/eval/layout-visibility.d.ts +18 -0
- package/dist/eval/layout-visibility.d.ts.map +1 -0
- package/dist/eval/layout-visibility.js +61 -0
- package/dist/eval/layout-visibility.js.map +1 -0
- package/dist/eval/option-availability.d.ts +26 -0
- package/dist/eval/option-availability.d.ts.map +1 -0
- package/dist/eval/option-availability.js +580 -0
- package/dist/eval/option-availability.js.map +1 -0
- package/dist/eval/options-boundary.d.ts +15 -0
- package/dist/eval/options-boundary.d.ts.map +1 -0
- package/dist/eval/options-boundary.js +40 -0
- package/dist/eval/options-boundary.js.map +1 -0
- package/dist/eval/options.d.ts +99 -0
- package/dist/eval/options.d.ts.map +1 -0
- package/dist/eval/options.js +96 -0
- package/dist/eval/options.js.map +1 -0
- package/dist/eval/overrides.d.ts +116 -0
- package/dist/eval/overrides.d.ts.map +1 -0
- package/dist/eval/overrides.js +176 -0
- package/dist/eval/overrides.js.map +1 -0
- package/dist/eval/paths.d.ts +25 -0
- package/dist/eval/paths.d.ts.map +1 -0
- package/dist/eval/paths.js +47 -0
- package/dist/eval/paths.js.map +1 -0
- package/dist/eval/presentation-reads.d.ts +20 -0
- package/dist/eval/presentation-reads.d.ts.map +1 -0
- package/dist/eval/presentation-reads.js +2 -0
- package/dist/eval/presentation-reads.js.map +1 -0
- package/dist/eval/presentation.d.ts +122 -0
- package/dist/eval/presentation.d.ts.map +1 -0
- package/dist/eval/presentation.js +255 -0
- package/dist/eval/presentation.js.map +1 -0
- package/dist/eval/reader/context-value.d.ts +41 -0
- package/dist/eval/reader/context-value.d.ts.map +1 -0
- package/dist/eval/reader/context-value.js +129 -0
- package/dist/eval/reader/context-value.js.map +1 -0
- package/dist/eval/reader/covered.d.ts +53 -0
- package/dist/eval/reader/covered.d.ts.map +1 -0
- package/dist/eval/reader/covered.js +139 -0
- package/dist/eval/reader/covered.js.map +1 -0
- package/dist/eval/reader/declarations.d.ts +182 -0
- package/dist/eval/reader/declarations.d.ts.map +1 -0
- package/dist/eval/reader/declarations.js +153 -0
- package/dist/eval/reader/declarations.js.map +1 -0
- package/dist/eval/reader/member-access.d.ts +87 -0
- package/dist/eval/reader/member-access.d.ts.map +1 -0
- package/dist/eval/reader/member-access.js +212 -0
- package/dist/eval/reader/member-access.js.map +1 -0
- package/dist/eval/reader/memo.d.ts +34 -0
- package/dist/eval/reader/memo.d.ts.map +1 -0
- package/dist/eval/reader/memo.js +67 -0
- package/dist/eval/reader/memo.js.map +1 -0
- package/dist/eval/reader/overlay.d.ts +74 -0
- package/dist/eval/reader/overlay.d.ts.map +1 -0
- package/dist/eval/reader/overlay.js +365 -0
- package/dist/eval/reader/overlay.js.map +1 -0
- package/dist/eval/reader/questions.d.ts +37 -0
- package/dist/eval/reader/questions.d.ts.map +1 -0
- package/dist/eval/reader/questions.js +78 -0
- package/dist/eval/reader/questions.js.map +1 -0
- package/dist/eval/reader/resolve.d.ts +84 -0
- package/dist/eval/reader/resolve.d.ts.map +1 -0
- package/dist/eval/reader/resolve.js +310 -0
- package/dist/eval/reader/resolve.js.map +1 -0
- package/dist/eval/reader/value-read.d.ts +50 -0
- package/dist/eval/reader/value-read.d.ts.map +1 -0
- package/dist/eval/reader/value-read.js +133 -0
- package/dist/eval/reader/value-read.js.map +1 -0
- package/dist/eval/reader/withheld.d.ts +48 -0
- package/dist/eval/reader/withheld.d.ts.map +1 -0
- package/dist/eval/reader/withheld.js +108 -0
- package/dist/eval/reader/withheld.js.map +1 -0
- package/dist/eval/reader-paths.d.ts +24 -0
- package/dist/eval/reader-paths.d.ts.map +1 -0
- package/dist/eval/reader-paths.js +23 -0
- package/dist/eval/reader-paths.js.map +1 -0
- package/dist/eval/reader.d.ts +281 -0
- package/dist/eval/reader.d.ts.map +1 -0
- package/dist/eval/reader.js +560 -0
- package/dist/eval/reader.js.map +1 -0
- package/dist/eval/receipt.d.ts +37 -0
- package/dist/eval/receipt.d.ts.map +1 -0
- package/dist/eval/receipt.js +222 -0
- package/dist/eval/receipt.js.map +1 -0
- package/dist/eval/report/assemble.d.ts +84 -0
- package/dist/eval/report/assemble.d.ts.map +1 -0
- package/dist/eval/report/assemble.js +277 -0
- package/dist/eval/report/assemble.js.map +1 -0
- package/dist/eval/report/fold.d.ts +18 -0
- package/dist/eval/report/fold.d.ts.map +1 -0
- package/dist/eval/report/fold.js +58 -0
- package/dist/eval/report/fold.js.map +1 -0
- package/dist/eval/rule/alternatives.d.ts +23 -0
- package/dist/eval/rule/alternatives.d.ts.map +1 -0
- package/dist/eval/rule/alternatives.js +46 -0
- package/dist/eval/rule/alternatives.js.map +1 -0
- package/dist/eval/rule/behaviour.d.ts +47 -0
- package/dist/eval/rule/behaviour.d.ts.map +1 -0
- package/dist/eval/rule/behaviour.js +249 -0
- package/dist/eval/rule/behaviour.js.map +1 -0
- package/dist/eval/rule/compute.d.ts +46 -0
- package/dist/eval/rule/compute.d.ts.map +1 -0
- package/dist/eval/rule/compute.js +158 -0
- package/dist/eval/rule/compute.js.map +1 -0
- package/dist/eval/rule/create-state.d.ts +42 -0
- package/dist/eval/rule/create-state.d.ts.map +1 -0
- package/dist/eval/rule/create-state.js +134 -0
- package/dist/eval/rule/create-state.js.map +1 -0
- package/dist/eval/rule/diagnostics.d.ts +24 -0
- package/dist/eval/rule/diagnostics.d.ts.map +1 -0
- package/dist/eval/rule/diagnostics.js +45 -0
- package/dist/eval/rule/diagnostics.js.map +1 -0
- package/dist/eval/rule/execution.d.ts +24 -0
- package/dist/eval/rule/execution.d.ts.map +1 -0
- package/dist/eval/rule/execution.js +495 -0
- package/dist/eval/rule/execution.js.map +1 -0
- package/dist/eval/rule/gate.d.ts +12 -0
- package/dist/eval/rule/gate.d.ts.map +1 -0
- package/dist/eval/rule/gate.js +34 -0
- package/dist/eval/rule/gate.js.map +1 -0
- package/dist/eval/rule/item.d.ts +11 -0
- package/dist/eval/rule/item.d.ts.map +1 -0
- package/dist/eval/rule/item.js +265 -0
- package/dist/eval/rule/item.js.map +1 -0
- package/dist/eval/rule/prepare.d.ts +64 -0
- package/dist/eval/rule/prepare.d.ts.map +1 -0
- package/dist/eval/rule/prepare.js +131 -0
- package/dist/eval/rule/prepare.js.map +1 -0
- package/dist/eval/rule/result.d.ts +97 -0
- package/dist/eval/rule/result.d.ts.map +1 -0
- package/dist/eval/rule/result.js +347 -0
- package/dist/eval/rule/result.js.map +1 -0
- package/dist/eval/rule/runner.d.ts +128 -0
- package/dist/eval/rule/runner.d.ts.map +1 -0
- package/dist/eval/rule/runner.js +296 -0
- package/dist/eval/rule/runner.js.map +1 -0
- package/dist/eval/rule/screen.d.ts +32 -0
- package/dist/eval/rule/screen.d.ts.map +1 -0
- package/dist/eval/rule/screen.js +73 -0
- package/dist/eval/rule/screen.js.map +1 -0
- package/dist/eval/rule/state.d.ts +137 -0
- package/dist/eval/rule/state.d.ts.map +1 -0
- package/dist/eval/rule/state.js +2 -0
- package/dist/eval/rule/state.js.map +1 -0
- package/dist/eval/rule/steps.d.ts +44 -0
- package/dist/eval/rule/steps.d.ts.map +1 -0
- package/dist/eval/rule/steps.js +367 -0
- package/dist/eval/rule/steps.js.map +1 -0
- package/dist/eval/rule/visibility.d.ts +18 -0
- package/dist/eval/rule/visibility.d.ts.map +1 -0
- package/dist/eval/rule/visibility.js +79 -0
- package/dist/eval/rule/visibility.js.map +1 -0
- package/dist/eval/seal.d.ts +74 -0
- package/dist/eval/seal.d.ts.map +1 -0
- package/dist/eval/seal.js +154 -0
- package/dist/eval/seal.js.map +1 -0
- package/dist/eval/signature-coverage.d.ts +19 -0
- package/dist/eval/signature-coverage.d.ts.map +1 -0
- package/dist/eval/signature-coverage.js +160 -0
- package/dist/eval/signature-coverage.js.map +1 -0
- package/dist/eval/state/derive.d.ts +72 -0
- package/dist/eval/state/derive.d.ts.map +1 -0
- package/dist/eval/state/derive.js +61 -0
- package/dist/eval/state/derive.js.map +1 -0
- package/dist/eval/state/describe.d.ts +18 -0
- package/dist/eval/state/describe.d.ts.map +1 -0
- package/dist/eval/state/describe.js +19 -0
- package/dist/eval/state/describe.js.map +1 -0
- package/dist/eval/state/field-state.d.ts +471 -0
- package/dist/eval/state/field-state.d.ts.map +1 -0
- package/dist/eval/state/field-state.js +1604 -0
- package/dist/eval/state/field-state.js.map +1 -0
- package/dist/eval/state/measurement.d.ts +136 -0
- package/dist/eval/state/measurement.d.ts.map +1 -0
- package/dist/eval/state/measurement.js +209 -0
- package/dist/eval/state/measurement.js.map +1 -0
- package/dist/eval/state/options.d.ts +21 -0
- package/dist/eval/state/options.d.ts.map +1 -0
- package/dist/eval/state/options.js +3 -0
- package/dist/eval/state/options.js.map +1 -0
- package/dist/eval/state/readiness.d.ts +400 -0
- package/dist/eval/state/readiness.d.ts.map +1 -0
- package/dist/eval/state/readiness.js +1067 -0
- package/dist/eval/state/readiness.js.map +1 -0
- package/dist/eval/state/snapshot.d.ts +130 -0
- package/dist/eval/state/snapshot.d.ts.map +1 -0
- package/dist/eval/state/snapshot.js +35 -0
- package/dist/eval/state/snapshot.js.map +1 -0
- package/dist/eval/state/unavailable-options.d.ts +54 -0
- package/dist/eval/state/unavailable-options.d.ts.map +1 -0
- package/dist/eval/state/unavailable-options.js +82 -0
- package/dist/eval/state/unavailable-options.js.map +1 -0
- package/dist/eval/state/value-state.d.ts +38 -0
- package/dist/eval/state/value-state.d.ts.map +1 -0
- package/dist/eval/state/value-state.js +52 -0
- package/dist/eval/state/value-state.js.map +1 -0
- package/dist/eval/submission/admission.d.ts +50 -0
- package/dist/eval/submission/admission.d.ts.map +1 -0
- package/dist/eval/submission/admission.js +174 -0
- package/dist/eval/submission/admission.js.map +1 -0
- package/dist/eval/submission/authority.d.ts +71 -0
- package/dist/eval/submission/authority.d.ts.map +1 -0
- package/dist/eval/submission/authority.js +118 -0
- package/dist/eval/submission/authority.js.map +1 -0
- package/dist/eval/submission/datasets.d.ts +28 -0
- package/dist/eval/submission/datasets.d.ts.map +1 -0
- package/dist/eval/submission/datasets.js +109 -0
- package/dist/eval/submission/datasets.js.map +1 -0
- package/dist/eval/submission/index.d.ts +15 -0
- package/dist/eval/submission/index.d.ts.map +1 -0
- package/dist/eval/submission/index.js +13 -0
- package/dist/eval/submission/index.js.map +1 -0
- package/dist/eval/submission/refusals.d.ts +103 -0
- package/dist/eval/submission/refusals.d.ts.map +1 -0
- package/dist/eval/submission/refusals.js +15 -0
- package/dist/eval/submission/refusals.js.map +1 -0
- package/dist/eval/submission/signatures.d.ts +7 -0
- package/dist/eval/submission/signatures.d.ts.map +1 -0
- package/dist/eval/submission/signatures.js +215 -0
- package/dist/eval/submission/signatures.js.map +1 -0
- package/dist/eval/submission/writes.d.ts +51 -0
- package/dist/eval/submission/writes.d.ts.map +1 -0
- package/dist/eval/submission/writes.js +203 -0
- package/dist/eval/submission/writes.js.map +1 -0
- package/dist/eval/submission.d.ts +53 -0
- package/dist/eval/submission.d.ts.map +1 -0
- package/dist/eval/submission.js +521 -0
- package/dist/eval/submission.js.map +1 -0
- package/dist/eval/suggestions-to-engine.d.ts +18 -0
- package/dist/eval/suggestions-to-engine.d.ts.map +1 -0
- package/dist/eval/suggestions-to-engine.js +40 -0
- package/dist/eval/suggestions-to-engine.js.map +1 -0
- package/dist/eval/suggestions.d.ts +17 -0
- package/dist/eval/suggestions.d.ts.map +1 -0
- package/dist/eval/suggestions.js +314 -0
- package/dist/eval/suggestions.js.map +1 -0
- package/dist/eval/undecided.d.ts +64 -0
- package/dist/eval/undecided.d.ts.map +1 -0
- package/dist/eval/undecided.js +101 -0
- package/dist/eval/undecided.js.map +1 -0
- package/dist/eval/verdict.d.ts +66 -0
- package/dist/eval/verdict.d.ts.map +1 -0
- package/dist/eval/verdict.js +106 -0
- package/dist/eval/verdict.js.map +1 -0
- package/dist/eval/verify-signature.d.ts +78 -0
- package/dist/eval/verify-signature.d.ts.map +1 -0
- package/dist/eval/verify-signature.js +185 -0
- package/dist/eval/verify-signature.js.map +1 -0
- package/dist/eval/version-dispatch.d.ts +38 -0
- package/dist/eval/version-dispatch.d.ts.map +1 -0
- package/dist/eval/version-dispatch.js +61 -0
- package/dist/eval/version-dispatch.js.map +1 -0
- package/dist/eval/visibility.d.ts +33 -0
- package/dist/eval/visibility.d.ts.map +1 -0
- package/dist/eval/visibility.js +83 -0
- package/dist/eval/visibility.js.map +1 -0
- package/dist/evaluate.d.ts +24 -0
- package/dist/evaluate.d.ts.map +1 -0
- package/dist/evaluate.js +18 -0
- package/dist/evaluate.js.map +1 -0
- package/dist/expr/builtin-docs.d.ts +51 -0
- package/dist/expr/builtin-docs.d.ts.map +1 -0
- package/dist/expr/builtin-docs.js +874 -0
- package/dist/expr/builtin-docs.js.map +1 -0
- package/dist/expr/builtins.d.ts +50 -0
- package/dist/expr/builtins.d.ts.map +1 -0
- package/dist/expr/builtins.js +966 -0
- package/dist/expr/builtins.js.map +1 -0
- package/dist/expr/decimal-precision.d.ts +39 -0
- package/dist/expr/decimal-precision.d.ts.map +1 -0
- package/dist/expr/decimal-precision.js +62 -0
- package/dist/expr/decimal-precision.js.map +1 -0
- package/dist/expr/decimal.d.ts +172 -0
- package/dist/expr/decimal.d.ts.map +1 -0
- package/dist/expr/decimal.js +782 -0
- package/dist/expr/decimal.js.map +1 -0
- package/dist/expr/deprecations.d.ts +34 -0
- package/dist/expr/deprecations.d.ts.map +1 -0
- package/dist/expr/deprecations.js +17 -0
- package/dist/expr/deprecations.js.map +1 -0
- package/dist/expr/diagnostics.d.ts +21 -0
- package/dist/expr/diagnostics.d.ts.map +1 -0
- package/dist/expr/diagnostics.js +231 -0
- package/dist/expr/diagnostics.js.map +1 -0
- package/dist/expr/direction.d.ts +30 -0
- package/dist/expr/direction.d.ts.map +1 -0
- package/dist/expr/direction.js +77 -0
- package/dist/expr/direction.js.map +1 -0
- package/dist/expr/example-expression.d.ts +62 -0
- package/dist/expr/example-expression.d.ts.map +1 -0
- package/dist/expr/example-expression.js +670 -0
- package/dist/expr/example-expression.js.map +1 -0
- package/dist/expr/instant.d.ts +49 -0
- package/dist/expr/instant.d.ts.map +1 -0
- package/dist/expr/instant.js +111 -0
- package/dist/expr/instant.js.map +1 -0
- package/dist/expr/logic.d.ts +17 -0
- package/dist/expr/logic.d.ts.map +1 -0
- package/dist/expr/logic.js +65 -0
- package/dist/expr/logic.js.map +1 -0
- package/dist/expr/messages.d.ts +45 -0
- package/dist/expr/messages.d.ts.map +1 -0
- package/dist/expr/messages.js +280 -0
- package/dist/expr/messages.js.map +1 -0
- package/dist/expr/money.d.ts +38 -0
- package/dist/expr/money.d.ts.map +1 -0
- package/dist/expr/money.js +127 -0
- package/dist/expr/money.js.map +1 -0
- package/dist/expr/ordering.d.ts +56 -0
- package/dist/expr/ordering.d.ts.map +1 -0
- package/dist/expr/ordering.js +167 -0
- package/dist/expr/ordering.js.map +1 -0
- package/dist/expr/pattern.d.ts +44 -0
- package/dist/expr/pattern.d.ts.map +1 -0
- package/dist/expr/pattern.js +458 -0
- package/dist/expr/pattern.js.map +1 -0
- package/dist/expr/plain-date.d.ts +90 -0
- package/dist/expr/plain-date.d.ts.map +1 -0
- package/dist/expr/plain-date.js +230 -0
- package/dist/expr/plain-date.js.map +1 -0
- package/dist/expr/plural-categories.d.ts +8 -0
- package/dist/expr/plural-categories.d.ts.map +1 -0
- package/dist/expr/plural-categories.js +15 -0
- package/dist/expr/plural-categories.js.map +1 -0
- package/dist/expr/plural-keys.d.ts +39 -0
- package/dist/expr/plural-keys.d.ts.map +1 -0
- package/dist/expr/plural-keys.js +46 -0
- package/dist/expr/plural-keys.js.map +1 -0
- package/dist/expr/plural.d.ts +33 -0
- package/dist/expr/plural.d.ts.map +1 -0
- package/dist/expr/plural.js +50 -0
- package/dist/expr/plural.js.map +1 -0
- package/dist/expr/quantity.d.ts +31 -0
- package/dist/expr/quantity.d.ts.map +1 -0
- package/dist/expr/quantity.js +83 -0
- package/dist/expr/quantity.js.map +1 -0
- package/dist/expr/reduce.d.ts +50 -0
- package/dist/expr/reduce.d.ts.map +1 -0
- package/dist/expr/reduce.js +236 -0
- package/dist/expr/reduce.js.map +1 -0
- package/dist/expr/regex.d.ts +108 -0
- package/dist/expr/regex.d.ts.map +1 -0
- package/dist/expr/regex.js +1210 -0
- package/dist/expr/regex.js.map +1 -0
- package/dist/expr/select-locale.d.ts +67 -0
- package/dist/expr/select-locale.d.ts.map +1 -0
- package/dist/expr/select-locale.js +219 -0
- package/dist/expr/select-locale.js.map +1 -0
- package/dist/expr/sequences.d.ts +123 -0
- package/dist/expr/sequences.d.ts.map +1 -0
- package/dist/expr/sequences.js +234 -0
- package/dist/expr/sequences.js.map +1 -0
- package/dist/expr/strings.d.ts +50 -0
- package/dist/expr/strings.d.ts.map +1 -0
- package/dist/expr/strings.js +184 -0
- package/dist/expr/strings.js.map +1 -0
- package/dist/expr/validation.d.ts +32 -0
- package/dist/expr/validation.d.ts.map +1 -0
- package/dist/expr/validation.js +182 -0
- package/dist/expr/validation.js.map +1 -0
- package/dist/graph/freeze.d.ts +4 -0
- package/dist/graph/freeze.d.ts.map +1 -0
- package/dist/graph/freeze.js +52 -0
- package/dist/graph/freeze.js.map +1 -0
- package/dist/graph/index.d.ts +15 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/inspect.d.ts +76 -0
- package/dist/graph/inspect.d.ts.map +1 -0
- package/dist/graph/inspect.js +263 -0
- package/dist/graph/inspect.js.map +1 -0
- package/dist/graph/read-walk.d.ts +101 -0
- package/dist/graph/read-walk.d.ts.map +1 -0
- package/dist/graph/read-walk.js +358 -0
- package/dist/graph/read-walk.js.map +1 -0
- package/dist/graph/record-index.d.ts +24 -0
- package/dist/graph/record-index.d.ts.map +1 -0
- package/dist/graph/record-index.js +35 -0
- package/dist/graph/record-index.js.map +1 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +139 -0
- package/dist/index.js.map +1 -0
- package/dist/lookup/digest.d.ts +51 -0
- package/dist/lookup/digest.d.ts.map +1 -0
- package/dist/lookup/digest.js +46 -0
- package/dist/lookup/digest.js.map +1 -0
- package/dist/lookup/index.d.ts +28 -0
- package/dist/lookup/index.d.ts.map +1 -0
- package/dist/lookup/index.js +27 -0
- package/dist/lookup/index.js.map +1 -0
- package/dist/lookup/install.d.ts +48 -0
- package/dist/lookup/install.d.ts.map +1 -0
- package/dist/lookup/install.js +315 -0
- package/dist/lookup/install.js.map +1 -0
- package/dist/lookup/pass.d.ts +55 -0
- package/dist/lookup/pass.d.ts.map +1 -0
- package/dist/lookup/pass.js +212 -0
- package/dist/lookup/pass.js.map +1 -0
- package/dist/lookup/pins.d.ts +34 -0
- package/dist/lookup/pins.d.ts.map +1 -0
- package/dist/lookup/pins.js +39 -0
- package/dist/lookup/pins.js.map +1 -0
- package/dist/lookup/provenance.d.ts +23 -0
- package/dist/lookup/provenance.d.ts.map +1 -0
- package/dist/lookup/provenance.js +78 -0
- package/dist/lookup/provenance.js.map +1 -0
- package/dist/lookup/readiness.d.ts +13 -0
- package/dist/lookup/readiness.d.ts.map +1 -0
- package/dist/lookup/readiness.js +57 -0
- package/dist/lookup/readiness.js.map +1 -0
- package/dist/lookup/resolve.d.ts +24 -0
- package/dist/lookup/resolve.d.ts.map +1 -0
- package/dist/lookup/resolve.js +201 -0
- package/dist/lookup/resolve.js.map +1 -0
- package/dist/lookup/store.d.ts +41 -0
- package/dist/lookup/store.d.ts.map +1 -0
- package/dist/lookup/store.js +74 -0
- package/dist/lookup/store.js.map +1 -0
- package/dist/model/access.d.ts +200 -0
- package/dist/model/access.d.ts.map +1 -0
- package/dist/model/access.js +125 -0
- package/dist/model/access.js.map +1 -0
- package/dist/model/artifact-members.d.ts +3 -0
- package/dist/model/artifact-members.d.ts.map +1 -0
- package/dist/model/artifact-members.js +38 -0
- package/dist/model/artifact-members.js.map +1 -0
- package/dist/model/composition.d.ts +47 -0
- package/dist/model/composition.d.ts.map +1 -0
- package/dist/model/composition.js +66 -0
- package/dist/model/composition.js.map +1 -0
- package/dist/model/domain.d.ts +51 -0
- package/dist/model/domain.d.ts.map +1 -0
- package/dist/model/domain.js +75 -0
- package/dist/model/domain.js.map +1 -0
- package/dist/model/duration.d.ts +31 -0
- package/dist/model/duration.d.ts.map +1 -0
- package/dist/model/duration.js +136 -0
- package/dist/model/duration.js.map +1 -0
- package/dist/model/errors.d.ts +58 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/errors.js +81 -0
- package/dist/model/errors.js.map +1 -0
- package/dist/model/evolution.d.ts +177 -0
- package/dist/model/evolution.d.ts.map +1 -0
- package/dist/model/evolution.js +5 -0
- package/dist/model/evolution.js.map +1 -0
- package/dist/model/expr-children.d.ts +15 -0
- package/dist/model/expr-children.d.ts.map +1 -0
- package/dist/model/expr-children.js +45 -0
- package/dist/model/expr-children.js.map +1 -0
- package/dist/model/guards.d.ts +9 -0
- package/dist/model/guards.d.ts.map +1 -0
- package/dist/model/guards.js +11 -0
- package/dist/model/guards.js.map +1 -0
- package/dist/model/input.d.ts +42 -0
- package/dist/model/input.d.ts.map +1 -0
- package/dist/model/input.js +26 -0
- package/dist/model/input.js.map +1 -0
- package/dist/model/integer.d.ts +14 -0
- package/dist/model/integer.d.ts.map +1 -0
- package/dist/model/integer.js +16 -0
- package/dist/model/integer.js.map +1 -0
- package/dist/model/intrinsic.d.ts +18 -0
- package/dist/model/intrinsic.d.ts.map +1 -0
- package/dist/model/intrinsic.js +21 -0
- package/dist/model/intrinsic.js.map +1 -0
- package/dist/model/layout.d.ts +129 -0
- package/dist/model/layout.d.ts.map +1 -0
- package/dist/model/layout.js +2 -0
- package/dist/model/layout.js.map +1 -0
- package/dist/model/media.d.ts +33 -0
- package/dist/model/media.d.ts.map +1 -0
- package/dist/model/media.js +86 -0
- package/dist/model/media.js.map +1 -0
- package/dist/model/members.generated.d.ts +11 -0
- package/dist/model/members.generated.d.ts.map +1 -0
- package/dist/model/members.generated.js +71 -0
- package/dist/model/members.generated.js.map +1 -0
- package/dist/model/row-address.d.ts +27 -0
- package/dist/model/row-address.d.ts.map +1 -0
- package/dist/model/row-address.js +146 -0
- package/dist/model/row-address.js.map +1 -0
- package/dist/model/schema.d.ts +108 -0
- package/dist/model/schema.d.ts.map +1 -0
- package/dist/model/schema.js +2 -0
- package/dist/model/schema.js.map +1 -0
- package/dist/model/shape.d.ts +193 -0
- package/dist/model/shape.d.ts.map +1 -0
- package/dist/model/shape.js +2 -0
- package/dist/model/shape.js.map +1 -0
- package/dist/model/time.d.ts +61 -0
- package/dist/model/time.d.ts.map +1 -0
- package/dist/model/time.js +110 -0
- package/dist/model/time.js.map +1 -0
- package/dist/model/types.d.ts +1329 -0
- package/dist/model/types.d.ts.map +1 -0
- package/dist/model/types.js +424 -0
- package/dist/model/types.js.map +1 -0
- package/dist/model/values.d.ts +91 -0
- package/dist/model/values.d.ts.map +1 -0
- package/dist/model/values.js +195 -0
- package/dist/model/values.js.map +1 -0
- package/dist/model/wire.d.ts +356 -0
- package/dist/model/wire.d.ts.map +1 -0
- package/dist/model/wire.js +1504 -0
- package/dist/model/wire.js.map +1 -0
- package/dist/offline/index.d.ts +374 -0
- package/dist/offline/index.d.ts.map +1 -0
- package/dist/offline/index.js +422 -0
- package/dist/offline/index.js.map +1 -0
- package/dist/testing.d.ts +30 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +42 -0
- package/dist/testing.js.map +1 -0
- package/dist/version.d.ts +30 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +116 -0
- package/dist/version.js.map +1 -0
- package/package.json +98 -3
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { DatasetColumn, LiteralDomain, LookupMissReason, LookupPort, LookupProvenance, Outcome } from '../../model/types.js';
|
|
2
|
+
import type { Evaluated, Presence } from './value.js';
|
|
3
|
+
/**
|
|
4
|
+
* Everything expression evaluation needs from the world it reads: resolved paths, the
|
|
5
|
+
* declared domain of a path, presence and relevance metadata, and the environment's
|
|
6
|
+
* capability flags. Rules and standalone guard evaluation supply different readers, but
|
|
7
|
+
* the language's own semantics live once, above this seam.
|
|
8
|
+
*/
|
|
9
|
+
export interface ExpressionHost {
|
|
10
|
+
/** Reads a declared path, memoised by the reader for one evaluation. */
|
|
11
|
+
read(path: string): Evaluated;
|
|
12
|
+
/** The declared primitive of a path, for the operand typing the artifact states. */
|
|
13
|
+
domainOf(path: string): LiteralDomain | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The declared members of a record path, in declaration order, or `undefined` when the path
|
|
16
|
+
* is not a closed record.
|
|
17
|
+
*
|
|
18
|
+
* A `record` field's members are declared by the artifact; a record-typed context root's are
|
|
19
|
+
* not. `keys` and `values` read this rather than the value's own keys, so a field the record
|
|
20
|
+
* omits is still one of its declared members and an open root is refused rather than read as
|
|
21
|
+
* whatever the host happened to send.
|
|
22
|
+
*/
|
|
23
|
+
recordMembersOf(path: string): Readonly<Record<string, LiteralDomain>> | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The declared members of a record array's rows, with each member's domain, or `undefined`
|
|
26
|
+
* when the array's items are not declared records. A comprehension over a declared array of
|
|
27
|
+
* rows binds each row as a closed record, so `map(r in f_rows: keys(r))` is well defined.
|
|
28
|
+
*/
|
|
29
|
+
recordItemMembersOf(path: string): Readonly<Record<string, LiteralDomain>> | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The declared element domain of an array path, or `undefined` when the declaration states
|
|
32
|
+
* none (an open list) or names record items rather than a primitive.
|
|
33
|
+
*/
|
|
34
|
+
elementDomainOf(path: string): LiteralDomain | undefined;
|
|
35
|
+
/** Presence metadata for a path, which is not the same question as its value. */
|
|
36
|
+
presence(path: string): Presence;
|
|
37
|
+
/**
|
|
38
|
+
* Whether this device may read the value at `path` at all. Presence and
|
|
39
|
+
* access are different questions: a masked, hidden or not-yet-written `write_only` field is
|
|
40
|
+
* present to the record and still unreadable here.
|
|
41
|
+
*/
|
|
42
|
+
canRead(path: string): boolean;
|
|
43
|
+
/** Relevance metadata for a path: it never reads the value. */
|
|
44
|
+
isRelevant(path: string): boolean;
|
|
45
|
+
/** A non-authorisation capability flag supplied by the environment. */
|
|
46
|
+
hasCapability(name: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The canonical row key of one item of a declared array. `undefined`
|
|
49
|
+
* means the row cannot be identified here, so a binding that needs one fails closed
|
|
50
|
+
* rather than matching an array position.
|
|
51
|
+
*/
|
|
52
|
+
rowKeyOf(arrayPath: string, index: number): string | number | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Marks the current position in the disclosure-taint stream. A read of a hidden, excluded
|
|
55
|
+
* field taints the stream so a caller can keep the value out of the report.
|
|
56
|
+
*/
|
|
57
|
+
taintMark?(): number;
|
|
58
|
+
/** The hidden, excluded fields a read since `mark` touched. */
|
|
59
|
+
taintedSince?(mark: number): readonly string[];
|
|
60
|
+
/**
|
|
61
|
+
* Records that the rule in force read an input that held no decided value, `RULES-2.1.1`.
|
|
62
|
+
*
|
|
63
|
+
* The evaluator answers this for a binder read the reader never sees: a row member the row does
|
|
64
|
+
* not carry, or a member no writer produced. The reader answers its own value reads, and the two
|
|
65
|
+
* are the complement of the refusals an access answer records.
|
|
66
|
+
*/
|
|
67
|
+
noteMissingInput?(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Records a withheld member read through a binder against the rule instance consuming it.
|
|
70
|
+
* The container read records which row supplied the withheld member; a `$prev` or `$next` read
|
|
71
|
+
* must also record the refusal for the row whose rule actually consumed it.
|
|
72
|
+
*/
|
|
73
|
+
noteRefusedInput?(fieldId: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Records that the rule in force read a value the server holds, `[ACCESS-3.1.2]`.
|
|
76
|
+
*
|
|
77
|
+
* The evaluator answers this for a binder read, which the reader never sees. The handoff survives
|
|
78
|
+
* a Kleene fold that turns the `DEFERRED` into `UNKNOWN`, so readiness still states it.
|
|
79
|
+
*/
|
|
80
|
+
noteDeferredInput?(): void;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The dataset seam: the store a host installed for this call, and where a resolution is
|
|
84
|
+
* reported.
|
|
85
|
+
*
|
|
86
|
+
* The store answers what a table holds; the report is the caller's, because provenance and
|
|
87
|
+
* a stale table belong to the evaluation being reported, not to the catalogue. A host that
|
|
88
|
+
* installed no store leaves every table missing, which is `STALE_DATA` rather than an
|
|
89
|
+
* empty answer.
|
|
90
|
+
*/
|
|
91
|
+
export interface LookupHost {
|
|
92
|
+
readonly port: LookupPort | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* The declared columns of one table, read from the store the host installed before the
|
|
95
|
+
* evaluation's own wrappers replaced it.
|
|
96
|
+
*
|
|
97
|
+
* A resolution hands back bare output records, so the declaration that a column is a
|
|
98
|
+
* `decimal` is lost at the store boundary unless the caller that holds the store states it.
|
|
99
|
+
* `declaredColumnsOf` builds this from a port that answers `columns(tableId)`; a port that
|
|
100
|
+
* does not leaves it absent, and the strict comparator and the domain-driven aggregates
|
|
101
|
+
* then answer undecided rather than reading a spelling.
|
|
102
|
+
*/
|
|
103
|
+
readonly columnsOf?: (tableId: string) => readonly DatasetColumn[] | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* The host's record date: the date a data-bound set resolves against when
|
|
106
|
+
* the call names no `asOf` of its own. Absent, an as-of-less membership
|
|
107
|
+
* call on a data table stays stale.
|
|
108
|
+
*/
|
|
109
|
+
readonly recordDate: string | undefined;
|
|
110
|
+
/** Records one resolution's provenance, hit or miss. */
|
|
111
|
+
recordProvenance(provenance: LookupProvenance): void;
|
|
112
|
+
/** Reports that a required table version could not be resolved. */
|
|
113
|
+
recordStaleData(tableId: string, reason: LookupMissReason): void;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The columns capability of one store, or `undefined` when it states none.
|
|
117
|
+
*
|
|
118
|
+
* The capability is read structurally because the port contract is owned by the store seam:
|
|
119
|
+
* a store that implements `columns(tableId)` answers here, and every store that does not
|
|
120
|
+
* simply leaves the aggregate input domains undeclared. The returned list is validated at
|
|
121
|
+
* this boundary rather than trusted, so a malformed store answer is ignored like no answer.
|
|
122
|
+
*
|
|
123
|
+
* This is called where the evaluation is assembled, before the pass replaces the store with
|
|
124
|
+
* its memoised and version-pinned wrappers, so the capability reaches the expression without
|
|
125
|
+
* the wrappers having to forward a method every store need not implement.
|
|
126
|
+
*/
|
|
127
|
+
export declare function declaredColumnsOf(port: LookupPort | undefined): ((tableId: string) => readonly DatasetColumn[] | undefined) | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The rule-scoped seam behind `rule_ok`, `no_blocking` and the step folds.
|
|
130
|
+
*
|
|
131
|
+
* Each reads fellow rules of the evaluation it runs inside, so only a rule engine can answer
|
|
132
|
+
* them; a standalone guard supplies no host and the built-ins are refused there. The compiler
|
|
133
|
+
* already restricts them to gate expressions.
|
|
134
|
+
*/
|
|
135
|
+
export interface RuleHost {
|
|
136
|
+
/** The outcome of another rule under this evaluation. */
|
|
137
|
+
outcomeOf(ruleId: string): Outcome;
|
|
138
|
+
/** Whether no `block`-severity result of `kind` blocks under `RULES-1.1.5`. */
|
|
139
|
+
noBlocking(kind: string): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Every rule the named step places folded to one outcome (`RULES-1.1.12`).
|
|
142
|
+
*
|
|
143
|
+
* Absent on a host that does not index the artifact's layout; the call then answers
|
|
144
|
+
* `UNKNOWN` rather than guessing that the step passed.
|
|
145
|
+
*/
|
|
146
|
+
readonly outcomeOfStep?: (stepId: string) => Outcome;
|
|
147
|
+
/** Whether no `block`-severity rule the named step places blocks. */
|
|
148
|
+
readonly noBlockingIn?: (stepId: string) => boolean;
|
|
149
|
+
/** Whether every `required` rule the named step places is satisfied, folded to a four-state outcome. */
|
|
150
|
+
readonly requiredIn?: (stepId: string) => Outcome;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/eval/expr/host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,OAAO,EACR,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,oFAAoF;IACpF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IAClD;;;;;;;;OAQG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,GAAG,SAAS,CAA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AC;IACxC,wDAAwD;IACxD,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrD,mEAAmE;IACnE,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAClE;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,GAAG,SAAS,GAC3B,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,aAAa,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,CAQzE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,yDAAyD;IACzD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,+EAA+E;IAC/E,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IACrD,qEAAqE;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IACpD,wGAAwG;IACxG,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;CACnD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { isScalarPrimitive } from '../../model/types.js';
|
|
2
|
+
import { isRecord } from '../../model/guards.js';
|
|
3
|
+
/** Whether a value the store stated is the column list the table seam promises. */
|
|
4
|
+
function isColumnList(value) {
|
|
5
|
+
if (!Array.isArray(value))
|
|
6
|
+
return false;
|
|
7
|
+
const entries = value;
|
|
8
|
+
return entries.every((entry) => isRecord(entry) &&
|
|
9
|
+
typeof entry['columnId'] === 'string' &&
|
|
10
|
+
isScalarPrimitive(entry['primitive']) &&
|
|
11
|
+
(entry['role'] === 'key' || entry['role'] === 'output'));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The columns capability of one store, or `undefined` when it states none.
|
|
15
|
+
*
|
|
16
|
+
* The capability is read structurally because the port contract is owned by the store seam:
|
|
17
|
+
* a store that implements `columns(tableId)` answers here, and every store that does not
|
|
18
|
+
* simply leaves the aggregate input domains undeclared. The returned list is validated at
|
|
19
|
+
* this boundary rather than trusted, so a malformed store answer is ignored like no answer.
|
|
20
|
+
*
|
|
21
|
+
* This is called where the evaluation is assembled, before the pass replaces the store with
|
|
22
|
+
* its memoised and version-pinned wrappers, so the capability reaches the expression without
|
|
23
|
+
* the wrappers having to forward a method every store need not implement.
|
|
24
|
+
*/
|
|
25
|
+
export function declaredColumnsOf(port) {
|
|
26
|
+
if (port === undefined)
|
|
27
|
+
return undefined;
|
|
28
|
+
const read = Reflect.get(port, 'columns');
|
|
29
|
+
if (typeof read !== 'function')
|
|
30
|
+
return undefined;
|
|
31
|
+
return (tableId) => {
|
|
32
|
+
const stated = Reflect.apply(read, port, [tableId]);
|
|
33
|
+
return isColumnList(stated) ? stated : undefined;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../../src/eval/expr/host.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAqHjD,mFAAmF;AACnF,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,MAAM,OAAO,GAAuB,KAAK,CAAC;IAC1C,OAAO,OAAO,CAAC,KAAK,CAClB,CAAC,KAAK,EAAE,EAAE,CACR,QAAQ,CAAC,KAAK,CAAC;QACf,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,QAAQ;QACrC,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACrC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAA4B;IAE5B,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzC,MAAM,IAAI,GAAY,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACnD,IAAI,OAAO,IAAI,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IACjD,OAAO,CAAC,OAAe,EAAE,EAAE;QACzB,MAAM,MAAM,GAAY,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7D,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACnD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type {\n DatasetColumn,\n LiteralDomain,\n LookupMissReason,\n LookupPort,\n LookupProvenance,\n Outcome,\n} from '../../model/types.js';\nimport { isScalarPrimitive } from '../../model/types.js';\nimport { isRecord } from '../../model/guards.js';\nimport type { Evaluated, Presence } from './value.js';\n\n/**\n * Everything expression evaluation needs from the world it reads: resolved paths, the\n * declared domain of a path, presence and relevance metadata, and the environment's\n * capability flags. Rules and standalone guard evaluation supply different readers, but\n * the language's own semantics live once, above this seam.\n */\nexport interface ExpressionHost {\n /** Reads a declared path, memoised by the reader for one evaluation. */\n read(path: string): Evaluated;\n /** The declared primitive of a path, for the operand typing the artifact states. */\n domainOf(path: string): LiteralDomain | undefined;\n /**\n * The declared members of a record path, in declaration order, or `undefined` when the path\n * is not a closed record.\n *\n * A `record` field's members are declared by the artifact; a record-typed context root's are\n * not. `keys` and `values` read this rather than the value's own keys, so a field the record\n * omits is still one of its declared members and an open root is refused rather than read as\n * whatever the host happened to send.\n */\n recordMembersOf(path: string): Readonly<Record<string, LiteralDomain>> | undefined;\n /**\n * The declared members of a record array's rows, with each member's domain, or `undefined`\n * when the array's items are not declared records. A comprehension over a declared array of\n * rows binds each row as a closed record, so `map(r in f_rows: keys(r))` is well defined.\n */\n recordItemMembersOf(path: string): Readonly<Record<string, LiteralDomain>> | undefined;\n /**\n * The declared element domain of an array path, or `undefined` when the declaration states\n * none (an open list) or names record items rather than a primitive.\n */\n elementDomainOf(path: string): LiteralDomain | undefined;\n /** Presence metadata for a path, which is not the same question as its value. */\n presence(path: string): Presence;\n /**\n * Whether this device may read the value at `path` at all. Presence and\n * access are different questions: a masked, hidden or not-yet-written `write_only` field is\n * present to the record and still unreadable here.\n */\n canRead(path: string): boolean;\n /** Relevance metadata for a path: it never reads the value. */\n isRelevant(path: string): boolean;\n /** A non-authorisation capability flag supplied by the environment. */\n hasCapability(name: string): boolean;\n /**\n * The canonical row key of one item of a declared array. `undefined`\n * means the row cannot be identified here, so a binding that needs one fails closed\n * rather than matching an array position.\n */\n rowKeyOf(arrayPath: string, index: number): string | number | undefined;\n /**\n * Marks the current position in the disclosure-taint stream. A read of a hidden, excluded\n * field taints the stream so a caller can keep the value out of the report.\n */\n taintMark?(): number;\n /** The hidden, excluded fields a read since `mark` touched. */\n taintedSince?(mark: number): readonly string[];\n /**\n * Records that the rule in force read an input that held no decided value, `RULES-2.1.1`.\n *\n * The evaluator answers this for a binder read the reader never sees: a row member the row does\n * not carry, or a member no writer produced. The reader answers its own value reads, and the two\n * are the complement of the refusals an access answer records.\n */\n noteMissingInput?(): void;\n /**\n * Records a withheld member read through a binder against the rule instance consuming it.\n * The container read records which row supplied the withheld member; a `$prev` or `$next` read\n * must also record the refusal for the row whose rule actually consumed it.\n */\n noteRefusedInput?(fieldId: string): void;\n /**\n * Records that the rule in force read a value the server holds, `[ACCESS-3.1.2]`.\n *\n * The evaluator answers this for a binder read, which the reader never sees. The handoff survives\n * a Kleene fold that turns the `DEFERRED` into `UNKNOWN`, so readiness still states it.\n */\n noteDeferredInput?(): void;\n}\n\n/**\n * The dataset seam: the store a host installed for this call, and where a resolution is\n * reported.\n *\n * The store answers what a table holds; the report is the caller's, because provenance and\n * a stale table belong to the evaluation being reported, not to the catalogue. A host that\n * installed no store leaves every table missing, which is `STALE_DATA` rather than an\n * empty answer.\n */\nexport interface LookupHost {\n readonly port: LookupPort | undefined;\n /**\n * The declared columns of one table, read from the store the host installed before the\n * evaluation's own wrappers replaced it.\n *\n * A resolution hands back bare output records, so the declaration that a column is a\n * `decimal` is lost at the store boundary unless the caller that holds the store states it.\n * `declaredColumnsOf` builds this from a port that answers `columns(tableId)`; a port that\n * does not leaves it absent, and the strict comparator and the domain-driven aggregates\n * then answer undecided rather than reading a spelling.\n */\n readonly columnsOf?: (tableId: string) => readonly DatasetColumn[] | undefined;\n /**\n * The host's record date: the date a data-bound set resolves against when\n * the call names no `asOf` of its own. Absent, an as-of-less membership\n * call on a data table stays stale.\n */\n readonly recordDate: string | undefined;\n /** Records one resolution's provenance, hit or miss. */\n recordProvenance(provenance: LookupProvenance): void;\n /** Reports that a required table version could not be resolved. */\n recordStaleData(tableId: string, reason: LookupMissReason): void;\n}\n\n/** Whether a value the store stated is the column list the table seam promises. */\nfunction isColumnList(value: unknown): value is readonly DatasetColumn[] {\n if (!Array.isArray(value)) return false;\n const entries: readonly unknown[] = value;\n return entries.every(\n (entry) =>\n isRecord(entry) &&\n typeof entry['columnId'] === 'string' &&\n isScalarPrimitive(entry['primitive']) &&\n (entry['role'] === 'key' || entry['role'] === 'output'),\n );\n}\n\n/**\n * The columns capability of one store, or `undefined` when it states none.\n *\n * The capability is read structurally because the port contract is owned by the store seam:\n * a store that implements `columns(tableId)` answers here, and every store that does not\n * simply leaves the aggregate input domains undeclared. The returned list is validated at\n * this boundary rather than trusted, so a malformed store answer is ignored like no answer.\n *\n * This is called where the evaluation is assembled, before the pass replaces the store with\n * its memoised and version-pinned wrappers, so the capability reaches the expression without\n * the wrappers having to forward a method every store need not implement.\n */\nexport function declaredColumnsOf(\n port: LookupPort | undefined,\n): ((tableId: string) => readonly DatasetColumn[] | undefined) | undefined {\n if (port === undefined) return undefined;\n const read: unknown = Reflect.get(port, 'columns');\n if (typeof read !== 'function') return undefined;\n return (tableId: string) => {\n const stated: unknown = Reflect.apply(read, port, [tableId]);\n return isColumnList(stated) ? stated : undefined;\n };\n}\n\n/**\n * The rule-scoped seam behind `rule_ok`, `no_blocking` and the step folds.\n *\n * Each reads fellow rules of the evaluation it runs inside, so only a rule engine can answer\n * them; a standalone guard supplies no host and the built-ins are refused there. The compiler\n * already restricts them to gate expressions.\n */\nexport interface RuleHost {\n /** The outcome of another rule under this evaluation. */\n outcomeOf(ruleId: string): Outcome;\n /** Whether no `block`-severity result of `kind` blocks under `RULES-1.1.5`. */\n noBlocking(kind: string): boolean;\n /**\n * Every rule the named step places folded to one outcome (`RULES-1.1.12`).\n *\n * Absent on a host that does not index the artifact's layout; the call then answers\n * `UNKNOWN` rather than guessing that the step passed.\n */\n readonly outcomeOfStep?: (stepId: string) => Outcome;\n /** Whether no `block`-severity rule the named step places blocks. */\n readonly noBlockingIn?: (stepId: string) => boolean;\n /** Whether every `required` rule the named step places is satisfied, folded to a four-state outcome. */\n readonly requiredIn?: (stepId: string) => Outcome;\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ExprNode } from '../../model/types.js';
|
|
2
|
+
import type { AggregateContext } from './aggregates.js';
|
|
3
|
+
import type { Evaluated } from './value.js';
|
|
4
|
+
/** The list-producing comprehensions, `EXPR-10.2.11` and `EXPR-10.2.12`. */
|
|
5
|
+
export type ListOperator = 'map' | 'filter';
|
|
6
|
+
/**
|
|
7
|
+
* `map(x in xs: expr)` / `map(x in xs: expr if pred)` and `filter(x in xs: pred)`.
|
|
8
|
+
*
|
|
9
|
+
* Both read the source once, in source order, through the same binder the aggregates use, so a
|
|
10
|
+
* body may read `$it`, `$i`, `$prev`, `$next` and the binder name exactly as it does inside
|
|
11
|
+
* `sum` or `count_where`. The result is a plain wire list, with the element domains its
|
|
12
|
+
* projections carry — that is what lets `join(map(x in f_rows: x.f_code), ", ")` type and
|
|
13
|
+
* evaluate as a list of text rather than a list of spellings.
|
|
14
|
+
*
|
|
15
|
+
* Amplification is bounded twice. No single produced list is larger than the evaluation's
|
|
16
|
+
* per-source element allowance (`refuseElements`), and a `map` nested inside another producer
|
|
17
|
+
* charges the elements it materialises against the rule's cumulative element allowance through
|
|
18
|
+
* the same `forEachElement` every aggregate uses. The outermost comprehension is not charged,
|
|
19
|
+
* so a single legal list is admitted; a nesting that multiplies past the ceiling is refused.
|
|
20
|
+
* An element that cannot be read makes the whole produced list undetermined rather than
|
|
21
|
+
* silently shortening it (`EXPR-10.1.4`, `EXPR-10.2.4`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function listCall(context: AggregateContext, op: ListOperator, args: readonly ExprNode[]): Evaluated;
|
|
24
|
+
//# sourceMappingURL=lists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../src/eval/expr/lists.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAiD,MAAM,sBAAsB,CAAC;AAEpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AAE5D,4EAA4E;AAC5E,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,gBAAgB,EACzB,EAAE,EAAE,YAAY,EAChB,IAAI,EAAE,SAAS,QAAQ,EAAE,GACxB,SAAS,CAMX"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { AxiomError } from '../../model/errors.js';
|
|
2
|
+
import { DEFERRED, isUndetermined, UNKNOWN } from '../../model/types.js';
|
|
3
|
+
import { comprehensionElementDomain, forEachElement } from './aggregates.js';
|
|
4
|
+
import { elementDomainsOf } from './domains.js';
|
|
5
|
+
import { foldUndetermined } from './operands.js';
|
|
6
|
+
import { valueOf, withheldRowsOf } from './value.js';
|
|
7
|
+
/**
|
|
8
|
+
* `map(x in xs: expr)` / `map(x in xs: expr if pred)` and `filter(x in xs: pred)`.
|
|
9
|
+
*
|
|
10
|
+
* Both read the source once, in source order, through the same binder the aggregates use, so a
|
|
11
|
+
* body may read `$it`, `$i`, `$prev`, `$next` and the binder name exactly as it does inside
|
|
12
|
+
* `sum` or `count_where`. The result is a plain wire list, with the element domains its
|
|
13
|
+
* projections carry — that is what lets `join(map(x in f_rows: x.f_code), ", ")` type and
|
|
14
|
+
* evaluate as a list of text rather than a list of spellings.
|
|
15
|
+
*
|
|
16
|
+
* Amplification is bounded twice. No single produced list is larger than the evaluation's
|
|
17
|
+
* per-source element allowance (`refuseElements`), and a `map` nested inside another producer
|
|
18
|
+
* charges the elements it materialises against the rule's cumulative element allowance through
|
|
19
|
+
* the same `forEachElement` every aggregate uses. The outermost comprehension is not charged,
|
|
20
|
+
* so a single legal list is admitted; a nesting that multiplies past the ceiling is refused.
|
|
21
|
+
* An element that cannot be read makes the whole produced list undetermined rather than
|
|
22
|
+
* silently shortening it (`EXPR-10.1.4`, `EXPR-10.2.4`).
|
|
23
|
+
*/
|
|
24
|
+
export function listCall(context, op, args) {
|
|
25
|
+
const [operand] = args;
|
|
26
|
+
if (args.length !== 1 || operand === undefined || operand.kind !== 'comprehension') {
|
|
27
|
+
throw new AxiomError('ENGINE_ERROR', `${op} takes one comprehension`);
|
|
28
|
+
}
|
|
29
|
+
return op === 'map' ? projectElements(context, operand) : keepElements(context, operand);
|
|
30
|
+
}
|
|
31
|
+
/** The result value one list of produced elements has, with the sidebands its producer knew. */
|
|
32
|
+
function producedList(elements, elementDomain) {
|
|
33
|
+
const withheld = withheldRowsOf(elements);
|
|
34
|
+
const memberDomains = elements.map((element) => element.memberDomains);
|
|
35
|
+
const closedMembers = elements.map((element) => element.closedMembers);
|
|
36
|
+
return {
|
|
37
|
+
kind: 'value',
|
|
38
|
+
value: elements.map((element) => element.value),
|
|
39
|
+
domain: undefined,
|
|
40
|
+
elementDomains: elementDomainsOf(elements),
|
|
41
|
+
// The element domain the projection declares travels beside the per-element answers, so an
|
|
42
|
+
// empty produced list still folds as its operand's domain rather than as a numeric zero.
|
|
43
|
+
...(elementDomain === undefined ? {} : { elementDomain }),
|
|
44
|
+
...(withheld === undefined ? {} : { withheldRows: withheld }),
|
|
45
|
+
...(memberDomains.some((entry) => entry !== undefined)
|
|
46
|
+
? { elementMemberDomains: memberDomains }
|
|
47
|
+
: {}),
|
|
48
|
+
...(closedMembers.some((entry) => entry !== undefined)
|
|
49
|
+
? { elementClosedMembers: closedMembers }
|
|
50
|
+
: {}),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** `map`: one projected value per element the filter keeps. */
|
|
54
|
+
function projectElements(context, node) {
|
|
55
|
+
const projected = [];
|
|
56
|
+
let pending;
|
|
57
|
+
const stopped = forEachElement(context, node, () => {
|
|
58
|
+
if (node.valueExpr === undefined) {
|
|
59
|
+
throw new AxiomError('ENGINE_ERROR', 'map requires a value projection');
|
|
60
|
+
}
|
|
61
|
+
if (node.predicate !== undefined) {
|
|
62
|
+
const outcome = context.statusOf(context.evaluate(node.predicate));
|
|
63
|
+
if (outcome === 'UNKNOWN')
|
|
64
|
+
return valueOf(UNKNOWN);
|
|
65
|
+
if (outcome === 'DEFERRED')
|
|
66
|
+
pending = foldUndetermined(pending, DEFERRED);
|
|
67
|
+
if (outcome === 'FAIL')
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const evaluated = context.evaluate(node.valueExpr);
|
|
71
|
+
if (evaluated.kind === 'absent') {
|
|
72
|
+
pending = foldUndetermined(pending, UNKNOWN);
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
if (isUndetermined(evaluated.value)) {
|
|
76
|
+
pending = foldUndetermined(pending, evaluated.value);
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
projected.push(context.typed(node.valueExpr, evaluated));
|
|
80
|
+
return undefined;
|
|
81
|
+
});
|
|
82
|
+
if (stopped !== undefined)
|
|
83
|
+
return stopped;
|
|
84
|
+
// A list is never partial: an element this device could not project decides the whole list.
|
|
85
|
+
if (pending !== undefined)
|
|
86
|
+
return valueOf(pending);
|
|
87
|
+
context.refuseElements(projected.length);
|
|
88
|
+
// The projection's declared domain, not the source's: `map(x in f_rows: x.amount)` produces
|
|
89
|
+
// the member's domain. It is the only statement available when the source has no elements.
|
|
90
|
+
return producedList(projected, comprehensionElementDomain(context, node));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The element domain a `filter` keeps, read from the comprehension's source.
|
|
94
|
+
*
|
|
95
|
+
* `filter` copies the source's own elements, so an empty result still belongs to the source's
|
|
96
|
+
* element domain. A source that is not a declared path (a literal or a nested call) states no
|
|
97
|
+
* single domain here; its non-empty result carries each element's own domain instead.
|
|
98
|
+
*/
|
|
99
|
+
function sourceElementDomain(context, source) {
|
|
100
|
+
if (source.kind !== 'path')
|
|
101
|
+
return undefined;
|
|
102
|
+
const origin = context.declarationPathOf(source.path) ?? source.path;
|
|
103
|
+
return context.declaredElementDomainOf(origin);
|
|
104
|
+
}
|
|
105
|
+
/** `filter`: the elements the predicate keeps, as a copy in source order. */
|
|
106
|
+
function keepElements(context, node) {
|
|
107
|
+
const kept = [];
|
|
108
|
+
const rowUndetermined = [];
|
|
109
|
+
let anyUndeterminedRow = false;
|
|
110
|
+
let pending;
|
|
111
|
+
const stopped = forEachElement(context, node, () => {
|
|
112
|
+
if (node.predicate === undefined) {
|
|
113
|
+
throw new AxiomError('ENGINE_ERROR', 'filter requires a predicate');
|
|
114
|
+
}
|
|
115
|
+
const scope = context.scopes[context.scopes.length - 1];
|
|
116
|
+
if (scope === undefined)
|
|
117
|
+
return undefined;
|
|
118
|
+
const element = scope.elements[scope.index];
|
|
119
|
+
if (element === undefined)
|
|
120
|
+
return undefined;
|
|
121
|
+
if (isUndetermined(element.value)) {
|
|
122
|
+
pending = foldUndetermined(pending, element.value);
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
const outcome = context.statusOf(context.evaluate(node.predicate));
|
|
126
|
+
if (outcome === 'UNKNOWN')
|
|
127
|
+
return valueOf(UNKNOWN);
|
|
128
|
+
if (outcome === 'DEFERRED') {
|
|
129
|
+
pending = foldUndetermined(pending, DEFERRED);
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
if (outcome !== 'PASS')
|
|
133
|
+
return undefined;
|
|
134
|
+
// The row's sidebands travel with it: a withheld member must not read as an absence once
|
|
135
|
+
// the row is copied, and a member a writer could not produce keeps its own sentinel.
|
|
136
|
+
const withheldMembers = scope.withheld?.[scope.index];
|
|
137
|
+
kept.push(withheldMembers === undefined || withheldMembers.length === 0
|
|
138
|
+
? element
|
|
139
|
+
: { ...element, withheldMembers });
|
|
140
|
+
const undeterminedMembers = scope.undetermined?.[scope.index];
|
|
141
|
+
rowUndetermined.push(undeterminedMembers ?? []);
|
|
142
|
+
if (undeterminedMembers !== undefined && undeterminedMembers.length > 0) {
|
|
143
|
+
anyUndeterminedRow = true;
|
|
144
|
+
}
|
|
145
|
+
return undefined;
|
|
146
|
+
});
|
|
147
|
+
if (stopped !== undefined)
|
|
148
|
+
return stopped;
|
|
149
|
+
if (pending !== undefined)
|
|
150
|
+
return valueOf(pending);
|
|
151
|
+
context.refuseElements(kept.length);
|
|
152
|
+
const result = producedList(kept, sourceElementDomain(context, node.source));
|
|
153
|
+
return anyUndeterminedRow ? { ...result, undeterminedRows: rowUndetermined } : result;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=lists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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C;IAC7E,OAAO,kBAAkB,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AACxF,CAAC","sourcesContent":["import { AxiomError } from '../../model/errors.js';\nimport type { ExprNode, LiteralDomain, Undetermined, UndeterminedRows } from '../../model/types.js';\nimport { DEFERRED, isUndetermined, UNKNOWN } from '../../model/types.js';\nimport type { AggregateContext } from './aggregates.js';\nimport { comprehensionElementDomain, forEachElement } from './aggregates.js';\nimport { elementDomainsOf } from './domains.js';\nimport { foldUndetermined } from './operands.js';\nimport { valueOf, withheldRowsOf } from './value.js';\nimport type { Evaluated, EvaluatedValue } from './value.js';\n\n/** The list-producing comprehensions, `EXPR-10.2.11` and `EXPR-10.2.12`. */\nexport type ListOperator = 'map' | 'filter';\n\n/**\n * `map(x in xs: expr)` / `map(x in xs: expr if pred)` and `filter(x in xs: pred)`.\n *\n * Both read the source once, in source order, through the same binder the aggregates use, so a\n * body may read `$it`, `$i`, `$prev`, `$next` and the binder name exactly as it does inside\n * `sum` or `count_where`. The result is a plain wire list, with the element domains its\n * projections carry — that is what lets `join(map(x in f_rows: x.f_code), \", \")` type and\n * evaluate as a list of text rather than a list of spellings.\n *\n * Amplification is bounded twice. No single produced list is larger than the evaluation's\n * per-source element allowance (`refuseElements`), and a `map` nested inside another producer\n * charges the elements it materialises against the rule's cumulative element allowance through\n * the same `forEachElement` every aggregate uses. The outermost comprehension is not charged,\n * so a single legal list is admitted; a nesting that multiplies past the ceiling is refused.\n * An element that cannot be read makes the whole produced list undetermined rather than\n * silently shortening it (`EXPR-10.1.4`, `EXPR-10.2.4`).\n */\nexport function listCall(\n context: AggregateContext,\n op: ListOperator,\n args: readonly ExprNode[],\n): Evaluated {\n const [operand] = args;\n if (args.length !== 1 || operand === undefined || operand.kind !== 'comprehension') {\n throw new AxiomError('ENGINE_ERROR', `${op} takes one comprehension`);\n }\n return op === 'map' ? projectElements(context, operand) : keepElements(context, operand);\n}\n\n/** The result value one list of produced elements has, with the sidebands its producer knew. */\nfunction producedList(\n elements: readonly EvaluatedValue[],\n elementDomain: LiteralDomain | undefined,\n): EvaluatedValue {\n const withheld = withheldRowsOf(elements);\n const memberDomains = elements.map((element) => element.memberDomains);\n const closedMembers = elements.map((element) => element.closedMembers);\n return {\n kind: 'value',\n value: elements.map((element) => element.value),\n domain: undefined,\n elementDomains: elementDomainsOf(elements),\n // The element domain the projection declares travels beside the per-element answers, so an\n // empty produced list still folds as its operand's domain rather than as a numeric zero.\n ...(elementDomain === undefined ? {} : { elementDomain }),\n ...(withheld === undefined ? {} : { withheldRows: withheld }),\n ...(memberDomains.some((entry) => entry !== undefined)\n ? { elementMemberDomains: memberDomains }\n : {}),\n ...(closedMembers.some((entry) => entry !== undefined)\n ? { elementClosedMembers: closedMembers }\n : {}),\n };\n}\n\n/** `map`: one projected value per element the filter keeps. */\nfunction projectElements(\n context: AggregateContext,\n node: ExprNode & { kind: 'comprehension' },\n): Evaluated {\n const projected: EvaluatedValue[] = [];\n let pending: Undetermined | undefined;\n const stopped = forEachElement(context, node, () => {\n if (node.valueExpr === undefined) {\n throw new AxiomError('ENGINE_ERROR', 'map requires a value projection');\n }\n if (node.predicate !== undefined) {\n const outcome = context.statusOf(context.evaluate(node.predicate));\n if (outcome === 'UNKNOWN') return valueOf(UNKNOWN);\n if (outcome === 'DEFERRED') pending = foldUndetermined(pending, DEFERRED);\n if (outcome === 'FAIL') return undefined;\n }\n const evaluated = context.evaluate(node.valueExpr);\n if (evaluated.kind === 'absent') {\n pending = foldUndetermined(pending, UNKNOWN);\n return undefined;\n }\n if (isUndetermined(evaluated.value)) {\n pending = foldUndetermined(pending, evaluated.value);\n return undefined;\n }\n projected.push(context.typed(node.valueExpr, evaluated));\n return undefined;\n });\n if (stopped !== undefined) return stopped;\n // A list is never partial: an element this device could not project decides the whole list.\n if (pending !== undefined) return valueOf(pending);\n context.refuseElements(projected.length);\n // The projection's declared domain, not the source's: `map(x in f_rows: x.amount)` produces\n // the member's domain. It is the only statement available when the source has no elements.\n return producedList(projected, comprehensionElementDomain(context, node));\n}\n\n/**\n * The element domain a `filter` keeps, read from the comprehension's source.\n *\n * `filter` copies the source's own elements, so an empty result still belongs to the source's\n * element domain. A source that is not a declared path (a literal or a nested call) states no\n * single domain here; its non-empty result carries each element's own domain instead.\n */\nfunction sourceElementDomain(\n context: AggregateContext,\n source: ExprNode,\n): LiteralDomain | undefined {\n if (source.kind !== 'path') return undefined;\n const origin = context.declarationPathOf(source.path) ?? source.path;\n return context.declaredElementDomainOf(origin);\n}\n\n/** `filter`: the elements the predicate keeps, as a copy in source order. */\nfunction keepElements(\n context: AggregateContext,\n node: ExprNode & { kind: 'comprehension' },\n): Evaluated {\n const kept: EvaluatedValue[] = [];\n const rowUndetermined: UndeterminedRows[number][] = [];\n let anyUndeterminedRow = false;\n let pending: Undetermined | undefined;\n const stopped = forEachElement(context, node, () => {\n if (node.predicate === undefined) {\n throw new AxiomError('ENGINE_ERROR', 'filter requires a predicate');\n }\n const scope = context.scopes[context.scopes.length - 1];\n if (scope === undefined) return undefined;\n const element = scope.elements[scope.index];\n if (element === undefined) return undefined;\n if (isUndetermined(element.value)) {\n pending = foldUndetermined(pending, element.value);\n return undefined;\n }\n const outcome = context.statusOf(context.evaluate(node.predicate));\n if (outcome === 'UNKNOWN') return valueOf(UNKNOWN);\n if (outcome === 'DEFERRED') {\n pending = foldUndetermined(pending, DEFERRED);\n return undefined;\n }\n if (outcome !== 'PASS') return undefined;\n // The row's sidebands travel with it: a withheld member must not read as an absence once\n // the row is copied, and a member a writer could not produce keeps its own sentinel.\n const withheldMembers = scope.withheld?.[scope.index];\n kept.push(\n withheldMembers === undefined || withheldMembers.length === 0\n ? element\n : { ...element, withheldMembers },\n );\n const undeterminedMembers = scope.undetermined?.[scope.index];\n rowUndetermined.push(undeterminedMembers ?? []);\n if (undeterminedMembers !== undefined && undeterminedMembers.length > 0) {\n anyUndeterminedRow = true;\n }\n return undefined;\n });\n if (stopped !== undefined) return stopped;\n if (pending !== undefined) return valueOf(pending);\n context.refuseElements(kept.length);\n const result = producedList(kept, sourceElementDomain(context, node.source));\n return anyUndeterminedRow ? { ...result, undeterminedRows: rowUndetermined } : result;\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ExprNode } from '../../model/types.js';
|
|
2
|
+
import type { Evaluated } from './value.js';
|
|
3
|
+
/** The evaluator operations a member read of a computed record needs. */
|
|
4
|
+
export interface MemberContext {
|
|
5
|
+
evaluate(node: ExprNode): Evaluated;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* `member(record, "name")`, the lowering of `lookup(t, [k]).col`.
|
|
9
|
+
*
|
|
10
|
+
* The base is evaluated first, so a sentinel propagates and a null record lifts to `UNKNOWN`
|
|
11
|
+
* rather than being read as absent. A member the value does not hold is `ABSENT` — the same
|
|
12
|
+
* answer a path gives — so `??` and presence can tell "no such member" from "unreadable".
|
|
13
|
+
*/
|
|
14
|
+
export declare function memberCall(context: MemberContext, args: readonly ExprNode[]): Evaluated;
|
|
15
|
+
//# sourceMappingURL=member.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member.d.ts","sourceRoot":"","sources":["../../../src/eval/expr/member.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,yEAAyE;AACzE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;CACrC;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,CAgBvF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AxiomError } from '../../model/errors.js';
|
|
2
|
+
import { isUndetermined, UNKNOWN } from '../../model/types.js';
|
|
3
|
+
import { descendMember } from './binder.js';
|
|
4
|
+
import { ABSENT, valueOf } from './value.js';
|
|
5
|
+
/**
|
|
6
|
+
* `member(record, "name")`, the lowering of `lookup(t, [k]).col`.
|
|
7
|
+
*
|
|
8
|
+
* The base is evaluated first, so a sentinel propagates and a null record lifts to `UNKNOWN`
|
|
9
|
+
* rather than being read as absent. A member the value does not hold is `ABSENT` — the same
|
|
10
|
+
* answer a path gives — so `??` and presence can tell "no such member" from "unreadable".
|
|
11
|
+
*/
|
|
12
|
+
export function memberCall(context, args) {
|
|
13
|
+
const [baseNode, nameNode] = args;
|
|
14
|
+
if (args.length !== 2 || baseNode === undefined || nameNode === undefined) {
|
|
15
|
+
throw new AxiomError('ENGINE_ERROR', 'member takes a record and a member name');
|
|
16
|
+
}
|
|
17
|
+
if (nameNode.kind !== 'literal' || typeof nameNode.value !== 'string') {
|
|
18
|
+
throw new AxiomError('ENGINE_ERROR', 'member requires a quoted member name');
|
|
19
|
+
}
|
|
20
|
+
const name = nameNode.value;
|
|
21
|
+
const base = context.evaluate(baseNode);
|
|
22
|
+
if (base.kind === 'absent')
|
|
23
|
+
return ABSENT;
|
|
24
|
+
if (isUndetermined(base.value))
|
|
25
|
+
return base;
|
|
26
|
+
// `null` is the empty value, so the member read is undecided rather than absent
|
|
27
|
+
// (`EXPR-5.1.12`): the record may exist on another device.
|
|
28
|
+
if (base.value === null)
|
|
29
|
+
return valueOf(UNKNOWN);
|
|
30
|
+
return descendMember(base, [name], name);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member.js","sourceRoot":"","sources":["../../../src/eval/expr/member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAQ7C;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,OAAsB,EAAE,IAAyB;IAC1E,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC;IAClC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC1E,MAAM,IAAI,UAAU,CAAC,cAAc,EAAE,yCAAyC,CAAC,CAAC;IAClF,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACtE,MAAM,IAAI,UAAU,CAAC,cAAc,EAAE,sCAAsC,CAAC,CAAC;IAC/E,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC1C,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,gFAAgF;IAChF,2DAA2D;IAC3D,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["import { AxiomError } from '../../model/errors.js';\nimport type { ExprNode } from '../../model/types.js';\nimport { isUndetermined, UNKNOWN } from '../../model/types.js';\nimport { descendMember } from './binder.js';\nimport { ABSENT, valueOf } from './value.js';\nimport type { Evaluated } from './value.js';\n\n/** The evaluator operations a member read of a computed record needs. */\nexport interface MemberContext {\n evaluate(node: ExprNode): Evaluated;\n}\n\n/**\n * `member(record, \"name\")`, the lowering of `lookup(t, [k]).col`.\n *\n * The base is evaluated first, so a sentinel propagates and a null record lifts to `UNKNOWN`\n * rather than being read as absent. A member the value does not hold is `ABSENT` — the same\n * answer a path gives — so `??` and presence can tell \"no such member\" from \"unreadable\".\n */\nexport function memberCall(context: MemberContext, args: readonly ExprNode[]): Evaluated {\n const [baseNode, nameNode] = args;\n if (args.length !== 2 || baseNode === undefined || nameNode === undefined) {\n throw new AxiomError('ENGINE_ERROR', 'member takes a record and a member name');\n }\n if (nameNode.kind !== 'literal' || typeof nameNode.value !== 'string') {\n throw new AxiomError('ENGINE_ERROR', 'member requires a quoted member name');\n }\n const name = nameNode.value;\n const base = context.evaluate(baseNode);\n if (base.kind === 'absent') return ABSENT;\n if (isUndetermined(base.value)) return base;\n // `null` is the empty value, so the member read is undecided rather than absent\n // (`EXPR-5.1.12`): the record may exist on another device.\n if (base.value === null) return valueOf(UNKNOWN);\n return descendMember(base, [name], name);\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WireValue } from '../../model/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Ordering of two money wire values, or `undefined` when either is not a money object.
|
|
4
|
+
*
|
|
5
|
+
* A minor amount is an exact integer, so the comparison is integer comparison; the currency
|
|
6
|
+
* and scale match is enforced by `compareMoney`, because money that spells an amount at a
|
|
7
|
+
* different scale is a different value rather than a coerced one.
|
|
8
|
+
*/
|
|
9
|
+
export declare function compareMoneyValues(left: WireValue, right: WireValue, path: string): number | undefined;
|
|
10
|
+
//# sourceMappingURL=money-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money-ops.d.ts","sourceRoot":"","sources":["../../../src/eval/expr/money-ops.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAKpB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { compareMoney, toMoneyValue } from '../../expr/money.js';
|
|
2
|
+
import { wireMembers } from '../../model/values.js';
|
|
3
|
+
/**
|
|
4
|
+
* Ordering of two money wire values, or `undefined` when either is not a money object.
|
|
5
|
+
*
|
|
6
|
+
* A minor amount is an exact integer, so the comparison is integer comparison; the currency
|
|
7
|
+
* and scale match is enforced by `compareMoney`, because money that spells an amount at a
|
|
8
|
+
* different scale is a different value rather than a coerced one.
|
|
9
|
+
*/
|
|
10
|
+
export function compareMoneyValues(left, right, path) {
|
|
11
|
+
const leftMembers = wireMembers(left);
|
|
12
|
+
const rightMembers = wireMembers(right);
|
|
13
|
+
if (leftMembers === undefined || rightMembers === undefined)
|
|
14
|
+
return undefined;
|
|
15
|
+
return compareMoney(toMoneyValue(leftMembers, path), toMoneyValue(rightMembers, path), path);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=money-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money-ops.js","sourceRoot":"","sources":["../../../src/eval/expr/money-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAe,EACf,KAAgB,EAChB,IAAY;IAEZ,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,WAAW,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC9E,OAAO,YAAY,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAC/F,CAAC","sourcesContent":["import { compareMoney, toMoneyValue } from '../../expr/money.js';\nimport type { WireValue } from '../../model/types.js';\nimport { wireMembers } from '../../model/values.js';\n\n/**\n * Ordering of two money wire values, or `undefined` when either is not a money object.\n *\n * A minor amount is an exact integer, so the comparison is integer comparison; the currency\n * and scale match is enforced by `compareMoney`, because money that spells an amount at a\n * different scale is a different value rather than a coerced one.\n */\nexport function compareMoneyValues(\n left: WireValue,\n right: WireValue,\n path: string,\n): number | undefined {\n const leftMembers = wireMembers(left);\n const rightMembers = wireMembers(right);\n if (leftMembers === undefined || rightMembers === undefined) return undefined;\n return compareMoney(toMoneyValue(leftMembers, path), toMoneyValue(rightMembers, path), path);\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComparisonOperator, ExprOperator, LiteralDomain, Outcome, Undetermined } from '../../model/types.js';
|
|
2
|
+
import type { RuntimeValue } from '../../expr/builtins.js';
|
|
3
|
+
import type { Evaluated, EvaluatedValue } from './value.js';
|
|
4
|
+
/** The fixed result domain of one built-in, or `undefined` when it depends on its operands. */
|
|
5
|
+
export declare function resultDomain(op: ExprOperator): LiteralDomain | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Folds one undetermined member into the membership's pending answer: `UNKNOWN` wins over
|
|
8
|
+
* `DEFERRED`, so a member this device genuinely cannot decide is never
|
|
9
|
+
* reported as a value computed elsewhere.
|
|
10
|
+
*/
|
|
11
|
+
export declare function foldUndetermined(pending: Undetermined | undefined, next: Undetermined): Undetermined;
|
|
12
|
+
/**
|
|
13
|
+
* The undetermined operand that decides a strict operation: `UNKNOWN`
|
|
14
|
+
* wins over `DEFERRED`, and an absent read is `UNKNOWN` — a missing local reading is
|
|
15
|
+
* never reported as a value computed elsewhere. The winning operand is returned as it
|
|
16
|
+
* was evaluated, so the domain the artifact pinned for it travels with it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function undeterminedOperand(operands: readonly Evaluated[]): Evaluated | undefined;
|
|
19
|
+
/** A resolved, decided operand: the fold above has already taken every other state. */
|
|
20
|
+
export declare function isDecidedValue(operand: Evaluated): operand is EvaluatedValue;
|
|
21
|
+
/** Whether `op` orders two operands: ordering has no `null` case. */
|
|
22
|
+
export declare function isOrderingOperator(op: ComparisonOperator): boolean;
|
|
23
|
+
/** One comparison's boolean answer under the equality and ordering rules. */
|
|
24
|
+
export declare function compareValues(op: ComparisonOperator, left: EvaluatedValue, right: EvaluatedValue, path: string): boolean;
|
|
25
|
+
/** The boolean a decided outcome stands for, or the sentinel itself. */
|
|
26
|
+
export declare function outcomeToValue(outcome: Outcome): RuntimeValue;
|
|
27
|
+
//# sourceMappingURL=operands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operands.d.ts","sourceRoot":"","sources":["../../../src/eval/expr/operands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,OAAO,EACP,YAAY,EACb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAyE5D,+FAA+F;AAC/F,wBAAgB,YAAY,CAAC,EAAE,EAAE,YAAY,GAAG,aAAa,GAAG,SAAS,CAExE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,GAAG,SAAS,EACjC,IAAI,EAAE,YAAY,GACjB,YAAY,CAEd;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,GAAG,SAAS,CASzF;AAED,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,IAAI,cAAc,CAE5E;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAElE;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAC3B,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,MAAM,GACX,OAAO,CAuCT;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,CAW7D"}
|