universal-physics-tensor 10.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -36
- package/bin/upt.mjs +13 -1
- package/data/applied-cases.json +1892 -0
- package/data/applied-cases.schema.json +194 -0
- package/data/atlas/atlas.json +25 -25
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +6 -6
- package/data/atlas/oscillators.json +7 -7
- package/data/atlas/waves.json +14 -14
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +389 -230
- package/data/bridge-catalog.schema.json +45 -7
- package/data/units.json +6 -25
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +21 -15
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/loader.js +2 -2
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +2 -2
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +9 -15
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +7 -8
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -12
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -39
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/models.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +106 -3
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -11
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -7
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -34
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +35 -25
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +37 -25
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +34 -31
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +55 -53
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +1 -1
- package/dist/atlas/physjs-reviewed.js +15 -15
- package/dist/atlas/physjs-reviewed.js.map +1 -1
- package/dist/atlas/poster/statements.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/regime.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +2 -6
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -48
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/models.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +30 -0
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +53 -0
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-specs.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +13 -8
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +26 -2
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +31 -1
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +20 -2
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +27 -12
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +11 -0
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +14 -5
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +35 -3
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +117 -23
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/notices.d.ts.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +4 -4
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +15 -16
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +3 -3
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/entries/atomic.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +4 -5
- package/dist/canonical/entries/condensed-matter.js.map +1 -1
- package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
- package/dist/canonical/entries/dimensional-classics.js +3 -4
- package/dist/canonical/entries/dimensional-classics.js.map +1 -1
- package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
- package/dist/canonical/entries/electromagnetism.js +4 -10
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +9 -17
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +25 -44
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +5 -11
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/structural.d.ts +21 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +40 -19
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/catalog-checks.d.ts +10 -0
- package/dist/cases/catalog-checks.d.ts.map +1 -0
- package/dist/cases/catalog-checks.js +241 -0
- package/dist/cases/catalog-checks.js.map +1 -0
- package/dist/cases/catalog.d.ts +83 -0
- package/dist/cases/catalog.d.ts.map +1 -0
- package/dist/cases/catalog.js +118 -0
- package/dist/cases/catalog.js.map +1 -0
- package/dist/cases/engine.d.ts +13 -0
- package/dist/cases/engine.d.ts.map +1 -0
- package/dist/cases/engine.js +179 -0
- package/dist/cases/engine.js.map +1 -0
- package/dist/cases/index.d.ts.map +1 -1
- package/dist/cases/index.js +5 -7
- package/dist/cases/index.js.map +1 -1
- package/dist/cases/methods.d.ts +215 -0
- package/dist/cases/methods.d.ts.map +1 -0
- package/dist/cases/methods.js +743 -0
- package/dist/cases/methods.js.map +1 -0
- package/dist/cases/quadrature.d.ts +7 -9
- package/dist/cases/quadrature.d.ts.map +1 -1
- package/dist/cases/quadrature.js +28 -32
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/types.d.ts +12 -0
- package/dist/cases/types.d.ts.map +1 -1
- package/dist/cases/types.js.map +1 -1
- package/dist/cli/args.d.ts +25 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts.map +1 -1
- package/dist/cli/bindings.js +5 -4
- package/dist/cli/bindings.js.map +1 -1
- package/dist/cli/command.d.ts +11 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +0 -9
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +8 -18
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts +1 -0
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +9 -9
- package/dist/cli/commands/_discovery-opts.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts.map +1 -1
- package/dist/cli/commands/atlas.js +8 -5
- package/dist/cli/commands/atlas.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +8 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +8 -14
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +22 -22
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/discover.d.ts.map +1 -1
- package/dist/cli/commands/discover.js +122 -73
- package/dist/cli/commands/discover.js.map +1 -1
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +1 -0
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +67 -39
- package/dist/cli/commands/evaluate.js.map +1 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +24 -3
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +7 -1
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +84 -11
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/metric.d.ts.map +1 -1
- package/dist/cli/commands/metric.js +12 -9
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +25 -3
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +59 -16
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +1 -0
- package/dist/cli/commands/regime.js.map +1 -1
- package/dist/cli/commands/retrieve.d.ts.map +1 -1
- package/dist/cli/commands/retrieve.js +1 -0
- package/dist/cli/commands/retrieve.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.d.ts.map +1 -1
- package/dist/cli/commands/symbolic.js +19 -28
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +4 -2
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/determination.d.ts +1 -0
- package/dist/cli/determination.d.ts.map +1 -1
- package/dist/cli/determination.js.map +1 -1
- package/dist/cli/expr-print.d.ts +0 -2
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +7 -31
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/flag-help.d.ts +1 -0
- package/dist/cli/flag-help.d.ts.map +1 -1
- package/dist/cli/flag-help.js +1 -0
- package/dist/cli/flag-help.js.map +1 -1
- package/dist/cli/graphs.d.ts +2 -0
- package/dist/cli/graphs.d.ts.map +1 -1
- package/dist/cli/graphs.js +1 -0
- package/dist/cli/graphs.js.map +1 -1
- package/dist/cli/main.d.ts +8 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +19 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +28 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +23 -0
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/record-reach.js +2 -2
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +6 -5
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +9 -8
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +7 -6
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +12 -9
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/stored-results.d.ts +7 -0
- package/dist/cli/stored-results.d.ts.map +1 -0
- package/dist/cli/stored-results.js +23 -0
- package/dist/cli/stored-results.js.map +1 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +8 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +36 -5
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +30 -4
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/axes.d.ts +0 -6
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +6 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +17 -0
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +102 -55
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +122 -24
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +3 -3
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +11 -38
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +2 -5
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +8 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +9 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +13 -5
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/consequence.d.ts +15 -5
- package/dist/composition/consequence.d.ts.map +1 -1
- package/dist/composition/consequence.js +6 -4
- package/dist/composition/consequence.js.map +1 -1
- package/dist/composition/discovery.d.ts +129 -9
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +171 -67
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +21 -2
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +23 -1
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +3 -12
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +7 -20
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +6 -15
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +26 -14
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +64 -72
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +23 -4
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +57 -17
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/graph-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/grounding.d.ts.map +1 -1
- package/dist/composition/grounding.js +19 -7
- package/dist/composition/grounding.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +8 -4
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +3 -2
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +7 -8
- package/dist/composition/mathts-quiet.d.ts.map +1 -1
- package/dist/composition/mathts-quiet.js +7 -16
- package/dist/composition/mathts-quiet.js.map +1 -1
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +2 -1
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/own-equation-magnitude.d.ts +95 -0
- package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
- package/dist/composition/own-equation-magnitude.js +270 -0
- package/dist/composition/own-equation-magnitude.js.map +1 -0
- package/dist/composition/probe/backend-protocol.d.ts +3 -0
- package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
- package/dist/composition/probe/backend-protocol.js.map +1 -1
- package/dist/composition/probe/candidate-store.d.ts +1 -0
- package/dist/composition/probe/candidate-store.d.ts.map +1 -1
- package/dist/composition/probe/candidate-store.js +1 -0
- package/dist/composition/probe/candidate-store.js.map +1 -1
- package/dist/composition/probe/corpus.d.ts +8 -4
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +23 -12
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +18 -0
- package/dist/composition/probe/dataset.d.ts.map +1 -1
- package/dist/composition/probe/dataset.js +95 -50
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.d.ts +7 -1
- package/dist/composition/probe/experiment-design.d.ts.map +1 -1
- package/dist/composition/probe/experiment-design.js +44 -24
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/falsify.d.ts +2 -0
- package/dist/composition/probe/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +2 -0
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +7 -0
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +46 -22
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +30 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +58 -36
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +14 -0
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +6 -0
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +25 -1
- package/dist/composition/probe/limits.d.ts.map +1 -1
- package/dist/composition/probe/limits.js +53 -11
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/pipeline.d.ts +5 -0
- package/dist/composition/probe/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +73 -24
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/power-law.d.ts +121 -0
- package/dist/composition/probe/power-law.d.ts.map +1 -0
- package/dist/composition/probe/power-law.js +251 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +8 -4
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +177 -49
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +7 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +10 -7
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/run-manifest.d.ts +1 -0
- package/dist/composition/probe/run-manifest.d.ts.map +1 -1
- package/dist/composition/probe/run-manifest.js.map +1 -1
- package/dist/composition/probe/scalar-search.d.ts +50 -0
- package/dist/composition/probe/scalar-search.d.ts.map +1 -0
- package/dist/composition/probe/scalar-search.js +169 -0
- package/dist/composition/probe/scalar-search.js.map +1 -0
- package/dist/composition/probe/scoring.d.ts +1 -0
- package/dist/composition/probe/scoring.d.ts.map +1 -1
- package/dist/composition/probe/scoring.js.map +1 -1
- package/dist/composition/probe/structure.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +31 -9
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +235 -184
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +16 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +29 -0
- package/dist/composition/probe/t-tail.js.map +1 -0
- package/dist/composition/probe/types.d.ts +3 -0
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +52 -12
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +107 -60
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantity-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +29 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts +15 -0
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +12 -4
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/user-equation.d.ts +1 -0
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +3 -2
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/assignment.d.ts +19 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/assignment.js +19 -0
- package/dist/core/assignment.js.map +1 -0
- package/dist/core/compare.d.ts +32 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +46 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/constants.d.ts +42 -41
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +71 -51
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +2 -0
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +14 -13
- package/dist/core/json-schema.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +0 -8
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +24 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/diff/bridge-ast-gradient.d.ts +27 -23
- package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-ast-gradient.js +75 -173
- package/dist/diff/bridge-ast-gradient.js.map +1 -1
- package/dist/diff/bridge-gradient.d.ts +19 -6
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +19 -11
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +3 -0
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +7 -0
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +11 -0
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/ast-types.d.ts +15 -0
- package/dist/dimensional/ast-types.d.ts.map +1 -1
- package/dist/dimensional/ast-types.js.map +1 -1
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/constant-rows.js +9 -9
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/curvature-composite.d.ts +1 -1
- package/dist/dimensional/curvature-composite.js.map +1 -1
- package/dist/dimensional/dimension-inference.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/errors.d.ts +1 -1
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +1 -15
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +24 -11
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +122 -130
- package/dist/dimensional/exact-scale.js.map +1 -1
- package/dist/dimensional/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +2 -2
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +44 -19
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
- package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
- package/dist/dimensional/mathts-unit-delegation.js +187 -0
- package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
- package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
- package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
- package/dist/dimensional/mathts-unit-wrapper.js +190 -0
- package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -1
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/scalar-lowering.d.ts +21 -0
- package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
- package/dist/dimensional/scalar-lowering.js +45 -0
- package/dist/dimensional/scalar-lowering.js.map +1 -0
- package/dist/dimensional/symbolic-constants.d.ts +9 -0
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +13 -1
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/types.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-data.d.ts +5 -1
- package/dist/dimensional/unit-data.d.ts.map +1 -1
- package/dist/dimensional/unit-data.js +30 -6
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/dimensional/units.d.ts +2 -0
- package/dist/dimensional/units.d.ts.map +1 -1
- package/dist/dimensional/units.js +59 -3
- package/dist/dimensional/units.js.map +1 -1
- package/dist/dimensional/validator.d.ts +2 -0
- package/dist/dimensional/validator.d.ts.map +1 -1
- package/dist/dimensional/validator.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
- package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
- package/dist/numerical/connection-lowering-helpers.js +11 -15
- package/dist/numerical/connection-lowering-helpers.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +34 -11
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +3 -2
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +0 -3
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +10 -24
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/pderiv.d.ts.map +1 -1
- package/dist/numerical/pderiv.js +2 -6
- package/dist/numerical/pderiv.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +11 -13
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +12 -0
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +72 -56
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/strides.d.ts +3 -2
- package/dist/numerical/strides.d.ts.map +1 -1
- package/dist/numerical/strides.js +3 -10
- package/dist/numerical/strides.js.map +1 -1
- package/dist/numerical/tensor-engine.d.ts +21 -0
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/relations/regime.d.ts +10 -0
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +18 -1
- package/dist/relations/regime.js.map +1 -1
- package/package.json +9 -12
- package/dist/cases/brownian-sphere.d.ts +0 -68
- package/dist/cases/brownian-sphere.d.ts.map +0 -1
- package/dist/cases/brownian-sphere.js +0 -354
- package/dist/cases/brownian-sphere.js.map +0 -1
- package/dist/cases/damped-resonator.d.ts +0 -23
- package/dist/cases/damped-resonator.d.ts.map +0 -1
- package/dist/cases/damped-resonator.js +0 -224
- package/dist/cases/damped-resonator.js.map +0 -1
- package/dist/cases/kepler-rv.d.ts +0 -13
- package/dist/cases/kepler-rv.d.ts.map +0 -1
- package/dist/cases/kepler-rv.js +0 -172
- package/dist/cases/kepler-rv.js.map +0 -1
- package/dist/cases/lumped-cooling.d.ts +0 -46
- package/dist/cases/lumped-cooling.d.ts.map +0 -1
- package/dist/cases/lumped-cooling.js +0 -261
- package/dist/cases/lumped-cooling.js.map +0 -1
- package/dist/cases/resistor-noise.d.ts +0 -14
- package/dist/cases/resistor-noise.d.ts.map +0 -1
- package/dist/cases/resistor-noise.js +0 -215
- package/dist/cases/resistor-noise.js.map +0 -1
- package/dist/cases/skin-depth.d.ts +0 -21
- package/dist/cases/skin-depth.d.ts.map +0 -1
- package/dist/cases/skin-depth.js +0 -174
- package/dist/cases/skin-depth.js.map +0 -1
|
@@ -12,12 +12,29 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { Dimension } from '../dimensional/types.js';
|
|
14
14
|
import { type EvaluatorSpec } from '../bridges/evaluators.js';
|
|
15
|
-
import { type InputContract } from '../bridges/input-contract.js';
|
|
15
|
+
import { type EvaluationWant, type InputContract } from '../bridges/input-contract.js';
|
|
16
16
|
import { type BridgeEdge } from './edge.js';
|
|
17
|
+
/**
|
|
18
|
+
* A further number an evaluator returns beside its value (be-52's
|
|
19
|
+
* `precession_arcsec_per_century`), with the unit and meaning its record states.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export interface ExtraOutput {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly value: number;
|
|
26
|
+
readonly unit: string;
|
|
27
|
+
readonly meaning: string;
|
|
28
|
+
}
|
|
17
29
|
/**
|
|
18
30
|
* A sourced number, or an unset coefficient.
|
|
19
31
|
*
|
|
20
|
-
*
|
|
32
|
+
* A value carries what it is: `name` is the quantity the relation computes
|
|
33
|
+
* (its target), `unit` that quantity's SI unit written from `dimension` (the
|
|
34
|
+
* form `parseUnit` reads back), `meaning` the relation as its record states it
|
|
35
|
+
* (a sign convention included), and `extras` every further output whose inputs
|
|
36
|
+
* were given. `upt evaluate` prints and serializes this object; it computes no
|
|
37
|
+
* label of its own. `formula` is the edge label.
|
|
21
38
|
*
|
|
22
39
|
* @public
|
|
23
40
|
*/
|
|
@@ -25,6 +42,10 @@ export type Evaluation = {
|
|
|
25
42
|
readonly kind: 'value';
|
|
26
43
|
readonly value: number;
|
|
27
44
|
readonly dimension: Dimension;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly unit: string;
|
|
47
|
+
readonly meaning: string;
|
|
48
|
+
readonly extras: readonly ExtraOutput[];
|
|
28
49
|
} | {
|
|
29
50
|
readonly kind: 'unset';
|
|
30
51
|
readonly formula: string;
|
|
@@ -38,15 +59,6 @@ export interface Evaluable {
|
|
|
38
59
|
readonly edge?: BridgeEdge;
|
|
39
60
|
readonly evaluator?: EvaluatorSpec;
|
|
40
61
|
}
|
|
41
|
-
/**
|
|
42
|
-
* The output of a closed-form evaluator: the quantity it computes and that
|
|
43
|
-
* quantity's dimension. An evaluator with no catalog dimension (a closed form
|
|
44
|
-
* with no AST) names no dimension.
|
|
45
|
-
*/
|
|
46
|
-
export declare function evaluatorOutput(spec: EvaluatorSpec): {
|
|
47
|
-
readonly name: string;
|
|
48
|
-
readonly dimension?: Dimension;
|
|
49
|
-
};
|
|
50
62
|
/**
|
|
51
63
|
* The declared inputs of an evaluable id: the closed-form evaluator's contract
|
|
52
64
|
* when it has one, else its edge's. {@link evaluateRelation} checks bindings
|
|
@@ -59,6 +71,15 @@ export declare function evaluableContract(found: Evaluable): InputContract;
|
|
|
59
71
|
* An unknown id throws. An id with an evaluator and no edge is not unknown.
|
|
60
72
|
*/
|
|
61
73
|
export declare function resolveEvaluable(id: string | number): Evaluable;
|
|
74
|
+
/**
|
|
75
|
+
* The one result builder: evaluate a resolved id at `bindings`. A closed-form
|
|
76
|
+
* evaluator is its `run`; an edge with none is checked against its contract and
|
|
77
|
+
* evaluated. {@link evaluateRelation} calls it with `want` `'value'`;
|
|
78
|
+
* `upt evaluate` calls it with `'all'`, which also requires an input only an
|
|
79
|
+
* extra output reads. Both get the same {@link Evaluation}.
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
export declare function evaluateResolved(found: Evaluable, bindings: Readonly<Record<string, number>>, want: EvaluationWant): Evaluation;
|
|
62
83
|
/**
|
|
63
84
|
* Evaluate `id` at `bindings`.
|
|
64
85
|
*
|
|
@@ -72,6 +93,9 @@ export declare function resolveEvaluable(id: string | number): Evaluable;
|
|
|
72
93
|
* An unset coefficient returns `{ kind: 'unset', formula }` and no number.
|
|
73
94
|
* A complete finite input whose closed form is not finite (a dropped factor,
|
|
74
95
|
* a singularity) is the same unset result, not a missing input.
|
|
96
|
+
* A value carries its name, SI unit and meaning, and every extra output whose
|
|
97
|
+
* inputs were given (`extras`); an input only an extra output reads is not
|
|
98
|
+
* required.
|
|
75
99
|
*
|
|
76
100
|
* @public
|
|
77
101
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate-relation.d.ts","sourceRoot":"","sources":["../../src/composition/evaluate-relation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"evaluate-relation.d.ts","sourceRoot":"","sources":["../../src/composition/evaluate-relation.ts"],"names":[],"mappings":"AAAA;;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;AAYD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY/D;AAoCD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC1C,IAAI,EAAE,cAAc,GACnB,UAAU,CAqBZ;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACzC,UAAU,CAEZ"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* @module composition/evaluate-relation
|
|
12
12
|
*/
|
|
13
13
|
import { EXPECTED_DIMENSION_BY_BRIDGE } from '../dimensional/bridge-check.js';
|
|
14
|
+
import { siUnitOf } from '../dimensional/algebra.js';
|
|
14
15
|
import { BRIDGE_EVALUATORS } from '../bridges/evaluators.js';
|
|
15
16
|
import { checkInputs, inputContract } from '../bridges/input-contract.js';
|
|
16
17
|
import { catalogEdgeKey, parseBridgeId, primaryRelation } from '../bridges/catalog-load.js';
|
|
@@ -19,19 +20,6 @@ import { CANONICAL_GROUP_PREFACTORS } from './canonical-prefactors.js';
|
|
|
19
20
|
import { CANONICAL_GRAPH } from './canonical-graph.js';
|
|
20
21
|
import { CATALOG_GRAPH } from './catalog-graph.js';
|
|
21
22
|
import { CoefficientUnsetError, evaluateEdge } from './edge.js';
|
|
22
|
-
/**
|
|
23
|
-
* The output of a closed-form evaluator: the quantity it computes and that
|
|
24
|
-
* quantity's dimension. An evaluator with no catalog dimension (a closed form
|
|
25
|
-
* with no AST) names no dimension.
|
|
26
|
-
*/
|
|
27
|
-
export function evaluatorOutput(spec) {
|
|
28
|
-
const relation = primaryRelation(spec.bridgeId);
|
|
29
|
-
const dimension = EXPECTED_DIMENSION_BY_BRIDGE.get(spec.bridgeId);
|
|
30
|
-
return {
|
|
31
|
-
name: relation?.target ?? 'value',
|
|
32
|
-
...(dimension === undefined ? {} : { dimension }),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
23
|
/**
|
|
36
24
|
* Names a canonical id may be bound under besides its sources: the equation's
|
|
37
25
|
* governing names (a registered constant may be overridden), its formula
|
|
@@ -106,21 +94,67 @@ export function resolveEvaluable(id) {
|
|
|
106
94
|
};
|
|
107
95
|
}
|
|
108
96
|
/**
|
|
109
|
-
* The closed form
|
|
110
|
-
* `value` is the catalog signature;
|
|
111
|
-
* output,
|
|
112
|
-
* unset result (a dropped factor, a singularity).
|
|
97
|
+
* The closed form through the evaluator's `run`, the one evaluation. A record's
|
|
98
|
+
* `value` is the catalog signature; every other number `run` returns is an
|
|
99
|
+
* extra output, labelled from `spec.outputs`. A non-finite value at finite
|
|
100
|
+
* inputs is an unset result (a dropped factor, a singularity).
|
|
113
101
|
*/
|
|
114
|
-
function closedFormEvaluation(spec, edge, bindings) {
|
|
115
|
-
const
|
|
102
|
+
function closedFormEvaluation(spec, edge, bindings, want) {
|
|
103
|
+
const numbers = spec.run(bindings, want);
|
|
104
|
+
const relation = primaryRelation(spec.bridgeId);
|
|
116
105
|
const dimension = edge?.target.dim ?? EXPECTED_DIMENSION_BY_BRIDGE.get(spec.bridgeId);
|
|
117
106
|
if (dimension === undefined) {
|
|
118
107
|
throw new Error(`evaluateRelation: be-${spec.bridgeId} has no catalog dimension`);
|
|
119
108
|
}
|
|
120
|
-
|
|
121
|
-
return { kind: 'value', value, dimension };
|
|
109
|
+
const value = numbers.value;
|
|
122
110
|
// `run` refused a non-finite input, so a non-finite value here comes from the closed form.
|
|
123
|
-
|
|
111
|
+
if (!Number.isFinite(value))
|
|
112
|
+
return { kind: 'unset', formula: edge?.label ?? relation?.label ?? spec.name };
|
|
113
|
+
return {
|
|
114
|
+
kind: 'value',
|
|
115
|
+
value,
|
|
116
|
+
dimension,
|
|
117
|
+
name: relation?.target ?? edge?.target.name ?? 'value',
|
|
118
|
+
unit: siUnitOf(dimension),
|
|
119
|
+
meaning: relation?.label ?? edge?.label ?? spec.name,
|
|
120
|
+
extras: spec.outputs
|
|
121
|
+
.filter((output) => numbers[output.name] !== undefined)
|
|
122
|
+
.map((output) => ({ name: output.name, value: numbers[output.name], unit: output.unit, meaning: output.meaning })),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The one result builder: evaluate a resolved id at `bindings`. A closed-form
|
|
127
|
+
* evaluator is its `run`; an edge with none is checked against its contract and
|
|
128
|
+
* evaluated. {@link evaluateRelation} calls it with `want` `'value'`;
|
|
129
|
+
* `upt evaluate` calls it with `'all'`, which also requires an input only an
|
|
130
|
+
* extra output reads. Both get the same {@link Evaluation}.
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
export function evaluateResolved(found, bindings, want) {
|
|
134
|
+
if (found.evaluator !== undefined)
|
|
135
|
+
return closedFormEvaluation(found.evaluator, found.edge, bindings, want);
|
|
136
|
+
const edge = found.edge;
|
|
137
|
+
const checked = checkInputs(evaluableContract(found), bindings, want);
|
|
138
|
+
try {
|
|
139
|
+
const value = evaluateEdge(edge, { ...checked });
|
|
140
|
+
// `checkInputs` refused a non-finite input, so a non-finite value comes from the formula.
|
|
141
|
+
if (!Number.isFinite(value))
|
|
142
|
+
return { kind: 'unset', formula: edge.label };
|
|
143
|
+
return {
|
|
144
|
+
kind: 'value',
|
|
145
|
+
value,
|
|
146
|
+
dimension: edge.target.dim,
|
|
147
|
+
name: edge.target.name,
|
|
148
|
+
unit: siUnitOf(edge.target.dim),
|
|
149
|
+
meaning: edge.label,
|
|
150
|
+
extras: [],
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
if (error instanceof CoefficientUnsetError)
|
|
155
|
+
return { kind: 'unset', formula: error.formula };
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
124
158
|
}
|
|
125
159
|
/**
|
|
126
160
|
* Evaluate `id` at `bindings`.
|
|
@@ -135,26 +169,13 @@ function closedFormEvaluation(spec, edge, bindings) {
|
|
|
135
169
|
* An unset coefficient returns `{ kind: 'unset', formula }` and no number.
|
|
136
170
|
* A complete finite input whose closed form is not finite (a dropped factor,
|
|
137
171
|
* a singularity) is the same unset result, not a missing input.
|
|
172
|
+
* A value carries its name, SI unit and meaning, and every extra output whose
|
|
173
|
+
* inputs were given (`extras`); an input only an extra output reads is not
|
|
174
|
+
* required.
|
|
138
175
|
*
|
|
139
176
|
* @public
|
|
140
177
|
*/
|
|
141
178
|
export function evaluateRelation(id, bindings) {
|
|
142
|
-
|
|
143
|
-
if (found.evaluator !== undefined)
|
|
144
|
-
return closedFormEvaluation(found.evaluator, found.edge, bindings);
|
|
145
|
-
const edge = found.edge;
|
|
146
|
-
const checked = checkInputs(evaluableContract(found), bindings);
|
|
147
|
-
try {
|
|
148
|
-
const value = evaluateEdge(edge, { ...checked });
|
|
149
|
-
// `checkInputs` refused a non-finite input, so a non-finite value comes from the formula.
|
|
150
|
-
if (!Number.isFinite(value))
|
|
151
|
-
return { kind: 'unset', formula: edge.label };
|
|
152
|
-
return { kind: 'value', value, dimension: edge.target.dim };
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
if (error instanceof CoefficientUnsetError)
|
|
156
|
-
return { kind: 'unset', formula: error.formula };
|
|
157
|
-
throw error;
|
|
158
|
-
}
|
|
179
|
+
return evaluateResolved(resolveEvaluable(id), bindings, 'value');
|
|
159
180
|
}
|
|
160
181
|
//# sourceMappingURL=evaluate-relation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate-relation.js","sourceRoot":"","sources":["../../src/composition/evaluate-relation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,O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AC;IACnC,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtG,MAAM,IAAI,GAAG,KAAK,CAAC,IAAK,CAAC;IACzB,MAAM,OAAO,GAAG,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QACjD,0FAA0F;QAC1F,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IAC9D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,qBAAqB;YAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAC7F,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["/**\n * One public evaluation of a catalog id or a canonical id.\n *\n * A catalog id with a closed-form evaluator is that evaluator's `run`, the\n * same call `upt evaluate` makes, so the library and the CLI check the\n * bindings, the domain and the value in one place. A canonical id is its\n * graph edge, checked against the same {@link checkInputs} contract first.\n * A formula string is not parsed. An unset coefficient is `kind: 'unset'` and\n * is not a number.\n *\n * @module composition/evaluate-relation\n */\n\nimport { EXPECTED_DIMENSION_BY_BRIDGE } from '../dimensional/bridge-check.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { BRIDGE_EVALUATORS, type EvaluatorSpec } from '../bridges/evaluators.js';\nimport { checkInputs, inputContract, type InputContract } from '../bridges/input-contract.js';\nimport { catalogEdgeKey, parseBridgeId, primaryRelation } from '../bridges/catalog-load.js';\nimport { CANONICAL_EQUATIONS } from '../canonical/registry.js';\nimport { CANONICAL_GROUP_PREFACTORS } from './canonical-prefactors.js';\nimport { CANONICAL_GRAPH } from './canonical-graph.js';\nimport { CATALOG_GRAPH } from './catalog-graph.js';\nimport { CoefficientUnsetError, evaluateEdge, type BridgeEdge } from './edge.js';\n\n/**\n * A sourced number, or an unset coefficient.\n *\n * `dimension` is the edge target. `formula` is the edge label.\n *\n * @public\n */\nexport type Evaluation =\n | { readonly kind: 'value'; readonly value: number; readonly dimension: Dimension }\n | { readonly kind: 'unset'; readonly formula: string };\n\n/**\n * An id the library can evaluate: a graph edge, a closed-form evaluator, or both.\n * The CLI and {@link evaluateRelation} both call this. Neither looks the id up again.\n */\nexport interface Evaluable {\n readonly id: string;\n readonly edge?: BridgeEdge;\n readonly evaluator?: EvaluatorSpec;\n}\n\n/**\n * The output of a closed-form evaluator: the quantity it computes and that\n * quantity's dimension. An evaluator with no catalog dimension (a closed form\n * with no AST) names no dimension.\n */\nexport function evaluatorOutput(spec: EvaluatorSpec): { readonly name: string; readonly dimension?: Dimension } {\n const relation = primaryRelation(spec.bridgeId);\n const dimension = EXPECTED_DIMENSION_BY_BRIDGE.get(spec.bridgeId);\n return {\n name: relation?.target ?? 'value',\n ...(dimension === undefined ? {} : { dimension }),\n };\n}\n\n/**\n * Names a canonical id may be bound under besides its sources: the equation's\n * governing names (a registered constant may be overridden), its formula\n * factors, and a bound dimensionless group such as `gamma`.\n */\nfunction canonicalNames(id: string): string[] {\n const equation = CANONICAL_EQUATIONS.find((candidate) => candidate.id === id);\n return [\n ...(equation?.dimensional.governing.map((g) => g.name) ?? []),\n ...CANONICAL_GROUP_PREFACTORS.filter((group) => group.id === id).map((group) => group.group),\n ];\n}\n\n/**\n * The declared inputs of an edge with no evaluator: each source under its name\n * and aliases, required; and, optional, its formula factors, the canonical\n * equation's governing names and a bound dimensionless group. A name that\n * already spells a source binds that source, so it is not a second slot.\n */\nfunction edgeContract(id: string, edge: BridgeEdge): InputContract {\n const sourceSlots = edge.sources.map((source) => ({\n key: source.name,\n spellings: [source.name, ...(edge.aliases?.[source.name] ?? [])],\n alternates: [],\n optional: false,\n readBy: 'value' as const,\n listed: true,\n }));\n const spelled = new Set(sourceSlots.flatMap((slot) => slot.spellings));\n const optional = [...Object.keys(edge.formulaFactors ?? {}), ...canonicalNames(id)].filter((name) => !spelled.has(name));\n return inputContract(id, [\n ...sourceSlots,\n ...[...new Set(optional)].map((name) => ({ key: name, spellings: [name], alternates: [], optional: true, readBy: 'value' as const, listed: false })),\n ]);\n}\n\n/**\n * The declared inputs of an evaluable id: the closed-form evaluator's contract\n * when it has one, else its edge's. {@link evaluateRelation} checks bindings\n * against exactly this contract.\n * @internal\n */\nexport function evaluableContract(found: Evaluable): InputContract {\n if (found.evaluator !== undefined) return found.evaluator.contract;\n return edgeContract(found.id, found.edge!);\n}\n\nfunction idOf(id: string | number): { key: string; numeric: number | undefined } {\n if (typeof id === 'number') return { key: catalogEdgeKey(id), numeric: id };\n try {\n const numeric = parseBridgeId(id);\n return { key: catalogEdgeKey(numeric), numeric };\n } catch {\n return { key: id, numeric: undefined };\n }\n}\n\n/**\n * The edge and the closed-form evaluator for `id`, when either exists.\n * An unknown id throws. An id with an evaluator and no edge is not unknown.\n */\nexport function resolveEvaluable(id: string | number): Evaluable {\n const { key, numeric } = idOf(id);\n const edge = [...CATALOG_GRAPH, ...CANONICAL_GRAPH].find((candidate) => candidate.id === key);\n const evaluator = numeric === undefined ? undefined : BRIDGE_EVALUATORS.get(numeric);\n if (edge === undefined && evaluator === undefined) {\n throw new Error(`evaluateRelation: unknown id '${key}'`);\n }\n return {\n id: key,\n ...(edge === undefined ? {} : { edge }),\n ...(evaluator === undefined ? {} : { evaluator }),\n };\n}\n\n/**\n * The closed form's primary output, through the evaluator's `run`. A record's\n * `value` is the catalog signature; any other number it returns is an extra\n * output, named by `spec.outputs`. A non-finite value at finite inputs is an\n * unset result (a dropped factor, a singularity).\n */\nfunction closedFormEvaluation(\n spec: EvaluatorSpec,\n edge: BridgeEdge | undefined,\n bindings: Readonly<Record<string, number>>,\n): Evaluation {\n const { value } = spec.run(bindings, 'value');\n const dimension = edge?.target.dim ?? EXPECTED_DIMENSION_BY_BRIDGE.get(spec.bridgeId);\n if (dimension === undefined) {\n throw new Error(`evaluateRelation: be-${spec.bridgeId} has no catalog dimension`);\n }\n if (Number.isFinite(value)) return { kind: 'value', value, dimension };\n // `run` refused a non-finite input, so a non-finite value here comes from the closed form.\n return { kind: 'unset', formula: edge?.label ?? primaryRelation(spec.bridgeId)?.label ?? spec.name };\n}\n\n/**\n * Evaluate `id` at `bindings`.\n *\n * A catalog id is `be-70` or `70`. A canonical id is `CE-sound-speed`.\n * Binding keys are the inputs' keys, quantity names or aliases.\n * The bindings are checked before the domain: an unknown key throws\n * `UnknownInputError`, a non-number `InputTypeError` (a `TypeError`), a\n * `NaN` or an infinity `NonFiniteInputError`, a key given twice\n * `DuplicateInputError`, an absent input `MissingInputError`.\n * A domain failure throws `DomainViolationError`.\n * An unset coefficient returns `{ kind: 'unset', formula }` and no number.\n * A complete finite input whose closed form is not finite (a dropped factor,\n * a singularity) is the same unset result, not a missing input.\n *\n * @public\n */\nexport function evaluateRelation(\n id: string | number,\n bindings: Readonly<Record<string, number>>,\n): Evaluation {\n const found = resolveEvaluable(id);\n if (found.evaluator !== undefined) return closedFormEvaluation(found.evaluator, found.edge, bindings);\n const edge = found.edge!;\n const checked = checkInputs(evaluableContract(found), bindings);\n try {\n const value = evaluateEdge(edge, { ...checked });\n // `checkInputs` refused a non-finite input, so a non-finite value comes from the formula.\n if (!Number.isFinite(value)) return { kind: 'unset', formula: edge.label };\n return { kind: 'value', value, dimension: edge.target.dim };\n } catch (error) {\n if (error instanceof CoefficientUnsetError) return { kind: 'unset', formula: error.formula };\n throw error;\n }\n}\n"]}
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AC/B,OAAO,EAAE,IAAI,CAAC,KAAK;YACnB,MAAM,EAAE,EAAE;SACX,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,qBAAqB;YAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAC7F,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,EAAmB,EACnB,QAA0C;IAE1C,OAAO,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC","sourcesContent":["/**\n * One public evaluation of a catalog id or a canonical id.\n *\n * A catalog id with a closed-form evaluator is that evaluator's `run`, the\n * same call `upt evaluate` makes, so the library and the CLI check the\n * bindings, the domain and the value in one place. A canonical id is its\n * graph edge, checked against the same {@link checkInputs} contract first.\n * A formula string is not parsed. An unset coefficient is `kind: 'unset'` and\n * is not a number.\n *\n * @module composition/evaluate-relation\n */\n\nimport { EXPECTED_DIMENSION_BY_BRIDGE } from '../dimensional/bridge-check.js';\nimport { siUnitOf } from '../dimensional/algebra.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { BRIDGE_EVALUATORS, type EvaluatorSpec } from '../bridges/evaluators.js';\nimport { checkInputs, inputContract, type EvaluationWant, type InputContract } from '../bridges/input-contract.js';\nimport { catalogEdgeKey, parseBridgeId, primaryRelation } from '../bridges/catalog-load.js';\nimport { CANONICAL_EQUATIONS } from '../canonical/registry.js';\nimport { CANONICAL_GROUP_PREFACTORS } from './canonical-prefactors.js';\nimport { CANONICAL_GRAPH } from './canonical-graph.js';\nimport { CATALOG_GRAPH } from './catalog-graph.js';\nimport { CoefficientUnsetError, evaluateEdge, type BridgeEdge } from './edge.js';\n\n/**\n * A further number an evaluator returns beside its value (be-52's\n * `precession_arcsec_per_century`), with the unit and meaning its record states.\n *\n * @public\n */\nexport interface ExtraOutput {\n readonly name: string;\n readonly value: number;\n readonly unit: string;\n readonly meaning: string;\n}\n\n/**\n * A sourced number, or an unset coefficient.\n *\n * A value carries what it is: `name` is the quantity the relation computes\n * (its target), `unit` that quantity's SI unit written from `dimension` (the\n * form `parseUnit` reads back), `meaning` the relation as its record states it\n * (a sign convention included), and `extras` every further output whose inputs\n * were given. `upt evaluate` prints and serializes this object; it computes no\n * label of its own. `formula` is the edge label.\n *\n * @public\n */\nexport type Evaluation =\n | {\n readonly kind: 'value';\n readonly value: number;\n readonly dimension: Dimension;\n readonly name: string;\n readonly unit: string;\n readonly meaning: string;\n readonly extras: readonly ExtraOutput[];\n }\n | { readonly kind: 'unset'; readonly formula: string };\n\n/**\n * An id the library can evaluate: a graph edge, a closed-form evaluator, or both.\n * The CLI and {@link evaluateRelation} both call this. Neither looks the id up again.\n */\nexport interface Evaluable {\n readonly id: string;\n readonly edge?: BridgeEdge;\n readonly evaluator?: EvaluatorSpec;\n}\n\n/**\n * Names a canonical id may be bound under besides its sources: the equation's\n * governing names (a registered constant may be overridden), its formula\n * factors, and a bound dimensionless group such as `gamma`.\n */\nfunction canonicalNames(id: string): string[] {\n const equation = CANONICAL_EQUATIONS.find((candidate) => candidate.id === id);\n return [\n ...(equation?.dimensional.governing.map((g) => g.name) ?? []),\n ...CANONICAL_GROUP_PREFACTORS.filter((group) => group.id === id).map((group) => group.group),\n ];\n}\n\n/**\n * The declared inputs of an edge with no evaluator: each source under its name\n * and aliases, required; and, optional, its formula factors, the canonical\n * equation's governing names and a bound dimensionless group. A name that\n * already spells a source binds that source, so it is not a second slot.\n */\nfunction edgeContract(id: string, edge: BridgeEdge): InputContract {\n const sourceSlots = edge.sources.map((source) => ({\n key: source.name,\n spellings: [source.name, ...(edge.aliases?.[source.name] ?? [])],\n alternates: [],\n optional: false,\n readBy: 'value' as const,\n listed: true,\n }));\n const spelled = new Set(sourceSlots.flatMap((slot) => slot.spellings));\n const optional = [...Object.keys(edge.formulaFactors ?? {}), ...canonicalNames(id)].filter((name) => !spelled.has(name));\n return inputContract(id, [\n ...sourceSlots,\n ...[...new Set(optional)].map((name) => ({ key: name, spellings: [name], alternates: [], optional: true, readBy: 'value' as const, listed: false })),\n ]);\n}\n\n/**\n * The declared inputs of an evaluable id: the closed-form evaluator's contract\n * when it has one, else its edge's. {@link evaluateRelation} checks bindings\n * against exactly this contract.\n * @internal\n */\nexport function evaluableContract(found: Evaluable): InputContract {\n if (found.evaluator !== undefined) return found.evaluator.contract;\n return edgeContract(found.id, found.edge!);\n}\n\nfunction idOf(id: string | number): { key: string; numeric: number | undefined } {\n if (typeof id === 'number') return { key: catalogEdgeKey(id), numeric: id };\n try {\n const numeric = parseBridgeId(id);\n return { key: catalogEdgeKey(numeric), numeric };\n } catch {\n return { key: id, numeric: undefined };\n }\n}\n\n/**\n * The edge and the closed-form evaluator for `id`, when either exists.\n * An unknown id throws. An id with an evaluator and no edge is not unknown.\n */\nexport function resolveEvaluable(id: string | number): Evaluable {\n const { key, numeric } = idOf(id);\n const edge = [...CATALOG_GRAPH, ...CANONICAL_GRAPH].find((candidate) => candidate.id === key);\n const evaluator = numeric === undefined ? undefined : BRIDGE_EVALUATORS.get(numeric);\n if (edge === undefined && evaluator === undefined) {\n throw new Error(`evaluateRelation: unknown id '${key}'`);\n }\n return {\n id: key,\n ...(edge === undefined ? {} : { edge }),\n ...(evaluator === undefined ? {} : { evaluator }),\n };\n}\n\n/**\n * The closed form through the evaluator's `run`, the one evaluation. A record's\n * `value` is the catalog signature; every other number `run` returns is an\n * extra output, labelled from `spec.outputs`. A non-finite value at finite\n * inputs is an unset result (a dropped factor, a singularity).\n */\nfunction closedFormEvaluation(\n spec: EvaluatorSpec,\n edge: BridgeEdge | undefined,\n bindings: Readonly<Record<string, number>>,\n want: EvaluationWant,\n): Evaluation {\n const numbers = spec.run(bindings, want);\n const relation = primaryRelation(spec.bridgeId);\n const dimension = edge?.target.dim ?? EXPECTED_DIMENSION_BY_BRIDGE.get(spec.bridgeId);\n if (dimension === undefined) {\n throw new Error(`evaluateRelation: be-${spec.bridgeId} has no catalog dimension`);\n }\n const value = numbers.value!;\n // `run` refused a non-finite input, so a non-finite value here comes from the closed form.\n if (!Number.isFinite(value)) return { kind: 'unset', formula: edge?.label ?? relation?.label ?? spec.name };\n return {\n kind: 'value',\n value,\n dimension,\n name: relation?.target ?? edge?.target.name ?? 'value',\n unit: siUnitOf(dimension),\n meaning: relation?.label ?? edge?.label ?? spec.name,\n extras: spec.outputs\n .filter((output) => numbers[output.name] !== undefined)\n .map((output) => ({ name: output.name, value: numbers[output.name]!, unit: output.unit, meaning: output.meaning })),\n };\n}\n\n/**\n * The one result builder: evaluate a resolved id at `bindings`. A closed-form\n * evaluator is its `run`; an edge with none is checked against its contract and\n * evaluated. {@link evaluateRelation} calls it with `want` `'value'`;\n * `upt evaluate` calls it with `'all'`, which also requires an input only an\n * extra output reads. Both get the same {@link Evaluation}.\n * @internal\n */\nexport function evaluateResolved(\n found: Evaluable,\n bindings: Readonly<Record<string, number>>,\n want: EvaluationWant,\n): Evaluation {\n if (found.evaluator !== undefined) return closedFormEvaluation(found.evaluator, found.edge, bindings, want);\n const edge = found.edge!;\n const checked = checkInputs(evaluableContract(found), bindings, want);\n try {\n const value = evaluateEdge(edge, { ...checked });\n // `checkInputs` refused a non-finite input, so a non-finite value comes from the formula.\n if (!Number.isFinite(value)) return { kind: 'unset', formula: edge.label };\n return {\n kind: 'value',\n value,\n dimension: edge.target.dim,\n name: edge.target.name,\n unit: siUnitOf(edge.target.dim),\n meaning: edge.label,\n extras: [],\n };\n } catch (error) {\n if (error instanceof CoefficientUnsetError) return { kind: 'unset', formula: error.formula };\n throw error;\n }\n}\n\n/**\n * Evaluate `id` at `bindings`.\n *\n * A catalog id is `be-70` or `70`. A canonical id is `CE-sound-speed`.\n * Binding keys are the inputs' keys, quantity names or aliases.\n * The bindings are checked before the domain: an unknown key throws\n * `UnknownInputError`, a non-number `InputTypeError` (a `TypeError`), a\n * `NaN` or an infinity `NonFiniteInputError`, a key given twice\n * `DuplicateInputError`, an absent input `MissingInputError`.\n * A domain failure throws `DomainViolationError`.\n * An unset coefficient returns `{ kind: 'unset', formula }` and no number.\n * A complete finite input whose closed form is not finite (a dropped factor,\n * a singularity) is the same unset result, not a missing input.\n * A value carries its name, SI unit and meaning, and every extra output whose\n * inputs were given (`extras`); an input only an extra output reads is not\n * required.\n *\n * @public\n */\nexport function evaluateRelation(\n id: string | number,\n bindings: Readonly<Record<string, number>>,\n): Evaluation {\n return evaluateResolved(resolveEvaluable(id), bindings, 'value');\n}\n"]}
|
|
@@ -29,20 +29,11 @@ import type { IdentifiabilityResult } from './identifiability.js';
|
|
|
29
29
|
import type { RetrodictionResult } from './retrodiction.js';
|
|
30
30
|
import type { Dimension } from '../dimensional/types.js';
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* the number; this is only the printed form. An integer stays an integer (`1`, not `1.0000e+0`).
|
|
35
|
-
* Every command prints a number through this function or through {@link formatExact}.
|
|
32
|
+
* The printed forms of a number, owned by `core/format` and re-exported here so the commands'
|
|
33
|
+
* imports stay as they were: every command prints a number through `formatQuantity` or `formatExact`.
|
|
36
34
|
* @internal
|
|
37
35
|
*/
|
|
38
|
-
export
|
|
39
|
-
/**
|
|
40
|
-
* Text form of a computed value that a reader may need to reproduce bit for bit: the shortest
|
|
41
|
-
* decimal that round-trips to the same double (`upt evaluate`'s outputs). A recovered or compared
|
|
42
|
-
* quantity prints through {@link formatQuantity} instead.
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
export declare function formatExact(value: number): string;
|
|
36
|
+
export { formatQuantity, formatExact } from '../core/format.js';
|
|
46
37
|
import type { DimensionalDeterminationResult } from '../dimensional/buckingham.js';
|
|
47
38
|
/** One structural derivation of the target, with the recovered value when
|
|
48
39
|
* ground-truth values were supplied. @public */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../src/composition/explain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../src/composition/explain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKzD;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAKnF;iDACiD;AACjD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE;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,CAAC;IAC7C,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAuRD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC3D,IAAI,GAAE,cAAmB,GACxB,mBAAmB,CAoPrB"}
|
|
@@ -25,28 +25,17 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import { QUANTITY_IDENTIFICATIONS } from './compose.js';
|
|
27
27
|
import { classifyIdentifiability, forwardClosure } from './identifiability.js';
|
|
28
|
+
import { fixedPoint } from '../canonical/fixed-points.js';
|
|
28
29
|
import { retrodictNode } from './retrodiction.js';
|
|
29
30
|
import { CANONICAL_GROUP_PREFACTORS } from './canonical-prefactors.js';
|
|
30
31
|
import { canonicalById } from '../canonical/registry.js';
|
|
32
|
+
import { formatQuantity } from '../core/format.js';
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* the number; this is only the printed form. An integer stays an integer (`1`, not `1.0000e+0`).
|
|
35
|
-
* Every command prints a number through this function or through {@link formatExact}.
|
|
34
|
+
* The printed forms of a number, owned by `core/format` and re-exported here so the commands'
|
|
35
|
+
* imports stay as they were: every command prints a number through `formatQuantity` or `formatExact`.
|
|
36
36
|
* @internal
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
39
|
-
return String(Number(value.toPrecision(digits)));
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Text form of a computed value that a reader may need to reproduce bit for bit: the shortest
|
|
43
|
-
* decimal that round-trips to the same double (`upt evaluate`'s outputs). A recovered or compared
|
|
44
|
-
* quantity prints through {@link formatQuantity} instead.
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
47
|
-
export function formatExact(value) {
|
|
48
|
-
return String(value);
|
|
49
|
-
}
|
|
38
|
+
export { formatQuantity, formatExact } from '../core/format.js';
|
|
50
39
|
import { dimensionallyDetermines } from '../dimensional/buckingham.js';
|
|
51
40
|
import { collapseSynonymGovernors } from './aliases.js';
|
|
52
41
|
import { formulaShape } from './formula-shape.js';
|
|
@@ -61,10 +50,8 @@ import { formulaShape } from './formula-shape.js';
|
|
|
61
50
|
function encodedMatchesMonomial(edges, target, knownNames, monomial, identifications) {
|
|
62
51
|
if (knownNames.length === 0)
|
|
63
52
|
return true;
|
|
64
|
-
|
|
65
|
-
knownNames.
|
|
66
|
-
base[name] = 1.7 + 0.3 * i;
|
|
67
|
-
});
|
|
53
|
+
// Known i takes 1.7 + 0.3 i: this check's own scheme, stated here; each is then scaled by 4.
|
|
54
|
+
const base = fixedPoint(knownNames, 1, { base: 1.7, step: 0.3 });
|
|
68
55
|
const read = (values) => {
|
|
69
56
|
const retro = retrodictNode(edges, values, target, { identifications });
|
|
70
57
|
const hit = retro.predictions.find((prediction) => Number.isFinite(prediction.value) && prediction.value !== 0);
|