universal-physics-tensor 9.0.0 → 11.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 +21 -17
- package/bin/upt.mjs +13 -1
- package/data/atlas/atlas.json +79 -68
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +24 -23
- package/data/atlas/oscillators.json +21 -16
- package/data/atlas/waves.json +36 -31
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +1192 -1636
- package/data/bridge-catalog.schema.json +390 -135
- package/data/quantities.json +53 -19
- package/data/schemas/atlas-record.v0.json +184 -46
- package/data/units.json +33 -4
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +35 -18
- package/dist/atlas/applicability.js.map +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 +12 -3
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +30 -21
- 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 +2 -2
- 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 +3 -3
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +16 -8
- 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.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts +0 -11
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +12 -24
- 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 +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -17
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -42
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/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.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/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 +107 -4
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/model.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -12
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -10
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -36
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/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.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/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.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-carriage.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/path-bound.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +25 -24
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +25 -24
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +107 -70
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +184 -101
- 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.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/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.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/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/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/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 +2 -9
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -52
- 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.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-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 +38 -4
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +80 -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.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/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 +17 -9
- package/dist/bridges/catalog-adapter.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts +12 -2
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +181 -13
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +74 -26
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/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 +46 -3
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +40 -4
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts +17 -2
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +76 -28
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +38 -4
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +101 -12
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +40 -4
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +128 -19
- 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.js.map +1 -1
- 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.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- 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 +6 -7
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +20 -50
- 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 +27 -13
- 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/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/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.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +8 -9
- 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 +5 -6
- 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 +6 -12
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +38 -39
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/statistical-mechanics.js +5 -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 +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts +29 -4
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +47 -64
- 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 +22 -23
- 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 +42 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +64 -23
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/brownian-sphere.d.ts +3 -3
- package/dist/cases/brownian-sphere.d.ts.map +1 -1
- package/dist/cases/brownian-sphere.js +10 -9
- package/dist/cases/brownian-sphere.js.map +1 -1
- package/dist/cases/damped-resonator.d.ts.map +1 -1
- package/dist/cases/damped-resonator.js +8 -11
- package/dist/cases/damped-resonator.js.map +1 -1
- package/dist/cases/index.js.map +1 -1
- package/dist/cases/kepler-rv.d.ts +1 -1
- package/dist/cases/kepler-rv.d.ts.map +1 -1
- package/dist/cases/kepler-rv.js +3 -2
- package/dist/cases/kepler-rv.js.map +1 -1
- package/dist/cases/lumped-cooling.d.ts +8 -3
- package/dist/cases/lumped-cooling.d.ts.map +1 -1
- package/dist/cases/lumped-cooling.js +22 -24
- package/dist/cases/lumped-cooling.js.map +1 -1
- package/dist/cases/quadrature.d.ts +7 -9
- package/dist/cases/quadrature.d.ts.map +1 -1
- package/dist/cases/quadrature.js +28 -32
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/resistor-noise.js +7 -7
- package/dist/cases/resistor-noise.js.map +1 -1
- package/dist/cases/skin-depth.d.ts +0 -4
- package/dist/cases/skin-depth.d.ts.map +1 -1
- package/dist/cases/skin-depth.js +3 -7
- package/dist/cases/skin-depth.js.map +1 -1
- package/dist/cases/types.js.map +1 -1
- package/dist/cli/args.d.ts +30 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +47 -9
- 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 +33 -0
- package/dist/cli/bindings.js.map +1 -0
- package/dist/cli/closed-form-range.js.map +1 -1
- package/dist/cli/command.d.ts +8 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +2 -11
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +50 -35
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +48 -14
- 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 +9 -8
- 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 +20 -20
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/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 -20
- package/dist/cli/commands/confront.js.map +1 -1
- 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 +60 -35
- 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 +20 -10
- 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 +14 -10
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +108 -58
- 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 +16 -8
- 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 -10
- 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 +155 -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 +58 -20
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +29 -7
- 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 +105 -38
- 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 -26
- 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 +23 -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 +9 -4
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.js +31 -36
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +5 -3
- package/dist/cli/commands/testplan.js.map +1 -1
- 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.js.map +1 -1
- package/dist/cli/eval-numbers.js.map +1 -1
- package/dist/cli/expr-print.d.ts +28 -3
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +42 -22
- 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.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +25 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/map-evidence.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +23 -6
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +15 -0
- package/dist/cli/output.js.map +1 -1
- 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 +17 -11
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +7 -6
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +40 -20
- 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 +19 -7
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +0 -7
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/stored-results.d.ts +7 -0
- package/dist/cli/stored-results.d.ts.map +1 -0
- package/dist/cli/stored-results.js +23 -0
- package/dist/cli/stored-results.js.map +1 -0
- package/dist/cli/top-level-help.js.map +1 -1
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +7 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +49 -14
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +42 -17
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/adjudication.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/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 +6 -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.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +14 -15
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +148 -91
- 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 +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +134 -26
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +9 -10
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +33 -102
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/canonical-prefactors.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +8 -25
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +10 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +11 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-regime.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-surface.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +166 -41
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/consequence.d.ts.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 +77 -11
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +194 -80
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +40 -10
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +47 -12
- 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 +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +5 -9
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +38 -18
- 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 -11
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +16 -0
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +24 -59
- 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 +28 -0
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +96 -2
- 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-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/grounding.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +14 -8
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +7 -5
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +29 -0
- package/dist/composition/mathts-quiet.d.ts.map +1 -0
- package/dist/composition/mathts-quiet.js +57 -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 +20 -35
- 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.d.ts +4 -2
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +20 -9
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +17 -0
- package/dist/composition/probe/dataset.d.ts.map +1 -1
- package/dist/composition/probe/dataset.js +95 -50
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.d.ts +5 -1
- package/dist/composition/probe/experiment-design.d.ts.map +1 -1
- package/dist/composition/probe/experiment-design.js +44 -24
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/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 +16 -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 +7 -1
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +48 -23
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +27 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +53 -30
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +18 -2
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +10 -2
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +24 -1
- package/dist/composition/probe/limits.d.ts.map +1 -1
- package/dist/composition/probe/limits.js +53 -11
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/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 +22 -9
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/power-law.d.ts +121 -0
- package/dist/composition/probe/power-law.d.ts.map +1 -0
- package/dist/composition/probe/power-law.js +255 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +12 -1
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +242 -48
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +6 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +9 -7
- 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.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +35 -12
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +241 -184
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +17 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +32 -0
- package/dist/composition/probe/t-tail.js.map +1 -0
- package/dist/composition/probe/types.d.ts +6 -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 +51 -13
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +110 -58
- 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-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/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/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +23 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts +16 -6
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +36 -10
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/uncertainty.js.map +1 -1
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +2 -2
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/assignment.d.ts +19 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/assignment.js +19 -0
- package/dist/core/assignment.js.map +1 -0
- package/dist/core/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/compare.d.ts +32 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +46 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/constants.d.ts +35 -35
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +52 -37
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/flux-rules.js +1 -1
- package/dist/core/flux-rules.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +3 -1
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +41 -16
- package/dist/core/json-schema.js.map +1 -1
- 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 -16
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/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 +64 -8
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- 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 +10 -6
- package/dist/diff/bridge-ast-gradient.js.map +1 -1
- package/dist/diff/bridge-gradient.d.ts +43 -86
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +40 -109
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts +16 -5
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +19 -4
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +12 -4
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +17 -5
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/ast-types.js.map +1 -1
- package/dist/dimensional/bridge-check.js.map +1 -1
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/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.map +1 -1
- package/dist/dimensional/constant-rows.js +17 -13
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/constants.d.ts +5 -6
- package/dist/dimensional/constants.d.ts.map +1 -1
- package/dist/dimensional/constants.js +5 -6
- 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.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/dimension-spec.d.ts +13 -7
- package/dist/dimensional/dimension-spec.d.ts.map +1 -1
- package/dist/dimensional/dimension-spec.js +49 -23
- package/dist/dimensional/dimension-spec.js.map +1 -1
- package/dist/dimensional/einstein-equation.js.map +1 -1
- package/dist/dimensional/errors.d.ts +4 -2
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +3 -17
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +0 -17
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +8 -8
- package/dist/dimensional/exact-scale.js.map +1 -1
- package/dist/dimensional/field-equation-helpers.js.map +1 -1
- 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 +2 -3
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +45 -12
- 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.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -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 +13 -0
- package/dist/dimensional/quantity-registry.d.ts.map +1 -1
- package/dist/dimensional/quantity-registry.js +14 -6
- 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 +9 -0
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +20 -3
- 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.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-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.map +1 -1
- package/dist/dimensional/unit-data.js +11 -7
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/dimensional/units.d.ts.map +1 -1
- package/dist/dimensional/units.js +38 -20
- 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 +59 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -24
- package/dist/index.js.map +1 -1
- package/dist/numerical/bianchi-residual.js.map +1 -1
- package/dist/numerical/binding-value.d.ts +11 -6
- package/dist/numerical/binding-value.d.ts.map +1 -1
- package/dist/numerical/binding-value.js +126 -122
- package/dist/numerical/binding-value.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/connection-lowering-helpers.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +36 -13
- 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 +9 -5
- 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 -8
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/evaluator-uncertainty.d.ts.map +1 -1
- package/dist/numerical/evaluator-uncertainty.js +19 -2
- package/dist/numerical/evaluator-uncertainty.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/formula-contract.d.ts +63 -7
- package/dist/numerical/formula-contract.d.ts.map +1 -1
- package/dist/numerical/formula-contract.js +61 -42
- package/dist/numerical/formula-contract.js.map +1 -1
- package/dist/numerical/formula-dimension.d.ts +8 -7
- package/dist/numerical/formula-dimension.d.ts.map +1 -1
- package/dist/numerical/formula-dimension.js +58 -36
- 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 +5 -2
- 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.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/gl4-integrator.d.ts +28 -27
- package/dist/numerical/gl4-integrator.d.ts.map +1 -1
- package/dist/numerical/gl4-integrator.js +41 -42
- 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 +16 -25
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ic.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/pderiv.d.ts.map +1 -1
- package/dist/numerical/pderiv.js +9 -2
- package/dist/numerical/pderiv.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts +5 -2
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +19 -4
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +25 -19
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +180 -286
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/strides.js.map +1 -1
- package/dist/numerical/tensor-engine.d.ts +30 -5
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/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 +28 -8
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +44 -15
- package/dist/relations/regime.js.map +1 -1
- package/dist/relations/types.d.ts +18 -5
- package/dist/relations/types.d.ts.map +1 -1
- package/dist/relations/types.js +5 -3
- package/dist/relations/types.js.map +1 -1
- package/package.json +16 -20
- 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,32 +1,19 @@
|
|
|
1
|
-
import { equals } from '../dimensional/algebra.js';
|
|
1
|
+
import { equals, isDimensionless } from '../dimensional/algebra.js';
|
|
2
2
|
import { DIMENSION_RENAMES, quantityIdForSpelling } from '../dimensional/formula-names.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
d.M === 0 &&
|
|
6
|
-
d.T === 0 &&
|
|
7
|
-
d.I === 0 &&
|
|
8
|
-
d.Theta === 0 &&
|
|
9
|
-
d.N === 0 &&
|
|
10
|
-
d.J === 0;
|
|
3
|
+
import { isRegisteredConstant, piMultipleValue } from '../dimensional/symbolic-constants.js';
|
|
4
|
+
import { isDecimalLiteral } from '../dimensional/ast-leaves.js';
|
|
11
5
|
/** Token for a node that carries no structural content (a dimensionless factor). */
|
|
12
6
|
const UNIT = '1';
|
|
13
7
|
/**
|
|
14
8
|
* Spelled-out dimensionless numeric constants some encoders write as a named
|
|
15
9
|
* symbol rather than a literal — genuine constants the eval `CONSTANTS`
|
|
16
|
-
* registry
|
|
17
|
-
*
|
|
18
|
-
* of `ln 2`. These stay droppable;
|
|
19
|
-
* PARAMETER stub (`alpha`,
|
|
10
|
+
* registry does not list under that spelling (its own keys are the canonical
|
|
11
|
+
* rows of the constant registry; `piMultipleValue` reads `pi`/`2pi`/`6pi`/…).
|
|
12
|
+
* `ln_2_constant` is BE-16's spelling of `ln 2`. These stay droppable;
|
|
13
|
+
* everything else dimensionless-and-named is a PARAMETER stub (`alpha`,
|
|
14
|
+
* `lambda`, `g_dark`, `ln⟨e^−βW⟩`, …) and is kept.
|
|
20
15
|
*/
|
|
21
16
|
const NAMED_DIMENSIONLESS_CONSTANTS = new Set(['ln_2_constant']);
|
|
22
|
-
/**
|
|
23
|
-
* A dimensionless symbol is a droppable "up to a constant" factor only when it
|
|
24
|
-
* is a numeric literal (`2`, `-1`, `0.5`), a registered named constant
|
|
25
|
-
* (`ln2`, `4pi`, …), or a spelled-out numeric constant (`6pi`, `ln_2_constant`).
|
|
26
|
-
* Any OTHER dimensionless symbol is a stub for an unknown dimensionless quantity
|
|
27
|
-
* (a parameter or a functional like `ln⟨exp(−βW)⟩`) and is structural —
|
|
28
|
-
* dropping it would conflate distinct interiors.
|
|
29
|
-
*/
|
|
30
17
|
/**
|
|
31
18
|
* Bridge ASTs still spell a governing quantity with the short symbol (`T`, `M`,
|
|
32
19
|
* `m_1`, `m_2`). The registry uses one name. The structural hash treats the
|
|
@@ -42,9 +29,17 @@ export function canonicalQuantityName(name, dim) {
|
|
|
42
29
|
}
|
|
43
30
|
return quantityIdForSpelling(name) ?? name;
|
|
44
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* A dimensionless symbol is a droppable "up to a constant" factor only when it
|
|
34
|
+
* is a numeric literal (`2`, `-1`, `0.5`), a registered named constant
|
|
35
|
+
* (`ln2`, `4pi`, …), or a spelled-out numeric constant (`6pi`, `ln_2_constant`).
|
|
36
|
+
* Any OTHER dimensionless symbol is a stub for an unknown dimensionless quantity
|
|
37
|
+
* (a parameter or a functional like `ln⟨exp(−βW)⟩`) and is structural —
|
|
38
|
+
* dropping it would conflate distinct interiors.
|
|
39
|
+
*/
|
|
45
40
|
function isDroppableConstant(name) {
|
|
46
|
-
return (name
|
|
47
|
-
|
|
41
|
+
return (isRegisteredConstant(name) ||
|
|
42
|
+
isDecimalLiteral(name) ||
|
|
48
43
|
NAMED_DIMENSIONLESS_CONSTANTS.has(name) ||
|
|
49
44
|
piMultipleValue(name) !== undefined);
|
|
50
45
|
}
|
|
@@ -124,6 +119,10 @@ export function normalForm(node) {
|
|
|
124
119
|
// dimensionless exponent is never dropped (symmetric for direct
|
|
125
120
|
// symbols and op sub-expressions alike).
|
|
126
121
|
const base = normalForm(node.args[0]);
|
|
122
|
+
// A dimensionless constant to any power is still a dimensionless constant (π², √(2π)),
|
|
123
|
+
// dropped as the constant is; the exponent is structural only on a dimensionful base.
|
|
124
|
+
if (base === UNIT)
|
|
125
|
+
return UNIT;
|
|
127
126
|
return `^(${base},${rawForm(node.args[1])})`;
|
|
128
127
|
}
|
|
129
128
|
case '+':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normal-form.js","sourceRoot":"","sources":["../../src/canonical/normal-form.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAElF,MAAM,eAAe,GAAG,CAAC,CAAY,EAAW,EAAE,CAChD,CAAC,CAAC,CAAC,KAAK,CAAC;IACT,CAAC,CAAC,CAAC,KAAK,CAAC;IACT,CAAC,CAAC,CAAC,KAAK,CAAC;IACT,CAAC,CAAC,CAAC,KAAK,CAAC;IACT,CAAC,CAAC,KAAK,KAAK,CAAC;IACb,CAAC,CAAC,CAAC,KAAK,CAAC;IACT,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAEZ,oFAAoF;AACpF,MAAM,IAAI,GAAG,GAAG,CAAC;AAEjB;;;;;;;GAOG;AACH,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;AAEjE;;;;;;;GAOG;AACH;;;;;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,GAAG,CAAC;gBAC1C,CAAC;gBACD;oBACE,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,CAAC;QACH,CAAC;QAED,KAAK,gBAAgB,EAAE,CAAC;YACtB,gEAAgE;YAChE,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC;YAC9B,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,CAAC;QAC9B,CAAC;QAED,KAAK,KAAK;YACR,OAAO,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAExC;YACE,2EAA2E;YAC3E,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;IAClD,CAAC;AACH,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,iBAAiB,CAAC,CAAW,EAAE,CAAW;IACxD,OAAO,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC","sourcesContent":["/**\n * Normalized structural form of a scalar `ExprNode`, **up to dimensionless\n * multiplicative factors** — the hash the F4 circularity guard uses to decide\n * whether a bridge's RHS and a canonical equation encode the same relation.\n *\n * Two expressions hash equal when they differ only by:\n * - dimensionless multiplicative CONSTANTS (numeric literals + registered\n * named constants: ln2, 4π, …),\n * - product nesting (`(a·b)·c` vs `a·b·c`),\n * - commutative reordering of `*` / `+` operands.\n *\n * They hash DIFFERENT when an exponent differs (T⁴ ≠ T), the non-dimensionless\n * factor set differs, OR a dimensionless **stub** differs. A dimensionless\n * symbol that is NOT a recognized constant is a STUB for an unknown\n * dimensionless quantity (e.g. `ln⟨exp(−βW)⟩` in BE-29) — it is kept as a\n * distinct structural token, so Jarzynski's `ln⟨e^−βW⟩` and Landauer's `ln2`\n * no longer collapse to the same form (\"up to a *constant*\" must not absorb a\n * differing functional). Sums keep every term; `^` keeps its exponent; `/`\n * keeps the numerator/denominator split.\n *\n * @module canonical/normal-form\n */\nimport type { ExprNode } from '../dimensional/validator.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { equals, isDimensionless } from '../dimensional/algebra.js';\nimport { DIMENSION_RENAMES, quantityIdForSpelling } from '../dimensional/formula-names.js';\nimport { isRegisteredConstant, piMultipleValue } from '../dimensional/symbolic-constants.js';\nimport { isDecimalLiteral } from '../dimensional/ast-leaves.js';\n\n/** Token for a node that carries no structural content (a dimensionless factor). */\nconst UNIT = '1';\n\n/**\n * Spelled-out dimensionless numeric constants some encoders write as a named\n * symbol rather than a literal — genuine constants the eval `CONSTANTS`\n * registry does not list under that spelling (its own keys are the canonical\n * rows of the constant registry; `piMultipleValue` reads `pi`/`2pi`/`6pi`/…).\n * `ln_2_constant` is BE-16's spelling of `ln 2`. These stay droppable;\n * everything else dimensionless-and-named is a PARAMETER stub (`alpha`,\n * `lambda`, `g_dark`, `ln⟨e^−βW⟩`, …) and is kept.\n */\nconst NAMED_DIMENSIONLESS_CONSTANTS = new Set(['ln_2_constant']);\n\n/**\n * Bridge ASTs still spell a governing quantity with the short symbol (`T`, `M`,\n * `m_1`, `m_2`). The registry uses one name. The structural hash treats the\n * short spelling as that name when the dimension is the quantity's dimension,\n * so a time coordinate named `T` stays a different symbol.\n *\n * @internal\n */\nexport function canonicalQuantityName(name: string, dim: Dimension): string {\n for (const row of DIMENSION_RENAMES) {\n if (row.symbol === name && equals(dim, row.dimension)) return row.name;\n }\n return quantityIdForSpelling(name) ?? name;\n}\n\n/**\n * A dimensionless symbol is a droppable \"up to a constant\" factor only when it\n * is a numeric literal (`2`, `-1`, `0.5`), a registered named constant\n * (`ln2`, `4pi`, …), or a spelled-out numeric constant (`6pi`, `ln_2_constant`).\n * Any OTHER dimensionless symbol is a stub for an unknown dimensionless quantity\n * (a parameter or a functional like `ln⟨exp(−βW)⟩`) and is structural —\n * dropping it would conflate distinct interiors.\n */\nfunction isDroppableConstant(name: string): boolean {\n return (\n isRegisteredConstant(name) ||\n isDecimalLiteral(name) ||\n NAMED_DIMENSIONLESS_CONSTANTS.has(name) ||\n piMultipleValue(name) !== undefined\n );\n}\n\n/**\n * Full structural serialization that NEVER drops dimensionless factors — used\n * for `^` exponents, which are structural (T⁴ ≠ T) and must not be treated\n * \"up to dimensionless factors\". Commutative operands are still sorted so the\n * exponent comparison is robust to reordering.\n */\nfunction rawForm(node: ExprNode): string {\n switch (node.kind) {\n case 'symbol':\n return `s:${node.name}`;\n case 'op': {\n const parts = node.args.map(rawForm);\n if (node.op === '*' || node.op === '+') parts.sort();\n return `${node.op}(${parts.join(',')})`;\n }\n case 'transcendental':\n return `${node.fn}[${rawForm(node.arg)}]`;\n case 'abs':\n return `abs[${rawForm(node.arg)}]`;\n default:\n return `${node.kind}:${JSON.stringify(node)}`;\n }\n}\n\n/** Collect the factors of a (possibly nested) `*` product. */\nfunction flattenProduct(node: ExprNode, out: ExprNode[]): void {\n if (node.kind === 'op' && node.op === '*') {\n for (const a of node.args) flattenProduct(a, out);\n } else {\n out.push(node);\n }\n}\n\n/**\n * The normalized structural form of `node`. Equal strings ⇒ same relation up to\n * dimensionless multiplicative factors.\n */\nexport function normalForm(node: ExprNode): string {\n switch (node.kind) {\n case 'symbol':\n // A non-dimensionless symbol is structural. A dimensionless symbol is a\n // droppable factor ONLY when it is a recognized constant; otherwise it is\n // a stub for an unknown dimensionless quantity and is kept (tagged) so two\n // different stubs do not collapse to the same form.\n if (!isDimensionless(node.dim)) return `sym:${canonicalQuantityName(node.name, node.dim)}`;\n return isDroppableConstant(node.name) ? UNIT : `stub:${node.name}`;\n\n case 'op': {\n switch (node.op) {\n case '*': {\n const factors: ExprNode[] = [];\n flattenProduct(node, factors);\n const kept = factors\n .map(normalForm)\n .filter((f) => f !== UNIT) // drop dimensionless factors\n .sort();\n if (kept.length === 0) return UNIT;\n if (kept.length === 1) return kept[0];\n return `*(${kept.join(',')})`;\n }\n case '/': {\n const num = normalForm(node.args[0]);\n const den = normalForm(node.args[1]);\n if (den === UNIT) return num; // ÷ dimensionless ⇒ the numerator\n return `/(${num},${den})`;\n }\n case '^': {\n // The exponent is structural (T⁴ ≠ T) and must NOT be reduced\n // \"up to dimensionless factors\" — serialize it with rawForm so a\n // dimensionless exponent is never dropped (symmetric for direct\n // symbols and op sub-expressions alike).\n const base = normalForm(node.args[0]);\n // A dimensionless constant to any power is still a dimensionless constant (π², √(2π)),\n // dropped as the constant is; the exponent is structural only on a dimensionful base.\n if (base === UNIT) return UNIT;\n return `^(${base},${rawForm(node.args[1])})`;\n }\n case '+':\n case '-': {\n const parts = node.args.map(normalForm);\n if (node.op === '+') parts.sort();\n return `${node.op}(${parts.join(',')})`;\n }\n default:\n return `op:${JSON.stringify(node)}`;\n }\n }\n\n case 'transcendental': {\n // ln(2) is the same dimensionless constant as the symbol `ln2`.\n const arg = normalForm(node.arg);\n if (arg === UNIT) return UNIT;\n return `${node.fn}(${arg})`;\n }\n\n case 'abs':\n return `abs(${normalForm(node.arg)})`;\n\n default:\n // integral / derivative / tensor arms: compare structurally by kind+shape.\n return `${node.kind}:${JSON.stringify(node)}`;\n }\n}\n\n/** Whether two scalar ASTs are the same relation up to dimensionless factors. */\nexport function structurallyEqual(a: ExprNode, b: ExprNode): boolean {\n return normalForm(a) === normalForm(b);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/canonical/registry.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,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AAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,mBAAmB,EAAE,CAAC;QACpC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc;YAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,CAAC,cAAc;YAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC7C,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SAClC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/**\n * The canonical-equation registry — the queryable index of the L-layer.\n * Seeded incrementally by `entries/*` modules (Tasks 2,4,5,9); this file owns\n * the assembled array, the id map, and the accessors.\n *\n * @module canonical/registry\n */\nimport type { CanonicalEquation, CanonicalDomain } from './canonical-equation.js';\nimport { BRIDGE_EQUATIONS } from '../bridges/index.js';\nimport { DIMENSIONAL_CLASSICS } from './entries/dimensional-classics.js';\nimport { RELATIVITY } from './entries/relativity.js';\nimport { MECHANICS } from './entries/mechanics.js';\nimport { ELECTROMAGNETISM } from './entries/electromagnetism.js';\nimport { FLUIDS_WAVES } from './entries/fluids-waves.js';\nimport { THERMO_NUCLEAR_COSMO } from './entries/thermo-nuclear-cosmo.js';\nimport { ATOMIC } from './entries/atomic.js';\nimport { CONDENSED_MATTER } from './entries/condensed-matter.js';\nimport { STATISTICAL_MECHANICS } from './entries/statistical-mechanics.js';\nimport { NONMONOMIAL } from './entries/nonmonomial.js';\n\n/**\n * Every canonical equation in the registry. The L1 entries are grouped by\n * physics domain (relativity / EM / thermo / atomic / …); the former\n * `l1-gravity-thermo` and `l1-quantum-em` batch files were folded into these\n * domain-named modules in the 2026-06-22 god-file split.\n */\nexport const CANONICAL_EQUATIONS: readonly CanonicalEquation[] = [\n ...DIMENSIONAL_CLASSICS,\n ...RELATIVITY,\n ...MECHANICS,\n ...ELECTROMAGNETISM,\n ...FLUIDS_WAVES,\n ...THERMO_NUCLEAR_COSMO,\n ...ATOMIC,\n ...CONDENSED_MATTER,\n ...STATISTICAL_MECHANICS,\n ...NONMONOMIAL,\n];\n\n/** Id → entry. */\nexport const CANONICAL_BY_ID: Readonly<Record<string, CanonicalEquation>> =\n Object.fromEntries(CANONICAL_EQUATIONS.map((e) => [e.id, e]));\n\n/** The entry with id `id`, or `undefined`. */\nexport function canonicalById(id: string): CanonicalEquation | undefined {\n return CANONICAL_BY_ID[id];\n}\n\n/** Every entry in `domain`. */\nexport function canonicalByDomain(\n domain: CanonicalDomain,\n): readonly CanonicalEquation[] {\n return CANONICAL_EQUATIONS.filter((e) => e.domain === domain);\n}\n\n/**\n * Canonical equations whose `dimensional.target.name` is `name`. Usually 0 or 1;\n * a length > 1 means the target quantity is shared (the caller must treat that as\n * ambiguous). Used by the identity-consequence surfacer to recover the source\n * equation behind a discovery candidate's endpoint.\n */\nexport function canonicalByTarget(\n name: string,\n): readonly CanonicalEquation[] {\n return CANONICAL_EQUATIONS.filter((e) => e.dimensional.target.name === name);\n}\n\n/** Catalog bridge ids (string form) that at least one canonical entry names as\n * a `partnerBridges` / `restatesBridge` correspondence. */\nexport function partneredBridgeIds(): Set<string> {\n const ids = new Set<string>();\n for (const e of CANONICAL_EQUATIONS) {\n for (const b of e.partnerBridges) ids.add(b);\n if (e.restatesBridge) ids.add(e.restatesBridge);\n }\n return ids;\n}\n\n/**\n * Catalog bridges with NO canonical correspondence partner yet — the explicit,\n * logged coverage gap (review finding F2). Sorted by numeric id. The count is\n * pinned by a test so shrinking it (adding a partner) is a deliberate act.\n */\nexport function bridgesWithoutCanonicalPartner(): string[] {\n const partnered = partneredBridgeIds();\n return BRIDGE_EQUATIONS.map((b) => String(b.id))\n .filter((id) => !partnered.has(id))\n .sort((a, b) => Number(a) - Number(b));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"residual.js","sourceRoot":"","sources":["../../src/canonical/residual.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAoB;IACpD,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,MAAM,GAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IAC5G,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;AAC9D,CAAC"}
|
|
1
|
+
{"version":3,"file":"residual.js","sourceRoot":"","sources":["../../src/canonical/residual.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAoB;IACpD,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,MAAM,GAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IAC5G,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;AAC9D,CAAC","sourcesContent":["/**\n * Residual form of a canonical equation: `target − scalarAst`.\n *\n * A canonical entry stores the RIGHT-HAND SIDE of one target (`scalarAst`), for example `m·a` for\n * the target force. A claim, as a user or the benchmark writes it, is a RELATION: `F − m·a`. The\n * structural key of a residual and of a right-hand side can never be equal, so a structural search\n * that compares a claim with `scalarAst` never matches. The criterion 3 study measured this: 0 of\n * 11,125 query × record pairs (pre-registration Amendment 8). Putting the canonical entry in residual\n * form makes both sides the same kind of object.\n *\n * Symbol names are not unified here. The structural key renames every dimensioned symbol to its\n * dimension, so `F` and `force` compare equal there. Symbol overlap still sees the two naming\n * conventions (`k_B` against `boltzmann-constant`), and no alias map bridges them.\n *\n * @module canonical/residual\n * @internal\n */\n\nimport type { ExprNode } from '../dimensional/ast-types.js';\nimport type { CanonicalEquation } from './canonical-equation.js';\n\n/**\n * The residual `target − scalarAst` of a canonical entry, or `undefined` when the entry has no\n * `scalarAst`. The target becomes a symbol with its name and dimension; the right-hand side is the\n * entry's own `scalarAst`, not a copy.\n *\n * @internal\n */\nexport function canonicalResidual(e: CanonicalEquation): ExprNode | undefined {\n if (e.scalarAst === undefined) return undefined;\n const target: ExprNode = { kind: 'symbol', name: e.dimensional.target.name, dim: e.dimensional.target.dim };\n return { kind: 'op', op: '-', args: [target, e.scalarAst] };\n}\n"]}
|
|
@@ -9,7 +9,13 @@ import type { CanonicalEquation } from './canonical-equation.js';
|
|
|
9
9
|
import type { PhysicalLaw, TensorConfig } from '../core/types.js';
|
|
10
10
|
import { UniversalTensor } from '../core/tensor.js';
|
|
11
11
|
/** A `TensorConfig` whose axes cover every regime the canonical registry uses,
|
|
12
|
-
* so `seedCanonicalLaws` never trips axis-membership validation.
|
|
12
|
+
* so `seedCanonicalLaws` never trips axis-membership validation. The scale,
|
|
13
|
+
* force and symmetry lists are the tensor's own unions (`PhysicalScale`,
|
|
14
|
+
* `Force`, `Symmetry`), written here because the canonical layer may not
|
|
15
|
+
* import the composition layer's axis registry (`layer:check`);
|
|
16
|
+
* `tests/composition/axes.test.ts` compares them to that registry so the two
|
|
17
|
+
* cannot drift apart. The information measures are the tensor's camelCase
|
|
18
|
+
* vocabulary (`InformationMeasure`). */
|
|
13
19
|
export declare const CANONICAL_TENSOR_CONFIG: TensorConfig;
|
|
14
20
|
/** Map a canonical entry onto the `PhysicalLaw` shape the L-layer consumes.
|
|
15
21
|
* Canonical laws are ground truth → `confidence: 1`. Regime axes map to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed-l-layer.d.ts","sourceRoot":"","sources":["../../src/canonical/seed-l-layer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD;
|
|
1
|
+
{"version":3,"file":"seed-l-layer.d.ts","sourceRoot":"","sources":["../../src/canonical/seed-l-layer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;;;;;yCAOyC;AACzC,eAAO,MAAM,uBAAuB,EAAE,YAMrC,CAAC;AAEF;;mFAEmF;AACnF,wBAAgB,cAAc,CAAC,EAAE,EAAE,iBAAiB,GAAG,WAAW,CAejE;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAM5D"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { CANONICAL_EQUATIONS } from './registry.js';
|
|
2
2
|
/** A `TensorConfig` whose axes cover every regime the canonical registry uses,
|
|
3
|
-
* so `seedCanonicalLaws` never trips axis-membership validation.
|
|
3
|
+
* so `seedCanonicalLaws` never trips axis-membership validation. The scale,
|
|
4
|
+
* force and symmetry lists are the tensor's own unions (`PhysicalScale`,
|
|
5
|
+
* `Force`, `Symmetry`), written here because the canonical layer may not
|
|
6
|
+
* import the composition layer's axis registry (`layer:check`);
|
|
7
|
+
* `tests/composition/axes.test.ts` compares them to that registry so the two
|
|
8
|
+
* cannot drift apart. The information measures are the tensor's camelCase
|
|
9
|
+
* vocabulary (`InformationMeasure`). */
|
|
4
10
|
export const CANONICAL_TENSOR_CONFIG = {
|
|
5
11
|
rank: 6,
|
|
6
12
|
scales: ['quantum', 'mesoscopic', 'classical', 'cosmological'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed-l-layer.js","sourceRoot":"","sources":["../../src/canonical/seed-l-layer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD;
|
|
1
|
+
{"version":3,"file":"seed-l-layer.js","sourceRoot":"","sources":["../../src/canonical/seed-l-layer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;;yCAOyC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAiB;IACnD,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,CAAC;IAC9D,MAAM,EAAE,CAAC,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC;IAC1E,UAAU,EAAE,CAAC,UAAU,EAAE,O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IACd,KAAK,MAAM,EAAE,IAAI,mBAAmB,EAAE,CAAC;QACrC,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;YAAE,KAAK,EAAE,CAAC;IAC5C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * Seed the canonical-equation registry into the tensor's L-layer (Π = L + B + E)\n * via the existing `addLaw` path. `canonicalToLaw` maps a registry entry onto the\n * `PhysicalLaw` shape; `seedCanonicalLaws` adds them all and returns the count.\n *\n * @module canonical/seed-l-layer\n */\nimport type { CanonicalEquation } from './canonical-equation.js';\nimport type { PhysicalLaw, TensorConfig } from '../core/types.js';\nimport { UniversalTensor } from '../core/tensor.js';\nimport { CANONICAL_EQUATIONS } from './registry.js';\n\n/** A `TensorConfig` whose axes cover every regime the canonical registry uses,\n * so `seedCanonicalLaws` never trips axis-membership validation. The scale,\n * force and symmetry lists are the tensor's own unions (`PhysicalScale`,\n * `Force`, `Symmetry`), written here because the canonical layer may not\n * import the composition layer's axis registry (`layer:check`);\n * `tests/composition/axes.test.ts` compares them to that registry so the two\n * cannot drift apart. The information measures are the tensor's camelCase\n * vocabulary (`InformationMeasure`). */\nexport const CANONICAL_TENSOR_CONFIG: TensorConfig = {\n rank: 6,\n scales: ['quantum', 'mesoscopic', 'classical', 'cosmological'],\n forces: ['gravitational', 'electromagnetic', 'weak', 'strong', 'emergent'],\n symmetries: ['poincare', 'gauge', 'conformal', 'susy', 'emergent'],\n informationMeasures: ['vonNeumann', 'shannon', 'kolmogorov', 'quantumDiscord'],\n};\n\n/** Map a canonical entry onto the `PhysicalLaw` shape the L-layer consumes.\n * Canonical laws are ground truth → `confidence: 1`. Regime axes map to the\n * law's single-valued axis arrays (empty when the regime leaves an axis open). */\nexport function canonicalToLaw(ce: CanonicalEquation): PhysicalLaw {\n const r = ce.regime;\n return {\n id: ce.id,\n name: ce.name,\n equation: ce.formula_latex,\n scales: r.scale ? [r.scale] : [],\n forces: r.force ? [r.force] : [],\n symmetries: r.symmetry ? [r.symmetry] : [],\n confidence: 1,\n informationMeasures: r.information ? [r.information] : undefined,\n dimensions: r.dimension !== undefined ? [r.dimension] : undefined,\n topologies: r.topology !== undefined ? [r.topology] : undefined,\n references: [...ce.references],\n };\n}\n\n/** Seed every canonical equation into `t`'s L-layer. Returns the count added. */\nexport function seedCanonicalLaws(t: UniversalTensor): number {\n let added = 0;\n for (const ce of CANONICAL_EQUATIONS) {\n if (t.addLaw(canonicalToLaw(ce))) added++;\n }\n return added;\n}\n"]}
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structural half of a bridge↔canonical comparison, shared with the chain
|
|
3
|
-
* pipeline. Same dimension, `normalForm`, and the F4 `restatesBridge` guard.
|
|
4
|
-
*
|
|
5
|
-
* This module does not import `composition/expr-eval.ts`. Numerical agreement
|
|
6
|
-
* is not a result here and is not a confirmation. `linkage.ts` calls
|
|
7
|
-
* {@link classifyStructure} and then runs its own numerical recovery.
|
|
8
|
-
*
|
|
9
|
-
* A chain whose normal form matches a catalog right-hand side the registry
|
|
10
|
-
* did not pre-declare confirms that catalog id. The call writes nothing.
|
|
11
|
-
* A chain that matches a canonical equation the registry pre-declared with
|
|
12
|
-
* `restatesBridge` is a restatement. Any other chain receives a provisional
|
|
13
|
-
* id, `chain-` followed by the ordered edge ids. That id is not a catalog
|
|
14
|
-
* id. It enters `BRIDGE_EQUATIONS` only after a vendored PhysJS proof, which
|
|
15
|
-
* this function does not record.
|
|
16
|
-
*
|
|
17
|
-
* @module canonical/structural
|
|
18
|
-
*/
|
|
19
1
|
import type { ExprNode } from '../dimensional/validator.js';
|
|
20
2
|
import type { Dimension } from '../dimensional/types.js';
|
|
21
3
|
/** One side of a structural comparison, plus the F4 inputs. @internal */
|
|
@@ -34,10 +16,25 @@ export interface StructuralPair {
|
|
|
34
16
|
/** The bridge id this comparison is against, as `restatesBridge` spells it. */
|
|
35
17
|
readonly bridgeId: string;
|
|
36
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* The algebraic-equivalence step a layer above may inject: on a normal-form
|
|
21
|
+
* miss with equal dimension, whether the two expressions are the same
|
|
22
|
+
* relation up to a dimensionless constant (`composition/algebraic-equivalence.ts`
|
|
23
|
+
* answers with MathTS `simplify`). This module stays below `composition/`, so
|
|
24
|
+
* it does not import the step; a caller that has it passes it.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export interface StructuralOptions {
|
|
29
|
+
readonly equivalent?: (left: ExprNode, right: ExprNode) => boolean;
|
|
30
|
+
}
|
|
37
31
|
/** Dimension, normal form, and the F4 guard. No numerical recovery. @internal */
|
|
38
32
|
export interface StructuralRelation {
|
|
39
33
|
readonly dimMatch: boolean;
|
|
34
|
+
/** The normal forms match, or the injected step found them equal up to a constant. */
|
|
40
35
|
readonly structuralMatch: boolean;
|
|
36
|
+
/** True only when the match came from the injected step, not from the hash. */
|
|
37
|
+
readonly algebraic: boolean;
|
|
41
38
|
/**
|
|
42
39
|
* True only when the normal forms match and `restatesBridge` names
|
|
43
40
|
* `bridgeId`. A structural match the registry did not pre-declare is
|
|
@@ -70,15 +67,39 @@ export interface ChainProvisional {
|
|
|
70
67
|
}
|
|
71
68
|
/** Decision (a) for one chain. @internal */
|
|
72
69
|
export type ChainClassification = ChainConfirmation | ChainRestatement | ChainProvisional;
|
|
70
|
+
/**
|
|
71
|
+
* A bridge RHS reduced to its comparison-ready, canonical-invariant form: its
|
|
72
|
+
* validated dimension (`null` when validation failed) and its normal-form
|
|
73
|
+
* hash. Both depend only on the bridge.
|
|
74
|
+
*
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
export interface BridgeShape {
|
|
78
|
+
readonly rhs: ExprNode;
|
|
79
|
+
readonly dim: Dimension | null;
|
|
80
|
+
readonly normal: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Every bridge RHS, validated and normal-formed ONCE for the process.
|
|
84
|
+
* `BRIDGE_RHS_BY_ID` is static, so the table is computed on first use and
|
|
85
|
+
* kept; a chain classification and a linkage scan both read it instead of
|
|
86
|
+
* re-validating every entry per call (9.0.0 audit §4 Low).
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export declare function bridgeShapes(): ReadonlyMap<number, BridgeShape>;
|
|
73
91
|
/**
|
|
74
92
|
* The structural classifier.
|
|
75
93
|
*
|
|
76
94
|
* A {@link StructuralPair} returns the dimension, normal-form, and F4
|
|
77
95
|
* result `classifyLinkage` uses. An expression plus the chain's ordered
|
|
78
|
-
* edge ids returns the chain classification. Both calls are this function
|
|
96
|
+
* edge ids returns the chain classification. Both calls are this function,
|
|
97
|
+
* and both take the optional {@link StructuralOptions} whose `equivalent`
|
|
98
|
+
* runs on a normal-form miss with equal dimension; without it the hash is
|
|
99
|
+
* the whole decision.
|
|
79
100
|
*
|
|
80
101
|
* @internal
|
|
81
102
|
*/
|
|
82
|
-
export declare function classifyStructure(pair: StructuralPair): StructuralRelation;
|
|
83
|
-
export declare function classifyStructure(expr: ExprNode, edgeIds: readonly string[]): ChainClassification;
|
|
103
|
+
export declare function classifyStructure(pair: StructuralPair, opts?: StructuralOptions): StructuralRelation;
|
|
104
|
+
export declare function classifyStructure(expr: ExprNode, edgeIds: readonly string[], opts?: StructuralOptions): ChainClassification;
|
|
84
105
|
//# sourceMappingURL=structural.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structural.d.ts","sourceRoot":"","sources":["../../src/canonical/structural.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"structural.d.ts","sourceRoot":"","sources":["../../src/canonical/structural.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAOzD,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B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C,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,4CAA4C;AAC5C,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AA8B1F;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAID;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAU/D;AA+ED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;AACtG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,mBAAmB,CAAC"}
|
|
@@ -1,24 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural half of a bridge↔canonical comparison, shared with the chain
|
|
3
|
+
* pipeline. Same dimension, `normalForm`, and the F4 `restatesBridge` guard.
|
|
4
|
+
*
|
|
5
|
+
* This module does not import `composition/expr-eval.ts`. Numerical agreement
|
|
6
|
+
* is not a result here and is not a confirmation. `linkage.ts` calls
|
|
7
|
+
* {@link classifyStructure} and then runs its own numerical recovery.
|
|
8
|
+
*
|
|
9
|
+
* A chain whose normal form matches a catalog right-hand side the registry
|
|
10
|
+
* did not pre-declare confirms that catalog id. The call writes nothing.
|
|
11
|
+
* A chain that matches a canonical equation the registry pre-declared with
|
|
12
|
+
* `restatesBridge` is a restatement. Any other chain receives a provisional
|
|
13
|
+
* id, `chain-` followed by the ordered edge ids. That id is not a catalog
|
|
14
|
+
* id. It enters `BRIDGE_EQUATIONS` only after a Lean proof in `lean/`, which
|
|
15
|
+
* this function does not record.
|
|
16
|
+
*
|
|
17
|
+
* @module canonical/structural
|
|
18
|
+
*/
|
|
19
|
+
import { compareCodepoint } from '../core/compare.js';
|
|
20
|
+
import { exactlyEquals } from '../dimensional/algebra.js';
|
|
1
21
|
import { validate } from '../dimensional/validator.js';
|
|
2
22
|
import { BRIDGE_RHS_BY_ID } from '../bridges/rhs-registry.js';
|
|
3
23
|
import { CANONICAL_EQUATIONS } from './registry.js';
|
|
4
24
|
import { normalForm } from './normal-form.js';
|
|
5
|
-
const dimEqual = (a, b) => a.L === b.L &&
|
|
6
|
-
a.M === b.M &&
|
|
7
|
-
a.T === b.T &&
|
|
8
|
-
a.I === b.I &&
|
|
9
|
-
a.Theta === b.Theta &&
|
|
10
|
-
a.N === b.N &&
|
|
11
|
-
a.J === b.J;
|
|
12
25
|
function isStructuralPair(value) {
|
|
13
26
|
return !('kind' in value) && 'bridgeId' in value;
|
|
14
27
|
}
|
|
15
|
-
function comparePair(pair) {
|
|
28
|
+
function comparePair(pair, opts = {}) {
|
|
16
29
|
const leftNormal = pair.leftNormal ?? normalForm(pair.left);
|
|
17
30
|
const rightNormal = pair.rightNormal ?? normalForm(pair.right);
|
|
18
|
-
const
|
|
31
|
+
const dimMatch = pair.rightDim != null && exactlyEquals(pair.rightDim, pair.leftDim);
|
|
32
|
+
const hashMatch = leftNormal === rightNormal;
|
|
33
|
+
// The hash is the cheap key; the step runs only on a miss, and only when the
|
|
34
|
+
// dimensions agree (a different dimension is a different relation).
|
|
35
|
+
const algebraic = !hashMatch && dimMatch && opts.equivalent !== undefined && opts.equivalent(pair.left, pair.right);
|
|
36
|
+
const structuralMatch = hashMatch || algebraic;
|
|
19
37
|
return {
|
|
20
|
-
dimMatch
|
|
38
|
+
dimMatch,
|
|
21
39
|
structuralMatch,
|
|
40
|
+
algebraic,
|
|
22
41
|
restates: structuralMatch &&
|
|
23
42
|
pair.restatesBridge !== undefined &&
|
|
24
43
|
pair.restatesBridge === pair.bridgeId,
|
|
@@ -27,6 +46,26 @@ function comparePair(pair) {
|
|
|
27
46
|
function bridgeRank(id) {
|
|
28
47
|
return /^\d+$/.test(id) ? Number(id) : Number.POSITIVE_INFINITY;
|
|
29
48
|
}
|
|
49
|
+
let bridgeShapeTable;
|
|
50
|
+
/**
|
|
51
|
+
* Every bridge RHS, validated and normal-formed ONCE for the process.
|
|
52
|
+
* `BRIDGE_RHS_BY_ID` is static, so the table is computed on first use and
|
|
53
|
+
* kept; a chain classification and a linkage scan both read it instead of
|
|
54
|
+
* re-validating every entry per call (9.0.0 audit §4 Low).
|
|
55
|
+
*
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
export function bridgeShapes() {
|
|
59
|
+
if (bridgeShapeTable === undefined) {
|
|
60
|
+
const table = new Map();
|
|
61
|
+
for (const [id, rhs] of BRIDGE_RHS_BY_ID) {
|
|
62
|
+
const v = validate(rhs);
|
|
63
|
+
table.set(id, { rhs, dim: v.ok ? v.inferredDimension : null, normal: normalForm(rhs) });
|
|
64
|
+
}
|
|
65
|
+
bridgeShapeTable = table;
|
|
66
|
+
}
|
|
67
|
+
return bridgeShapeTable;
|
|
68
|
+
}
|
|
30
69
|
/**
|
|
31
70
|
* Provisional id for a chain. The edge ids stay in the order the caller
|
|
32
71
|
* passed, which is the chain order. They are not sorted.
|
|
@@ -34,7 +73,7 @@ function bridgeRank(id) {
|
|
|
34
73
|
function provisionalChainId(edgeIds) {
|
|
35
74
|
return `chain-${edgeIds.join('-')}`;
|
|
36
75
|
}
|
|
37
|
-
function classifyChain(expr, edgeIds) {
|
|
76
|
+
function classifyChain(expr, edgeIds, opts) {
|
|
38
77
|
const ordered = [...edgeIds];
|
|
39
78
|
const validated = validate(expr);
|
|
40
79
|
const leftDim = validated.ok ? validated.inferredDimension : null;
|
|
@@ -54,7 +93,7 @@ function classifyChain(expr, edgeIds) {
|
|
|
54
93
|
rightDim: ce.dimensional.target.dim,
|
|
55
94
|
restatesBridge: ce.restatesBridge,
|
|
56
95
|
bridgeId: ce.restatesBridge,
|
|
57
|
-
});
|
|
96
|
+
}, opts);
|
|
58
97
|
if (relation.restates && relation.dimMatch) {
|
|
59
98
|
restatements.push({ canonicalId: ce.id, restatesBridge: ce.restatesBridge });
|
|
60
99
|
}
|
|
@@ -63,7 +102,7 @@ function classifyChain(expr, edgeIds) {
|
|
|
63
102
|
const byBridge = bridgeRank(a.restatesBridge) - bridgeRank(b.restatesBridge);
|
|
64
103
|
if (byBridge !== 0)
|
|
65
104
|
return byBridge;
|
|
66
|
-
return a.canonicalId
|
|
105
|
+
return compareCodepoint(a.canonicalId, b.canonicalId);
|
|
67
106
|
});
|
|
68
107
|
const restatement = restatements[0];
|
|
69
108
|
if (restatement !== undefined) {
|
|
@@ -75,17 +114,17 @@ function classifyChain(expr, edgeIds) {
|
|
|
75
114
|
};
|
|
76
115
|
}
|
|
77
116
|
const confirmations = [];
|
|
78
|
-
for (const [id,
|
|
79
|
-
const bridge = validate(rhs);
|
|
117
|
+
for (const [id, bridge] of bridgeShapes()) {
|
|
80
118
|
const relation = comparePair({
|
|
81
119
|
left: expr,
|
|
82
120
|
leftDim,
|
|
83
121
|
leftNormal,
|
|
84
|
-
right: rhs,
|
|
85
|
-
rightDim: bridge.
|
|
122
|
+
right: bridge.rhs,
|
|
123
|
+
rightDim: bridge.dim,
|
|
124
|
+
rightNormal: bridge.normal,
|
|
86
125
|
restatesBridge: undefined,
|
|
87
126
|
bridgeId: String(id),
|
|
88
|
-
});
|
|
127
|
+
}, opts);
|
|
89
128
|
if (relation.structuralMatch && relation.dimMatch)
|
|
90
129
|
confirmations.push(id);
|
|
91
130
|
}
|
|
@@ -96,12 +135,14 @@ function classifyChain(expr, edgeIds) {
|
|
|
96
135
|
}
|
|
97
136
|
return { kind: 'provisional', id: provisionalChainId(ordered), edgeIds: ordered };
|
|
98
137
|
}
|
|
99
|
-
export function classifyStructure(exprOrPair,
|
|
100
|
-
if (isStructuralPair(exprOrPair))
|
|
101
|
-
|
|
102
|
-
|
|
138
|
+
export function classifyStructure(exprOrPair, edgeIdsOrOpts, opts = {}) {
|
|
139
|
+
if (isStructuralPair(exprOrPair)) {
|
|
140
|
+
const pairOpts = edgeIdsOrOpts !== undefined && !Array.isArray(edgeIdsOrOpts) ? edgeIdsOrOpts : {};
|
|
141
|
+
return comparePair(exprOrPair, pairOpts);
|
|
142
|
+
}
|
|
143
|
+
if (edgeIdsOrOpts === undefined || !Array.isArray(edgeIdsOrOpts)) {
|
|
103
144
|
throw new TypeError('classifyStructure: a chain needs its ordered edge ids');
|
|
104
145
|
}
|
|
105
|
-
return classifyChain(exprOrPair,
|
|
146
|
+
return classifyChain(exprOrPair, edgeIdsOrOpts, opts);
|
|
106
147
|
}
|
|
107
148
|
//# sourceMappingURL=structural.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structural.js","sourceRoot":"","sources":["../../src/canonical/structural.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA4D9C,MAAM,QAAQ,GAAG,CAAC,CAAY,EAAE,CAAY,EAAW,EAAE,CACvD,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC,KA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CAAC;IACD,OAAO,aAAa,CAAC,UAAU,EAAE,aAAkC,EAAE,IAAI,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["/**\n * Structural half of a bridge↔canonical comparison, shared with the chain\n * pipeline. Same dimension, `normalForm`, and the F4 `restatesBridge` guard.\n *\n * This module does not import `composition/expr-eval.ts`. Numerical agreement\n * is not a result here and is not a confirmation. `linkage.ts` calls\n * {@link classifyStructure} and then runs its own numerical recovery.\n *\n * A chain whose normal form matches a catalog right-hand side the registry\n * did not pre-declare confirms that catalog id. The call writes nothing.\n * A chain that matches a canonical equation the registry pre-declared with\n * `restatesBridge` is a restatement. Any other chain receives a provisional\n * id, `chain-` followed by the ordered edge ids. That id is not a catalog\n * id. It enters `BRIDGE_EQUATIONS` only after a Lean proof in `lean/`, which\n * this function does not record.\n *\n * @module canonical/structural\n */\nimport { compareCodepoint } from '../core/compare.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { exactlyEquals } from '../dimensional/algebra.js';\nimport { validate } from '../dimensional/validator.js';\nimport { BRIDGE_RHS_BY_ID } from '../bridges/rhs-registry.js';\nimport { CANONICAL_EQUATIONS } from './registry.js';\nimport { normalForm } from './normal-form.js';\n\n/** One side of a structural comparison, plus the F4 inputs. @internal */\nexport interface StructuralPair {\n readonly left: ExprNode;\n readonly leftDim: Dimension;\n /** Precomputed `normalForm(left)`. Computed here when omitted. */\n readonly leftNormal?: string;\n readonly right: ExprNode;\n /** Inferred dimension of `right`, or null when validation failed. */\n readonly rightDim: Dimension | null;\n /** Precomputed `normalForm(right)`. Computed here when omitted. */\n readonly rightNormal?: string;\n /** The canonical entry's `restatesBridge`, when it has one. */\n readonly restatesBridge: string | undefined;\n /** The bridge id this comparison is against, as `restatesBridge` spells it. */\n readonly bridgeId: string;\n}\n\n/**\n * The algebraic-equivalence step a layer above may inject: on a normal-form\n * miss with equal dimension, whether the two expressions are the same\n * relation up to a dimensionless constant (`composition/algebraic-equivalence.ts`\n * answers with MathTS `simplify`). This module stays below `composition/`, so\n * it does not import the step; a caller that has it passes it.\n *\n * @internal\n */\nexport interface StructuralOptions {\n readonly equivalent?: (left: ExprNode, right: ExprNode) => boolean;\n}\n\n/** Dimension, normal form, and the F4 guard. No numerical recovery. @internal */\nexport interface StructuralRelation {\n readonly dimMatch: boolean;\n /** The normal forms match, or the injected step found them equal up to a constant. */\n readonly structuralMatch: boolean;\n /** True only when the match came from the injected step, not from the hash. */\n readonly algebraic: boolean;\n /**\n * True only when the normal forms match and `restatesBridge` names\n * `bridgeId`. A structural match the registry did not pre-declare is\n * not a restatement.\n */\n readonly restates: boolean;\n}\n\n/** A chain matched an existing catalog equation. Nothing was written. @internal */\nexport interface ChainConfirmation {\n readonly kind: 'confirmation';\n readonly catalogId: number;\n readonly edgeIds: readonly string[];\n}\n\n/** A chain matches a canonical equation the registry pre-declared. @internal */\nexport interface ChainRestatement {\n readonly kind: 'restatement';\n readonly canonicalId: string;\n readonly restatesBridge: string;\n readonly edgeIds: readonly string[];\n}\n\n/**\n * A chain that is neither a catalog confirmation nor a pre-declared\n * restatement. `id` is `chain-` plus the edge ids in chain order.\n * @internal\n */\nexport interface ChainProvisional {\n readonly kind: 'provisional';\n readonly id: string;\n readonly edgeIds: readonly string[];\n}\n\n/** Decision (a) for one chain. @internal */\nexport type ChainClassification = ChainConfirmation | ChainRestatement | ChainProvisional;\n\nfunction isStructuralPair(value: ExprNode | StructuralPair): value is StructuralPair {\n return !('kind' in value) && 'bridgeId' in value;\n}\n\nfunction comparePair(pair: StructuralPair, opts: StructuralOptions = {}): StructuralRelation {\n const leftNormal = pair.leftNormal ?? normalForm(pair.left);\n const rightNormal = pair.rightNormal ?? normalForm(pair.right);\n const dimMatch = pair.rightDim != null && exactlyEquals(pair.rightDim, pair.leftDim);\n const hashMatch = leftNormal === rightNormal;\n // The hash is the cheap key; the step runs only on a miss, and only when the\n // dimensions agree (a different dimension is a different relation).\n const algebraic = !hashMatch && dimMatch && opts.equivalent !== undefined && opts.equivalent(pair.left, pair.right);\n const structuralMatch = hashMatch || algebraic;\n return {\n dimMatch,\n structuralMatch,\n algebraic,\n restates:\n structuralMatch &&\n pair.restatesBridge !== undefined &&\n pair.restatesBridge === pair.bridgeId,\n };\n}\n\nfunction bridgeRank(id: string): number {\n return /^\\d+$/.test(id) ? Number(id) : Number.POSITIVE_INFINITY;\n}\n\n/**\n * A bridge RHS reduced to its comparison-ready, canonical-invariant form: its\n * validated dimension (`null` when validation failed) and its normal-form\n * hash. Both depend only on the bridge.\n *\n * @internal\n */\nexport interface BridgeShape {\n readonly rhs: ExprNode;\n readonly dim: Dimension | null;\n readonly normal: string;\n}\n\nlet bridgeShapeTable: ReadonlyMap<number, BridgeShape> | undefined;\n\n/**\n * Every bridge RHS, validated and normal-formed ONCE for the process.\n * `BRIDGE_RHS_BY_ID` is static, so the table is computed on first use and\n * kept; a chain classification and a linkage scan both read it instead of\n * re-validating every entry per call (9.0.0 audit §4 Low).\n *\n * @internal\n */\nexport function bridgeShapes(): ReadonlyMap<number, BridgeShape> {\n if (bridgeShapeTable === undefined) {\n const table = new Map<number, BridgeShape>();\n for (const [id, rhs] of BRIDGE_RHS_BY_ID) {\n const v = validate(rhs);\n table.set(id, { rhs, dim: v.ok ? v.inferredDimension : null, normal: normalForm(rhs) });\n }\n bridgeShapeTable = table;\n }\n return bridgeShapeTable;\n}\n\n/**\n * Provisional id for a chain. The edge ids stay in the order the caller\n * passed, which is the chain order. They are not sorted.\n */\nfunction provisionalChainId(edgeIds: readonly string[]): string {\n return `chain-${edgeIds.join('-')}`;\n}\n\nfunction classifyChain(expr: ExprNode, edgeIds: readonly string[], opts: StructuralOptions): ChainClassification {\n const ordered = [...edgeIds];\n const validated = validate(expr);\n const leftDim = validated.ok ? validated.inferredDimension : null;\n if (leftDim == null) {\n return { kind: 'provisional', id: provisionalChainId(ordered), edgeIds: ordered };\n }\n const leftNormal = normalForm(expr);\n\n const restatements: { canonicalId: string; restatesBridge: string }[] = [];\n for (const ce of CANONICAL_EQUATIONS) {\n if (ce.scalarAst === undefined || ce.restatesBridge === undefined) continue;\n const relation = comparePair(\n {\n left: expr,\n leftDim,\n leftNormal,\n right: ce.scalarAst,\n rightDim: ce.dimensional.target.dim,\n restatesBridge: ce.restatesBridge,\n bridgeId: ce.restatesBridge,\n },\n opts,\n );\n if (relation.restates && relation.dimMatch) {\n restatements.push({ canonicalId: ce.id, restatesBridge: ce.restatesBridge });\n }\n }\n restatements.sort((a, b) => {\n const byBridge = bridgeRank(a.restatesBridge) - bridgeRank(b.restatesBridge);\n if (byBridge !== 0) return byBridge;\n return compareCodepoint(a.canonicalId, b.canonicalId);\n });\n const restatement = restatements[0];\n if (restatement !== undefined) {\n return {\n kind: 'restatement',\n canonicalId: restatement.canonicalId,\n restatesBridge: restatement.restatesBridge,\n edgeIds: ordered,\n };\n }\n\n const confirmations: number[] = [];\n for (const [id, bridge] of bridgeShapes()) {\n const relation = comparePair(\n {\n left: expr,\n leftDim,\n leftNormal,\n right: bridge.rhs,\n rightDim: bridge.dim,\n rightNormal: bridge.normal,\n restatesBridge: undefined,\n bridgeId: String(id),\n },\n opts,\n );\n if (relation.structuralMatch && relation.dimMatch) confirmations.push(id);\n }\n confirmations.sort((a, b) => a - b);\n const catalogId = confirmations[0];\n if (catalogId !== undefined) {\n return { kind: 'confirmation', catalogId, edgeIds: ordered };\n }\n\n return { kind: 'provisional', id: provisionalChainId(ordered), edgeIds: ordered };\n}\n\n/**\n * The structural classifier.\n *\n * A {@link StructuralPair} returns the dimension, normal-form, and F4\n * result `classifyLinkage` uses. An expression plus the chain's ordered\n * edge ids returns the chain classification. Both calls are this function,\n * and both take the optional {@link StructuralOptions} whose `equivalent`\n * runs on a normal-form miss with equal dimension; without it the hash is\n * the whole decision.\n *\n * @internal\n */\nexport function classifyStructure(pair: StructuralPair, opts?: StructuralOptions): StructuralRelation;\nexport function classifyStructure(expr: ExprNode, edgeIds: readonly string[], opts?: StructuralOptions): ChainClassification;\nexport function classifyStructure(\n exprOrPair: ExprNode | StructuralPair,\n edgeIdsOrOpts?: readonly string[] | StructuralOptions,\n opts: StructuralOptions = {},\n): StructuralRelation | ChainClassification {\n if (isStructuralPair(exprOrPair)) {\n const pairOpts = edgeIdsOrOpts !== undefined && !Array.isArray(edgeIdsOrOpts) ? (edgeIdsOrOpts as StructuralOptions) : {};\n return comparePair(exprOrPair, pairOpts);\n }\n if (edgeIdsOrOpts === undefined || !Array.isArray(edgeIdsOrOpts)) {\n throw new TypeError('classifyStructure: a chain needs its ordered edge ids');\n }\n return classifyChain(exprOrPair, edgeIdsOrOpts as readonly string[], opts);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AppliedCase } from './types.js';
|
|
2
|
-
/** Standard gravity (CGPM 1901), for the sedimentation speed. @internal */
|
|
3
|
-
export declare const G_STANDARD
|
|
2
|
+
/** Standard gravity (CGPM 1901), for the sedimentation speed: the unit table's `standard_gravity` row, read as newtons per kilogram-force. @internal */
|
|
3
|
+
export declare const G_STANDARD: number;
|
|
4
4
|
/** The thresholds `ab-stokes-einstein` states: Re ≤ 0.1 and τ_p/t ≤ 0.01. @internal */
|
|
5
5
|
export declare const MAX_RE = 0.1;
|
|
6
6
|
export declare const MAX_TAU_P_RATIO = 0.01;
|
|
@@ -29,7 +29,7 @@ export declare function ballisticDeficit(x: number): number;
|
|
|
29
29
|
* C(t) = (k_BT/πγ) ∫₀^∞ e^{−ut} √(τ_f u)/((1 − τ_p u)² + τ_f u) du, τ_p = M/γ.
|
|
30
30
|
* Then ⟨Δx²⟩ = 2∫₀ᵗ (t − s) C(s) ds, and with v = ut,
|
|
31
31
|
* MSD/(2Dt) = (1/π) ∫₀^∞ √(βv) (v − 1 + e^{−v}) / (v² ((1 − αv)² + βv)) dv, α = τ_p/t, β = τ_f/t,
|
|
32
|
-
* integrated here over ln v by adaptive
|
|
32
|
+
* integrated here over ln v by MathTS `quad` (adaptive Gauss–Kronrod), split at v = 1, 1/β and around
|
|
33
33
|
* the near-resonance at v = 1/α (width √(β/α) in ln v; β/α ≤ 9 for any densities).
|
|
34
34
|
*
|
|
35
35
|
* Limits: → 1 − 2√(τ_f/(πt)) + (τ_f − τ_p)/t for t ≫ τ_p, τ_f (expanding Ĉ in √s),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brownian-sphere.d.ts","sourceRoot":"","sources":["../../src/cases/brownian-sphere.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brownian-sphere.d.ts","sourceRoot":"","sources":["../../src/cases/brownian-sphere.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAoD,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAIhG,wJAAwJ;AACxJ,eAAO,MAAM,UAAU,QAA0C,CAAC;AAElE,uFAAuF;AACvF,eAAO,MAAM,MAAM,MAAM,CAAC;AAC1B,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,wFAAwF;AACxF,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,uGAAuG;AACvG,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,qGAAqG;AACrG,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,+GAA+G;AAC/G,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAcxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAkB3D;AAED,eAAO,MAAM,oBAAoB,EAAE,WA2OlC,CAAC"}
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
* @module cases/brownian-sphere
|
|
20
20
|
*/
|
|
21
21
|
import { K_B_SI } from '../core/constants.js';
|
|
22
|
-
import {
|
|
22
|
+
import { convertValue } from '../dimensional/units.js';
|
|
23
|
+
import { adaptiveQuadrature } from './quadrature.js';
|
|
23
24
|
import { check, requirePositive, signedRelativeDifference } from './types.js';
|
|
24
25
|
const ID = 'case-brownian-sphere';
|
|
25
|
-
/** Standard gravity (CGPM 1901), for the sedimentation speed. @internal */
|
|
26
|
-
export const G_STANDARD =
|
|
26
|
+
/** Standard gravity (CGPM 1901), for the sedimentation speed: the unit table's `standard_gravity` row, read as newtons per kilogram-force. @internal */
|
|
27
|
+
export const G_STANDARD = convertValue('1 kgf/kg', 'm/s^2').value;
|
|
27
28
|
/** The thresholds `ab-stokes-einstein` states: Re ≤ 0.1 and τ_p/t ≤ 0.01. @internal */
|
|
28
29
|
export const MAX_RE = 0.1;
|
|
29
30
|
export const MAX_TAU_P_RATIO = 0.01;
|
|
@@ -54,7 +55,7 @@ export function ballisticDeficit(x) {
|
|
|
54
55
|
* C(t) = (k_BT/πγ) ∫₀^∞ e^{−ut} √(τ_f u)/((1 − τ_p u)² + τ_f u) du, τ_p = M/γ.
|
|
55
56
|
* Then ⟨Δx²⟩ = 2∫₀ᵗ (t − s) C(s) ds, and with v = ut,
|
|
56
57
|
* MSD/(2Dt) = (1/π) ∫₀^∞ √(βv) (v − 1 + e^{−v}) / (v² ((1 − αv)² + βv)) dv, α = τ_p/t, β = τ_f/t,
|
|
57
|
-
* integrated here over ln v by adaptive
|
|
58
|
+
* integrated here over ln v by MathTS `quad` (adaptive Gauss–Kronrod), split at v = 1, 1/β and around
|
|
58
59
|
* the near-resonance at v = 1/α (width √(β/α) in ln v; β/α ≤ 9 for any densities).
|
|
59
60
|
*
|
|
60
61
|
* Limits: → 1 − 2√(τ_f/(πt)) + (τ_f − τ_p)/t for t ≫ τ_p, τ_f (expanding Ĉ in √s),
|
|
@@ -77,7 +78,7 @@ export function hydrodynamicMsdRatio(alpha, beta) {
|
|
|
77
78
|
let sum = 0;
|
|
78
79
|
for (let k = 1; k < edges.length; k++)
|
|
79
80
|
if (edges[k] > edges[k - 1])
|
|
80
|
-
sum +=
|
|
81
|
+
sum += adaptiveQuadrature(f, edges[k - 1], edges[k], 1e-12);
|
|
81
82
|
return sum / Math.PI;
|
|
82
83
|
}
|
|
83
84
|
/**
|
|
@@ -201,10 +202,10 @@ export const BROWNIAN_SPHERE_CASE = {
|
|
|
201
202
|
unit: '',
|
|
202
203
|
meaning: "the memory force's own share: MSD_H against the Ornstein–Uhlenbeck MSD with the same τ_p (added mass, no memory)",
|
|
203
204
|
},
|
|
204
|
-
{ key: 'D_parallel_m2_per_s', symbol: 'D_∥', unit: 'm^2/s', meaning: 'D beside the wall, parallel to it: D·(Faxén series in a/h);
|
|
205
|
-
{ key: 'D_perp_m2_per_s', symbol: 'D_⊥', unit: 'm^2/s', meaning: 'D normal to the wall: D/λ, λ from Brenner\'s exact series;
|
|
206
|
-
{ key: 'MSD_wall_m2', symbol: '⟨|Δr|²⟩_w', unit: 'm^2', meaning: '2t(d_∥ D_∥ + d_⊥ D_⊥): the tracked horizontal axes parallel to the wall, a third one normal to it;
|
|
207
|
-
{ key: 'wall_deviation', symbol: 'MSD/MSD_w − 1', unit: '', meaning: signedRelativeDifference('unbounded-fluid MSD', 'wall-corrected one', '
|
|
205
|
+
{ key: 'D_parallel_m2_per_s', symbol: 'D_∥', unit: 'm^2/s', meaning: 'D beside the wall, parallel to it: D·(Faxén series in a/h); not defined without h_m' },
|
|
206
|
+
{ key: 'D_perp_m2_per_s', symbol: 'D_⊥', unit: 'm^2/s', meaning: 'D normal to the wall: D/λ, λ from Brenner\'s exact series; not defined without h_m' },
|
|
207
|
+
{ key: 'MSD_wall_m2', symbol: '⟨|Δr|²⟩_w', unit: 'm^2', meaning: '2t(d_∥ D_∥ + d_⊥ D_⊥): the tracked horizontal axes parallel to the wall, a third one normal to it; not defined without h_m' },
|
|
208
|
+
{ key: 'wall_deviation', symbol: 'MSD/MSD_w − 1', unit: '', meaning: signedRelativeDifference('unbounded-fluid MSD', 'wall-corrected one', 'not defined without h_m') },
|
|
208
209
|
],
|
|
209
210
|
comparison: {
|
|
210
211
|
reference: 'the parent Langevin model (bare mass, white noise; it has neither added mass nor hydrodynamic memory)',
|