universal-physics-tensor 8.0.0 → 10.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 +26 -21
- package/data/atlas/atlas.json +75 -64
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +23 -22
- package/data/atlas/oscillators.json +21 -16
- package/data/atlas/waves.json +33 -28
- package/data/bridge-catalog.json +1356 -1791
- package/data/bridge-catalog.schema.json +789 -46
- package/data/quantities.json +280 -234
- package/data/quantities.schema.json +52 -0
- package/data/schemas/atlas-record.v0.json +184 -46
- package/data/units.json +1178 -0
- package/data/units.schema.json +124 -0
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +14 -3
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/association.d.ts +1 -1
- package/dist/atlas/association.js.map +1 -1
- package/dist/atlas/benchmark/backend-shapes.d.ts.map +1 -1
- package/dist/atlas/benchmark/backend-shapes.js +5 -1
- package/dist/atlas/benchmark/backend-shapes.js.map +1 -1
- package/dist/atlas/benchmark/baselines.d.ts.map +1 -1
- package/dist/atlas/benchmark/baselines.js +8 -0
- package/dist/atlas/benchmark/baselines.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +3 -2
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +16 -12
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/leakage.js.map +1 -1
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/run-atlas.d.ts.map +1 -1
- package/dist/atlas/benchmark/run-atlas.js +14 -2
- package/dist/atlas/benchmark/run-atlas.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +1 -1
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +1 -1
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/benchmark/study.js.map +1 -1
- package/dist/atlas/benchmark/types.js.map +1 -1
- package/dist/atlas/bridge-record.d.ts +4 -4
- package/dist/atlas/bridge-record.d.ts.map +1 -1
- package/dist/atlas/bridge-record.js +6 -6
- package/dist/atlas/bridge-record.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts +0 -11
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +5 -16
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/composition-table.js.map +1 -1
- package/dist/atlas/conventions.js.map +1 -1
- package/dist/atlas/coverage.d.ts +2 -2
- package/dist/atlas/coverage.js.map +1 -1
- package/dist/atlas/derivation.js.map +1 -1
- package/dist/atlas/derive-evidence.d.ts +6 -4
- package/dist/atlas/derive-evidence.d.ts.map +1 -1
- package/dist/atlas/derive-evidence.js +7 -2
- package/dist/atlas/derive-evidence.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +0 -5
- 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 +0 -3
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/index.d.ts +1 -1
- package/dist/atlas/diffusion/index.d.ts.map +1 -1
- package/dist/atlas/diffusion/index.js.map +1 -1
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/error-algebra.d.ts +6 -0
- package/dist/atlas/error-algebra.d.ts.map +1 -1
- package/dist/atlas/error-algebra.js +26 -0
- package/dist/atlas/error-algebra.js.map +1 -1
- package/dist/atlas/export.d.ts +18 -2
- package/dist/atlas/export.d.ts.map +1 -1
- package/dist/atlas/export.js +9 -3
- package/dist/atlas/export.js.map +1 -1
- package/dist/atlas/families.d.ts +19 -2
- package/dist/atlas/families.d.ts.map +1 -1
- package/dist/atlas/families.js +26 -3
- package/dist/atlas/families.js.map +1 -1
- package/dist/atlas/family.d.ts +27 -0
- package/dist/atlas/family.d.ts.map +1 -0
- package/dist/atlas/family.js +12 -0
- package/dist/atlas/family.js.map +1 -0
- package/dist/atlas/index.d.ts +3 -2
- package/dist/atlas/index.d.ts.map +1 -1
- package/dist/atlas/index.js +2 -1
- package/dist/atlas/index.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +1 -1
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/model.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +0 -1
- 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 +0 -3
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +0 -2
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/index.d.ts +1 -16
- package/dist/atlas/oscillators/index.d.ts.map +1 -1
- package/dist/atlas/oscillators/index.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/norm-transport-witness.js.map +1 -1
- package/dist/atlas/oscillators/norm-transport.js.map +1 -1
- package/dist/atlas/oscillators/norms.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-carriage.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/path-bound.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +1601 -220
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +1854 -345
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +151 -117
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +244 -211
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +31 -0
- package/dist/atlas/physjs-reviewed.d.ts.map +1 -0
- package/dist/atlas/physjs-reviewed.js +194 -0
- package/dist/atlas/physjs-reviewed.js.map +1 -0
- package/dist/atlas/poster/associations.js.map +1 -1
- package/dist/atlas/poster/derivations.js.map +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +16 -8
- package/dist/atlas/proof-target.d.ts.map +1 -1
- package/dist/atlas/proof-target.js +34 -31
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/public.d.ts +2 -1
- package/dist/atlas/public.d.ts.map +1 -1
- package/dist/atlas/public.js +2 -1
- package/dist/atlas/public.js.map +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/serialize.d.ts +18 -12
- package/dist/atlas/serialize.d.ts.map +1 -1
- package/dist/atlas/serialize.js +28 -18
- package/dist/atlas/serialize.js.map +1 -1
- package/dist/atlas/statement.js.map +1 -1
- package/dist/atlas/translation-registry.js.map +1 -1
- package/dist/atlas/translation.js.map +1 -1
- package/dist/atlas/types.d.ts +9 -2
- package/dist/atlas/types.d.ts.map +1 -1
- package/dist/atlas/types.js +1 -1
- package/dist/atlas/types.js.map +1 -1
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +0 -3
- 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 +0 -4
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/index.d.ts +1 -1
- package/dist/atlas/waves/index.d.ts.map +1 -1
- package/dist/atlas/waves/index.js.map +1 -1
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-artifact.js.map +1 -1
- package/dist/atlas/witness-dominance.d.ts +4 -3
- package/dist/atlas/witness-dominance.d.ts.map +1 -1
- package/dist/atlas/witness-dominance.js +15 -5
- package/dist/atlas/witness-dominance.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +8 -4
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +27 -2
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-result.d.ts +7 -1
- package/dist/atlas/witness-result.d.ts.map +1 -1
- package/dist/atlas/witness-result.js.map +1 -1
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/atlas/witnesses/quantum-support.js.map +1 -1
- package/dist/bridges/caller-table.d.ts +1 -1
- package/dist/bridges/caller-table.d.ts.map +1 -1
- package/dist/bridges/caller-table.js.map +1 -1
- package/dist/bridges/carrier-sign.d.ts.map +1 -1
- package/dist/bridges/carrier-sign.js +8 -3
- package/dist/bridges/carrier-sign.js.map +1 -1
- package/dist/bridges/catalog-adapter.d.ts +12 -3
- package/dist/bridges/catalog-adapter.d.ts.map +1 -1
- package/dist/bridges/catalog-adapter.js +22 -14
- package/dist/bridges/catalog-adapter.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts +19 -2
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +233 -14
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +96 -27
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/coefficient-statement.js +1 -5
- package/dist/bridges/coefficient-statement.js.map +1 -1
- package/dist/bridges/confrontation-coverage.js.map +1 -1
- package/dist/bridges/confrontations.d.ts +1 -1
- package/dist/bridges/confrontations.d.ts.map +1 -1
- package/dist/bridges/confrontations.js +1 -1
- package/dist/bridges/confrontations.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +89 -0
- package/dist/bridges/evaluation-errors.d.ts.map +1 -0
- package/dist/bridges/evaluation-errors.js +136 -0
- package/dist/bridges/evaluation-errors.js.map +1 -0
- package/dist/bridges/evaluator-inputs.d.ts +5 -3
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +24 -24
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts +48 -8
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +173 -38
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +38 -7
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +129 -156
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +16 -8
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +130 -236
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/index.d.ts +15 -14
- package/dist/bridges/index.d.ts.map +1 -1
- package/dist/bridges/index.js +14 -15
- package/dist/bridges/index.js.map +1 -1
- package/dist/bridges/input-contract.d.ts +65 -0
- package/dist/bridges/input-contract.d.ts.map +1 -0
- package/dist/bridges/input-contract.js +97 -0
- package/dist/bridges/input-contract.js.map +1 -0
- package/dist/bridges/membership.d.ts +5 -3
- package/dist/bridges/membership.d.ts.map +1 -1
- package/dist/bridges/membership.js +5 -6
- package/dist/bridges/membership.js.map +1 -1
- package/dist/bridges/notices.d.ts +11 -0
- package/dist/bridges/notices.d.ts.map +1 -0
- package/dist/bridges/notices.js +22 -0
- package/dist/bridges/notices.js.map +1 -0
- package/dist/bridges/observations/types.js.map +1 -1
- package/dist/bridges/rejected.d.ts +11 -17
- package/dist/bridges/rejected.d.ts.map +1 -1
- package/dist/bridges/rejected.js +13 -68
- package/dist/bridges/rejected.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +5 -6
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +9 -38
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/rhs-registry.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts +11 -3
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +24 -10
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/tensor-index.js.map +1 -1
- package/dist/bridges/types.d.ts +1 -7
- package/dist/bridges/types.d.ts.map +1 -1
- package/dist/bridges/types.js +1 -4
- package/dist/bridges/types.js.map +1 -1
- package/dist/canonical/canonical-equation.d.ts +31 -0
- package/dist/canonical/canonical-equation.d.ts.map +1 -1
- package/dist/canonical/canonical-equation.js.map +1 -1
- package/dist/canonical/dimensional-fields.js.map +1 -1
- package/dist/canonical/entries/_l1-build.js.map +1 -1
- package/dist/canonical/entries/atomic.d.ts.map +1 -1
- package/dist/canonical/entries/atomic.js +11 -1
- 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 +7 -4
- 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 +50 -2
- 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 +32 -2
- 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 +34 -0
- 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 +24 -0
- 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 +42 -24
- 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 -0
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/statistical-mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/statistical-mechanics.js +24 -5
- package/dist/canonical/entries/statistical-mechanics.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +15 -0
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/linkage.d.ts +29 -4
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +31 -29
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts +0 -8
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +17 -12
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/registry.js.map +1 -1
- package/dist/canonical/residual.js.map +1 -1
- package/dist/canonical/seed-l-layer.d.ts +7 -1
- package/dist/canonical/seed-l-layer.d.ts.map +1 -1
- package/dist/canonical/seed-l-layer.js +7 -1
- package/dist/canonical/seed-l-layer.js.map +1 -1
- package/dist/canonical/structural.d.ts +21 -0
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +24 -4
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/brownian-sphere.js +4 -4
- package/dist/cases/brownian-sphere.js.map +1 -1
- package/dist/cases/damped-resonator.js +2 -2
- package/dist/cases/damped-resonator.js.map +1 -1
- package/dist/cases/index.d.ts +9 -2
- package/dist/cases/index.d.ts.map +1 -1
- package/dist/cases/index.js +26 -7
- package/dist/cases/index.js.map +1 -1
- package/dist/cases/kepler-rv.js +6 -6
- package/dist/cases/kepler-rv.js.map +1 -1
- package/dist/cases/lumped-cooling.js +1 -1
- package/dist/cases/lumped-cooling.js.map +1 -1
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/resistor-noise.js +3 -3
- package/dist/cases/resistor-noise.js.map +1 -1
- package/dist/cases/skin-depth.js.map +1 -1
- package/dist/cases/types.js.map +1 -1
- package/dist/cli/args.d.ts +7 -2
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +18 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts +13 -0
- package/dist/cli/bindings.d.ts.map +1 -0
- package/dist/cli/bindings.js +32 -0
- package/dist/cli/bindings.js.map +1 -0
- package/dist/cli/closed-form-range.js.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +3 -3
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +43 -18
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts +2 -1
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +48 -18
- 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 +7 -12
- 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 +13 -21
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/candidates.d.ts.map +1 -1
- package/dist/cli/commands/candidates.js +16 -8
- package/dist/cli/commands/candidates.js.map +1 -1
- package/dist/cli/commands/canonical.js.map +1 -1
- package/dist/cli/commands/chain.js +1 -1
- package/dist/cli/commands/chain.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +22 -14
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/connectors.d.ts.map +1 -1
- package/dist/cli/commands/connectors.js +8 -9
- package/dist/cli/commands/connectors.js.map +1 -1
- package/dist/cli/commands/coverage.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +50 -26
- 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 +18 -13
- 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 +29 -26
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts +1 -35
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +99 -208
- 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 +57 -45
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/frontier.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +41 -11
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +84 -92
- 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 +53 -15
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.js +4 -4
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/predict.js.map +1 -1
- package/dist/cli/commands/priority.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +50 -26
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/recover.js +1 -1
- package/dist/cli/commands/recover.js.map +1 -1
- package/dist/cli/commands/regime.d.ts +5 -4
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +25 -27
- 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 +22 -14
- 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 +8 -4
- 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 +14 -7
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.js +4 -4
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/conventions.d.ts +6 -7
- package/dist/cli/conventions.d.ts.map +1 -1
- package/dist/cli/conventions.js +19 -28
- package/dist/cli/conventions.js.map +1 -1
- package/dist/cli/determination.js.map +1 -1
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/euler-guard.d.ts +13 -2
- package/dist/cli/euler-guard.d.ts.map +1 -1
- package/dist/cli/euler-guard.js +17 -3
- package/dist/cli/euler-guard.js.map +1 -1
- package/dist/cli/eval-numbers.d.ts +4 -9
- package/dist/cli/eval-numbers.d.ts.map +1 -1
- package/dist/cli/eval-numbers.js +11 -41
- package/dist/cli/eval-numbers.js.map +1 -1
- package/dist/cli/expr-print.d.ts +29 -2
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +46 -2
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/flag-help.js.map +1 -1
- package/dist/cli/graphs.js.map +1 -1
- package/dist/cli/library-defaults.d.ts +19 -0
- package/dist/cli/library-defaults.d.ts.map +1 -0
- package/dist/cli/library-defaults.js +22 -0
- package/dist/cli/library-defaults.js.map +1 -0
- package/dist/cli/main.js +7 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/map-evidence.js.map +1 -1
- package/dist/cli/output.d.ts +3 -6
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/published-url.d.ts +2 -0
- package/dist/cli/published-url.d.ts.map +1 -1
- package/dist/cli/published-url.js +5 -0
- package/dist/cli/published-url.js.map +1 -1
- package/dist/cli/record-reach.d.ts +6 -0
- package/dist/cli/record-reach.d.ts.map +1 -1
- package/dist/cli/record-reach.js +16 -10
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts +2 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +8 -3
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +31 -12
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts +5 -0
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +12 -1
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/top-level-help.js.map +1 -1
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +57 -18
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +49 -21
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/adjudication.d.ts +8 -30
- package/dist/composition/adjudication.d.ts.map +1 -1
- package/dist/composition/adjudication.js +15 -67
- package/dist/composition/adjudication.js.map +1 -1
- package/dist/composition/aliases.d.ts +1 -1
- package/dist/composition/aliases.d.ts.map +1 -1
- package/dist/composition/aliases.js +10 -20
- package/dist/composition/aliases.js.map +1 -1
- package/dist/composition/audit-coverage.d.ts +2 -0
- package/dist/composition/audit-coverage.d.ts.map +1 -1
- package/dist/composition/audit-coverage.js.map +1 -1
- package/dist/composition/axes.d.ts +12 -0
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +18 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +0 -14
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +66 -57
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/bridge-prediction.d.ts +5 -1
- package/dist/composition/bridge-prediction.d.ts.map +1 -1
- package/dist/composition/bridge-prediction.js +12 -16
- package/dist/composition/bridge-prediction.js.map +1 -1
- package/dist/composition/buckingham-filter.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +12 -2
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +15 -18
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +59 -85
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/canonical-prefactors.d.ts +10 -29
- package/dist/composition/canonical-prefactors.d.ts.map +1 -1
- package/dist/composition/canonical-prefactors.js +15 -202
- package/dist/composition/canonical-prefactors.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +6 -20
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +2 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +2 -0
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-regime.js.map +1 -1
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-surface.js.map +1 -1
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +154 -36
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/consequence.d.ts.map +1 -1
- package/dist/composition/consequence.js +15 -6
- package/dist/composition/consequence.js.map +1 -1
- package/dist/composition/consistency.js.map +1 -1
- package/dist/composition/descriptor.d.ts +1 -1
- package/dist/composition/descriptor.d.ts.map +1 -1
- package/dist/composition/descriptor.js.map +1 -1
- package/dist/composition/dimension-adjacency.js.map +1 -1
- package/dist/composition/discovery.d.ts +67 -7
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +83 -23
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +19 -22
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +25 -28
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts +2 -2
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +29 -5
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +100 -72
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +14 -4
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +53 -19
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +2 -1
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +9 -39
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/expr-subst.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +9 -0
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +54 -0
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/frontier-account.d.ts +3 -2
- package/dist/composition/frontier-account.d.ts.map +1 -1
- package/dist/composition/frontier-account.js +7 -3
- package/dist/composition/frontier-account.js.map +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/grounding.js.map +1 -1
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +9 -5
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +7 -4
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +28 -0
- package/dist/composition/mathts-quiet.d.ts.map +1 -0
- package/dist/composition/mathts-quiet.js +56 -0
- package/dist/composition/mathts-quiet.js.map +1 -0
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +18 -34
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/not-composable-seeds.d.ts +3 -1
- package/dist/composition/not-composable-seeds.d.ts.map +1 -1
- package/dist/composition/not-composable-seeds.js +2 -0
- package/dist/composition/not-composable-seeds.js.map +1 -1
- package/dist/composition/probe/backend-protocol.js.map +1 -1
- package/dist/composition/probe/candidate-store.js.map +1 -1
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/expression-gaps.js.map +1 -1
- package/dist/composition/probe/falsify.d.ts +14 -3
- package/dist/composition/probe/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +14 -27
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fingerprint.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +1 -1
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +2 -1
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +4 -2
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +4 -2
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/metadata.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 +13 -6
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/problem.d.ts +8 -0
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +78 -12
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/run-manifest.js +2 -2
- package/dist/composition/probe/run-manifest.js.map +1 -1
- package/dist/composition/probe/scoring.d.ts +2 -1
- package/dist/composition/probe/scoring.d.ts.map +1 -1
- package/dist/composition/probe/scoring.js +21 -7
- package/dist/composition/probe/scoring.js.map +1 -1
- package/dist/composition/probe/search-budget.js.map +1 -1
- package/dist/composition/probe/serialize.js.map +1 -1
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +4 -3
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +5 -3
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/types.d.ts +3 -1
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js +2 -0
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +11 -4
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +14 -6
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantities.d.ts +0 -4
- package/dist/composition/quantities.d.ts.map +1 -1
- package/dist/composition/quantities.js +5 -5
- package/dist/composition/quantities.js.map +1 -1
- package/dist/composition/quantity.d.ts +18 -2
- package/dist/composition/quantity.d.ts.map +1 -1
- package/dist/composition/quantity.js +35 -6
- package/dist/composition/quantity.js.map +1 -1
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts +18 -0
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +37 -7
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/uncertainty.js.map +1 -1
- package/dist/composition/user-equation.d.ts +11 -7
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +24 -26
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/axes-registry.d.ts +8 -5
- package/dist/core/axes-registry.d.ts.map +1 -1
- package/dist/core/axes-registry.js.map +1 -1
- package/dist/core/cell.js.map +1 -1
- package/dist/core/constants.d.ts +35 -12
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +46 -15
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +27 -0
- package/dist/core/data-file.d.ts.map +1 -0
- package/dist/core/data-file.js +48 -0
- package/dist/core/data-file.js.map +1 -0
- package/dist/core/flux-rules.js +1 -1
- package/dist/core/flux-rules.js.map +1 -1
- package/dist/core/json-schema.d.ts +27 -0
- package/dist/core/json-schema.d.ts.map +1 -0
- package/dist/core/json-schema.js +177 -0
- package/dist/core/json-schema.js.map +1 -0
- package/dist/core/labeled-tensor.d.ts +6 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +18 -8
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/regime-registry.d.ts +6 -2
- package/dist/core/regime-registry.d.ts.map +1 -1
- package/dist/core/regime-registry.js.map +1 -1
- package/dist/core/regime-rule-install.js.map +1 -1
- package/dist/core/regimes-builtins.js.map +1 -1
- package/dist/core/tensor.d.ts +7 -4
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +40 -8
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +3 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +16 -14
- package/dist/core/types.js.map +1 -1
- package/dist/core/universal-index.js.map +1 -1
- package/dist/diff/bridge-ast-gradient.d.ts +4 -5
- package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-ast-gradient.js +16 -23
- package/dist/diff/bridge-ast-gradient.js.map +1 -1
- package/dist/diff/bridge-gradient.d.ts +24 -80
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +21 -98
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts +18 -6
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +17 -5
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +5 -4
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +6 -5
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-types.js.map +1 -1
- package/dist/dimensional/bridge-check.d.ts.map +1 -1
- package/dist/dimensional/bridge-check.js +3 -5
- package/dist/dimensional/bridge-check.js.map +1 -1
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/connection-validators.d.ts +2 -1
- package/dist/dimensional/connection-validators.d.ts.map +1 -1
- package/dist/dimensional/connection-validators.js.map +1 -1
- package/dist/dimensional/connection.js.map +1 -1
- package/dist/dimensional/constant-rows.d.ts +54 -0
- package/dist/dimensional/constant-rows.d.ts.map +1 -0
- package/dist/dimensional/constant-rows.js +115 -0
- package/dist/dimensional/constant-rows.js.map +1 -0
- package/dist/dimensional/constants.d.ts +7 -17
- package/dist/dimensional/constants.d.ts.map +1 -1
- package/dist/dimensional/constants.js +12 -21
- package/dist/dimensional/constants.js.map +1 -1
- package/dist/dimensional/curvature-composite.js.map +1 -1
- package/dist/dimensional/curvature-invariants.js.map +1 -1
- package/dist/dimensional/curvature.js.map +1 -1
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/dimension-spec.d.ts +21 -6
- package/dist/dimensional/dimension-spec.d.ts.map +1 -1
- package/dist/dimensional/dimension-spec.js +150 -160
- package/dist/dimensional/dimension-spec.js.map +1 -1
- package/dist/dimensional/einstein-equation.js.map +1 -1
- package/dist/dimensional/errors.d.ts +3 -1
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +2 -2
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +79 -0
- package/dist/dimensional/exact-scale.d.ts.map +1 -0
- package/dist/dimensional/exact-scale.js +222 -0
- package/dist/dimensional/exact-scale.js.map +1 -0
- package/dist/dimensional/field-equation-helpers.js.map +1 -1
- package/dist/dimensional/formula-names.d.ts +13 -12
- package/dist/dimensional/formula-names.d.ts.map +1 -1
- package/dist/dimensional/formula-names.js +28 -51
- package/dist/dimensional/formula-names.js.map +1 -1
- package/dist/dimensional/fresh-label.js.map +1 -1
- package/dist/dimensional/friedmann-equation.d.ts +3 -3
- package/dist/dimensional/friedmann-equation.js +3 -3
- package/dist/dimensional/friedmann-equation.js.map +1 -1
- package/dist/dimensional/gauge-field.d.ts +2 -3
- package/dist/dimensional/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +0 -1
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +8 -0
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/killing-validators.js.map +1 -1
- package/dist/dimensional/klein-gordon-equation.js.map +1 -1
- package/dist/dimensional/metric-validators.d.ts +2 -1
- package/dist/dimensional/metric-validators.d.ts.map +1 -1
- package/dist/dimensional/metric-validators.js.map +1 -1
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/natural-units.js.map +1 -1
- package/dist/dimensional/quantity-registry.d.ts +23 -1
- package/dist/dimensional/quantity-registry.d.ts.map +1 -1
- package/dist/dimensional/quantity-registry.js +55 -18
- package/dist/dimensional/quantity-registry.js.map +1 -1
- package/dist/dimensional/rg-flow.js.map +1 -1
- package/dist/dimensional/stress-energy-validators.js.map +1 -1
- package/dist/dimensional/symbolic-constants.d.ts +63 -19
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +114 -92
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/tensor-trace.js.map +1 -1
- package/dist/dimensional/tensor.js.map +1 -1
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-convention.d.ts +0 -2
- package/dist/dimensional/unit-convention.d.ts.map +1 -1
- package/dist/dimensional/unit-convention.js +2 -2
- package/dist/dimensional/unit-convention.js.map +1 -1
- package/dist/dimensional/unit-data.d.ts +70 -0
- package/dist/dimensional/unit-data.d.ts.map +1 -0
- package/dist/dimensional/unit-data.js +139 -0
- package/dist/dimensional/unit-data.js.map +1 -0
- package/dist/dimensional/units.d.ts +87 -24
- package/dist/dimensional/units.d.ts.map +1 -1
- package/dist/dimensional/units.js +290 -295
- package/dist/dimensional/units.js.map +1 -1
- package/dist/dimensional/validator-registry.js.map +1 -1
- package/dist/dimensional/validator.d.ts +0 -16
- package/dist/dimensional/validator.d.ts.map +1 -1
- package/dist/dimensional/validator.js +65 -29
- package/dist/dimensional/validator.js.map +1 -1
- package/dist/dimensional/weyl-validators.js.map +1 -1
- package/dist/index.d.ts +65 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -24
- package/dist/index.js.map +1 -1
- package/dist/numerical/bianchi-residual.js.map +1 -1
- package/dist/numerical/binding-value.d.ts +32 -7
- package/dist/numerical/binding-value.d.ts.map +1 -1
- package/dist/numerical/binding-value.js +218 -209
- package/dist/numerical/binding-value.js.map +1 -1
- package/dist/numerical/christoffel-flat.js.map +1 -1
- 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 +2 -2
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.d.ts +20 -0
- package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +6 -3
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/derivative-lowering.js.map +1 -1
- package/dist/numerical/einstein-equation.js.map +1 -1
- package/dist/numerical/engine-registry.js.map +1 -1
- package/dist/numerical/errors.d.ts +7 -3
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +5 -5
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/evaluator-uncertainty.d.ts +34 -0
- package/dist/numerical/evaluator-uncertainty.d.ts.map +1 -0
- package/dist/numerical/evaluator-uncertainty.js +134 -0
- package/dist/numerical/evaluator-uncertainty.js.map +1 -0
- package/dist/numerical/formula-contract.d.ts +67 -7
- package/dist/numerical/formula-contract.d.ts.map +1 -1
- package/dist/numerical/formula-contract.js +68 -42
- package/dist/numerical/formula-contract.js.map +1 -1
- package/dist/numerical/formula-dimension.d.ts +17 -7
- package/dist/numerical/formula-dimension.d.ts.map +1 -1
- package/dist/numerical/formula-dimension.js +120 -44
- package/dist/numerical/formula-dimension.js.map +1 -1
- package/dist/numerical/formula-mathts.d.ts.map +1 -1
- package/dist/numerical/formula-mathts.js +10 -3
- package/dist/numerical/formula-mathts.js.map +1 -1
- package/dist/numerical/formula-registry.d.ts +13 -3
- package/dist/numerical/formula-registry.d.ts.map +1 -1
- package/dist/numerical/formula-registry.js +7 -2
- package/dist/numerical/formula-registry.js.map +1 -1
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/gl4-integrator.d.ts +28 -27
- package/dist/numerical/gl4-integrator.d.ts.map +1 -1
- package/dist/numerical/gl4-integrator.js +44 -45
- package/dist/numerical/gl4-integrator.js.map +1 -1
- package/dist/numerical/grid-field.js.map +1 -1
- package/dist/numerical/index.js.map +1 -1
- package/dist/numerical/input-validation.d.ts +3 -6
- package/dist/numerical/input-validation.d.ts.map +1 -1
- package/dist/numerical/input-validation.js +4 -8
- package/dist/numerical/input-validation.js.map +1 -1
- package/dist/numerical/killing.d.ts +8 -5
- package/dist/numerical/killing.d.ts.map +1 -1
- package/dist/numerical/killing.js.map +1 -1
- package/dist/numerical/klein-gordon.js.map +1 -1
- package/dist/numerical/kretschmann.js.map +1 -1
- package/dist/numerical/lowering-utils.js.map +1 -1
- package/dist/numerical/lowering.d.ts.map +1 -1
- package/dist/numerical/lowering.js +7 -17
- package/dist/numerical/lowering.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +11 -6
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ic.js.map +1 -1
- package/dist/numerical/null-ray-integrator.js +4 -4
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/pderiv.d.ts.map +1 -1
- package/dist/numerical/pderiv.js +9 -2
- package/dist/numerical/pderiv.js.map +1 -1
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts +5 -2
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +20 -3
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/spacetime-metrics.d.ts +17 -19
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +158 -250
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/strides.js.map +1 -1
- package/dist/numerical/tensor-engine.d.ts +9 -5
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/numerical/types.js.map +1 -1
- package/dist/numerical/weyl-lowering.js.map +1 -1
- package/dist/relations/category.js.map +1 -1
- package/dist/relations/composition-table.d.ts +4 -4
- package/dist/relations/composition-table.js +4 -4
- package/dist/relations/composition-table.js.map +1 -1
- package/dist/relations/conventions.js.map +1 -1
- package/dist/relations/domain-regimes.js.map +1 -1
- package/dist/relations/regime-registration.js.map +1 -1
- package/dist/relations/regime-vocabularies.js.map +1 -1
- package/dist/relations/regime.d.ts +18 -8
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +26 -14
- package/dist/relations/regime.js.map +1 -1
- package/dist/relations/types.d.ts +26 -6
- package/dist/relations/types.d.ts.map +1 -1
- package/dist/relations/types.js +15 -3
- package/dist/relations/types.js.map +1 -1
- package/package.json +10 -14
- package/dist/bridges/registry.d.ts +0 -60
- package/dist/bridges/registry.d.ts.map +0 -1
- package/dist/bridges/registry.js +0 -87
- package/dist/bridges/registry.js.map +0 -1
- package/dist/cli/poster-source.d.ts +0 -154
- package/dist/cli/poster-source.d.ts.map +0 -1
- package/dist/cli/poster-source.js +0 -184
- package/dist/cli/poster-source.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantity-registry.d.ts","sourceRoot":"","sources":["../../src/dimensional/quantity-registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"quantity-registry.d.ts","sourceRoot":"","sources":["../../src/dimensional/quantity-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,uDAAuD;AACvD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnD,wDAAwD;AACxD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE7C,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;CAChD;AAED,uEAAuE;AACvE,eAAO,MAAM,QAAQ,MAAO,MAAM,KAAG,MAA8B,CAAC;AAKpE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,cAAc,EAAE,CAoBhF;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAY1G;AAID,wDAAwD;AACxD,wBAAgB,kBAAkB,IAAI,SAAS,cAAc,EAAE,CAE9D;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEvE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAQ1E"}
|
|
@@ -1,36 +1,73 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The quantity registry. Canonical id, aliases, dimension, and whether an
|
|
3
3
|
* affine temperature is an absolute point or an interval. Synonym groups and
|
|
4
|
-
* the temperature role are projections of this table.
|
|
4
|
+
* the temperature role are projections of this table. The aliases of a
|
|
5
|
+
* quantity that is also a registered constant come from the constant registry.
|
|
5
6
|
*
|
|
6
7
|
* @module dimensional/quantity-registry
|
|
7
8
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const foldName = (s) => s.replace(/_/g, '-');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import { checkedDataFile } from '../core/data-file.js';
|
|
10
|
+
import { CONSTANT_REGISTRY } from './symbolic-constants.js';
|
|
11
|
+
/** `_` written as `-`: the one fold every spelling comparison uses. */
|
|
12
|
+
export const foldName = (s) => s.replace(/_/g, '-');
|
|
13
|
+
const isAffineTemperature = (dimension) => dimension.Theta === 1 && dimension.L === 0 && dimension.M === 0 && dimension.T === 0 && dimension.I === 0 && dimension.N === 0 && dimension.J === 0;
|
|
14
|
+
/**
|
|
15
|
+
* The rows of a quantity file. A constant that is also a quantity (`k_B` is
|
|
16
|
+
* `boltzmann-constant`) gives that row its spellings as aliases: the
|
|
17
|
+
* constant registry owns them and the file does not repeat them. A `kind` is
|
|
18
|
+
* the role of an affine temperature, so a row whose dimension is not Θ¹ may
|
|
19
|
+
* not carry one: there it decides nothing and misleads a reader.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export function readQuantityFile(parsed) {
|
|
23
|
+
for (const row of parsed.quantities) {
|
|
24
|
+
if (row.kind !== undefined && !isAffineTemperature(row.dimension)) {
|
|
25
|
+
throw new Error(`data/quantities.json: ${row.id}: kind ${row.kind} on a quantity that is not an affine temperature`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const ids = new Set(parsed.quantities.map((row) => row.id));
|
|
29
|
+
const derived = new Map();
|
|
30
|
+
for (const constant of CONSTANT_REGISTRY) {
|
|
31
|
+
if (constant.quantity === undefined)
|
|
32
|
+
continue;
|
|
33
|
+
if (!ids.has(constant.quantity)) {
|
|
34
|
+
throw new Error(`constant '${constant.name}' names quantity '${constant.quantity}', which data/quantities.json does not have`);
|
|
35
|
+
}
|
|
36
|
+
derived.set(constant.quantity, [...(derived.get(constant.quantity) ?? []), constant.name, ...constant.spellings]);
|
|
37
|
+
}
|
|
38
|
+
return parsed.quantities.map((row) => {
|
|
39
|
+
const known = new Set([row.id, ...(row.aliases ?? [])].map(foldName));
|
|
40
|
+
const spellings = (derived.get(row.id) ?? []).filter((spelling) => !known.has(foldName(spelling)));
|
|
41
|
+
return spellings.length === 0 ? row : { ...row, aliases: [...(row.aliases ?? []), ...spellings] };
|
|
42
|
+
});
|
|
16
43
|
}
|
|
17
|
-
const QUANTITIES =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
const QUANTITIES = readQuantityFile(checkedDataFile('quantities.json'));
|
|
45
|
+
/**
|
|
46
|
+
* Folded spelling → row, over every id and alias. Two rows that one folded
|
|
47
|
+
* spelling names throw: the later row would silently shadow the earlier.
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export function quantitySpellingIndex(rows) {
|
|
51
|
+
const index = new Map();
|
|
52
|
+
for (const row of rows) {
|
|
53
|
+
for (const spelling of new Set([row.id, ...(row.aliases ?? [])].map(foldName))) {
|
|
54
|
+
const other = index.get(spelling);
|
|
55
|
+
if (other !== undefined) {
|
|
56
|
+
throw new Error(`data/quantities.json: '${spelling}' spells both '${other.id}' and '${row.id}' (\`_\` and \`-\` are one character)`);
|
|
57
|
+
}
|
|
58
|
+
index.set(spelling, row);
|
|
59
|
+
}
|
|
25
60
|
}
|
|
61
|
+
return index;
|
|
26
62
|
}
|
|
63
|
+
const BY_KEY = quantitySpellingIndex(QUANTITIES);
|
|
27
64
|
/** Every quantity record, graph nodes and spellings. */
|
|
28
65
|
export function allQuantityRecords() {
|
|
29
66
|
return QUANTITIES;
|
|
30
67
|
}
|
|
31
68
|
/** The record `name` spells, comparing `_` and `-` as the same character. */
|
|
32
69
|
export function quantityRecord(name) {
|
|
33
|
-
return BY_KEY.get(
|
|
70
|
+
return BY_KEY.get(foldName(name));
|
|
34
71
|
}
|
|
35
72
|
/**
|
|
36
73
|
* Synonym groups projected from declared aliases. The canonical id is first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantity-registry.js","sourceRoot":"","sources":["../../src/dimensional/quantity-registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"quantity-registry.js","sourceRoot":"","sources":["../../src/dimensional/quantity-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAyB5D,uEAAuE;AACvE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAEpE,MAAM,mBAAmB,GAAG,CAAC,SAAoB,EAAW,EAAE,CAC5D,SAAS,CAAC,KAAK,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC;AAEtJ;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAoB;IACnD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACpC,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAClE,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,CAAC,EAAE,UAAU,GAAG,CAAC,IAAI,kDAAkD,CAAC,CAAC;QACvH,CAAC;IACH,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE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KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * The quantity registry. Canonical id, aliases, dimension, and whether an\n * affine temperature is an absolute point or an interval. Synonym groups and\n * the temperature role are projections of this table. The aliases of a\n * quantity that is also a registered constant come from the constant registry.\n *\n * @module dimensional/quantity-registry\n */\n\nimport { checkedDataFile } from '../core/data-file.js';\nimport type { Dimension } from './types.js';\nimport { CONSTANT_REGISTRY } from './symbolic-constants.js';\n\n/** Declared role of an affine temperature quantity. */\nexport type QuantityKind = 'absolute' | 'interval';\n\n/** A carrier that enters a same-sign transport rule. */\nexport type SignRole = 'charge' | 'mobility';\n\n/** One quantity. `graphNode` is false for a spelling that is not a graph node. */\nexport interface QuantityRecord {\n readonly id: string;\n readonly symbol: string;\n readonly dimension: Dimension;\n readonly attributes: Readonly<Record<string, string>>;\n readonly kind?: QuantityKind;\n readonly aliases?: readonly string[];\n readonly signRole?: SignRole;\n readonly graphNode: boolean;\n}\n\n/** The shape of `data/quantities.json`. @internal */\nexport interface QuantityFile {\n readonly quantities: readonly QuantityRecord[];\n}\n\n/** `_` written as `-`: the one fold every spelling comparison uses. */\nexport const foldName = (s: string): string => s.replace(/_/g, '-');\n\nconst isAffineTemperature = (dimension: Dimension): boolean =>\n dimension.Theta === 1 && dimension.L === 0 && dimension.M === 0 && dimension.T === 0 && dimension.I === 0 && dimension.N === 0 && dimension.J === 0;\n\n/**\n * The rows of a quantity file. A constant that is also a quantity (`k_B` is\n * `boltzmann-constant`) gives that row its spellings as aliases: the\n * constant registry owns them and the file does not repeat them. A `kind` is\n * the role of an affine temperature, so a row whose dimension is not Θ¹ may\n * not carry one: there it decides nothing and misleads a reader.\n * @internal\n */\nexport function readQuantityFile(parsed: QuantityFile): readonly QuantityRecord[] {\n for (const row of parsed.quantities) {\n if (row.kind !== undefined && !isAffineTemperature(row.dimension)) {\n throw new Error(`data/quantities.json: ${row.id}: kind ${row.kind} on a quantity that is not an affine temperature`);\n }\n }\n const ids = new Set(parsed.quantities.map((row) => row.id));\n const derived = new Map<string, string[]>();\n for (const constant of CONSTANT_REGISTRY) {\n if (constant.quantity === undefined) continue;\n if (!ids.has(constant.quantity)) {\n throw new Error(`constant '${constant.name}' names quantity '${constant.quantity}', which data/quantities.json does not have`);\n }\n derived.set(constant.quantity, [...(derived.get(constant.quantity) ?? []), constant.name, ...constant.spellings]);\n }\n return parsed.quantities.map((row) => {\n const known = new Set([row.id, ...(row.aliases ?? [])].map(foldName));\n const spellings = (derived.get(row.id) ?? []).filter((spelling) => !known.has(foldName(spelling)));\n return spellings.length === 0 ? row : { ...row, aliases: [...(row.aliases ?? []), ...spellings] };\n });\n}\n\nconst QUANTITIES = readQuantityFile(checkedDataFile('quantities.json') as QuantityFile);\n\n/**\n * Folded spelling → row, over every id and alias. Two rows that one folded\n * spelling names throw: the later row would silently shadow the earlier.\n * @internal\n */\nexport function quantitySpellingIndex(rows: readonly QuantityRecord[]): ReadonlyMap<string, QuantityRecord> {\n const index = new Map<string, QuantityRecord>();\n for (const row of rows) {\n for (const spelling of new Set([row.id, ...(row.aliases ?? [])].map(foldName))) {\n const other = index.get(spelling);\n if (other !== undefined) {\n throw new Error(`data/quantities.json: '${spelling}' spells both '${other.id}' and '${row.id}' (\\`_\\` and \\`-\\` are one character)`);\n }\n index.set(spelling, row);\n }\n }\n return index;\n}\n\nconst BY_KEY = quantitySpellingIndex(QUANTITIES);\n\n/** Every quantity record, graph nodes and spellings. */\nexport function allQuantityRecords(): readonly QuantityRecord[] {\n return QUANTITIES;\n}\n\n/** The record `name` spells, comparing `_` and `-` as the same character. */\nexport function quantityRecord(name: string): QuantityRecord | undefined {\n return BY_KEY.get(foldName(name));\n}\n\n/**\n * Synonym groups projected from declared aliases. The canonical id is first.\n * A quantity with no alias is not a group.\n */\nexport function synonymGroupsFromRegistry(): readonly (readonly string[])[] {\n const groups: string[][] = [];\n for (const row of QUANTITIES) {\n const aliases = row.aliases ?? [];\n if (aliases.length === 0) continue;\n groups.push([row.id, ...aliases]);\n }\n return groups;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rg-flow.js","sourceRoot":"","sources":["../../src/dimensional/rg-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AA0BzE;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAoB;IACrD,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,KAAK,CACb,4DAA4D;YAC1D,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACxC,CAAC;IACJ,CAAC;IACD,0BAA0B,CACxB,gBAAgB,EAChB,aAAa,IAAI,CAAC,IAAI,GAAG,EACzB,IAAI,CAAC,GAAG,EACR,aAAa,EACb,yGAAyG,CAC1G,CAAC;AACJ,CAAC;AAsDD;;;;;;;;;;;;;;;;;;;;;G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F,6EAA6E;IAC7E,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CACb,qDAAqD;gBACnD,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,mCAAmC;gBAC5D,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,uCAAuC;gBAC/D,gDAAgD,CACnD,CAAC;QACJ,CAAC;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CACb,gCAAgC,CAAC,cAAc;oBAC7C,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,yBAAyB,CAAC,IAAI,CAC3D,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AAC9D,CAAC","sourcesContent":["/**\n * Renormalization-group (RG) flow primitives — `RGCouplingNode` +\n * `BetaFunctionNode` (v0.7 BE-X re-encoding sprint).\n *\n * Encodes the structure of a Wilsonian / functional-RG flow on the\n * space of *dimensionless* couplings. The motivating physics context\n * is the asymptotic-safety program for quantum gravity (Reuter 1998\n * *Phys. Rev. D* 57:971, arXiv:hep-th/9605030; Niedermaier-Reuter 2006\n * *Living Rev. Relativity* 9:5 for the canonical review), in which RG\n * flow on the space of dimensionless couplings `g_n = G_n(k)·k^{d_n}`\n * is governed by polynomial β-functions\n *\n * β_n(g_1, g_2, …) ≡ k ∂_k g_n\n *\n * and a viable UV-complete theory is signalled by the existence of a\n * non-Gaussian fixed point `(g_1*, g_2*, …)` at which every β_n\n * vanishes simultaneously. The structural distinction made here:\n *\n * - `RGCouplingNode` represents a single dimensionless coupling\n * (`g`, `λ`, …) — a labelled handle, dim hardcoded to\n * DIMENSIONLESS for type-system symmetry with other AST nodes.\n * - `BetaFunctionNode` represents one β-function of a multi-coupling\n * flow: it carries the FULL coupling vector (the flow direction),\n * a `target` selector picking out which coupling's β-function this\n * node represents, the polynomial expression in those couplings,\n * and an optional UV / IR fixed-point pin.\n *\n * The polynomial expression is a standard `ExprNode` built from\n * dimensionless symbols + the existing `op (+ * / ^ -)` primitives;\n * `validateBetaFunction` delegates dimensional checking to the existing\n * `validate()` from `validator.ts` and verifies the result reduces to\n * DIMENSIONLESS.\n *\n * These primitives are NOT (yet) added to the `ExprNode` union — they\n * live as a standalone predicate-level structure that callers compose\n * adjacent to the existing AST. BE-39's polynomial RHS continues to be\n * encoded as plain `op`-trees for catalog round-trip; the structural\n * `BetaFunctionNode` wrapper supplies the higher-level RG-flow\n * semantics on top.\n *\n * @module dimensional/rg-flow\n */\n\nimport type { ExprNode } from './validator.js';\nimport { validate } from './validator.js';\nimport type { Dimension } from './types.js';\nimport { DIMENSIONLESS } from './types.js';\nimport { validateComponentDimension } from './field-equation-helpers.js';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// RGCouplingNode\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * AST node for a single dimensionless RG coupling (e.g. `g`, `λ`).\n *\n * By RG-discipline every coupling appearing in a β-function expression\n * is dimensionless: physical dimensionful couplings `G_n` are made\n * dimensionless via the RG scale `k` (e.g. `g = G·k²`, `λ = Λ/k²`).\n * The `dim` field is therefore hardcoded to `DIMENSIONLESS`; it is\n * exposed for type-system symmetry with `{ kind: 'symbol' }` so a\n * future ExprNode-union integration is mechanical.\n *\n * @public\n */\nexport interface RGCouplingNode {\n readonly kind: 'rg-coupling';\n /** Coupling name, e.g. `'g'`, `'lambda'`. Non-empty. */\n readonly name: string;\n /** Always `DIMENSIONLESS` — RG-discipline invariant. */\n readonly dim: Dimension;\n}\n\n/**\n * Construct an `RGCouplingNode` with the dimensionless invariant\n * pre-applied. Convenience helper — callers may also build the node\n * literal directly.\n *\n * @public\n */\nexport function rgCoupling(name: string): RGCouplingNode {\n return { kind: 'rg-coupling', name, dim: DIMENSIONLESS };\n}\n\n/**\n * Validate an `RGCouplingNode`.\n *\n * Predicates:\n * 1. `name` is a non-empty string (dimension validators reject empty\n * labels because they make error messages unintelligible).\n * 2. `dim` is `DIMENSIONLESS` (RG-discipline invariant; physical\n * dimension is absorbed into the running scale `k`).\n *\n * Throws an `Error` with `\"name\"` / `\"dimension\"` in the message on\n * failure.\n *\n * @public\n */\nexport function validateRGCoupling(node: RGCouplingNode): void {\n if (typeof node.name !== 'string' || node.name.length === 0) {\n throw new Error(\n `RGCouplingNode: invalid name — must be a non-empty string ` +\n `(got ${JSON.stringify(node.name)}).`,\n );\n }\n validateComponentDimension(\n 'RGCouplingNode',\n `coupling '${node.name}'`,\n node.dim,\n DIMENSIONLESS,\n `must be DIMENSIONLESS by RG-discipline. Physical dimension should be absorbed into the running scale k.`,\n );\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// BetaFunctionNode\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * AST node for a single β-function in a multi-coupling RG flow.\n *\n * Fields:\n * - `couplings` — the full coupling vector `(g_1, g_2, …)`; this is\n * the flow direction. Every coupling must appear here, even those\n * that do not enter the polynomialExpansion of this specific\n * β-function (so that the cross-coupling dependency structure is\n * captured at the type level).\n * - `target` — the coupling whose β-function this node represents.\n * MUST be one of `couplings` (by name).\n * - `polynomialExpansion` — the explicit β(couplings) expression as\n * a standard `ExprNode`. Must reduce to `DIMENSIONLESS` via the\n * existing `validate()`.\n * - `fixedPoint` — optional UV / IR fixed-point pin, one numeric\n * value per coupling in the same order as `couplings`. When\n * present, `fixedPoint.length === couplings.length` is enforced.\n *\n * The polynomial form follows Reuter 1998 + the Niedermaier-Reuter 2006\n * review: each β_n is a polynomial in the dimensionless couplings,\n * truncated at some power dictated by the chosen truncation scheme\n * (e.g. canonical Einstein-Hilbert truncation for gravity).\n *\n * @public\n */\nexport interface BetaFunctionNode {\n readonly kind: 'beta-function';\n readonly couplings: ReadonlyArray<RGCouplingNode>;\n readonly target: RGCouplingNode;\n readonly polynomialExpansion: ExprNode;\n readonly fixedPoint?: ReadonlyArray<number>;\n}\n\n/**\n * Result of validating a `BetaFunctionNode`.\n *\n * `dim` is always `DIMENSIONLESS` (a β-function of dimensionless\n * couplings is itself dimensionless: `β = k ∂_k g` with both `g` and\n * `k ∂_k log(k)` dimensionless). `targetName` is the validated target\n * coupling label, useful for downstream RG-flow assembly.\n *\n * @public\n */\nexport interface BetaFunctionValidationResult {\n readonly dim: Dimension;\n readonly targetName: string;\n}\n\n/**\n * Validate a `BetaFunctionNode`.\n *\n * Predicates:\n *\n * 1. **Coupling list non-empty**: `couplings.length >= 1`. A flow\n * with no couplings has no β-function to define.\n * 2. **Every coupling is well-formed**: each entry passes\n * `validateRGCoupling`. Names must be unique.\n * 3. **Target ∈ couplings**: `target.name` appears in\n * `couplings.map(c => c.name)`. Throws an Error scoped\n * `'BetaFunctionNode: target …'` on miss.\n * 4. **Polynomial dimensionless**: `validate(polynomialExpansion)`\n * succeeds and yields `DIMENSIONLESS`. Anything else throws with\n * `'dimension'` in the message.\n * 5. **Fixed-point length match** (if `fixedPoint` is set):\n * `fixedPoint.length === couplings.length`. Each value must be\n * finite. Throws scoped `'BetaFunctionNode: fixedPoint …'` on\n * mismatch.\n *\n * @public\n */\nexport function validateBetaFunction(\n node: BetaFunctionNode,\n): BetaFunctionValidationResult {\n // ── Predicate 1: coupling list non-empty ───────────────────────────────────\n if (node.couplings.length === 0) {\n throw new Error(\n `BetaFunctionNode: coupling list is empty — an RG flow requires ` +\n `at least one coupling. Define the flow direction in 'couplings'.`,\n );\n }\n\n // ── Predicate 2: every coupling is well-formed; names unique ──────────────\n const seen = new Set<string>();\n for (const c of node.couplings) {\n validateRGCoupling(c);\n if (seen.has(c.name)) {\n throw new Error(\n `BetaFunctionNode: duplicate coupling name '${c.name}' in ` +\n `couplings list. Each RGCouplingNode must have a unique name.`,\n );\n }\n seen.add(c.name);\n }\n\n // ── Predicate 3: target is one of the couplings ───────────────────────────\n validateRGCoupling(node.target);\n if (!seen.has(node.target.name)) {\n throw new Error(\n `BetaFunctionNode: target coupling '${node.target.name}' is not in ` +\n `the couplings list [${[...seen].join(', ')}]. The target must be ` +\n `one of the flow-direction couplings.`,\n );\n }\n\n // ── Predicate 4: polynomialExpansion validates to DIMENSIONLESS ───────────\n const polyResult = validate(node.polynomialExpansion);\n if (!polyResult.ok || polyResult.inferredDimension === null) {\n const noteSummary = polyResult.violations\n .map((v) => v.note)\n .join('; ');\n throw new Error(\n `BetaFunctionNode: polynomialExpansion failed dimension inference ` +\n `for target '${node.target.name}' — ${noteSummary || 'no detail available'}.`,\n );\n }\n validateComponentDimension(\n 'BetaFunctionNode',\n `polynomialExpansion for target '${node.target.name}'`,\n polyResult.inferredDimension,\n DIMENSIONLESS,\n `must be DIMENSIONLESS (β-function of dimensionless couplings).`,\n );\n\n // ── Predicate 5: fixed-point length agrees with couplings count ───────────\n if (node.fixedPoint !== undefined) {\n if (node.fixedPoint.length !== node.couplings.length) {\n throw new Error(\n `BetaFunctionNode: fixedPoint length mismatch — got ` +\n `${node.fixedPoint.length} value(s) but couplings list has ` +\n `${node.couplings.length}. Provide one fixed-point coordinate ` +\n `per coupling in the same order as 'couplings'.`,\n );\n }\n for (let i = 0; i < node.fixedPoint.length; i++) {\n const v = node.fixedPoint[i];\n if (!Number.isFinite(v)) {\n throw new Error(\n `BetaFunctionNode: fixedPoint[${i}] (coupling ` +\n `'${node.couplings[i].name}') is not finite (got ${v}).`,\n );\n }\n }\n }\n\n return { dim: DIMENSIONLESS, targetName: node.target.name };\n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;AAQD;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC1C,IAA8B;IAE9B,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,KAAK,CACb,qDAAqD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AACnD,CAAC","sourcesContent":["/**\n * Stress-energy tensor and cosmological constant AST nodes (v0.6.0 Phase 2).\n *\n * Locked to lower-lower variance (Decision #2). Symmetry locked as\n * explicit field (Decision #12). Antisymmetric T_μν⁺ (Belinfante-Rosenfeld)\n * deferred to v0.7.0+.\n *\n * @module dimensional/stress-energy-validators\n */\n\nimport type { Dimension } from './types.js';\nimport type {\n CovariantIndex,\n StressEnergyTensorNode,\n CosmologicalConstantNode,\n} from './ast-types.js';\n\n// Node types now live in the leaf `ast-types.ts`; re-exported for compat.\nexport type { StressEnergyTensorNode, CosmologicalConstantNode } from './ast-types.js';\n\n/**\n * AST node for the stress-energy tensor T_μν. Rank-2 lower-lower locked\n * (Decision #2). Symmetric (Decision #12).\n *\n * componentDim is the SI dimension of a single component: [M·L⁻¹·T⁻²]\n * (energy density = Pa = kg·m⁻¹·s⁻²).\n *\n * @public\n */\n// v0.6.1: dropped export — internal-only validation-result shape.\ninterface StressEnergyValidationResult {\n readonly dim: Dimension;\n readonly freeIndices: Map<string, { upper: number; lower: number }>;\n}\n\n/**\n * Validate a `stress-energy` node.\n *\n * Throws:\n * - Error if rank ≠ 2 (T_μν is a rank-2 tensor by definition).\n * - Error if any index variance ≠ 'lower' (lower-lower locked per Decision #2).\n *\n * Returns `{dim: componentDim, freeIndices: {idx0: {lower:1}, idx1: {lower:1}}}`.\n */\nexport function validateStressEnergyTensor(\n node: StressEnergyTensorNode,\n): StressEnergyValidationResult {\n if (node.indices.length !== 2) {\n throw new Error(\n `StressEnergyTensorNode: expected rank-2, got rank-${node.indices.length}`,\n );\n }\n for (const idx of node.indices) {\n if (idx.variance !== 'lower') {\n throw new Error(\n `StressEnergyTensorNode: only lower-lower variance supported in v0.6.0 (got '${idx.variance}')`,\n );\n }\n }\n const freeIndices = new Map<string, { upper: number; lower: number }>();\n freeIndices.set(node.indices[0].label, { upper: 0, lower: 1 });\n freeIndices.set(node.indices[1].label, { upper: 0, lower: 1 });\n return { dim: node.componentDim, freeIndices };\n}\n\n// v0.6.1: dropped export — internal-only validation-result shape.\ninterface CosmologicalConstantValidationResult {\n readonly dim: Dimension;\n readonly freeIndices: Map<string, { upper: number; lower: number }>;\n}\n\n/**\n * Validate a `cosmological-constant` node.\n *\n * Throws:\n * - Error if dim ≠ [L⁻²] (check L === -2 && M === 0 && T === 0).\n *\n * Returns `{dim, freeIndices: empty}` (scalar — no free indices).\n */\nexport function validateCosmologicalConstant(\n node: CosmologicalConstantNode,\n): CosmologicalConstantValidationResult {\n if (node.dim.L !== -2 || node.dim.M !== 0 || node.dim.T !== 0) {\n throw new Error(\n `CosmologicalConstantNode: expected dim [L⁻²], got ${JSON.stringify(node.dim)}`,\n );\n }\n return { dim: node.dim, freeIndices: new Map() };\n}\n"]}
|
|
@@ -1,42 +1,89 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The constant registry: one row per physical constant a formula may name.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* A row (written in `constant-rows.ts`) holds the formula name, its other
|
|
5
|
+
* exact-case spellings, the SI value (imported from `core/constants.js`, the
|
|
6
|
+
* one owner of every value), the SI unit in `parseUnit` syntax, the meaning
|
|
7
|
+
* and the source. The dimension is derived from the unit once, here; no second
|
|
8
|
+
* table states it. The rows sit in their own module because the unit table
|
|
9
|
+
* names constants by these spellings, and this module imports the unit parser. Every other
|
|
10
|
+
* constant table in the library ({@link CONSTANTS}, `FORMULA_NAMED`,
|
|
11
|
+
* `CONSTANT_SPELLINGS`, {@link CONSTANT_PROVENANCE}, `CANONICAL_CONSTANTS`,
|
|
12
|
+
* the `upt eval` scope, the binding scope, the gradient constants) is a
|
|
13
|
+
* projection of this array, so a spelling, a value and a dimension cannot
|
|
14
|
+
* disagree between two files. A constant that is also a quantity names its
|
|
15
|
+
* `data/quantities.json` row in `quantity`; the quantity registry derives that
|
|
16
|
+
* row's aliases from here, so the file states no constant spelling.
|
|
10
17
|
*
|
|
11
|
-
*
|
|
18
|
+
* `canonical` marks a universal constant a canonical equation's `governing`
|
|
19
|
+
* list may bake as a leaf. A row that is an overlay for `upt eval` and the
|
|
20
|
+
* dimensional assignment only (`m_p`, `N_A`, the GRW parameters) is not
|
|
21
|
+
* canonical, so the canonical graph does not bake it.
|
|
22
|
+
*
|
|
23
|
+
* Numeric-literal leaves (`'2'`, `'3'`) are NOT registered — `evalExpr`
|
|
12
24
|
* resolves them via `Number(name)` and they are implicitly dimensionless.
|
|
13
|
-
* Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (
|
|
14
|
-
*
|
|
25
|
+
* Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (`Number('8pi')`
|
|
26
|
+
* is `NaN`).
|
|
15
27
|
*
|
|
16
28
|
* INTERNAL — not on the public surface.
|
|
17
29
|
*
|
|
18
30
|
* @module dimensional/symbolic-constants
|
|
19
31
|
*/
|
|
20
32
|
import type { Dimension } from './types.js';
|
|
33
|
+
import { type ConstantRow } from './constant-rows.js';
|
|
34
|
+
/** One registered constant: its row, with the dimension derived from its unit. @internal */
|
|
35
|
+
export interface ConstantRecord extends ConstantRow {
|
|
36
|
+
readonly dim: Dimension;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Every registered constant, the rows of `constant-rows.ts` with each
|
|
40
|
+
* dimension derived once from its unit. Order is the order the tables print.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export declare const CONSTANT_REGISTRY: readonly ConstantRecord[];
|
|
44
|
+
/** The registered constant `spelling` names, or undefined. @internal */
|
|
45
|
+
export declare function constantRecord(spelling: string): ConstantRecord | undefined;
|
|
46
|
+
/** A stated value for a registered constant disagrees with the registry. The equations use the registered value. @internal */
|
|
47
|
+
export declare class ConstantDisagreementError extends Error {
|
|
48
|
+
readonly key: string;
|
|
49
|
+
readonly constant: string;
|
|
50
|
+
readonly registered: number;
|
|
51
|
+
readonly given: number;
|
|
52
|
+
constructor(key: string, constant: string, registered: number, given: number);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The registered constant `key` names when `value` agrees with it within
|
|
56
|
+
* {@link CONSTANT_AGREEMENT}, or null when `key` names no constant. A value
|
|
57
|
+
* that disagrees throws {@link ConstantDisagreementError}: a constant is not
|
|
58
|
+
* a graph quantity, so a stated value is checked, never bound.
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export declare function constantAgreement(key: string, value: number): string | null;
|
|
62
|
+
/** The notes of the registered constants among `names`, each once, in registry order. @internal */
|
|
63
|
+
export declare function constantNotes(names: Iterable<string>): string[];
|
|
64
|
+
/** Every spelling → SI value, for a numeric scope. `pi` and `tau` are added. @internal */
|
|
65
|
+
export declare function constantScope(): Record<string, number>;
|
|
21
66
|
/** A registered constant leaf: SI value + SI dimension. @internal */
|
|
22
|
-
interface NamedConstantValue {
|
|
67
|
+
export interface NamedConstantValue {
|
|
23
68
|
readonly value: number;
|
|
24
69
|
readonly dim: Dimension;
|
|
25
70
|
}
|
|
26
71
|
/**
|
|
27
|
-
* Constant leaves a `symbolic` ExprNode may reference
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
72
|
+
* Constant leaves a `symbolic` ExprNode may reference, keyed by formula name:
|
|
73
|
+
* the canonical rows of {@link CONSTANT_REGISTRY}. `ln2`/`8pi`/`4pi`
|
|
74
|
+
* reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI` exactly
|
|
75
|
+
* (same IEEE-754 primitives).
|
|
31
76
|
*/
|
|
32
77
|
export declare const CONSTANTS: Readonly<Record<string, NamedConstantValue>>;
|
|
33
78
|
/** What a registered constant is, its SI unit, and where its value comes from (audit I10). @internal */
|
|
34
79
|
export interface ConstantProvenance {
|
|
35
80
|
readonly meaning: string;
|
|
36
|
-
/** The SI unit, in the syntax `parseUnit` reads;
|
|
81
|
+
/** The SI unit, in the syntax `parseUnit` reads; the registered dimension is derived from it. */
|
|
37
82
|
readonly unit: string;
|
|
38
83
|
readonly source: string;
|
|
39
84
|
}
|
|
85
|
+
/** One row per {@link CONSTANT_REGISTRY} name. @internal */
|
|
86
|
+
export declare const CONSTANT_PROVENANCE: Readonly<Record<string, ConstantProvenance>>;
|
|
40
87
|
/**
|
|
41
88
|
* A spelled-out multiple of π written as one symbol (`pi`, `6pi`). `2pi`,
|
|
42
89
|
* `4pi` and `8pi` are also registered in {@link CONSTANTS}; this covers the
|
|
@@ -47,7 +94,4 @@ export interface ConstantProvenance {
|
|
|
47
94
|
* @internal
|
|
48
95
|
*/
|
|
49
96
|
export declare function piMultipleValue(name: string): number | undefined;
|
|
50
|
-
/** One row per {@link CONSTANTS} key; a test holds the two key sets equal. @internal */
|
|
51
|
-
export declare const CONSTANT_PROVENANCE: Readonly<Record<string, ConstantProvenance>>;
|
|
52
|
-
export {};
|
|
53
97
|
//# sourceMappingURL=symbolic-constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbolic-constants.d.ts","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"symbolic-constants.d.ts","sourceR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ED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAKlE,CAAC;AAEF,wGAAwG;AACxG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iGAAiG;IACjG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAK5E,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMhE"}
|
|
@@ -1,75 +1,128 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The constant registry: one row per physical constant a formula may name.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* A row (written in `constant-rows.ts`) holds the formula name, its other
|
|
5
|
+
* exact-case spellings, the SI value (imported from `core/constants.js`, the
|
|
6
|
+
* one owner of every value), the SI unit in `parseUnit` syntax, the meaning
|
|
7
|
+
* and the source. The dimension is derived from the unit once, here; no second
|
|
8
|
+
* table states it. The rows sit in their own module because the unit table
|
|
9
|
+
* names constants by these spellings, and this module imports the unit parser. Every other
|
|
10
|
+
* constant table in the library ({@link CONSTANTS}, `FORMULA_NAMED`,
|
|
11
|
+
* `CONSTANT_SPELLINGS`, {@link CONSTANT_PROVENANCE}, `CANONICAL_CONSTANTS`,
|
|
12
|
+
* the `upt eval` scope, the binding scope, the gradient constants) is a
|
|
13
|
+
* projection of this array, so a spelling, a value and a dimension cannot
|
|
14
|
+
* disagree between two files. A constant that is also a quantity names its
|
|
15
|
+
* `data/quantities.json` row in `quantity`; the quantity registry derives that
|
|
16
|
+
* row's aliases from here, so the file states no constant spelling.
|
|
10
17
|
*
|
|
11
|
-
*
|
|
18
|
+
* `canonical` marks a universal constant a canonical equation's `governing`
|
|
19
|
+
* list may bake as a leaf. A row that is an overlay for `upt eval` and the
|
|
20
|
+
* dimensional assignment only (`m_p`, `N_A`, the GRW parameters) is not
|
|
21
|
+
* canonical, so the canonical graph does not bake it.
|
|
22
|
+
*
|
|
23
|
+
* Numeric-literal leaves (`'2'`, `'3'`) are NOT registered — `evalExpr`
|
|
12
24
|
* resolves them via `Number(name)` and they are implicitly dimensionless.
|
|
13
|
-
* Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (
|
|
14
|
-
*
|
|
25
|
+
* Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (`Number('8pi')`
|
|
26
|
+
* is `NaN`).
|
|
15
27
|
*
|
|
16
28
|
* INTERNAL — not on the public surface.
|
|
17
29
|
*
|
|
18
30
|
* @module dimensional/symbolic-constants
|
|
19
31
|
*/
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
import { parseUnit } from './units.js';
|
|
33
|
+
import { CONSTANT_ROWS, constantRow } from './constant-rows.js';
|
|
34
|
+
/**
|
|
35
|
+
* Every registered constant, the rows of `constant-rows.ts` with each
|
|
36
|
+
* dimension derived once from its unit. Order is the order the tables print.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export const CONSTANT_REGISTRY = CONSTANT_ROWS.map((constant) => ({
|
|
40
|
+
...constant,
|
|
41
|
+
dim: parseUnit(constant.unit).dim,
|
|
42
|
+
}));
|
|
43
|
+
const RECORD_OF_ROW = new Map(CONSTANT_ROWS.map((constant, i) => [constant, CONSTANT_REGISTRY[i]]));
|
|
44
|
+
/**
|
|
45
|
+
* Every spelling → its record; `constant-rows.ts` refuses a spelling written twice. A constant
|
|
46
|
+
* that is also a quantity (`quantity`, e.g. `k_B` → `boltzmann-constant`) is reachable by that
|
|
47
|
+
* quantity id too, so a user who writes the quantity's name states the constant, and the value
|
|
48
|
+
* is checked against the registry rather than bound.
|
|
49
|
+
*/
|
|
50
|
+
const BY_SPELLING = new Map(CONSTANT_REGISTRY.flatMap((record) => [record.name, ...record.spellings, ...(record.quantity === undefined ? [] : [record.quantity])].map((spelling) => [spelling, record])));
|
|
51
|
+
/** The registered constant `spelling` names, or undefined. @internal */
|
|
52
|
+
export function constantRecord(spelling) {
|
|
53
|
+
const constant = constantRow(spelling);
|
|
54
|
+
return constant === undefined ? undefined : RECORD_OF_ROW.get(constant);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Relative tolerance within which a stated constant agrees with the registered
|
|
58
|
+
* value. Textbook roundings such as `b = 2.9e-3` pass.
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
const CONSTANT_AGREEMENT = 5e-3;
|
|
62
|
+
/** A stated value for a registered constant disagrees with the registry. The equations use the registered value. @internal */
|
|
63
|
+
export class ConstantDisagreementError extends Error {
|
|
64
|
+
key;
|
|
65
|
+
constant;
|
|
66
|
+
registered;
|
|
67
|
+
given;
|
|
68
|
+
constructor(key, constant, registered, given) {
|
|
69
|
+
super(`'${key}' is the registered constant ${constant} = ${registered}; ` +
|
|
70
|
+
`${given} disagrees, and the equations use the registered value, so it cannot be rebound.`);
|
|
71
|
+
this.key = key;
|
|
72
|
+
this.constant = constant;
|
|
73
|
+
this.registered = registered;
|
|
74
|
+
this.given = given;
|
|
75
|
+
this.name = 'ConstantDisagreementError';
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The registered constant `key` names when `value` agrees with it within
|
|
80
|
+
* {@link CONSTANT_AGREEMENT}, or null when `key` names no constant. A value
|
|
81
|
+
* that disagrees throws {@link ConstantDisagreementError}: a constant is not
|
|
82
|
+
* a graph quantity, so a stated value is checked, never bound.
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
export function constantAgreement(key, value) {
|
|
86
|
+
const record = BY_SPELLING.get(key);
|
|
87
|
+
if (record === undefined)
|
|
88
|
+
return null;
|
|
89
|
+
if (Math.abs(value - record.value) > CONSTANT_AGREEMENT * Math.abs(record.value)) {
|
|
90
|
+
throw new ConstantDisagreementError(key, record.name, record.value, value);
|
|
91
|
+
}
|
|
92
|
+
return record.name;
|
|
93
|
+
}
|
|
94
|
+
/** The notes of the registered constants among `names`, each once, in registry order. @internal */
|
|
95
|
+
export function constantNotes(names) {
|
|
96
|
+
const seen = new Set();
|
|
97
|
+
for (const name of names) {
|
|
98
|
+
const record = BY_SPELLING.get(name);
|
|
99
|
+
if (record?.note !== undefined)
|
|
100
|
+
seen.add(record);
|
|
101
|
+
}
|
|
102
|
+
return CONSTANT_REGISTRY.filter((record) => seen.has(record)).map((record) => record.note);
|
|
103
|
+
}
|
|
104
|
+
/** Every spelling → SI value, for a numeric scope. `pi` and `tau` are added. @internal */
|
|
105
|
+
export function constantScope() {
|
|
106
|
+
const scope = { pi: Math.PI, tau: 2 * Math.PI };
|
|
107
|
+
for (const [spelling, record] of BY_SPELLING)
|
|
108
|
+
scope[spelling] = record.value;
|
|
109
|
+
return scope;
|
|
110
|
+
}
|
|
43
111
|
/**
|
|
44
|
-
* Constant leaves a `symbolic` ExprNode may reference
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
112
|
+
* Constant leaves a `symbolic` ExprNode may reference, keyed by formula name:
|
|
113
|
+
* the canonical rows of {@link CONSTANT_REGISTRY}. `ln2`/`8pi`/`4pi`
|
|
114
|
+
* reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI` exactly
|
|
115
|
+
* (same IEEE-754 primitives).
|
|
48
116
|
*/
|
|
49
|
-
export const CONSTANTS =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'2pi': { value: 2 * Math.PI, dim: DIMENSIONLESS },
|
|
59
|
-
// Extension constants for the canonical-equation L1 entries (Coulomb, Bohr,
|
|
60
|
-
// Stefan–Boltzmann). CODATA 2018 values.
|
|
61
|
-
// ISO 80000 / CODATA: a bare e is the elementary charge. Eccentricity is
|
|
62
|
-
// one_minus_e_sq. The canonical dimension guard still refuses to bake a
|
|
63
|
-
// dimensionless governing name e.
|
|
64
|
-
e: { value: E_SI, dim: CHARGE },
|
|
65
|
-
epsilon_0: { value: 8.8541878128e-12, dim: PERMITTIVITY },
|
|
66
|
-
sigma_sb: { value: 5.670374419e-8, dim: STEFAN_BOLTZMANN },
|
|
67
|
-
b: { value: B_WIEN_SI, dim: WIEN },
|
|
68
|
-
// IAU 2015 nominal solar parameter. M_sun in eval stays the rounded kilogram M_SUN_SI.
|
|
69
|
-
GM_sun: { value: GM_SUN_SI, dim: dim(3, 0, -2) },
|
|
70
|
-
Msun_iau: { value: GM_SUN_SI / G_SI, dim: dim(0, 1, 0) },
|
|
71
|
-
m_u: { value: M_U_SI, dim: MASS },
|
|
72
|
-
};
|
|
117
|
+
export const CONSTANTS = Object.fromEntries(CONSTANT_REGISTRY.filter((record) => record.canonical).map((record) => [
|
|
118
|
+
record.name,
|
|
119
|
+
{ value: record.value, dim: record.dim },
|
|
120
|
+
]));
|
|
121
|
+
/** One row per {@link CONSTANT_REGISTRY} name. @internal */
|
|
122
|
+
export const CONSTANT_PROVENANCE = Object.fromEntries(CONSTANT_REGISTRY.map((record) => [
|
|
123
|
+
record.name,
|
|
124
|
+
{ meaning: record.meaning, unit: record.unit, source: record.source },
|
|
125
|
+
]));
|
|
73
126
|
/**
|
|
74
127
|
* A spelled-out multiple of π written as one symbol (`pi`, `6pi`). `2pi`,
|
|
75
128
|
* `4pi` and `8pi` are also registered in {@link CONSTANTS}; this covers the
|
|
@@ -88,35 +141,4 @@ export function piMultipleValue(name) {
|
|
|
88
141
|
return undefined;
|
|
89
142
|
return n * Math.PI;
|
|
90
143
|
}
|
|
91
|
-
/** One row per {@link CONSTANTS} key; a test holds the two key sets equal. @internal */
|
|
92
|
-
export const CONSTANT_PROVENANCE = {
|
|
93
|
-
hbar: { meaning: 'reduced Planck constant h/(2π)', unit: 'J*s', source: 'exact H_SI/(2π) (core/constants.ts HBAR_SI)' },
|
|
94
|
-
h: { meaning: 'Planck constant', unit: 'J*s', source: 'exact SI, 2019 redefinition (core/constants.ts H_SI)' },
|
|
95
|
-
c: { meaning: 'speed of light in vacuum', unit: 'm/s', source: 'exact SI (core/constants.ts C_SI)' },
|
|
96
|
-
G: { meaning: 'Newtonian gravitational constant', unit: 'm^3/(kg*s^2)', source: 'CODATA 2018 (core/constants.ts G_SI)' },
|
|
97
|
-
k_B: { meaning: 'Boltzmann constant', unit: 'J/K', source: 'exact SI, 2019 redefinition (core/constants.ts K_B_SI)' },
|
|
98
|
-
ln2: { meaning: 'natural logarithm of 2', unit: '1', source: 'mathematical constant (Math.LN2)' },
|
|
99
|
-
'8pi': { meaning: '8π', unit: '1', source: 'mathematical constant (8·Math.PI)' },
|
|
100
|
-
'4pi': { meaning: '4π', unit: '1', source: 'mathematical constant (4·Math.PI)' },
|
|
101
|
-
'2pi': { meaning: '2π', unit: '1', source: 'mathematical constant (2·Math.PI)' },
|
|
102
|
-
e: { meaning: 'elementary charge', unit: 'C', source: 'exact SI, 2019 redefinition (core/constants.ts E_SI)' },
|
|
103
|
-
epsilon_0: { meaning: 'vacuum permittivity', unit: 'F/m', source: 'CODATA 2018 (this table)' },
|
|
104
|
-
sigma_sb: { meaning: 'Stefan–Boltzmann constant', unit: 'W/(m^2*K^4)', source: 'CODATA 2018 (this table)' },
|
|
105
|
-
b: { meaning: 'Wien displacement constant', unit: 'm*K', source: 'CODATA 2018 (core/constants.ts B_WIEN_SI)' },
|
|
106
|
-
GM_sun: {
|
|
107
|
-
meaning: 'IAU nominal solar gravitational parameter (GM)☉',
|
|
108
|
-
unit: 'm^3/s^2',
|
|
109
|
-
source: 'IAU 2015 Resolution B3 (core/constants.ts GM_SUN_SI)',
|
|
110
|
-
},
|
|
111
|
-
Msun_iau: {
|
|
112
|
-
meaning: 'IAU solar mass (GM)☉/G, the mass that reproduces GM_sun with G_SI',
|
|
113
|
-
unit: 'kg',
|
|
114
|
-
source: 'GM_SUN_SI/G_SI (core/constants.ts)',
|
|
115
|
-
},
|
|
116
|
-
m_u: {
|
|
117
|
-
meaning: 'unified atomic mass unit (atomic mass constant)',
|
|
118
|
-
unit: 'kg',
|
|
119
|
-
source: 'CODATA 2018 (core/constants.ts M_U_SI)',
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
144
|
//# sourceMappingURL=symbolic-constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbolic-constants.js","sourceRoot":"","sources":["../../src/dimensional/symbolic-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,IAAI,EACJ,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE7G,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAa,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,CAAC;IACD,CAAC;I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AAG,IAAI,CAAC,EAAE,CAAC;AACrB,CAAC","sourcesContent":["/**\n * The constant registry: one row per physical constant a formula may name.\n *\n * A row (written in `constant-rows.ts`) holds the formula name, its other\n * exact-case spellings, the SI value (imported from `core/constants.js`, the\n * one owner of every value), the SI unit in `parseUnit` syntax, the meaning\n * and the source. The dimension is derived from the unit once, here; no second\n * table states it. The rows sit in their own module because the unit table\n * names constants by these spellings, and this module imports the unit parser. Every other\n * constant table in the library ({@link CONSTANTS}, `FORMULA_NAMED`,\n * `CONSTANT_SPELLINGS`, {@link CONSTANT_PROVENANCE}, `CANONICAL_CONSTANTS`,\n * the `upt eval` scope, the binding scope, the gradient constants) is a\n * projection of this array, so a spelling, a value and a dimension cannot\n * disagree between two files. A constant that is also a quantity names its\n * `data/quantities.json` row in `quantity`; the quantity registry derives that\n * row's aliases from here, so the file states no constant spelling.\n *\n * `canonical` marks a universal constant a canonical equation's `governing`\n * list may bake as a leaf. A row that is an overlay for `upt eval` and the\n * dimensional assignment only (`m_p`, `N_A`, the GRW parameters) is not\n * canonical, so the canonical graph does not bake it.\n *\n * Numeric-literal leaves (`'2'`, `'3'`) are NOT registered — `evalExpr`\n * resolves them via `Number(name)` and they are implicitly dimensionless.\n * Non-base-10 tokens (`'8pi'`, `'4pi'`, `'ln2'`) MUST be here (`Number('8pi')`\n * is `NaN`).\n *\n * INTERNAL — not on the public surface.\n *\n * @module dimensional/symbolic-constants\n */\n\nimport type { Dimension } from './types.js';\nimport { parseUnit } from './units.js';\nimport { CONSTANT_ROWS, constantRow, type ConstantRow } from './constant-rows.js';\n\n/** One registered constant: its row, with the dimension derived from its unit. @internal */\nexport interface ConstantRecord extends ConstantRow {\n readonly dim: Dimension;\n}\n\n/**\n * Every registered constant, the rows of `constant-rows.ts` with each\n * dimension derived once from its unit. Order is the order the tables print.\n * @internal\n */\nexport const CONSTANT_REGISTRY: readonly ConstantRecord[] = CONSTANT_ROWS.map((constant) => ({\n ...constant,\n dim: parseUnit(constant.unit).dim,\n}));\n\nconst RECORD_OF_ROW = new Map<ConstantRow, ConstantRecord>(CONSTANT_ROWS.map((constant, i) => [constant, CONSTANT_REGISTRY[i]!]));\n\n/**\n * Every spelling → its record; `constant-rows.ts` refuses a spelling written twice. A constant\n * that is also a quantity (`quantity`, e.g. `k_B` → `boltzmann-constant`) is reachable by that\n * quantity id too, so a user who writes the quantity's name states the constant, and the value\n * is checked against the registry rather than bound.\n */\nconst BY_SPELLING = new Map<string, ConstantRecord>(\n CONSTANT_REGISTRY.flatMap((record) =>\n [record.name, ...record.spellings, ...(record.quantity === undefined ? [] : [record.quantity])].map(\n (spelling) => [spelling, record] as const,\n ),\n ),\n);\n\n/** The registered constant `spelling` names, or undefined. @internal */\nexport function constantRecord(spelling: string): ConstantRecord | undefined {\n const constant = constantRow(spelling);\n return constant === undefined ? undefined : RECORD_OF_ROW.get(constant);\n}\n\n/**\n * Relative tolerance within which a stated constant agrees with the registered\n * value. Textbook roundings such as `b = 2.9e-3` pass.\n * @internal\n */\nconst CONSTANT_AGREEMENT = 5e-3;\n\n/** A stated value for a registered constant disagrees with the registry. The equations use the registered value. @internal */\nexport class ConstantDisagreementError extends Error {\n constructor(\n readonly key: string,\n readonly constant: string,\n readonly registered: number,\n readonly given: number,\n ) {\n super(\n `'${key}' is the registered constant ${constant} = ${registered}; ` +\n `${given} disagrees, and the equations use the registered value, so it cannot be rebound.`,\n );\n this.name = 'ConstantDisagreementError';\n }\n}\n\n/**\n * The registered constant `key` names when `value` agrees with it within\n * {@link CONSTANT_AGREEMENT}, or null when `key` names no constant. A value\n * that disagrees throws {@link ConstantDisagreementError}: a constant is not\n * a graph quantity, so a stated value is checked, never bound.\n * @internal\n */\nexport function constantAgreement(key: string, value: number): string | null {\n const record = BY_SPELLING.get(key);\n if (record === undefined) return null;\n if (Math.abs(value - record.value) > CONSTANT_AGREEMENT * Math.abs(record.value)) {\n throw new ConstantDisagreementError(key, record.name, record.value, value);\n }\n return record.name;\n}\n\n/** The notes of the registered constants among `names`, each once, in registry order. @internal */\nexport function constantNotes(names: Iterable<string>): string[] {\n const seen = new Set<ConstantRecord>();\n for (const name of names) {\n const record = BY_SPELLING.get(name);\n if (record?.note !== undefined) seen.add(record);\n }\n return CONSTANT_REGISTRY.filter((record) => seen.has(record)).map((record) => record.note!);\n}\n\n/** Every spelling → SI value, for a numeric scope. `pi` and `tau` are added. @internal */\nexport function constantScope(): Record<string, number> {\n const scope: Record<string, number> = { pi: Math.PI, tau: 2 * Math.PI };\n for (const [spelling, record] of BY_SPELLING) scope[spelling] = record.value;\n return scope;\n}\n\n/** A registered constant leaf: SI value + SI dimension. @internal */\nexport interface NamedConstantValue {\n readonly value: number;\n readonly dim: Dimension;\n}\n\n/**\n * Constant leaves a `symbolic` ExprNode may reference, keyed by formula name:\n * the canonical rows of {@link CONSTANT_REGISTRY}. `ln2`/`8pi`/`4pi`\n * reproduce the evaluators' `Math.LN2` / `8*Math.PI` / `4*Math.PI` exactly\n * (same IEEE-754 primitives).\n */\nexport const CONSTANTS: Readonly<Record<string, NamedConstantValue>> = Object.fromEntries(\n CONSTANT_REGISTRY.filter((record) => record.canonical).map((record) => [\n record.name,\n { value: record.value, dim: record.dim },\n ]),\n);\n\n/** What a registered constant is, its SI unit, and where its value comes from (audit I10). @internal */\nexport interface ConstantProvenance {\n readonly meaning: string;\n /** The SI unit, in the syntax `parseUnit` reads; the registered dimension is derived from it. */\n readonly unit: string;\n readonly source: string;\n}\n\n/** One row per {@link CONSTANT_REGISTRY} name. @internal */\nexport const CONSTANT_PROVENANCE: Readonly<Record<string, ConstantProvenance>> = Object.fromEntries(\n CONSTANT_REGISTRY.map((record) => [\n record.name,\n { meaning: record.meaning, unit: record.unit, source: record.source },\n ]),\n);\n\n/**\n * A spelled-out multiple of π written as one symbol (`pi`, `6pi`). `2pi`,\n * `4pi` and `8pi` are also registered in {@link CONSTANTS}; this covers the\n * multiples an encoder spelled out and did not register (`6pi` in\n * CE-perihelion-precession). The structural normal form already drops these.\n * The numeric evaluator has to resolve them too, or a comparison treats `6pi`\n * as a free symbol and never aligns the formula.\n * @internal\n */\nexport function piMultipleValue(name: string): number | undefined {\n const m = /^(\\d*)pi$/.exec(name);\n if (m === null) return undefined;\n const n = m[1] === '' ? 1 : Number(m[1]);\n if (!Number.isInteger(n) || n < 0) return undefined;\n return n * Math.PI;\n}\n"]}
|