universal-physics-tensor 10.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 +4 -3
- package/bin/upt.mjs +13 -1
- package/data/atlas/atlas.json +25 -25
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +6 -6
- package/data/atlas/oscillators.json +7 -7
- package/data/atlas/waves.json +14 -14
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +371 -228
- package/data/bridge-catalog.schema.json +45 -7
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +21 -15
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/loader.js +2 -2
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +2 -2
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +15 -7
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +7 -8
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -12
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -39
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/models.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +106 -3
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -11
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -7
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -34
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +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 +34 -31
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +55 -53
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +1 -1
- package/dist/atlas/physjs-reviewed.js +15 -15
- package/dist/atlas/physjs-reviewed.js.map +1 -1
- package/dist/atlas/poster/statements.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/regime.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +2 -6
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -48
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/models.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +30 -0
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +53 -0
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-specs.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +13 -8
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +26 -2
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +31 -1
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +20 -2
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +27 -12
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +11 -0
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +14 -5
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +35 -3
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +117 -23
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/notices.d.ts.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +4 -4
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +15 -16
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +3 -3
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/entries/atomic.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +4 -5
- package/dist/canonical/entries/condensed-matter.js.map +1 -1
- package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
- package/dist/canonical/entries/dimensional-classics.js +3 -4
- package/dist/canonical/entries/dimensional-classics.js.map +1 -1
- package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
- package/dist/canonical/entries/electromagnetism.js +4 -10
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +9 -17
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +25 -44
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +5 -11
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/structural.d.ts +21 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +40 -19
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/brownian-sphere.d.ts +3 -3
- package/dist/cases/brownian-sphere.d.ts.map +1 -1
- package/dist/cases/brownian-sphere.js +6 -5
- 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 +6 -9
- package/dist/cases/damped-resonator.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 +21 -23
- 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 +4 -4
- 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/cli/args.d.ts +23 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts.map +1 -1
- package/dist/cli/bindings.js +5 -4
- package/dist/cli/bindings.js.map +1 -1
- package/dist/cli/command.d.ts +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 +0 -9
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +8 -18
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +8 -9
- package/dist/cli/commands/_discovery-opts.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts.map +1 -1
- package/dist/cli/commands/atlas.js +8 -5
- package/dist/cli/commands/atlas.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +8 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +8 -14
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +22 -22
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/discover.d.ts.map +1 -1
- package/dist/cli/commands/discover.js +6 -2
- package/dist/cli/commands/discover.js.map +1 -1
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +1 -0
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +65 -37
- 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 +2 -1
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +1 -0
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +75 -5
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/metric.d.ts.map +1 -1
- package/dist/cli/commands/metric.js +12 -9
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +25 -3
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +59 -16
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +1 -0
- package/dist/cli/commands/regime.js.map +1 -1
- package/dist/cli/commands/retrieve.d.ts.map +1 -1
- package/dist/cli/commands/retrieve.js +1 -0
- package/dist/cli/commands/retrieve.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.d.ts.map +1 -1
- package/dist/cli/commands/symbolic.js +19 -28
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +4 -2
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/expr-print.d.ts +0 -2
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +7 -31
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/main.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +18 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +20 -0
- 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/record-reach.js +2 -2
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +6 -5
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +9 -8
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +7 -6
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +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/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 +34 -5
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +28 -4
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/axes.d.ts +0 -6
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +6 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +17 -0
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +102 -55
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +122 -24
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +1 -1
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +9 -36
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +2 -5
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +8 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +9 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +13 -5
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/discovery.d.ts +56 -0
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +114 -60
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +21 -2
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +23 -1
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +3 -12
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +7 -20
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts.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 +15 -20
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +23 -4
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +57 -17
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/graph-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +8 -4
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +3 -2
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +4 -3
- package/dist/composition/mathts-quiet.d.ts.map +1 -1
- package/dist/composition/mathts-quiet.js +4 -3
- package/dist/composition/mathts-quiet.js.map +1 -1
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +2 -1
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/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/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +2 -0
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +6 -0
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +46 -22
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +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 +14 -0
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +6 -0
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +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/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +10 -4
- 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 +7 -4
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +177 -49
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +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/structure.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +31 -9
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +236 -181
- 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 +3 -0
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +41 -10
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +100 -55
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantity-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +23 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +2 -1
- package/dist/composition/retrodiction.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/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 +30 -30
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +47 -30
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +2 -0
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +14 -13
- package/dist/core/json-schema.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +0 -8
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +24 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/diff/bridge-gradient.d.ts +19 -6
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +19 -11
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +3 -0
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +7 -0
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +11 -0
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/constant-rows.js +9 -9
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/dimension-inference.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/errors.d.ts +1 -1
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +1 -15
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +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/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +2 -2
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +44 -19
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -1
- package/dist/dimensional/metric.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 +13 -1
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/types.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-data.js +2 -2
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +34 -11
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +3 -2
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +0 -3
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +10 -24
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +8 -10
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +12 -0
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +72 -56
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/tensor-engine.d.ts +21 -0
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/relations/regime.d.ts +10 -0
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +18 -1
- package/dist/relations/regime.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-result.js","sourceRoot":"","sources":["../../src/composition/chain-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,mBAAmB,EAA2B,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"chain-result.js","sourceRoot":"","sources":["../../src/composition/chain-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAA2B,MAAM,sBAAsB,CAAC;AAuBrG;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,MAAmB;IAC/C,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,KAAK,cAAc;QAAE,OAAO,cAAc,CAAC;IACzE,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,KAAK,aAAa;QAAE,OAAO,aAAa,CAAC;IACvE,OAAO,MAAM,CAAC,OAAO,KAAK,kCAAkC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,CAAC;AACrG,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA+B;IAC/D,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,OAAO,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QACtF,IAAI,OAAO,KAAK,CAAC;YAAE,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,OAAO,mBAAmB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * One internal chain record.\n *\n * The classifier kind, the order key, the filter theorem, a regime\n * mismatch, and the edge ids live on this value. {@link chainOrderKey}\n * and the pipeline's renderer are functions of it. A confirmation and a\n * restatement do not become a rejection.\n *\n * @module composition/chain-result\n */\n\nimport type { ChainClassification } from '../canonical/structural.js';\nimport type { CompositionResult } from '../relations/composition-table.js';\nimport type { BuckinghamFilterRecord } from './buckingham-filter.js';\nimport { chainClassIndex, compareChainEdgeIds, type ChainCandidateKind } from './chain-candidate.js';\nimport type { ChainRegimeMismatch } from './chain-regime.js';\n\n/**\n * The pipeline's one chain value.\n *\n * `classification` is the structural result. `theorem` is the Buckingham\n * filter's named shape, or null when the filter named none. `mismatch`\n * is set only for a provisional chain the regime gate refused.\n * `categoryComposition` is the category claim for the two steps. It is\n * unset when the edges have no stored category object ids. A recorded\n * `no-composite-claim` does not change the order key.\n *\n * @internal\n */\nexport interface ChainRecord {\n readonly edgeIds: readonly string[];\n readonly classification: ChainClassification;\n readonly theorem: BuckinghamFilterRecord['theorem'];\n readonly mismatch: ChainRegimeMismatch | undefined;\n readonly categoryComposition: CompositionResult | undefined;\n}\n\n/**\n * The four-class order key of `record`.\n *\n * A confirmation stays a confirmation. A restatement stays a restatement.\n * A provisional chain whose filter theorem is `monomial_form` is a unique\n * monomial. Every other provisional chain is an unfixed shape. A mismatch\n * does not change the key.\n *\n * @internal\n */\nexport function chainOrderKey(record: ChainRecord): ChainCandidateKind {\n if (record.classification.kind === 'confirmation') return 'confirmation';\n if (record.classification.kind === 'restatement') return 'restatement';\n return record.theorem === 'PhysJS.Dimensional.monomial_form' ? 'unique-monomial' : 'unfixed-shape';\n}\n\n/**\n * Total order of chain records by {@link chainOrderKey}, then by edge ids.\n *\n * Returns a new array. The input array is left as it was. A rejection is\n * not a class in this order.\n *\n * @internal\n */\nexport function orderChainRecords(records: readonly ChainRecord[]): ChainRecord[] {\n return [...records].sort((a, b) => {\n const byClass = chainClassIndex(chainOrderKey(a)) - chainClassIndex(chainOrderKey(b));\n if (byClass !== 0) return byClass < 0 ? -1 : 1;\n return compareChainEdgeIds(a.edgeIds, b.edgeIds);\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-symbolic.d.ts","sourceRoot":"","sources":["../../src/composition/compose-symbolic.ts"],"names":[],"mappings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jE,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAC9D;AAqCD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,QAAQ,GACb,UAAU,CA4BZ;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,EAClB,IAAI,GAAE,sBAA2B,GAChC,UAAU,CAmDZ"}
|
|
@@ -20,7 +20,8 @@ import { validate } from '../dimensional/validator.js';
|
|
|
20
20
|
import { QUANTITY_IDENTIFICATIONS } from './compose.js';
|
|
21
21
|
import { substitute } from './expr-subst.js';
|
|
22
22
|
import { evalExpr, SymbolicEvalError } from './expr-eval.js';
|
|
23
|
-
import {
|
|
23
|
+
import { isRegisteredConstant } from '../dimensional/symbolic-constants.js';
|
|
24
|
+
import { isDecimalLiteral } from '../dimensional/ast-leaves.js';
|
|
24
25
|
import { scalarSymbolsFromMathTs } from './mathts-scalar-symbols.js';
|
|
25
26
|
/** Symbolic composition is undefined (no junction / missing `symbolic` /
|
|
26
27
|
* zero-occurrence substitution / dimensional mismatch). @public */
|
|
@@ -57,7 +58,7 @@ function findJunctionName(first, second, identifications) {
|
|
|
57
58
|
function freeLeaves(expr) {
|
|
58
59
|
return scalarSymbolsFromMathTs(expr)
|
|
59
60
|
.map((leaf) => leaf.name)
|
|
60
|
-
.filter((n) => !(n
|
|
61
|
+
.filter((n) => !isRegisteredConstant(n) && !isDecimalLiteral(n))
|
|
61
62
|
.sort();
|
|
62
63
|
}
|
|
63
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-symbolic.js","sourceRoot":"","sources":["../../src/composition/compose-symbolic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAE,MA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C;IACJ,CAAC;IAED,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC;QAC1C,MAAM,IAAI,wBAAwB,CAChC,6BAA6B,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,EAAE,UAAU;YAC7D,2BAA2B,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,iBAAiB,GAAG,CAC3E,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,wBAAwB,CAChC,6BAA6B,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,EAAE,iBAAiB;YACpE,GAAG,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM;YAC9D,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAClC,CAAC;IACJ,CAAC;IAED,OAAO,cAAc,CACnB,MAAM,CAAC,MAAM,CAAC,IAAI,EAClB,MAAM,CAAC,MAAM,CAAC,MAAM,EACpB,MAAM,CAAC,MAAM,CAAC,GAAG,EACjB,IAAI,CACL,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Symbolic bridge composition (v0.12 — the Observable contract).\n *\n * Resolves the Part-IX §4 \"Observable contract\" deferral with a fourth\n * option the spec did not enumerate: an OPTIONAL `symbolic` ExprNode on a\n * bridge edge (leaves = source-quantity names + the `CONSTANTS` registry),\n * composed by AST SUBSTITUTION. `composeSymbolic(first, second)` substitutes\n * `first`'s symbolic form into the junction leaf of `second`'s, producing a\n * new ExprNode that is dimensionally validated and numerically evaluable —\n * not the black-box numeric closure `composeEdges` chains.\n *\n * Non-breaking (the field is optional), no per-pair adapters, and it retains\n * dimensional type-safety. Edges without a `symbolic` form fall back to\n * numeric `composeEdges` (unchanged).\n *\n * @module composition/compose-symbolic\n */\n\nimport { equals, format } from '../dimensional/algebra.js';\nimport { validate } from '../dimensional/validator.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport type { BridgeEdge } from './edge.js';\nimport type { QuantityIdentification } from './compose.js';\nimport { QUANTITY_IDENTIFICATIONS } from './compose.js';\nimport { substitute } from './expr-subst.js';\nimport { evalExpr, SymbolicEvalError } from './expr-eval.js';\nimport { CONSTANTS } from '../dimensional/symbolic-constants.js';\nimport { scalarSymbolsFromMathTs } from './mathts-scalar-symbols.js';\n\n/**\n * A composed quantity carrying its SYMBOLIC form and an executable\n * evaluator — the shared return contract Part-IX §4 said was missing.\n *\n * @public\n */\nexport interface Observable {\n /** Target quantity name (from `second.target`). */\n readonly name: string;\n /** Display symbol. */\n readonly symbol: string;\n /** Dimensionally-validated SI dimension. */\n readonly dim: Dimension;\n /** The composed (substituted) AST. */\n readonly expr: ExprNode;\n /** Free leaf symbols = the required inputs (constants/literals excluded). */\n readonly leaves: readonly string[];\n /**\n * Numerically evaluate the composed form. STRICT input (Eve EVE-1): every\n * `leaves` key must be supplied and no extra key is accepted. PURE symbolic\n * value — NOT domain-checked (unlike `composeEdges`, which throws\n * `DomainViolationError`); use `composeEdges` for domain-checked values.\n */\n evaluate(values: Readonly<Record<string, number>>): number;\n}\n\n/** Symbolic composition is undefined (no junction / missing `symbolic` /\n * zero-occurrence substitution / dimensional mismatch). @public */\nexport class SymbolicCompositionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'SymbolicCompositionError';\n }\n}\n\n/** Options for {@link composeSymbolic}. @public */\nexport interface ComposeSymbolicOptions {\n /** Extra identifications consulted after the registered ones. */\n readonly identifications?: readonly QuantityIdentification[];\n}\n\n/** Find the junction source of `second` matching `first.target` (by name or\n * identification). Returns the source whose NAME is the substitution leaf —\n * `junction.name` is correct in BOTH the name-match and identification cases\n * (Eve EVE-4), avoiding the always-`ident.to` trap. */\nfunction findJunctionName(\n first: BridgeEdge,\n second: BridgeEdge,\n identifications: readonly QuantityIdentification[],\n): string {\n for (const src of second.sources) {\n if (src.name === first.target.name) return src.name;\n }\n for (const ident of identifications) {\n if (ident.from !== first.target.name) continue;\n for (const src of second.sources) {\n if (src.name === ident.to) return src.name;\n }\n }\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: target ` +\n `'${first.target.name}' matches none of [${second.sources\n .map((s) => `'${s.name}'`)\n .join(', ')}] by name or registered identification.`,\n );\n}\n\n/** Free leaves = symbols that are neither registered constants nor numeric\n * literals (those are not inputs). The names are the MathTS symbol filter. */\nfunction freeLeaves(expr: ExprNode): string[] {\n return scalarSymbolsFromMathTs(expr)\n .map((leaf) => leaf.name)\n .filter((n) => !(n in CONSTANTS) && !Number.isFinite(Number(n)))\n .sort();\n}\n\n/**\n * Build an {@link Observable} from a composed/simplified expression: computes\n * the free `leaves` and a STRICT `evaluate` closure over THIS `expr` + leaves.\n * Shared by `composeSymbolic` and `simplifyObservable` so a simplified\n * Observable gets a fresh closure (never the stale unsimplified one).\n *\n * @internal\n */\nexport function makeObservable(\n name: string,\n symbol: string,\n dim: Dimension,\n expr: ExprNode,\n): Observable {\n const leaves = freeLeaves(expr);\n return {\n name,\n symbol,\n dim,\n expr,\n leaves,\n evaluate(values) {\n for (const leaf of leaves) {\n if (!Object.prototype.hasOwnProperty.call(values, leaf)) {\n throw new SymbolicEvalError(\n `Observable(${name}).evaluate: missing required input '${leaf}' ` +\n `(leaves: ${leaves.join(', ')}).`,\n );\n }\n }\n for (const key of Object.keys(values)) {\n if (!leaves.includes(key)) {\n throw new SymbolicEvalError(\n `Observable(${name}).evaluate: unexpected input '${key}' (this ` +\n `Observable's inputs are exactly: ${leaves.join(', ') || '(none)'}).`,\n );\n }\n }\n return evalExpr(expr, values);\n },\n };\n}\n\n/**\n * Compose two bridges SYMBOLICALLY: substitute `first`'s `symbolic` form into\n * the junction leaf of `second`'s, validate the composed AST's dimension, and\n * return an {@link Observable}. Both operands must carry a `symbolic` form\n * (else throws — fall back to `composeEdges` for numeric-only composition).\n *\n * @public\n */\nexport function composeSymbolic(\n first: BridgeEdge,\n second: BridgeEdge,\n opts: ComposeSymbolicOptions = {},\n): Observable {\n const identifications = [\n ...QUANTITY_IDENTIFICATIONS,\n ...(opts.identifications ?? []),\n ];\n\n if (!first.symbolic || !second.symbolic) {\n const missing = !first.symbolic ? first.id : second.id;\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: edge ` +\n `'${missing}' has no symbolic form (numeric-only edge — use ` +\n `composeEdges).`,\n );\n }\n\n const junctionName = findJunctionName(first, second, identifications);\n const { expr, count } = substitute(\n second.symbolic,\n junctionName,\n first.symbolic,\n );\n\n if (count === 0) {\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: junction ` +\n `'${junctionName}' does not appear as a leaf of ${second.id}'s ` +\n `symbolic form — substitution would silently ignore ${first.id}.`,\n );\n }\n\n const v = validate(expr);\n if (!v.ok || v.inferredDimension === null) {\n throw new SymbolicCompositionError(\n `Composed symbolic form of ${first.id} -> ${second.id} failed ` +\n `dimensional validation: ${v.violations[0]?.note ?? 'not homogeneous'}.`,\n );\n }\n if (!equals(v.inferredDimension, second.target.dim)) {\n throw new SymbolicCompositionError(\n `Composed symbolic form of ${first.id} -> ${second.id} has dimension ` +\n `${format(v.inferredDimension)} but ${second.target.name} is ` +\n `${format(second.target.dim)}.`,\n );\n }\n\n return makeObservable(\n second.target.name,\n second.target.symbol,\n second.target.dim,\n expr,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compose-symbolic.js","sourceRoot":"","sources":["../../src/composition/compose-symbolic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,2BAA2B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AC;IACJ,CAAC;IAED,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC;QAC1C,MAAM,IAAI,wBAAwB,CAChC,6BAA6B,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,EAAE,UAAU;YAC7D,2BAA2B,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,iBAAiB,GAAG,CAC3E,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,wBAAwB,CAChC,6BAA6B,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,EAAE,iBAAiB;YACpE,GAAG,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM;YAC9D,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAClC,CAAC;IACJ,CAAC;IAED,OAAO,cAAc,CACnB,MAAM,CAAC,MAAM,CAAC,IAAI,EAClB,MAAM,CAAC,MAAM,CAAC,MAAM,EACpB,MAAM,CAAC,MAAM,CAAC,GAAG,EACjB,IAAI,CACL,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Symbolic bridge composition (v0.12 — the Observable contract).\n *\n * Resolves the Part-IX §4 \"Observable contract\" deferral with a fourth\n * option the spec did not enumerate: an OPTIONAL `symbolic` ExprNode on a\n * bridge edge (leaves = source-quantity names + the `CONSTANTS` registry),\n * composed by AST SUBSTITUTION. `composeSymbolic(first, second)` substitutes\n * `first`'s symbolic form into the junction leaf of `second`'s, producing a\n * new ExprNode that is dimensionally validated and numerically evaluable —\n * not the black-box numeric closure `composeEdges` chains.\n *\n * Non-breaking (the field is optional), no per-pair adapters, and it retains\n * dimensional type-safety. Edges without a `symbolic` form fall back to\n * numeric `composeEdges` (unchanged).\n *\n * @module composition/compose-symbolic\n */\n\nimport { equals, format } from '../dimensional/algebra.js';\nimport { validate } from '../dimensional/validator.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport type { BridgeEdge } from './edge.js';\nimport type { QuantityIdentification } from './compose.js';\nimport { QUANTITY_IDENTIFICATIONS } from './compose.js';\nimport { substitute } from './expr-subst.js';\nimport { evalExpr, SymbolicEvalError } from './expr-eval.js';\nimport { isRegisteredConstant } from '../dimensional/symbolic-constants.js';\nimport { isDecimalLiteral } from '../dimensional/ast-leaves.js';\nimport { scalarSymbolsFromMathTs } from './mathts-scalar-symbols.js';\n\n/**\n * A composed quantity carrying its SYMBOLIC form and an executable\n * evaluator — the shared return contract Part-IX §4 said was missing.\n *\n * @public\n */\nexport interface Observable {\n /** Target quantity name (from `second.target`). */\n readonly name: string;\n /** Display symbol. */\n readonly symbol: string;\n /** Dimensionally-validated SI dimension. */\n readonly dim: Dimension;\n /** The composed (substituted) AST. */\n readonly expr: ExprNode;\n /** Free leaf symbols = the required inputs (constants/literals excluded). */\n readonly leaves: readonly string[];\n /**\n * Numerically evaluate the composed form. STRICT input (Eve EVE-1): every\n * `leaves` key must be supplied and no extra key is accepted. PURE symbolic\n * value — NOT domain-checked (unlike `composeEdges`, which throws\n * `DomainViolationError`); use `composeEdges` for domain-checked values.\n */\n evaluate(values: Readonly<Record<string, number>>): number;\n}\n\n/** Symbolic composition is undefined (no junction / missing `symbolic` /\n * zero-occurrence substitution / dimensional mismatch). @public */\nexport class SymbolicCompositionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'SymbolicCompositionError';\n }\n}\n\n/** Options for {@link composeSymbolic}. @public */\nexport interface ComposeSymbolicOptions {\n /** Extra identifications consulted after the registered ones. */\n readonly identifications?: readonly QuantityIdentification[];\n}\n\n/** Find the junction source of `second` matching `first.target` (by name or\n * identification). Returns the source whose NAME is the substitution leaf —\n * `junction.name` is correct in BOTH the name-match and identification cases\n * (Eve EVE-4), avoiding the always-`ident.to` trap. */\nfunction findJunctionName(\n first: BridgeEdge,\n second: BridgeEdge,\n identifications: readonly QuantityIdentification[],\n): string {\n for (const src of second.sources) {\n if (src.name === first.target.name) return src.name;\n }\n for (const ident of identifications) {\n if (ident.from !== first.target.name) continue;\n for (const src of second.sources) {\n if (src.name === ident.to) return src.name;\n }\n }\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: target ` +\n `'${first.target.name}' matches none of [${second.sources\n .map((s) => `'${s.name}'`)\n .join(', ')}] by name or registered identification.`,\n );\n}\n\n/** Free leaves = symbols that are neither registered constants nor numeric\n * literals (those are not inputs). The names are the MathTS symbol filter. */\nfunction freeLeaves(expr: ExprNode): string[] {\n return scalarSymbolsFromMathTs(expr)\n .map((leaf) => leaf.name)\n .filter((n) => !isRegisteredConstant(n) && !isDecimalLiteral(n))\n .sort();\n}\n\n/**\n * Build an {@link Observable} from a composed/simplified expression: computes\n * the free `leaves` and a STRICT `evaluate` closure over THIS `expr` + leaves.\n * Shared by `composeSymbolic` and `simplifyObservable` so a simplified\n * Observable gets a fresh closure (never the stale unsimplified one).\n *\n * @internal\n */\nexport function makeObservable(\n name: string,\n symbol: string,\n dim: Dimension,\n expr: ExprNode,\n): Observable {\n const leaves = freeLeaves(expr);\n return {\n name,\n symbol,\n dim,\n expr,\n leaves,\n evaluate(values) {\n for (const leaf of leaves) {\n if (!Object.prototype.hasOwnProperty.call(values, leaf)) {\n throw new SymbolicEvalError(\n `Observable(${name}).evaluate: missing required input '${leaf}' ` +\n `(leaves: ${leaves.join(', ')}).`,\n );\n }\n }\n for (const key of Object.keys(values)) {\n if (!leaves.includes(key)) {\n throw new SymbolicEvalError(\n `Observable(${name}).evaluate: unexpected input '${key}' (this ` +\n `Observable's inputs are exactly: ${leaves.join(', ') || '(none)'}).`,\n );\n }\n }\n return evalExpr(expr, values);\n },\n };\n}\n\n/**\n * Compose two bridges SYMBOLICALLY: substitute `first`'s `symbolic` form into\n * the junction leaf of `second`'s, validate the composed AST's dimension, and\n * return an {@link Observable}. Both operands must carry a `symbolic` form\n * (else throws — fall back to `composeEdges` for numeric-only composition).\n *\n * @public\n */\nexport function composeSymbolic(\n first: BridgeEdge,\n second: BridgeEdge,\n opts: ComposeSymbolicOptions = {},\n): Observable {\n const identifications = [\n ...QUANTITY_IDENTIFICATIONS,\n ...(opts.identifications ?? []),\n ];\n\n if (!first.symbolic || !second.symbolic) {\n const missing = !first.symbolic ? first.id : second.id;\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: edge ` +\n `'${missing}' has no symbolic form (numeric-only edge — use ` +\n `composeEdges).`,\n );\n }\n\n const junctionName = findJunctionName(first, second, identifications);\n const { expr, count } = substitute(\n second.symbolic,\n junctionName,\n first.symbolic,\n );\n\n if (count === 0) {\n throw new SymbolicCompositionError(\n `Cannot symbolically compose ${first.id} -> ${second.id}: junction ` +\n `'${junctionName}' does not appear as a leaf of ${second.id}'s ` +\n `symbolic form — substitution would silently ignore ${first.id}.`,\n );\n }\n\n const v = validate(expr);\n if (!v.ok || v.inferredDimension === null) {\n throw new SymbolicCompositionError(\n `Composed symbolic form of ${first.id} -> ${second.id} failed ` +\n `dimensional validation: ${v.violations[0]?.note ?? 'not homogeneous'}.`,\n );\n }\n if (!equals(v.inferredDimension, second.target.dim)) {\n throw new SymbolicCompositionError(\n `Composed symbolic form of ${first.id} -> ${second.id} has dimension ` +\n `${format(v.inferredDimension)} but ${second.target.name} is ` +\n `${format(second.target.dim)}.`,\n );\n }\n\n return makeObservable(\n second.target.name,\n second.target.symbol,\n second.target.dim,\n expr,\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/composition/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;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AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAC9C,MAAM,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC,CAU5C,CAAC;AAQF;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAAE,cAAc,EACjB,CAAC,EAAE,cAAc,GAChB,cAAc,CAEhB;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAChD;AAiCD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAElF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,EAClB,IAAI,GAAE,cAAmB,GACxB,UAAU,CA6NZ"}
|
|
@@ -310,6 +310,10 @@ export function composeEdges(first, second, opts = {}) {
|
|
|
310
310
|
si[junction.name] = intermediate * junctionScale;
|
|
311
311
|
return si;
|
|
312
312
|
};
|
|
313
|
+
const id = `${first.id}>>${second.id}`;
|
|
314
|
+
// A name `second` reads under a renamed key reads it under that key here.
|
|
315
|
+
const secondKeyOf = (keyOf) => (name) => keyOf(Object.entries(renameMap).find(([, original]) => original === name)?.[0] ?? name);
|
|
316
|
+
const pipedContext = `on ${second.id}, with ${junction.name} piped from ${first.id}`;
|
|
313
317
|
const composedDomain = {
|
|
314
318
|
description: `(${first.domain.description}) AND, on the piped ` +
|
|
315
319
|
`${junction.name}, (${second.domain.description})`,
|
|
@@ -324,8 +328,14 @@ export function composeEdges(first, second, opts = {}) {
|
|
|
324
328
|
const intermediate = first.evaluate(inputs);
|
|
325
329
|
return second.domain.predicate(buildSecondInputs(inputs, intermediate));
|
|
326
330
|
},
|
|
331
|
+
violations: (inputs, keyOf = (name) => name) => {
|
|
332
|
+
const before = first.domain.violations(inputs, keyOf);
|
|
333
|
+
if (before.length > 0)
|
|
334
|
+
return before;
|
|
335
|
+
const piped = buildSecondInputs(inputs, first.evaluate(inputs));
|
|
336
|
+
return second.domain.violations(piped, secondKeyOf(keyOf));
|
|
337
|
+
},
|
|
327
338
|
};
|
|
328
|
-
const id = `${first.id}>>${second.id}`;
|
|
329
339
|
// ── Atlas Phase 1 (S1.2b): the relation overlay, and NOTHING else. ────────
|
|
330
340
|
// Entered only when BOTH operands carry a `relation`. An operand with no
|
|
331
341
|
// relation skips this block, and the composed edge then has no `relation`
|
|
@@ -389,8 +399,7 @@ export function composeEdges(first, second, opts = {}) {
|
|
|
389
399
|
domain: composedDomain,
|
|
390
400
|
evaluate: (inputs) => {
|
|
391
401
|
if (!first.domain.predicate(inputs)) {
|
|
392
|
-
throw new DomainViolationError(
|
|
393
|
-
`(${composedDomain.description})`);
|
|
402
|
+
throw new DomainViolationError(id, first.domain.violations(inputs), `on ${first.id}`);
|
|
394
403
|
}
|
|
395
404
|
// Each operand's unset-coefficient gate is the one `evaluateEdge`
|
|
396
405
|
// applies to a primitive edge; an operand's monomial times an absent 1
|
|
@@ -399,8 +408,7 @@ export function composeEdges(first, second, opts = {}) {
|
|
|
399
408
|
const intermediate = first.evaluate(inputs);
|
|
400
409
|
const pipedInputs = buildSecondInputs(inputs, intermediate);
|
|
401
410
|
if (!second.domain.predicate(pipedInputs)) {
|
|
402
|
-
throw new DomainViolationError(
|
|
403
|
-
`(${composedDomain.description})`);
|
|
411
|
+
throw new DomainViolationError(id, second.domain.violations(pipedInputs, secondKeyOf((name) => name)), pipedContext);
|
|
404
412
|
}
|
|
405
413
|
assertCoefficientSet(second, pipedInputs);
|
|
406
414
|
return second.evaluate(pipedInputs);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../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,QAAQ,KAAK,SAAS;QAC5B,MAAM,CAAC,QAAQ,KAAK,SAAS;QAC7B,aAAa,KAAK,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC,EACnC,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnF,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACjD,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,iBAAiB,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9G,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/**\n * Composition graph — the composition operator (v0.8.0 T2/T4, per\n * docs/planning/v0.8.0-Design.md §3 + r2 deltas).\n *\n * `composeEdges(first, second)` pipes `first`'s output quantity into a\n * matching source of `second`, producing a NEW `BridgeEdge` (design\n * D-2 — composition closes over the edge type, so chains nest\n * arbitrarily). Defined iff:\n *\n * 1. `first.target` matches one of `second.sources` — by canonical\n * name, or via an explicit {@link QuantityIdentification} (the\n * reviewable physics judgments, e.g. \"the Hawking temperature IS\n * the temperature in Landauer's bound\");\n * 2. the junction dimensions are EXACTLY equal (the dimension-functor\n * check — ℤ⁷ integer-vector equality via the dimensional\n * calculus's `equals`);\n * 3. domains conjoin THROUGH the pipe (design D-5): the composed\n * domain checks `first`'s domain on the outer inputs and\n * `second`'s domain on the piped intermediate value. This\n * evaluates `first.evaluate` inside the predicate — acceptable\n * for scalar closed forms.\n *\n * Confidence demotes: `min(first, second)` on\n * established > speculative > highly-speculative. Composition never\n * launders credibility (improvement-plan confidence algebra).\n *\n * Operator is named `composeEdges` (NOT `compose`) — `compose` is the\n * public v0.7 Cell factory in `src/core/cell.ts` (Adam A-1).\n *\n * @module composition/compose\n */\n\nimport { equals, format } from '../dimensional/algebra.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { validate } from '../dimensional/validator.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport type { BridgeEdge, EdgeConfidence } from './edge.js';\nimport type { Quantity, RegimeAttributes } from './quantity.js';\nimport { regimeAttributesOf } from './quantity.js';\nimport { AXES } from './axes.js';\nimport { conventionFactor } from '../dimensional/unit-convention.js';\nimport {\n assertCoefficientSet,\n CompositionAliasError,\n CompositionDimensionError,\n CompositionJunctionError,\n UndefinedCompositionError,\n} from './edge.js';\nimport { DomainViolationError } from '../bridges/evaluation-errors.js';\nimport { substitute } from './expr-subst.js';\nimport { monomialExponents } from './formula-shape.js';\n// Atlas Phase 1 overlay. The composition table is a leaf module (pure, no\n// registry reads, no import from `src/composition/`), so this does not close a\n// cycle — same rule as the type-only atlas import in `./edge.ts`.\nimport { composeRelation, NO_COMPOSITE_CLAIM } from '../relations/composition-table.js';\nimport { checkConventions } from '../relations/conventions.js';\nimport { intersectRegimes } from '../relations/regime.js';\nimport type { Conventions, Regime, RelationContract, RelationType } from '../relations/types.js';\n\n/**\n * The `RelationContract` a composed edge carries, given the composite TYPE the\n * table returned and the two operand contracts.\n *\n * Only four types can be returned by the table (`derivation`,\n * `exact-equivalence`, `restriction`, `coarse-graining`); the other four appear\n * only as operands. `exact-equivalence` is produced by exactly one cell —\n * `exact-equivalence ∘ exact-equivalence` — so both operands are guaranteed to\n * carry the `inverse` its contract requires, and the composed inverse undoes\n * the second map first.\n *\n * NOT composed here: an `ApproximationBound`. `coarse-graining ∘\n * coarse-graining` accumulates error through `composeBounds`\n * (`src/atlas/error-algebra.ts`), which the implementation plan wires in as a\n * SEPARATE task behind this same guard. Until then the composite states its\n * type and no bound — it does not restate either operand's bound, which would\n * be a narrower error claim than the chain supports.\n *\n * @internal\n */\nfunction composedContract(\n type: Exclude<RelationType, 'approximation'>,\n first: RelationContract,\n second: RelationContract,\n): RelationContract {\n const transformation = `${first.transformation} then ${second.transformation}`;\n if (type === 'exact-equivalence') {\n // Guarded by the table: only exact ∘ exact yields exact, and that contract\n // makes `inverse` REQUIRED on both operands.\n const fi = (first as Extract<RelationContract, { type: 'exact-equivalence' }>).inverse;\n const si = (second as Extract<RelationContract, { type: 'exact-equivalence' }>).inverse;\n return { type, transformation, inverse: `${si} then ${fi}` };\n }\n return { type, transformation };\n}\n\n/**\n * A reviewable quantity-identification judgment: the assertion that\n * the quantity named `from` (an edge's target) IS the quantity named\n * `to` (another edge's source), with the physics rationale on record.\n *\n * @public\n */\nexport interface QuantityIdentification {\n readonly from: string;\n readonly to: string;\n readonly rationale: string;\n readonly citation?: string;\n}\n\n/**\n * Registered identifications (v0.8.0 CT-1). Each entry is a physics\n * judgment intended for review — see CONTRIBUTING.md.\n *\n * @public\n */\nexport const QUANTITY_IDENTIFICATIONS: readonly QuantityIdentification[] = [\n {\n from: 'hawking-temperature',\n to: 'temperature',\n rationale:\n 'The Hawking temperature of a black-hole horizon is a genuine ' +\n 'thermodynamic temperature — the temperature appearing in ' +\n \"Landauer's bound for erasure at the horizon. This is the \" +\n 'standard identification underlying black-hole thermodynamics ' +\n '(the horizon radiates as a black body at T_H).',\n citation: 'Hawking 1975 CMP 43:199; Bekenstein 1973 PRD 7:2333',\n },\n {\n from: 'de-broglie-wavelength',\n to: 'compton-wavelength',\n rationale:\n 'The de Broglie wavelength λ = h/p and the Compton wavelength ' +\n 'λ_C = h/(mc) are the SAME matter-wavelength quantity of a massive ' +\n 'particle; the Compton wavelength is its value in the relativistic ' +\n 'limit p = mc (v → c). They are equal only in that limit, but at the ' +\n 'composition graph’s quantity-KIND resolution they name one node. ' +\n 'Folded ONTO compton-wavelength (not the reverse) because that node is ' +\n 'anchor-determinable (ℏ/mc from a mass) and carries the sourced atomic ' +\n 'scale the magnitude gate needs; de-broglie’s own form needs a ' +\n 'momentum the single-mass anchor does not supply.',\n citation: 'de Broglie 1924; Compton 1923 Phys. Rev. 21:483',\n },\n {\n from: 'thermal-de-broglie-wavelength',\n to: 'thermal-wavelength',\n rationale:\n 'The catalog names the thermal de Broglie wavelength ' +\n 'λ_T = √(2πℏ²/(m k_B T)) `thermal-de-broglie-wavelength` (BE-11 Zurek ' +\n 'decoherence, BE-12 Caldeira–Leggett coherence length), while the ' +\n 'canonical L-layer law `CE-thermal-de-broglie` names the SAME physical ' +\n 'quantity `thermal-wavelength`. They are one node. Folded ONTO the ' +\n 'canonical `thermal-wavelength` (anchor-determinable: √(2πℏ²/(m k_B T)) ' +\n 'from a mass + temperature), reconnecting BE-11 — an ESTABLISHED bridge — ' +\n 'to standard physics (surfaced by the bridges-vs-canonical map; the link ' +\n 'was hidden purely by the name divergence).',\n citation: 'de Broglie 1924; standard statistical mechanics (λ_T)',\n },\n];\n\n/**\n * Effective regime attributes for a candidate NAME, resolved through the\n * `QUANTITY_IDENTIFICATIONS` fold — the SINGLE shared implementation every\n * attribute consumer must use (Eve r3 #2 mandate; the discovery-hardening\n * Phase-2 axis-compatibility gate is the first). `attributesByName` is the\n * REGISTRY-only source (never canonical per-equation stamps — Option-A,\n * audit adjudication F1): callers supply it (production: every centralized\n * `Quantity.attributes`; tests: an injected fixture map), this function only\n * does the fold resolution.\n *\n * Candidate names are already fold-canonicalized (the `to` side of an\n * identification); this additionally pulls in every `from` contributor that\n * folds ONTO `name` and, per axis, unions their stated value with `name`'s\n * own. Where contributors DISAGREE on an axis, the axis counts as UNSTATED\n * (conflict → abstain) rather than picking a side — the fold-conflict rule.\n *\n * @internal\n */\nexport function effectiveAttributes(\n name: string,\n attributesByName: ReadonlyMap<string, RegimeAttributes>,\n idents: readonly QuantityIdentification[] = QUANTITY_IDENTIFICATIONS,\n): RegimeAttributes {\n const contributors: RegimeAttributes[] = [];\n const own = attributesByName.get(name);\n if (own) contributors.push(own);\n for (const id of idents) {\n if (id.to !== name) continue;\n const folded = attributesByName.get(id.from);\n if (folded) contributors.push(folded);\n }\n\n // One-value-agrees, zero-or-conflicting-values-abstain, per REGISTRY axis.\n // The fold reads `AXES`, so an axis the registry carries is folded here: a\n // hand list once named scale, force and information only, and the\n // discrimination audit then measured symmetry, topology and statistics as\n // `checked: 0` whatever the data said (9.0.0 audit §4 C2).\n const folded: Record<string, string> = {};\n for (const { name } of AXES) {\n const values = new Set(\n contributors.map((c) => (c as Readonly<Record<string, string | undefined>>)[name]).filter((v) => v !== undefined),\n );\n if (values.size === 1) folded[name] = [...values][0]!;\n }\n return regimeAttributesOf(folded, `effectiveAttributes(${name})`);\n}\n\n/**\n * A recorded aliasing judgment for one duplicate source name in a\n * composition (v0.11 Option D). `'shared'` = one input deliberately\n * feeds both slots (e.g. ST-2: one M is both the lens and the r_s\n * source). `renameSecond` = split the collision: the SECOND operand's\n * quantity is renamed, and the composed evaluator remaps the renamed\n * input key back to the operand's internal name (vet A-4 — without the\n * remap the rename is a no-op).\n *\n * @public\n */\nexport interface AliasDisposition {\n readonly name: string;\n readonly treatAs: 'shared' | { readonly renameSecond: string };\n readonly rationale: string;\n readonly citation?: string;\n}\n\n/**\n * Registered alias dispositions, keyed by composed id\n * (`first.id>>second.id`) — judgments live in reviewable registry\n * data, mirroring {@link QUANTITY_IDENTIFICATIONS} (vet A-6.2).\n *\n * @public\n */\nexport const SOURCE_ALIAS_DISPOSITIONS: Readonly<\n Record<string, readonly AliasDisposition[]>\n> = {\n // Empty. The one entry this table held, `law-schwarzschild-radius>>be-51`\n // (\"ST-2\": one M is both the lens and the r_s source), keyed a composition\n // no call can reach: the law's target `schwarzschild-radius` matches none\n // of be-51's sources (`mass`, `impact-parameter`) by name or registered\n // identification, so `composeEdges` throws `CompositionJunctionError`\n // before the alias gate runs. The judgment was never applied. Retracted in\n // the 9.0.0 audit (§4 C8); `tests/composition/compose.test.ts` now requires\n // every key here to reach the gate.\n};\n\nconst CONFIDENCE_RANK: Record<EdgeConfidence, number> = {\n established: 2,\n speculative: 1,\n 'highly-speculative': 0,\n};\n\n/**\n * Confidence demotion: the min of the two grades on the ordering\n * established > speculative > highly-speculative.\n *\n * @public\n */\nexport function minConfidence(\n a: EdgeConfidence,\n b: EdgeConfidence,\n): EdgeConfidence {\n return CONFIDENCE_RANK[a] <= CONFIDENCE_RANK[b] ? a : b;\n}\n\n/** Options for {@link composeEdges}. @public */\nexport interface ComposeOptions {\n /** Extra identifications, consulted after the registered ones. */\n readonly identifications?: readonly QuantityIdentification[];\n /**\n * Alias dispositions for duplicate source names (v0.11 Option D);\n * consulted after {@link SOURCE_ALIAS_DISPOSITIONS} entries for the\n * composed id.\n */\n readonly aliases?: readonly AliasDisposition[];\n}\n\nfunction findJunction(\n first: BridgeEdge,\n second: BridgeEdge,\n identifications: readonly QuantityIdentification[],\n): {\n junction: BridgeEdge['sources'][number];\n /** Position in `second.sources`: the slot the pipe fills. One slot, even when the same object sits twice. */\n index: number;\n viaIdentification: QuantityIdentification | null;\n} {\n for (const [index, src] of second.sources.entries()) {\n if (src.name === first.target.name) {\n return { junction: src, index, viaIdentification: null };\n }\n }\n for (const ident of identifications) {\n if (ident.from !== first.target.name) continue;\n for (const [index, src] of second.sources.entries()) {\n if (src.name === ident.to) {\n return { junction: src, index, viaIdentification: ident };\n }\n }\n }\n throw new CompositionJunctionError(\n `Cannot compose ${first.id} -> ${second.id}: target quantity ` +\n `'${first.target.name}' matches none of [${second.sources\n .map((s) => `'${s.name}'`)\n .join(', ')}] by name or registered identification`,\n );\n}\n\n/**\n * The two sides of a composition pipe have the same dimension.\n *\n * This is the check `composeEdges` already applied: `equals` on the seven\n * SI bases, including that function's exponent tolerance. A mismatch is\n * still {@link CompositionDimensionError}.\n *\n * @internal\n */\nexport function junctionDimensionsMatch(left: Dimension, right: Dimension): boolean {\n return equals(left, right);\n}\n\n/**\n * Compose two edges into a new edge (sequential composition through a\n * shared quantity). See module docs for the definedness conditions.\n *\n * The composed edge's `sources` are `first.sources` followed by\n * `second`'s remaining (non-junction) sources; `kind` is `'law'` only\n * when both operands are laws; `beId` is null (a derived relation has\n * no single catalog row).\n *\n * @public\n */\nexport function composeEdges(\n first: BridgeEdge,\n second: BridgeEdge,\n opts: ComposeOptions = {},\n): BridgeEdge {\n const identifications = [\n ...QUANTITY_IDENTIFICATIONS,\n ...(opts.identifications ?? []),\n ];\n const { junction, index: junctionIndex, viaIdentification } = findJunction(\n first,\n second,\n identifications,\n );\n\n if (!junctionDimensionsMatch(first.target.dim, junction.dim)) {\n throw new CompositionDimensionError(\n `Cannot compose ${first.id} -> ${second.id}: junction dimension ` +\n `mismatch — ${first.target.name} is ${format(first.target.dim)} ` +\n `but ${junction.name} is ${format(junction.dim)}`,\n );\n }\n const junctionScale =\n viaIdentification === null\n ? 1\n : conventionFactor(first.target.name, junction.name);\n\n // The pipe fills ONE slot of `second.sources`, the one `findJunction`\n // returned. Removal by object identity would also drop a second slot that\n // holds the same `Quantity` object, which a `shared` disposition produces.\n const remainingSources = second.sources.filter((_, i) => i !== junctionIndex);\n\n // v0.11 Option D (namespacing gate): pure name-collision rule across\n // operands. Intra-operand duplicates (e.g. ['mass','mass'] inherited\n // from a prior 'shared' disposition) are exempt by construction —\n // only names present in BOTH first.sources and second's remaining\n // sources are collisions, and each needs a recorded disposition.\n const firstNames = new Set(first.sources.map((s) => s.name));\n const collisionNames = [\n ...new Set(\n remainingSources\n .filter((s) => firstNames.has(s.name))\n .map((s) => s.name),\n ),\n ];\n const composedId = `${first.id}>>${second.id}`;\n const dispositions: AliasDisposition[] = [\n ...(SOURCE_ALIAS_DISPOSITIONS[composedId] ?? []),\n ...(opts.aliases ?? []),\n ];\n const renameMap: Record<string, string> = {}; // renamed key -> operand-internal name\n const dispositionsUsed: AliasDisposition[] = [];\n let finalRemaining: Quantity[] = [...remainingSources];\n for (const name of collisionNames) {\n const d = dispositions.find((x) => x.name === name);\n if (!d) {\n throw new CompositionAliasError(\n `Cannot compose ${composedId}: source quantity '${name}' appears ` +\n `in BOTH operands (first: [${[...firstNames].join(', ')}]; ` +\n `second remaining: [${remainingSources\n .map((s) => s.name)\n .join(', ')}]). Same name does not imply same physical ` +\n `quantity — record an AliasDisposition ('shared' or ` +\n `{renameSecond}) in SOURCE_ALIAS_DISPOSITIONS or opts.aliases.`,\n );\n }\n dispositionsUsed.push(d);\n if (d.treatAs === 'shared') continue; // one input key feeds both slots\n const renamed = d.treatAs.renameSecond;\n if (\n firstNames.has(renamed) ||\n second.sources.some((s) => s.name === renamed)\n ) {\n throw new CompositionAliasError(\n `Cannot compose ${composedId}: renameSecond target '${renamed}' ` +\n `collides with an existing source name of an operand (vet A-4).`,\n );\n }\n finalRemaining = finalRemaining.map((s) =>\n s.name === name ? { ...s, name: renamed, symbol: s.symbol } : s,\n );\n renameMap[renamed] = name;\n }\n\n /** Build the second operand's input map: remap renamed keys back to\n * the operand-internal names (shadowing the first operand's value\n * for that name — vet A-4's required remap), then pipe the junction. */\n const buildSecondInputs = (\n inputs: Record<string, number>,\n intermediate: number,\n ): Record<string, number> => {\n const si: Record<string, number> = { ...inputs };\n for (const [renamed, original] of Object.entries(renameMap)) {\n si[original] = inputs[renamed];\n delete si[renamed];\n }\n si[junction.name] = intermediate * junctionScale;\n return si;\n };\n\n const composedDomain = {\n description:\n `(${first.domain.description}) AND, on the piped ` +\n `${junction.name}, (${second.domain.description})`,\n // Standalone domain queries evaluate `first` to obtain the piped\n // intermediate (design D-5; acceptable for scalar closed forms).\n // The composed `evaluate` below does NOT call this predicate — it\n // computes the intermediate once and checks both domains inline\n // (v0.8.0 punch-list: removed the double evaluation of `first`).\n predicate: (inputs: Record<string, number>): boolean => {\n if (!first.domain.predicate(inputs)) return false;\n const intermediate = first.evaluate(inputs);\n return second.domain.predicate(buildSecondInputs(inputs, intermediate));\n },\n };\n\n const id = `${first.id}>>${second.id}`;\n\n // ── Atlas Phase 1 (S1.2b): the relation overlay, and NOTHING else. ────────\n // Entered only when BOTH operands carry a `relation`. An operand with no\n // relation skips this block, and the composed edge then has no `relation`\n // key. The catalog edges that carry one are the catalog's `relation` rows\n // (`tests/composition/relation-refusal.test.ts` lists them); they stay.\n // When both operands carry a relation, a silent table cell throws\n // `UndefinedCompositionError`. The approximation cell throws the same\n // error, because an edge relation carries no norm transport and this\n // layer does not invent a bound. `enumerateCompositionsWithRefusals`\n // records that throw on its own list. A dimension or junction failure\n // is a different error and is not that list.\n let relationOverlay: Pick<\n BridgeEdge,\n 'relation' | 'relationDerivedFrom' | 'conventions'\n > = {};\n if (first.relation !== undefined && second.relation !== undefined) {\n const composite = composeRelation(first.relation.type, second.relation.type);\n if (composite === NO_COMPOSITE_CLAIM) {\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the composition table ` +\n `asserts no composite relation for '${first.relation.type}' ` +\n `(${first.id}) followed by '${second.relation.type}' ` +\n `(${second.id}). This is silence, not refutation — see ` +\n `docs/planning/Atlas-Phase-1-Design.md §2.2.`,\n );\n }\n if (composite === 'approximation') {\n // Reachable since the table's one widening: approximation then\n // exact-equivalence (docs/planning/ADR-transported-norm-composition.md).\n // An `approximation` contract REQUIRES an `ApproximationBound`, and the\n // composed bound exists only when the exact map declares a norm\n // transport. A `RelationContract` on an edge carries none, so this layer\n // cannot compose the bound and must refuse rather than fabricate one.\n // The atlas route layer (`boundPath`) is where a declared transport is\n // applied.\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the composition table ` +\n `returned 'approximation', which requires a composed ` +\n `ApproximationBound; an edge relation declares no norm transport, ` +\n `so no bound is composed here (the atlas boundPath applies declared transports).`,\n );\n }\n // Conventions carry forward only when the operands do not CONTRADICT each\n // other. `checkConventions` treats an undeclared key as unknown, so a\n // silent operand never blocks the carry-forward; a genuine disagreement\n // does, and then the composite declares no conventions at all rather than\n // picking one operand's choice over the other's. One rule, not a per-key\n // filter: a chain built across a sign disagreement has no single first-law\n // convention to state, and stating one would be a claim about the chain\n // that neither operand supports.\n const merged: Conventions =\n checkConventions(first.conventions, second.conventions).length === 0\n ? { ...first.conventions, ...second.conventions }\n : {};\n relationOverlay = {\n relation: composedContract(composite, first.relation, second.relation),\n relationDerivedFrom: [first.id, second.id],\n ...(Object.keys(merged).length > 0 ? { conventions: merged } : {}),\n };\n }\n\n return {\n id,\n beId: null,\n kind: first.kind === 'law' && second.kind === 'law' ? 'law' : 'bridge',\n label: `${first.label} ∘ ${second.label}`,\n sources: [...first.sources, ...finalRemaining],\n target: second.target,\n confidence: minConfidence(first.confidence, second.confidence),\n domain: composedDomain,\n evaluate: (inputs) => {\n if (!first.domain.predicate(inputs)) {\n throw new DomainViolationError(\n `${id}: inputs violate composed validity domain ` +\n `(${composedDomain.description})`,\n );\n }\n // Each operand's unset-coefficient gate is the one `evaluateEdge`\n // applies to a primitive edge; an operand's monomial times an absent 1\n // must not reach the caller as a number through the pipe.\n assertCoefficientSet(first, inputs);\n const intermediate = first.evaluate(inputs);\n const pipedInputs = buildSecondInputs(inputs, intermediate);\n if (!second.domain.predicate(pipedInputs)) {\n throw new DomainViolationError(\n `${id}: inputs violate composed validity domain ` +\n `(${composedDomain.description})`,\n );\n }\n assertCoefficientSet(second, pipedInputs);\n return second.evaluate(pipedInputs);\n },\n citation: `${first.citation} | ${second.citation}`,\n ...(viaIdentification !== null\n ? { identificationUsed: viaIdentification }\n : {}),\n ...(dispositionsUsed.length > 0\n ? { aliasDispositionsUsed: dispositionsUsed }\n : {}),\n ...relationOverlay,\n ...carriedClaims(first, second, junction, junctionScale, finalRemaining, renameMap),\n };\n}\n\n/**\n * The claims a composed edge carries from its operands (9.0.0 audit §4 C5).\n * A composed edge that dropped them answered differently from its operands:\n * the regime gate abstained on every chain longer than two, an unset\n * coefficient became a number, an even input lost its magnitude reading,\n * a count became a Buckingham governor, and an alias key stopped working.\n *\n * - `regime`: the one an operand states; two of one family intersect\n * (`intersectRegimes`, which also refuses conflicting group definitions);\n * two of different families refuse with `UndefinedCompositionError`, since\n * this layer does not state where a cross-family chain applies.\n * - `coefficientUnset`: either operand's. `evaluateEdge` then refuses the\n * composite; a bound group lifts a primitive entry only, because the group\n * row is keyed by the entry id, so a composite with an unset operand is\n * refused by `evaluateEdge` whatever is bound (its own `evaluate` applies\n * each operand's gate and does lift the operand whose group is bound).\n * - `evenInputs`, `aliases`: the first operand's, plus the second's for its\n * remaining sources under their composed names. The piped junction is not\n * an input and is dropped. An alias key that two quantities would share is\n * carried for neither.\n * - `formulaFactors`: the second operand's for its remaining sources, exact.\n * The first operand's counts enter through the pipe with their exponent\n * times the junction's exponent in the second's monomial, so they are\n * carried only when `second.symbolic` is a monomial that states it.\n * - `symbolic`: the second's form with the junction leaf replaced by the\n * first's, when both exist, the junction carries no convention factor, no\n * source was renamed, the leaf occurs, and the result validates to the\n * target dimension. Otherwise absent, as on a numeric-only edge.\n */\nfunction carriedClaims(\n first: BridgeEdge,\n second: BridgeEdge,\n junction: Quantity,\n junctionScale: number,\n finalRemaining: readonly Quantity[],\n renameMap: Readonly<Record<string, string>>,\n): Pick<BridgeEdge, 'regime' | 'coefficientUnset' | 'evenInputs' | 'formulaFactors' | 'aliases' | 'symbolic'> {\n const out: {\n regime?: Regime;\n coefficientUnset?: boolean;\n evenInputs?: readonly string[];\n formulaFactors?: Readonly<Record<string, number>>;\n aliases?: Readonly<Record<string, readonly string[]>>;\n symbolic?: ExprNode;\n } = {};\n\n if (first.regime !== undefined && second.regime !== undefined) {\n if (first.regime.family !== second.regime.family) {\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the regimes are of different ` +\n `families ('${first.regime.family}', '${second.regime.family}'), and this ` +\n `layer does not state where a cross-family chain applies.`,\n );\n }\n try {\n out.regime = intersectRegimes(first.regime, second.regime);\n } catch (e) {\n // Conflicting definitions of one group name: the composite has no regime this\n // layer can state, the same refusal as a cross-family chain.\n throw new UndefinedCompositionError(`Cannot compose ${first.id} -> ${second.id}: ${(e as Error).message}`);\n }\n } else if (first.regime !== undefined || second.regime !== undefined) {\n out.regime = first.regime ?? second.regime;\n }\n\n if (first.coefficientUnset === true || second.coefficientUnset === true) out.coefficientUnset = true;\n\n // Operand-internal name → the name the composite exposes it under.\n const composedName = new Map(Object.entries(renameMap).map(([renamed, original]) => [original, renamed]));\n const exposed = (name: string): string => composedName.get(name) ?? name;\n const remainingNames = new Set(finalRemaining.map((s) => s.name));\n const secondRemaining = (name: string): boolean => name !== junction.name && remainingNames.has(exposed(name));\n\n const even = [\n ...(first.evenInputs ?? []),\n ...(second.evenInputs ?? []).filter(secondRemaining).map(exposed),\n ];\n if (even.length > 0) out.evenInputs = even;\n\n const factors: Record<string, number> = {};\n const junctionExponent = monomialExponents(second.symbolic)?.get(junction.name);\n if (first.formulaFactors !== undefined && junctionExponent !== undefined) {\n for (const [name, exp] of Object.entries(first.formulaFactors)) factors[name] = exp * junctionExponent;\n }\n for (const [name, exp] of Object.entries(second.formulaFactors ?? {})) {\n if (secondRemaining(name)) factors[exposed(name)] = exp;\n }\n if (Object.keys(factors).length > 0) out.formulaFactors = factors;\n\n const aliasOwner = new Map<string, string>();\n const shared = new Set<string>();\n const aliases: Record<string, string[]> = {};\n const addAliases = (quantity: string, keys: readonly string[]): void => {\n for (const key of keys) {\n const owner = aliasOwner.get(key);\n if (owner !== undefined && owner !== quantity) shared.add(key);\n aliasOwner.set(key, quantity);\n (aliases[quantity] ??= []).push(key);\n }\n };\n for (const [quantity, keys] of Object.entries(first.aliases ?? {})) addAliases(quantity, keys);\n for (const [quantity, keys] of Object.entries(second.aliases ?? {})) {\n if (secondRemaining(quantity)) addAliases(exposed(quantity), keys);\n }\n const kept = Object.fromEntries(\n Object.entries(aliases)\n .map(([quantity, keys]) => [quantity, keys.filter((k) => !shared.has(k))] as const)\n .filter(([, keys]) => keys.length > 0),\n );\n if (Object.keys(kept).length > 0) out.aliases = kept;\n\n if (\n first.symbolic !== undefined &&\n second.symbolic !== undefined &&\n junctionScale === 1 &&\n Object.keys(renameMap).length === 0\n ) {\n const { expr, count } = substitute(second.symbolic, junction.name, first.symbolic);\n const v = count > 0 ? validate(expr) : undefined;\n if (v !== undefined && v.ok && v.inferredDimension !== null && equals(v.inferredDimension, second.target.dim)) {\n out.symbolic = expr;\n }\n }\n\n return out;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/composition/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,0EAA0E;AAC1E,+EAA+E;AAC/E,kEAAkE;AAClE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,gBAAgB,CACvB,IAA4C,EAC5C,KAAuB,EACvB,MAAwB;IAExB,MAAM,cAAc,GAAG,GAAG,KAAK,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,KAAK,CAAC,QAAQ,KAAK,SAAS;QAC5B,MAAM,CAAC,QAAQ,KAAK,SAAS;QAC7B,aAAa,KAAK,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC,EACnC,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnF,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACjD,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,iBAAiB,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9G,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/**\n * Composition graph — the composition operator (v0.8.0 T2/T4, per\n * docs/planning/v0.8.0-Design.md §3 + r2 deltas).\n *\n * `composeEdges(first, second)` pipes `first`'s output quantity into a\n * matching source of `second`, producing a NEW `BridgeEdge` (design\n * D-2 — composition closes over the edge type, so chains nest\n * arbitrarily). Defined iff:\n *\n * 1. `first.target` matches one of `second.sources` — by canonical\n * name, or via an explicit {@link QuantityIdentification} (the\n * reviewable physics judgments, e.g. \"the Hawking temperature IS\n * the temperature in Landauer's bound\");\n * 2. the junction dimensions are EXACTLY equal (the dimension-functor\n * check — ℤ⁷ integer-vector equality via the dimensional\n * calculus's `equals`);\n * 3. domains conjoin THROUGH the pipe (design D-5): the composed\n * domain checks `first`'s domain on the outer inputs and\n * `second`'s domain on the piped intermediate value. This\n * evaluates `first.evaluate` inside the predicate — acceptable\n * for scalar closed forms.\n *\n * Confidence demotes: `min(first, second)` on\n * established > speculative > highly-speculative. Composition never\n * launders credibility (improvement-plan confidence algebra).\n *\n * Operator is named `composeEdges` (NOT `compose`) — `compose` is the\n * public v0.7 Cell factory in `src/core/cell.ts` (Adam A-1).\n *\n * @module composition/compose\n */\n\nimport { equals, format } from '../dimensional/algebra.js';\nimport type { Dimension } from '../dimensional/types.js';\nimport { validate } from '../dimensional/validator.js';\nimport type { ExprNode } from '../dimensional/validator.js';\nimport type { BridgeEdge, EdgeConfidence, ValidityDomain } from './edge.js';\nimport type { Quantity, RegimeAttributes } from './quantity.js';\nimport { regimeAttributesOf } from './quantity.js';\nimport { AXES } from './axes.js';\nimport { conventionFactor } from '../dimensional/unit-convention.js';\nimport {\n assertCoefficientSet,\n CompositionAliasError,\n CompositionDimensionError,\n CompositionJunctionError,\n UndefinedCompositionError,\n} from './edge.js';\nimport { DomainViolationError } from '../bridges/evaluation-errors.js';\nimport { substitute } from './expr-subst.js';\nimport { monomialExponents } from './formula-shape.js';\n// Atlas Phase 1 overlay. The composition table is a leaf module (pure, no\n// registry reads, no import from `src/composition/`), so this does not close a\n// cycle — same rule as the type-only atlas import in `./edge.ts`.\nimport { composeRelation, NO_COMPOSITE_CLAIM } from '../relations/composition-table.js';\nimport { checkConventions } from '../relations/conventions.js';\nimport { intersectRegimes } from '../relations/regime.js';\nimport type { Conventions, Regime, RelationContract, RelationType } from '../relations/types.js';\n\n/**\n * The `RelationContract` a composed edge carries, given the composite TYPE the\n * table returned and the two operand contracts.\n *\n * Only four types can be returned by the table (`derivation`,\n * `exact-equivalence`, `restriction`, `coarse-graining`); the other four appear\n * only as operands. `exact-equivalence` is produced by exactly one cell —\n * `exact-equivalence ∘ exact-equivalence` — so both operands are guaranteed to\n * carry the `inverse` its contract requires, and the composed inverse undoes\n * the second map first.\n *\n * NOT composed here: an `ApproximationBound`. `coarse-graining ∘\n * coarse-graining` accumulates error through `composeBounds`\n * (`src/atlas/error-algebra.ts`), which the implementation plan wires in as a\n * SEPARATE task behind this same guard. Until then the composite states its\n * type and no bound — it does not restate either operand's bound, which would\n * be a narrower error claim than the chain supports.\n *\n * @internal\n */\nfunction composedContract(\n type: Exclude<RelationType, 'approximation'>,\n first: RelationContract,\n second: RelationContract,\n): RelationContract {\n const transformation = `${first.transformation} then ${second.transformation}`;\n if (type === 'exact-equivalence') {\n // Guarded by the table: only exact ∘ exact yields exact, and that contract\n // makes `inverse` REQUIRED on both operands.\n const fi = (first as Extract<RelationContract, { type: 'exact-equivalence' }>).inverse;\n const si = (second as Extract<RelationContract, { type: 'exact-equivalence' }>).inverse;\n return { type, transformation, inverse: `${si} then ${fi}` };\n }\n return { type, transformation };\n}\n\n/**\n * A reviewable quantity-identification judgment: the assertion that\n * the quantity named `from` (an edge's target) IS the quantity named\n * `to` (another edge's source), with the physics rationale on record.\n *\n * @public\n */\nexport interface QuantityIdentification {\n readonly from: string;\n readonly to: string;\n readonly rationale: string;\n readonly citation?: string;\n}\n\n/**\n * Registered identifications (v0.8.0 CT-1). Each entry is a physics\n * judgment intended for review — see CONTRIBUTING.md.\n *\n * @public\n */\nexport const QUANTITY_IDENTIFICATIONS: readonly QuantityIdentification[] = [\n {\n from: 'hawking-temperature',\n to: 'temperature',\n rationale:\n 'The Hawking temperature of a black-hole horizon is a genuine ' +\n 'thermodynamic temperature — the temperature appearing in ' +\n \"Landauer's bound for erasure at the horizon. This is the \" +\n 'standard identification underlying black-hole thermodynamics ' +\n '(the horizon radiates as a black body at T_H).',\n citation: 'Hawking 1975 CMP 43:199; Bekenstein 1973 PRD 7:2333',\n },\n {\n from: 'de-broglie-wavelength',\n to: 'compton-wavelength',\n rationale:\n 'The de Broglie wavelength λ = h/p and the Compton wavelength ' +\n 'λ_C = h/(mc) are the SAME matter-wavelength quantity of a massive ' +\n 'particle; the Compton wavelength is its value in the relativistic ' +\n 'limit p = mc (v → c). They are equal only in that limit, but at the ' +\n 'composition graph’s quantity-KIND resolution they name one node. ' +\n 'Folded ONTO compton-wavelength (not the reverse) because that node is ' +\n 'anchor-determinable (ℏ/mc from a mass) and carries the sourced atomic ' +\n 'scale the magnitude gate needs; de-broglie’s own form needs a ' +\n 'momentum the single-mass anchor does not supply.',\n citation: 'de Broglie 1924; Compton 1923 Phys. Rev. 21:483',\n },\n {\n from: 'thermal-de-broglie-wavelength',\n to: 'thermal-wavelength',\n rationale:\n 'The catalog names the thermal de Broglie wavelength ' +\n 'λ_T = √(2πℏ²/(m k_B T)) `thermal-de-broglie-wavelength` (BE-11 Zurek ' +\n 'decoherence, BE-12 Caldeira–Leggett coherence length), while the ' +\n 'canonical L-layer law `CE-thermal-de-broglie` names the SAME physical ' +\n 'quantity `thermal-wavelength`. They are one node. Folded ONTO the ' +\n 'canonical `thermal-wavelength` (anchor-determinable: √(2πℏ²/(m k_B T)) ' +\n 'from a mass + temperature), reconnecting BE-11 — an ESTABLISHED bridge — ' +\n 'to standard physics (surfaced by the bridges-vs-canonical map; the link ' +\n 'was hidden purely by the name divergence).',\n citation: 'de Broglie 1924; standard statistical mechanics (λ_T)',\n },\n];\n\n/**\n * Effective regime attributes for a candidate NAME, resolved through the\n * `QUANTITY_IDENTIFICATIONS` fold — the SINGLE shared implementation every\n * attribute consumer must use (Eve r3 #2 mandate; the discovery-hardening\n * Phase-2 axis-compatibility gate is the first). `attributesByName` is the\n * REGISTRY-only source (never canonical per-equation stamps — Option-A,\n * audit adjudication F1): callers supply it (production: every centralized\n * `Quantity.attributes`; tests: an injected fixture map), this function only\n * does the fold resolution.\n *\n * Candidate names are already fold-canonicalized (the `to` side of an\n * identification); this additionally pulls in every `from` contributor that\n * folds ONTO `name` and, per axis, unions their stated value with `name`'s\n * own. Where contributors DISAGREE on an axis, the axis counts as UNSTATED\n * (conflict → abstain) rather than picking a side — the fold-conflict rule.\n *\n * @internal\n */\nexport function effectiveAttributes(\n name: string,\n attributesByName: ReadonlyMap<string, RegimeAttributes>,\n idents: readonly QuantityIdentification[] = QUANTITY_IDENTIFICATIONS,\n): RegimeAttributes {\n const contributors: RegimeAttributes[] = [];\n const own = attributesByName.get(name);\n if (own) contributors.push(own);\n for (const id of idents) {\n if (id.to !== name) continue;\n const folded = attributesByName.get(id.from);\n if (folded) contributors.push(folded);\n }\n\n // One-value-agrees, zero-or-conflicting-values-abstain, per REGISTRY axis.\n // The fold reads `AXES`, so an axis the registry carries is folded here: a\n // hand list once named scale, force and information only, and the\n // discrimination audit then measured symmetry, topology and statistics as\n // `checked: 0` whatever the data said (9.0.0 audit §4 C2).\n const folded: Record<string, string> = {};\n for (const { name } of AXES) {\n const values = new Set(\n contributors.map((c) => (c as Readonly<Record<string, string | undefined>>)[name]).filter((v) => v !== undefined),\n );\n if (values.size === 1) folded[name] = [...values][0]!;\n }\n return regimeAttributesOf(folded, `effectiveAttributes(${name})`);\n}\n\n/**\n * A recorded aliasing judgment for one duplicate source name in a\n * composition (v0.11 Option D). `'shared'` = one input deliberately\n * feeds both slots (e.g. ST-2: one M is both the lens and the r_s\n * source). `renameSecond` = split the collision: the SECOND operand's\n * quantity is renamed, and the composed evaluator remaps the renamed\n * input key back to the operand's internal name (vet A-4 — without the\n * remap the rename is a no-op).\n *\n * @public\n */\nexport interface AliasDisposition {\n readonly name: string;\n readonly treatAs: 'shared' | { readonly renameSecond: string };\n readonly rationale: string;\n readonly citation?: string;\n}\n\n/**\n * Registered alias dispositions, keyed by composed id\n * (`first.id>>second.id`) — judgments live in reviewable registry\n * data, mirroring {@link QUANTITY_IDENTIFICATIONS} (vet A-6.2).\n *\n * @public\n */\nexport const SOURCE_ALIAS_DISPOSITIONS: Readonly<\n Record<string, readonly AliasDisposition[]>\n> = {\n // Empty. The one entry this table held, `law-schwarzschild-radius>>be-51`\n // (\"ST-2\": one M is both the lens and the r_s source), keyed a composition\n // no call can reach: the law's target `schwarzschild-radius` matches none\n // of be-51's sources (`mass`, `impact-parameter`) by name or registered\n // identification, so `composeEdges` throws `CompositionJunctionError`\n // before the alias gate runs. The judgment was never applied. Retracted in\n // the 9.0.0 audit (§4 C8); `tests/composition/compose.test.ts` now requires\n // every key here to reach the gate.\n};\n\nconst CONFIDENCE_RANK: Record<EdgeConfidence, number> = {\n established: 2,\n speculative: 1,\n 'highly-speculative': 0,\n};\n\n/**\n * Confidence demotion: the min of the two grades on the ordering\n * established > speculative > highly-speculative.\n *\n * @public\n */\nexport function minConfidence(\n a: EdgeConfidence,\n b: EdgeConfidence,\n): EdgeConfidence {\n return CONFIDENCE_RANK[a] <= CONFIDENCE_RANK[b] ? a : b;\n}\n\n/** Options for {@link composeEdges}. @public */\nexport interface ComposeOptions {\n /** Extra identifications, consulted after the registered ones. */\n readonly identifications?: readonly QuantityIdentification[];\n /**\n * Alias dispositions for duplicate source names (v0.11 Option D);\n * consulted after {@link SOURCE_ALIAS_DISPOSITIONS} entries for the\n * composed id.\n */\n readonly aliases?: readonly AliasDisposition[];\n}\n\nfunction findJunction(\n first: BridgeEdge,\n second: BridgeEdge,\n identifications: readonly QuantityIdentification[],\n): {\n junction: BridgeEdge['sources'][number];\n /** Position in `second.sources`: the slot the pipe fills. One slot, even when the same object sits twice. */\n index: number;\n viaIdentification: QuantityIdentification | null;\n} {\n for (const [index, src] of second.sources.entries()) {\n if (src.name === first.target.name) {\n return { junction: src, index, viaIdentification: null };\n }\n }\n for (const ident of identifications) {\n if (ident.from !== first.target.name) continue;\n for (const [index, src] of second.sources.entries()) {\n if (src.name === ident.to) {\n return { junction: src, index, viaIdentification: ident };\n }\n }\n }\n throw new CompositionJunctionError(\n `Cannot compose ${first.id} -> ${second.id}: target quantity ` +\n `'${first.target.name}' matches none of [${second.sources\n .map((s) => `'${s.name}'`)\n .join(', ')}] by name or registered identification`,\n );\n}\n\n/**\n * The two sides of a composition pipe have the same dimension.\n *\n * This is the check `composeEdges` already applied: `equals` on the seven\n * SI bases, including that function's exponent tolerance. A mismatch is\n * still {@link CompositionDimensionError}.\n *\n * @internal\n */\nexport function junctionDimensionsMatch(left: Dimension, right: Dimension): boolean {\n return equals(left, right);\n}\n\n/**\n * Compose two edges into a new edge (sequential composition through a\n * shared quantity). See module docs for the definedness conditions.\n *\n * The composed edge's `sources` are `first.sources` followed by\n * `second`'s remaining (non-junction) sources; `kind` is `'law'` only\n * when both operands are laws; `beId` is null (a derived relation has\n * no single catalog row).\n *\n * @public\n */\nexport function composeEdges(\n first: BridgeEdge,\n second: BridgeEdge,\n opts: ComposeOptions = {},\n): BridgeEdge {\n const identifications = [\n ...QUANTITY_IDENTIFICATIONS,\n ...(opts.identifications ?? []),\n ];\n const { junction, index: junctionIndex, viaIdentification } = findJunction(\n first,\n second,\n identifications,\n );\n\n if (!junctionDimensionsMatch(first.target.dim, junction.dim)) {\n throw new CompositionDimensionError(\n `Cannot compose ${first.id} -> ${second.id}: junction dimension ` +\n `mismatch — ${first.target.name} is ${format(first.target.dim)} ` +\n `but ${junction.name} is ${format(junction.dim)}`,\n );\n }\n const junctionScale =\n viaIdentification === null\n ? 1\n : conventionFactor(first.target.name, junction.name);\n\n // The pipe fills ONE slot of `second.sources`, the one `findJunction`\n // returned. Removal by object identity would also drop a second slot that\n // holds the same `Quantity` object, which a `shared` disposition produces.\n const remainingSources = second.sources.filter((_, i) => i !== junctionIndex);\n\n // v0.11 Option D (namespacing gate): pure name-collision rule across\n // operands. Intra-operand duplicates (e.g. ['mass','mass'] inherited\n // from a prior 'shared' disposition) are exempt by construction —\n // only names present in BOTH first.sources and second's remaining\n // sources are collisions, and each needs a recorded disposition.\n const firstNames = new Set(first.sources.map((s) => s.name));\n const collisionNames = [\n ...new Set(\n remainingSources\n .filter((s) => firstNames.has(s.name))\n .map((s) => s.name),\n ),\n ];\n const composedId = `${first.id}>>${second.id}`;\n const dispositions: AliasDisposition[] = [\n ...(SOURCE_ALIAS_DISPOSITIONS[composedId] ?? []),\n ...(opts.aliases ?? []),\n ];\n const renameMap: Record<string, string> = {}; // renamed key -> operand-internal name\n const dispositionsUsed: AliasDisposition[] = [];\n let finalRemaining: Quantity[] = [...remainingSources];\n for (const name of collisionNames) {\n const d = dispositions.find((x) => x.name === name);\n if (!d) {\n throw new CompositionAliasError(\n `Cannot compose ${composedId}: source quantity '${name}' appears ` +\n `in BOTH operands (first: [${[...firstNames].join(', ')}]; ` +\n `second remaining: [${remainingSources\n .map((s) => s.name)\n .join(', ')}]). Same name does not imply same physical ` +\n `quantity — record an AliasDisposition ('shared' or ` +\n `{renameSecond}) in SOURCE_ALIAS_DISPOSITIONS or opts.aliases.`,\n );\n }\n dispositionsUsed.push(d);\n if (d.treatAs === 'shared') continue; // one input key feeds both slots\n const renamed = d.treatAs.renameSecond;\n if (\n firstNames.has(renamed) ||\n second.sources.some((s) => s.name === renamed)\n ) {\n throw new CompositionAliasError(\n `Cannot compose ${composedId}: renameSecond target '${renamed}' ` +\n `collides with an existing source name of an operand (vet A-4).`,\n );\n }\n finalRemaining = finalRemaining.map((s) =>\n s.name === name ? { ...s, name: renamed, symbol: s.symbol } : s,\n );\n renameMap[renamed] = name;\n }\n\n /** Build the second operand's input map: remap renamed keys back to\n * the operand-internal names (shadowing the first operand's value\n * for that name — vet A-4's required remap), then pipe the junction. */\n const buildSecondInputs = (\n inputs: Record<string, number>,\n intermediate: number,\n ): Record<string, number> => {\n const si: Record<string, number> = { ...inputs };\n for (const [renamed, original] of Object.entries(renameMap)) {\n si[original] = inputs[renamed];\n delete si[renamed];\n }\n si[junction.name] = intermediate * junctionScale;\n return si;\n };\n\n const id = `${first.id}>>${second.id}`;\n // A name `second` reads under a renamed key reads it under that key here.\n const secondKeyOf = (keyOf: (name: string) => string) => (name: string): string =>\n keyOf(Object.entries(renameMap).find(([, original]) => original === name)?.[0] ?? name);\n const pipedContext = `on ${second.id}, with ${junction.name} piped from ${first.id}`;\n\n const composedDomain: ValidityDomain = {\n description:\n `(${first.domain.description}) AND, on the piped ` +\n `${junction.name}, (${second.domain.description})`,\n // Standalone domain queries evaluate `first` to obtain the piped\n // intermediate (design D-5; acceptable for scalar closed forms).\n // The composed `evaluate` below does NOT call this predicate — it\n // computes the intermediate once and checks both domains inline\n // (v0.8.0 punch-list: removed the double evaluation of `first`).\n predicate: (inputs: Record<string, number>): boolean => {\n if (!first.domain.predicate(inputs)) return false;\n const intermediate = first.evaluate(inputs);\n return second.domain.predicate(buildSecondInputs(inputs, intermediate));\n },\n violations: (inputs, keyOf = (name) => name) => {\n const before = first.domain.violations(inputs, keyOf);\n if (before.length > 0) return before;\n const piped = buildSecondInputs(inputs, first.evaluate(inputs));\n return second.domain.violations(piped, secondKeyOf(keyOf));\n },\n };\n\n\n // ── Atlas Phase 1 (S1.2b): the relation overlay, and NOTHING else. ────────\n // Entered only when BOTH operands carry a `relation`. An operand with no\n // relation skips this block, and the composed edge then has no `relation`\n // key. The catalog edges that carry one are the catalog's `relation` rows\n // (`tests/composition/relation-refusal.test.ts` lists them); they stay.\n // When both operands carry a relation, a silent table cell throws\n // `UndefinedCompositionError`. The approximation cell throws the same\n // error, because an edge relation carries no norm transport and this\n // layer does not invent a bound. `enumerateCompositionsWithRefusals`\n // records that throw on its own list. A dimension or junction failure\n // is a different error and is not that list.\n let relationOverlay: Pick<\n BridgeEdge,\n 'relation' | 'relationDerivedFrom' | 'conventions'\n > = {};\n if (first.relation !== undefined && second.relation !== undefined) {\n const composite = composeRelation(first.relation.type, second.relation.type);\n if (composite === NO_COMPOSITE_CLAIM) {\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the composition table ` +\n `asserts no composite relation for '${first.relation.type}' ` +\n `(${first.id}) followed by '${second.relation.type}' ` +\n `(${second.id}). This is silence, not refutation — see ` +\n `docs/planning/Atlas-Phase-1-Design.md §2.2.`,\n );\n }\n if (composite === 'approximation') {\n // Reachable since the table's one widening: approximation then\n // exact-equivalence (docs/planning/ADR-transported-norm-composition.md).\n // An `approximation` contract REQUIRES an `ApproximationBound`, and the\n // composed bound exists only when the exact map declares a norm\n // transport. A `RelationContract` on an edge carries none, so this layer\n // cannot compose the bound and must refuse rather than fabricate one.\n // The atlas route layer (`boundPath`) is where a declared transport is\n // applied.\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the composition table ` +\n `returned 'approximation', which requires a composed ` +\n `ApproximationBound; an edge relation declares no norm transport, ` +\n `so no bound is composed here (the atlas boundPath applies declared transports).`,\n );\n }\n // Conventions carry forward only when the operands do not CONTRADICT each\n // other. `checkConventions` treats an undeclared key as unknown, so a\n // silent operand never blocks the carry-forward; a genuine disagreement\n // does, and then the composite declares no conventions at all rather than\n // picking one operand's choice over the other's. One rule, not a per-key\n // filter: a chain built across a sign disagreement has no single first-law\n // convention to state, and stating one would be a claim about the chain\n // that neither operand supports.\n const merged: Conventions =\n checkConventions(first.conventions, second.conventions).length === 0\n ? { ...first.conventions, ...second.conventions }\n : {};\n relationOverlay = {\n relation: composedContract(composite, first.relation, second.relation),\n relationDerivedFrom: [first.id, second.id],\n ...(Object.keys(merged).length > 0 ? { conventions: merged } : {}),\n };\n }\n\n return {\n id,\n beId: null,\n kind: first.kind === 'law' && second.kind === 'law' ? 'law' : 'bridge',\n label: `${first.label} ∘ ${second.label}`,\n sources: [...first.sources, ...finalRemaining],\n target: second.target,\n confidence: minConfidence(first.confidence, second.confidence),\n domain: composedDomain,\n evaluate: (inputs) => {\n if (!first.domain.predicate(inputs)) {\n throw new DomainViolationError(id, first.domain.violations(inputs), `on ${first.id}`);\n }\n // Each operand's unset-coefficient gate is the one `evaluateEdge`\n // applies to a primitive edge; an operand's monomial times an absent 1\n // must not reach the caller as a number through the pipe.\n assertCoefficientSet(first, inputs);\n const intermediate = first.evaluate(inputs);\n const pipedInputs = buildSecondInputs(inputs, intermediate);\n if (!second.domain.predicate(pipedInputs)) {\n throw new DomainViolationError(id, second.domain.violations(pipedInputs, secondKeyOf((name) => name)), pipedContext);\n }\n assertCoefficientSet(second, pipedInputs);\n return second.evaluate(pipedInputs);\n },\n citation: `${first.citation} | ${second.citation}`,\n ...(viaIdentification !== null\n ? { identificationUsed: viaIdentification }\n : {}),\n ...(dispositionsUsed.length > 0\n ? { aliasDispositionsUsed: dispositionsUsed }\n : {}),\n ...relationOverlay,\n ...carriedClaims(first, second, junction, junctionScale, finalRemaining, renameMap),\n };\n}\n\n/**\n * The claims a composed edge carries from its operands (9.0.0 audit §4 C5).\n * A composed edge that dropped them answered differently from its operands:\n * the regime gate abstained on every chain longer than two, an unset\n * coefficient became a number, an even input lost its magnitude reading,\n * a count became a Buckingham governor, and an alias key stopped working.\n *\n * - `regime`: the one an operand states; two of one family intersect\n * (`intersectRegimes`, which also refuses conflicting group definitions);\n * two of different families refuse with `UndefinedCompositionError`, since\n * this layer does not state where a cross-family chain applies.\n * - `coefficientUnset`: either operand's. `evaluateEdge` then refuses the\n * composite; a bound group lifts a primitive entry only, because the group\n * row is keyed by the entry id, so a composite with an unset operand is\n * refused by `evaluateEdge` whatever is bound (its own `evaluate` applies\n * each operand's gate and does lift the operand whose group is bound).\n * - `evenInputs`, `aliases`: the first operand's, plus the second's for its\n * remaining sources under their composed names. The piped junction is not\n * an input and is dropped. An alias key that two quantities would share is\n * carried for neither.\n * - `formulaFactors`: the second operand's for its remaining sources, exact.\n * The first operand's counts enter through the pipe with their exponent\n * times the junction's exponent in the second's monomial, so they are\n * carried only when `second.symbolic` is a monomial that states it.\n * - `symbolic`: the second's form with the junction leaf replaced by the\n * first's, when both exist, the junction carries no convention factor, no\n * source was renamed, the leaf occurs, and the result validates to the\n * target dimension. Otherwise absent, as on a numeric-only edge.\n */\nfunction carriedClaims(\n first: BridgeEdge,\n second: BridgeEdge,\n junction: Quantity,\n junctionScale: number,\n finalRemaining: readonly Quantity[],\n renameMap: Readonly<Record<string, string>>,\n): Pick<BridgeEdge, 'regime' | 'coefficientUnset' | 'evenInputs' | 'formulaFactors' | 'aliases' | 'symbolic'> {\n const out: {\n regime?: Regime;\n coefficientUnset?: boolean;\n evenInputs?: readonly string[];\n formulaFactors?: Readonly<Record<string, number>>;\n aliases?: Readonly<Record<string, readonly string[]>>;\n symbolic?: ExprNode;\n } = {};\n\n if (first.regime !== undefined && second.regime !== undefined) {\n if (first.regime.family !== second.regime.family) {\n throw new UndefinedCompositionError(\n `Cannot compose ${first.id} -> ${second.id}: the regimes are of different ` +\n `families ('${first.regime.family}', '${second.regime.family}'), and this ` +\n `layer does not state where a cross-family chain applies.`,\n );\n }\n try {\n out.regime = intersectRegimes(first.regime, second.regime);\n } catch (e) {\n // Conflicting definitions of one group name: the composite has no regime this\n // layer can state, the same refusal as a cross-family chain.\n throw new UndefinedCompositionError(`Cannot compose ${first.id} -> ${second.id}: ${(e as Error).message}`);\n }\n } else if (first.regime !== undefined || second.regime !== undefined) {\n out.regime = first.regime ?? second.regime;\n }\n\n if (first.coefficientUnset === true || second.coefficientUnset === true) out.coefficientUnset = true;\n\n // Operand-internal name → the name the composite exposes it under.\n const composedName = new Map(Object.entries(renameMap).map(([renamed, original]) => [original, renamed]));\n const exposed = (name: string): string => composedName.get(name) ?? name;\n const remainingNames = new Set(finalRemaining.map((s) => s.name));\n const secondRemaining = (name: string): boolean => name !== junction.name && remainingNames.has(exposed(name));\n\n const even = [\n ...(first.evenInputs ?? []),\n ...(second.evenInputs ?? []).filter(secondRemaining).map(exposed),\n ];\n if (even.length > 0) out.evenInputs = even;\n\n const factors: Record<string, number> = {};\n const junctionExponent = monomialExponents(second.symbolic)?.get(junction.name);\n if (first.formulaFactors !== undefined && junctionExponent !== undefined) {\n for (const [name, exp] of Object.entries(first.formulaFactors)) factors[name] = exp * junctionExponent;\n }\n for (const [name, exp] of Object.entries(second.formulaFactors ?? {})) {\n if (secondRemaining(name)) factors[exposed(name)] = exp;\n }\n if (Object.keys(factors).length > 0) out.formulaFactors = factors;\n\n const aliasOwner = new Map<string, string>();\n const shared = new Set<string>();\n const aliases: Record<string, string[]> = {};\n const addAliases = (quantity: string, keys: readonly string[]): void => {\n for (const key of keys) {\n const owner = aliasOwner.get(key);\n if (owner !== undefined && owner !== quantity) shared.add(key);\n aliasOwner.set(key, quantity);\n (aliases[quantity] ??= []).push(key);\n }\n };\n for (const [quantity, keys] of Object.entries(first.aliases ?? {})) addAliases(quantity, keys);\n for (const [quantity, keys] of Object.entries(second.aliases ?? {})) {\n if (secondRemaining(quantity)) addAliases(exposed(quantity), keys);\n }\n const kept = Object.fromEntries(\n Object.entries(aliases)\n .map(([quantity, keys]) => [quantity, keys.filter((k) => !shared.has(k))] as const)\n .filter(([, keys]) => keys.length > 0),\n );\n if (Object.keys(kept).length > 0) out.aliases = kept;\n\n if (\n first.symbolic !== undefined &&\n second.symbolic !== undefined &&\n junctionScale === 1 &&\n Object.keys(renameMap).length === 0\n ) {\n const { expr, count } = substitute(second.symbolic, junction.name, first.symbolic);\n const v = count > 0 ? validate(expr) : undefined;\n if (v !== undefined && v.ok && v.inferredDimension !== null && equals(v.inferredDimension, second.target.dim)) {\n out.symbolic = expr;\n }\n }\n\n return out;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-recovery.d.ts","sourceRoot":"","sources":["../../src/composition/composition-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"composition-recovery.d.ts","sourceRoot":"","sources":["../../src/composition/composition-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,yDAAyD;AACzD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB;IACrE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,UAAU,CAAC;CACrC;AAED,0EAA0E;AAC1E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAClD;AAMD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,GAAE,SAAS,UAAU,EAAkB,GAC3C,uBAAuB,CAsCzB"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* @module composition/composition-recovery
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
+
import { byKey, compareCodepoint } from '../core/compare.js';
|
|
17
18
|
import { CANONICAL_EQUATIONS } from '../canonical/registry.js';
|
|
18
19
|
import { normalForm } from '../canonical/normal-form.js';
|
|
19
20
|
import { CATALOG_GRAPH } from './catalog-graph.js';
|
|
@@ -65,13 +66,9 @@ export function scanCompositionRecovery(edges = CATALOG_GRAPH) {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (byPair !== 0)
|
|
72
|
-
return byPair;
|
|
73
|
-
return a.canonicalId < b.canonicalId ? -1 : a.canonicalId > b.canonicalId ? 1 : 0;
|
|
74
|
-
});
|
|
69
|
+
const byPair = byKey(pairKey);
|
|
70
|
+
pairs.sort(byPair);
|
|
71
|
+
hits.sort((a, b) => byPair(a, b) || compareCodepoint(a.canonicalId, b.canonicalId));
|
|
75
72
|
return { pairs, hits };
|
|
76
73
|
}
|
|
77
74
|
//# sourceMappingURL=composition-recovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-recovery.js","sourceRoot":"","sources":["../../src/composition/composition-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,wBA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MAAM,CAAC,CAAC;IACnB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IACpF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC","sourcesContent":["/**\n * Composition-derived recovery.\n *\n * Single-bridge linkage asks whether one bridge RHS is a canonical equation.\n * This asks the same question of a chain of two edges that both carry a\n * symbolic form. The comparison is `normalForm`: the same relation up to a\n * dimensionless factor. Dimensionful cancellation is not applied, so an\n * unsimplified chain is not rewritten into a simpler formula.\n *\n * A chain is never `restates-canonical`. That label is the F4 guard on one\n * bridge the registry already names. A chain is a derivation, and a\n * structural match is `recovers`.\n *\n * @module composition/composition-recovery\n * @internal\n */\n\nimport { byKey, compareCodepoint } from '../core/compare.js';\nimport { CANONICAL_EQUATIONS } from '../canonical/registry.js';\nimport { normalForm } from '../canonical/normal-form.js';\nimport { CATALOG_GRAPH } from './catalog-graph.js';\nimport { composeSymbolic, SymbolicCompositionError } from './compose-symbolic.js';\nimport type { BridgeEdge } from './edge.js';\n\n/** One ordered pair of edges that composed. @internal */\nexport interface CompositionRecoveryPair {\n readonly firstId: string;\n readonly secondId: string;\n}\n\n/**\n * A chain whose normal form equals a canonical scalar AST.\n * `classification` is always `recovers`.\n * @internal\n */\nexport interface CompositionRecoveryHit extends CompositionRecoveryPair {\n readonly canonicalId: string;\n readonly classification: 'recovers';\n}\n\n/** The chains that were searched, and the ones that matched. @internal */\nexport interface CompositionRecoveryScan {\n readonly pairs: readonly CompositionRecoveryPair[];\n readonly hits: readonly CompositionRecoveryHit[];\n}\n\nfunction pairKey(pair: CompositionRecoveryPair): string {\n return `${pair.firstId}\\0${pair.secondId}`;\n}\n\n/**\n * Search two-edge symbolic chains against the canonical registry.\n *\n * The default edge list is the catalog graph. A caller may pass a shorter\n * list; the canonical side stays the registry. Pairs that cannot compose\n * are not examined. Order is by edge id, then canonical id.\n *\n * @internal\n */\nexport function scanCompositionRecovery(\n edges: readonly BridgeEdge[] = CATALOG_GRAPH,\n): CompositionRecoveryScan {\n const symbolic = edges.filter((edge) => edge.symbolic !== undefined);\n const canons = CANONICAL_EQUATIONS.filter((ce) => ce.scalarAst !== undefined).map((ce) => ({\n id: ce.id,\n normal: normalForm(ce.scalarAst!),\n }));\n\n const pairs: CompositionRecoveryPair[] = [];\n const hits: CompositionRecoveryHit[] = [];\n\n for (const first of symbolic) {\n for (const second of symbolic) {\n if (first.id === second.id) continue;\n let expr;\n try {\n expr = composeSymbolic(first, second).expr;\n } catch (error) {\n if (error instanceof SymbolicCompositionError) continue;\n throw error;\n }\n pairs.push({ firstId: first.id, secondId: second.id });\n const form = normalForm(expr);\n for (const canon of canons) {\n if (form !== canon.normal) continue;\n hits.push({\n firstId: first.id,\n secondId: second.id,\n canonicalId: canon.id,\n classification: 'recovers',\n });\n }\n }\n }\n\n const byPair = byKey(pairKey);\n pairs.sort(byPair);\n hits.sort((a, b) => byPair(a, b) || compareCodepoint(a.canonicalId, b.canonicalId));\n return { pairs, hits };\n}\n"]}
|
|
@@ -79,6 +79,19 @@ export interface VettedCandidate {
|
|
|
79
79
|
* value (the gate abstained — see `magnitudeChecked`).
|
|
80
80
|
*/
|
|
81
81
|
readonly ordersApart: number | null;
|
|
82
|
+
/**
|
|
83
|
+
* The calibrated STRENGTH of the magnitude falsifier against the two values' stated
|
|
84
|
+
* uncertainties: `2·Φ(−ordersApart / √(σ_a² + σ_b²))`, with σ in decades per representative
|
|
85
|
+
* value (`sigmaDecades`, default one decade: the table's "good to about one order"; an
|
|
86
|
+
* anchor-derived value takes the default), through MathTS `normalCDF` of the negative
|
|
87
|
+
* argument so a far tail is not rounded to 0 by `1 − cdf`. It is reported BESIDE the verdict
|
|
88
|
+
* and changes no verdict: the clash threshold stays `ordersApart > maxOrders`. A small p says
|
|
89
|
+
* the two magnitudes are hard to reconcile at their stated precision; 2.9 decades at σ = 1
|
|
90
|
+
* is p ≈ 0.040, no longer a clean pass, while 3.1 decades stays a clash. NOT a credibility
|
|
91
|
+
* score: it says nothing about whether the identification is true. `null` when the gate
|
|
92
|
+
* abstained. Optional on the type; the funnel always sets it.
|
|
93
|
+
*/
|
|
94
|
+
readonly magnitudeP?: number | null;
|
|
82
95
|
/** Both endpoints had a representative value, so the magnitude gate ran. */
|
|
83
96
|
readonly magnitudeChecked: boolean;
|
|
84
97
|
/** The magnitude gate read at least one endpoint value from the graph at
|
|
@@ -247,6 +260,48 @@ export interface DiscoveryContext {
|
|
|
247
260
|
/** Resolve options and compute the candidate-invariant discovery state once.
|
|
248
261
|
* @internal */
|
|
249
262
|
export declare function buildDiscoveryContext(edges: readonly BridgeEdge[], opts: DiscoveryOptions): DiscoveryContext;
|
|
263
|
+
/** One endpoint's magnitude for the gate: its value, where it came from, and its σ in decades. */
|
|
264
|
+
interface GateMagnitude {
|
|
265
|
+
readonly value: number;
|
|
266
|
+
readonly fromAnchor: boolean;
|
|
267
|
+
readonly sigmaDecades: number;
|
|
268
|
+
}
|
|
269
|
+
/** What the magnitude gate found for one candidate. @internal */
|
|
270
|
+
export interface MagnitudeGate {
|
|
271
|
+
/** The two magnitudes, when both were found (the gate ran). */
|
|
272
|
+
readonly a: GateMagnitude | undefined;
|
|
273
|
+
readonly b: GateMagnitude | undefined;
|
|
274
|
+
readonly checked: boolean;
|
|
275
|
+
readonly usedAnchor: boolean;
|
|
276
|
+
/** `|log10|a| − log10|b||`, or null when the gate abstained. */
|
|
277
|
+
readonly ordersApart: number | null;
|
|
278
|
+
/** The verdict: `ordersApart > maxOrders`. */
|
|
279
|
+
readonly clash: boolean;
|
|
280
|
+
/** The calibrated strength `2·Φ(−orders/√(σ_a² + σ_b²))`, or null when the gate abstained. */
|
|
281
|
+
readonly p: number | null;
|
|
282
|
+
/** The endpoints with no magnitude (why the gate abstained); empty when it ran. */
|
|
283
|
+
readonly missing: readonly string[];
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The two-sided tail of a gap of `orders` decades between two values whose log10 carry
|
|
287
|
+
* standard deviations `sigmaA` and `sigmaB` decades: `2·Φ(−orders/√(σ_a² + σ_b²))`, through the
|
|
288
|
+
* NEGATIVE argument (`1 − Φ` rounds a far tail to 0; the lower tail is accurate). A strength of
|
|
289
|
+
* the falsifier, not a credibility score.
|
|
290
|
+
*
|
|
291
|
+
* @internal
|
|
292
|
+
*/
|
|
293
|
+
export declare function magnitudeStrength(orders: number, sigmaA: number, sigmaB: number): number;
|
|
294
|
+
/**
|
|
295
|
+
* The magnitude gate: an INDEPENDENT falsifier the single-anchor graph cannot make. It runs only
|
|
296
|
+
* when both endpoints have a representative value and abstains (never false-rejects) otherwise.
|
|
297
|
+
* A value comes from the sourced static table first, else — for graph-derived quantities the
|
|
298
|
+
* table omits by design (schwarzschild-radius, thermal-de-broglie-wavelength) — from the
|
|
299
|
+
* quantity's value AT THE REGISTERED ANCHOR, a definite magnitude for this run, with the default
|
|
300
|
+
* σ of one decade. The verdict is `ordersApart > ctx.maxOrders`; `p` is reported beside it.
|
|
301
|
+
*
|
|
302
|
+
* @internal
|
|
303
|
+
*/
|
|
304
|
+
export declare function magnitudeGate(candidate: LinkCandidate, ctx: DiscoveryContext): MagnitudeGate;
|
|
250
305
|
/**
|
|
251
306
|
* Vet one link candidate by hypothesizing the identification a≡b and
|
|
252
307
|
* measuring its structural and numerical consequences. See module docs.
|
|
@@ -272,4 +327,5 @@ export declare function vetInContext(edges: readonly BridgeEdge[], candidate: Li
|
|
|
272
327
|
* @public
|
|
273
328
|
*/
|
|
274
329
|
export declare function rankDiscoveries(edges: readonly BridgeEdge[], opts?: DiscoveryOptions): VettedCandidate[];
|
|
330
|
+
export {};
|
|
275
331
|
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/composition/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/composition/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAYtE;4DAC4D;AAC5D,eAAO,MAAM,2BAA2B,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAE7E,CAAC;AA+BF,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAA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