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":"graph-viz.js","sourceRoot":"","sources":["../../src/composition/graph-viz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,w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QACpE,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,QAAQ,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,iBAAiB,CAAC;IAE9C,OAAO;QACL,SAAS;QACT,QAAQ;QACR,WAAW;QACX,YAAY;QACZ,SAAS,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC;QACjE,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC;KAC1D,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Physics-map visualization — turn the composition hypergraph into Mermaid and\n * Graphviz-DOT **source text**.\n *\n * The graph is bipartite in the drawing: round nodes are *quantities*\n * (`mass`, `temperature`, …) and box nodes are *equations* — laws, bridges, or\n * proposed relations — each an n-ary junction (its source quantities point in,\n * its target points out). This makes \"equations as junctions\" literal and draws\n * n-ary edges faithfully (a single Mermaid/DOT edge can only connect two nodes).\n *\n * The model computes its own connected components over the junctions — so a\n * `--proposed` overlay participates in the clustering — and groups each component\n * into its own subgraph so the genuinely disjointed map stays legible. For the\n * pure-`BridgeEdge` case the component count matches the authoritative\n * {@link linkageMap} (pinned by a drift-guard test).\n *\n * Pure string production: no file I/O (the CLI is the only file-touching layer).\n *\n * @module composition/graph-viz\n */\n\nimport type { BridgeEdge } from './edge.js';\nimport { QUANTITY_IDENTIFICATIONS } from './compose.js';\nimport type { EvidenceTag, RelationType } from '../relations/types.js';\n\n/**\n * Epistemic status of a junction — drives node colour/shape. Bridges carry\n * their catalog confidence; `law` is a diagonal/established-physics edge;\n * `proposed` is a machine-derived, unadjudicated relation (rendered quarantined).\n *\n * @public\n */\nexport type VizStatus =\n | 'law'\n | 'established'\n | 'speculative'\n | 'highly-speculative'\n | 'proposed'\n | 'user'\n | 'poster'\n | 'association';\n\n/**\n * Every `VizStatus`, as VALUES.\n *\n * Exists so the union can be pinned at RUNTIME. `VizStatus` is a type: the\n * public-surface test pins its NAME and nothing pins its MEMBERS, so widening\n * it is invisible to every existing test. This array is what the three places\n * a status must be registered are checked against — `STATUS_STYLE` (a compile\n * error when incomplete), `STATUSES_IN_ORDER` (a plain array that would\n * SILENTLY omit a Mermaid `classDef`), and the published surface.\n *\n * @internal\n */\nexport const ALL_VIZ_STATUSES: readonly VizStatus[] = [\n 'law',\n 'established',\n 'speculative',\n 'highly-speculative',\n 'proposed',\n 'user',\n 'poster',\n 'association',\n];\n\n/**\n * A normalized equation junction: n source quantities → 1 target. The render\n * model's unit of \"equation\", decoupled from both `BridgeEdge` and the internal\n * `ProposedBridge` type (the CLI converts each into this shape).\n *\n * @public\n */\nexport interface VizJunction {\n /** Graph id, e.g. `'be-42'` or `'IC-…'`. */\n readonly id: string;\n /** Short human label. */\n readonly label: string;\n readonly status: VizStatus;\n /** Source quantity names. */\n readonly sources: readonly string[];\n /** Target quantity name. */\n readonly target: string;\n /**\n * The Atlas Phase 1 relation TYPE this junction's edge records, when one was\n * recorded. Absent means \"nobody has audited this edge\", which is a\n * different statement from \"this edge is not an approximation\" — the\n * filtering in {@link buildVizModel} keeps the two apart and counts them\n * separately.\n */\n readonly relation?: RelationType;\n /**\n * The catalog id this junction's edge cross-references, when it has one.\n * Carried so evidence can be DERIVED at read time; no evidence tag is ever\n * stored on a junction.\n */\n readonly beId?: number | null;\n}\n\n/**\n * Why junctions were left out of a filtered map.\n *\n * The two dropped counts are SEPARATE on purpose. An edge dropped for not\n * matching the filter answered the question; an edge dropped for carrying no\n * overlay never got asked. Folding them together would let an unaudited graph\n * render as a complete answer to a question nobody could put to it.\n *\n * @public\n */\nexport interface VizFilterStats {\n /** Junctions considered, before filtering. */\n readonly total: number;\n /** Junctions rendered. */\n readonly kept: number;\n /** Dropped because their recorded metadata did not match the filter. */\n readonly droppedNotMatching: number;\n /** Dropped because they carry no metadata the filter could read. */\n readonly droppedMissingMetadata: number;\n /** The `relation` filter in force, if any. */\n readonly relation?: RelationType;\n /** The `evidence` filter in force, if any. */\n readonly evidence?: EvidenceTag;\n}\n\n/**\n * One connected component of the bipartite graph.\n *\n * @public\n */\nexport interface VizCluster {\n /** Junction ids in this component. */\n readonly junctionIds: readonly string[];\n /** Distinct (canonical) quantity names touched by this component. */\n readonly quantities: readonly string[];\n /** Number of junctions (the cluster \"size\", matching `linkageMap`). */\n readonly size: number;\n /** Contains a `law`/`established` junction (anchored to known physics). */\n readonly anchored: boolean;\n}\n\n/**\n * Options for {@link buildVizModel}.\n *\n * @public\n */\nexport interface VizOptions {\n /** Diagram title (used as the graph label). */\n readonly title?: string;\n /** Already-normalized extra junctions to overlay (e.g. proposed relations). */\n readonly extraJunctions?: readonly VizJunction[];\n /**\n * Keep only junctions whose recorded relation is this type.\n *\n * ⚠ Setting ANY filter changes what a missing overlay MEANS. Unfiltered, an\n * edge with no `relation` is kept — the map is about connectivity and an\n * unaudited edge still connects. Filtered, it is dropped, because it cannot\n * be shown to satisfy the filter. The count of those drops is reported\n * separately in {@link VizFilterStats} and printed in the legend.\n */\n readonly relation?: RelationType;\n /**\n * Keep only junctions whose DERIVED evidence set contains this tag.\n *\n * Evidence is never stored. It is derived from the catalog row named by the\n * junction's `beId`, every time it is asked for; a junction with no numeric\n * `beId` cannot be evaluated and counts as LACKING metadata, not as\n * non-matching.\n */\n readonly evidence?: EvidenceTag;\n /**\n * The derivation used when `evidence` is set. The catalog derivation lives\n * with the CLI (`cli/map-evidence.ts`), which passes it. This module does\n * not import that derivation. A junction with a numeric `beId` and no\n * function here cannot be evaluated, and the filter throws rather than\n * rendering an unfiltered map as a filtered one. A junction with no numeric\n * `beId` is lacking metadata and does not call the function.\n */\n readonly deriveEvidence?: (beId: number) => ReadonlySet<EvidenceTag>;\n}\n\n/**\n * The render model: normalized junctions, their connected components, and the\n * two serializers.\n *\n * @public\n */\nexport interface VizModel {\n readonly junctions: readonly VizJunction[];\n readonly clusters: readonly VizCluster[];\n /** What filtering did. Present even when no filter was set (all kept). */\n readonly filterStats: VizFilterStats;\n /** One-line legend describing the filter, or `null` when none is in force. */\n readonly filterLegend: string | null;\n toMermaid(): string;\n toDot(): string;\n}\n\n/** Fill colour + dashed flag per status. Tweak here to restyle the whole map. */\nconst STATUS_STYLE: Readonly<\n Record<VizStatus, { readonly fill: string; readonly stroke: string; readonly dashed: boolean }>\n> = {\n law: { fill: '#cfe3f7', stroke: '#3a6ea5', dashed: false }, // textbook law — blue\n established: { fill: '#cde7d3', stroke: '#3f8f5b', dashed: false }, // solid bridge — green\n speculative: { fill: '#fdebc8', stroke: '#c9881b', dashed: false }, // amber\n 'highly-speculative': { fill: '#f5c6c6', stroke: '#c0392b', dashed: false }, // red\n proposed: { fill: '#e6e6e6', stroke: '#888888', dashed: true }, // unadjudicated — grey dashed\n user: { fill: '#e9d8fd', stroke: '#6b46c1', dashed: false }, // user-supplied — violet\n // Poster index (Atlas Phase 3). A derivation is a SOLID box: it is a stated\n // claim with a recorded relation, not an unadjudicated guess like `proposed`.\n poster: { fill: '#dbe7ff', stroke: '#4c6ef5', dashed: false }, // indigo\n // An association is DASHED because it asserts no relation at all\n // (`atlas/association.ts`): the dash is the only thing in the drawing that\n // says \"this line is a resemblance, not a claim\". Do not make it solid.\n association: { fill: '#f3f0e7', stroke: '#8d7b4f', dashed: true }, // khaki dashed\n};\n\n/** Map a `BridgeEdge` to a `VizJunction` (raw quantity names).\n *\n * The display label is the compact catalog id (`BE-<n>`) when the edge is\n * catalog-backed, else the edge's own label — a *map* reads better with short\n * junction names; the full formula stays in the catalog. */\nexport function edgeToJunction(edge: BridgeEdge): VizJunction {\n const status: VizStatus = edge.kind === 'law' ? 'law' : edge.confidence;\n return {\n id: edge.id,\n label: edge.beId != null ? `BE-${edge.beId}` : edge.label,\n status,\n sources: edge.sources.map((s) => s.name),\n target: edge.target.name,\n ...(edge.relation ? { relation: edge.relation.type } : {}),\n beId: edge.beId,\n };\n}\n\n/** How one junction fared against the filters. */\ntype FilterVerdict = 'keep' | 'not-matching' | 'missing-metadata';\n\n/** The overlay a filter reads off a junction or an edge. */\ninterface OverlayView {\n readonly relation?: RelationType;\n readonly beId?: number | null;\n}\n\nfunction judge(\n item: OverlayView,\n opts: Pick<VizOptions, 'relation' | 'evidence' | 'deriveEvidence'>,\n): FilterVerdict {\n if (opts.relation !== undefined) {\n if (item.relation === undefined) return 'missing-metadata';\n if (item.relation !== opts.relation) return 'not-matching';\n }\n if (opts.evidence !== undefined) {\n if (item.beId == null) return 'missing-metadata';\n const derive = opts.deriveEvidence;\n if (derive === undefined) {\n throw new Error(\n 'evidence filter has no deriveEvidence function; catalog derivation is not in this module',\n );\n }\n if (!derive(item.beId).has(opts.evidence)) return 'not-matching';\n }\n return 'keep';\n}\n\n/**\n * Apply the same filters `buildVizModel` applies, to a raw edge list — so the\n * TEXT map and the visual map can never disagree about what a filter selects.\n *\n * @internal — CLI support, reached through `src/cli-api.ts`.\n */\nexport function filterEdges(\n edges: readonly BridgeEdge[],\n opts: Pick<VizOptions, 'relation' | 'evidence' | 'deriveEvidence'>,\n): { readonly kept: BridgeEdge[]; readonly stats: VizFilterStats } {\n const kept: BridgeEdge[] = [];\n let droppedNotMatching = 0;\n let droppedMissingMetadata = 0;\n for (const e of edges) {\n switch (judge({ relation: e.relation?.type, beId: e.beId }, opts)) {\n case 'keep':\n kept.push(e);\n break;\n case 'not-matching':\n droppedNotMatching += 1;\n break;\n case 'missing-metadata':\n droppedMissingMetadata += 1;\n break;\n }\n }\n return {\n kept,\n stats: {\n total: edges.length,\n kept: kept.length,\n droppedNotMatching,\n droppedMissingMetadata,\n ...(opts.relation !== undefined ? { relation: opts.relation } : {}),\n ...(opts.evidence !== undefined ? { evidence: opts.evidence } : {}),\n },\n };\n}\n\n/**\n * The legend line. It always states the lacking-metadata count, including when\n * it is zero: a printed `0` says the graph was checked and nothing was hidden,\n * whereas an omitted line says nothing at all.\n *\n * @internal — CLI support, reached through `src/cli-api.ts`.\n */\nexport function formatFilterLegend(stats: VizFilterStats): string | null {\n const terms: string[] = [];\n if (stats.relation !== undefined) terms.push(`relation=${stats.relation}`);\n if (stats.evidence !== undefined) terms.push(`evidence=${stats.evidence}`);\n if (terms.length === 0) return null;\n return (\n `filter: ${terms.join(' ')} — ${stats.kept} of ${stats.total} kept; ` +\n `${stats.droppedNotMatching} dropped (did not match); ` +\n `${stats.droppedMissingMetadata} dropped (no overlay metadata)`\n );\n}\n\n/** Quantity-name canonicalizer from `QUANTITY_IDENTIFICATIONS` (matches `linkageMap`). */\nfunction makeCanon(): (name: string) => string {\n const alias = new Map(QUANTITY_IDENTIFICATIONS.map((id) => [id.from, id.to]));\n return (n) => alias.get(n) ?? n;\n}\n\n/** Distinct canonical quantity names of a junction (sources ∪ target). */\nfunction quantitiesOf(j: VizJunction): string[] {\n return [...new Set([...j.sources, j.target])];\n}\n\n/** Union-find component grouping of junctions sharing a (canonical) quantity. */\nfunction componentsOf(junctions: readonly VizJunction[]): VizCluster[] {\n const parent = junctions.map((_, i) => i);\n const find = (x: number): number =>\n parent[x] === x ? x : (parent[x] = find(parent[x]));\n const union = (a: number, b: number): void => {\n parent[find(a)] = find(b);\n };\n\n const qToJunctions = new Map<string, number[]>();\n junctions.forEach((j, i) => {\n for (const qty of quantitiesOf(j)) {\n const arr = qToJunctions.get(qty) ?? [];\n arr.push(i);\n qToJunctions.set(qty, arr);\n }\n });\n for (const idxs of qToJunctions.values()) {\n for (let k = 1; k < idxs.length; k++) union(idxs[0], idxs[k]);\n }\n\n const groups = new Map<number, number[]>();\n junctions.forEach((_, i) => {\n const r = find(i);\n const arr = groups.get(r) ?? [];\n arr.push(i);\n groups.set(r, arr);\n });\n\n const clusters = [...groups.values()].map((idxs): VizCluster => {\n const js = idxs.map((i) => junctions[i]);\n const quantities = [...new Set(js.flatMap(quantitiesOf))].sort();\n return {\n junctionIds: js.map((j) => j.id),\n quantities,\n size: js.length,\n // DELIBERATE: only `law` and `established` anchor. A `poster`,\n // `association`, `proposed` or `user` junction never does — the poster\n // index maps claims and their supports, it does not assert that any of\n // them is textbook physics. Widening this would make an unanchored\n // cluster read as anchored the moment a poster overlay touched it.\n anchored: js.some((j) => j.status === 'law' || j.status === 'established'),\n };\n });\n // Deterministic: largest first, then by first junction id.\n clusters.sort(\n (a, b) => b.size - a.size || a.junctionIds[0].localeCompare(b.junctionIds[0]),\n );\n return clusters;\n}\n\n/** A stable, collision-free id factory mapping arbitrary keys to safe ids. */\nfunction idFactory(prefix: string): (key: string) => string {\n const seen = new Map<string, string>();\n const used = new Set<string>();\n return (key) => {\n const cached = seen.get(key);\n if (cached) return cached;\n const base = `${prefix}_${key.replace(/[^A-Za-z0-9]/g, '_')}`;\n let id = base;\n let n = 1;\n while (used.has(id)) id = `${base}_${n++}`;\n used.add(id);\n seen.set(key, id);\n return id;\n };\n}\n\n/** Escape a label for Mermaid `[\"…\"]` — XML-entity-encode the characters that\n * break the quoted form or are read as entities (`&`, `\"`, `<`, `>`). */\nconst mmLabel = (s: string): string =>\n s\n .replace(/\\r\\n|\\r|\\n/g, ' ')\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n/** Escape a label for a DOT double-quoted string. */\nconst dotLabel = (s: string): string =>\n s.replace(/\\r\\n|\\r|\\n/g, ' ').replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n\n/**\n * Mermaid `classDef` emission order.\n *\n * ⚠ A plain array, so a status MISSING here does not fail to compile — it\n * silently omits that status's `classDef` and the node renders unstyled. That\n * is why `ALL_VIZ_STATUSES` exists and why a test compares the two sets.\n */\nconst STATUSES_IN_ORDER: readonly VizStatus[] = [\n 'law',\n 'established',\n 'speculative',\n 'highly-speculative',\n 'proposed',\n 'user',\n 'poster',\n 'association',\n];\n\n/**\n * Drive a format-specific cluster renderer over the standard layout, identical\n * for both emitters: multi-junction components first (each its own subgraph,\n * keyed `0`,`1`,…, labelled `anchored cluster (n)` / `cluster (n)`), then a\n * single `iso` subgraph collecting all singletons. The callback owns all\n * per-format string production; this owns only the traversal and labelling.\n */\nfunction forEachClusterGroup(\n clusters: readonly VizCluster[],\n renderCluster: (label: string, junctionIds: readonly string[], key: string) => void,\n): void {\n const multi = clusters.filter((c) => c.size > 1);\n const singletons = clusters.filter((c) => c.size === 1);\n multi.forEach((c, i) =>\n renderCluster(`${c.anchored ? 'anchored ' : ''}cluster (${c.size})`, c.junctionIds, String(i)),\n );\n if (singletons.length) {\n renderCluster(\n `isolated (${singletons.length})`,\n singletons.flatMap((c) => c.junctionIds),\n 'iso',\n );\n }\n}\n\nfunction emitMermaid(\n clusters: readonly VizCluster[],\n byId: ReadonlyMap<string, VizJunction>,\n title: string,\n legend: string | null,\n): string {\n const qid = idFactory('q');\n const jid = idFactory('j');\n const usedStatuses = new Set<VizStatus>();\n const out: string[] = [`flowchart LR`, `%% ${title}`];\n // The legend is a comment AND a rendered node: a comment alone disappears in\n // every renderer, and a filtered map that does not say it is filtered reads\n // as the whole graph.\n if (legend !== null) out.push(`%% ${legend}`);\n\n const renderCluster = (label: string, junctionIds: readonly string[], key: string): void => {\n out.push(` subgraph cl_${key}[\"${mmLabel(label)}\"]`);\n out.push(` direction LR`);\n const declared = new Set<string>();\n const declareQ = (name: string): string => {\n const id = qid(name);\n if (!declared.has(id)) {\n out.push(` ${id}([\"${mmLabel(name)}\"]):::qty`);\n declared.add(id);\n }\n return id;\n };\n for (const id of junctionIds) {\n const j = byId.get(id)!;\n usedStatuses.add(j.status);\n const jId = jid(j.id);\n out.push(` ${jId}[\"${mmLabel(j.label)}\"]:::${j.status}`);\n for (const s of j.sources) out.push(` ${declareQ(s)} --> ${jId}`);\n out.push(` ${jId} --> ${declareQ(j.target)}`);\n }\n out.push(` end`);\n };\n\n forEachClusterGroup(clusters, renderCluster);\n\n if (legend !== null) out.push(` legend[\"${mmLabel(legend)}\"]:::legend`);\n\n for (const st of STATUSES_IN_ORDER) {\n if (!usedStatuses.has(st)) continue;\n const { fill, stroke, dashed } = STATUS_STYLE[st];\n out.push(\n ` classDef ${st} fill:${fill},stroke:${stroke}${dashed ? ',stroke-dasharray:4 3' : ''}`,\n );\n }\n out.push(` classDef qty fill:#ffffff,stroke:#999999`);\n if (legend !== null) out.push(` classDef legend fill:#ffffff,stroke:#333333`);\n return out.join('\\n') + '\\n';\n}\n\nfunction emitDot(\n clusters: readonly VizCluster[],\n byId: ReadonlyMap<string, VizJunction>,\n title: string,\n legend: string | null,\n): string {\n const qid = idFactory('q');\n const jid = idFactory('j');\n const out: string[] = [\n `digraph PhysicsMap {`,\n // DOT's label is a single quoted string and `dotLabel` collapses newlines,\n // so the legend joins the title on one line rather than being dropped.\n ` label=\"${dotLabel(legend === null ? title : `${title} — ${legend}`)}\";`,\n ` rankdir=LR;`,\n ` node [fontname=\"Helvetica\"];`,\n ];\n\n const renderCluster = (label: string, junctionIds: readonly string[], key: string): void => {\n out.push(` subgraph cluster_${key} {`);\n out.push(` label=\"${dotLabel(label)}\";`);\n const declared = new Set<string>();\n const declareQ = (name: string): string => {\n const id = qid(name);\n if (!declared.has(id)) {\n out.push(` ${id} [shape=ellipse,label=\"${dotLabel(name)}\"];`);\n declared.add(id);\n }\n return id;\n };\n for (const id of junctionIds) {\n const j = byId.get(id)!;\n const jId = jid(j.id);\n const { fill, stroke, dashed } = STATUS_STYLE[j.status];\n const style = dashed ? 'filled,dashed' : 'filled';\n out.push(\n ` ${jId} [shape=box,style=\"${style}\",fillcolor=\"${fill}\",color=\"${stroke}\",label=\"${dotLabel(\n j.label,\n )}\"];`,\n );\n for (const s of j.sources) out.push(` ${declareQ(s)} -> ${jId};`);\n out.push(` ${jId} -> ${declareQ(j.target)};`);\n }\n out.push(` }`);\n };\n\n forEachClusterGroup(clusters, renderCluster);\n out.push(`}`);\n return out.join('\\n') + '\\n';\n}\n\n/**\n * Build the bipartite, clustered render model from a graph (+ optional overlay).\n * Quantity names are canonicalized via `QUANTITY_IDENTIFICATIONS` so the\n * clustering matches the authoritative {@link linkageMap}.\n *\n * @public\n */\nexport function buildVizModel(\n edges: readonly BridgeEdge[],\n opts: VizOptions = {},\n): VizModel {\n const canon = makeCanon();\n const normalize = (j: VizJunction): VizJunction => ({\n ...j,\n sources: j.sources.map(canon),\n target: canon(j.target),\n });\n const all: VizJunction[] = [\n ...edges.map((e) => normalize(edgeToJunction(e))),\n ...(opts.extraJunctions ?? []).map(normalize),\n ];\n // Filtering is applied to the OVERLAY junctions too. A proposed or\n // user-supplied junction carries no relation and no beId, so a filtered map\n // drops it as lacking metadata — the same rule as any other edge, and the\n // count says so out loud rather than letting the overlay vanish quietly.\n const junctions: VizJunction[] = [];\n let droppedNotMatching = 0;\n let droppedMissingMetadata = 0;\n for (const j of all) {\n switch (judge(j, opts)) {\n case 'keep':\n junctions.push(j);\n break;\n case 'not-matching':\n droppedNotMatching += 1;\n break;\n case 'missing-metadata':\n droppedMissingMetadata += 1;\n break;\n }\n }\n const filterStats: VizFilterStats = {\n total: all.length,\n kept: junctions.length,\n droppedNotMatching,\n droppedMissingMetadata,\n ...(opts.relation !== undefined ? { relation: opts.relation } : {}),\n ...(opts.evidence !== undefined ? { evidence: opts.evidence } : {}),\n };\n const filterLegend = formatFilterLegend(filterStats);\n // A duplicate junction id (e.g. a proposed overlay colliding with an edge id)\n // would silently drop one from the rendered output — make it a loud error.\n const byId = new Map<string, VizJunction>();\n for (const j of junctions) {\n if (byId.has(j.id)) {\n throw new Error(`buildVizModel: duplicate junction id '${j.id}'`);\n }\n byId.set(j.id, j);\n }\n const clusters = componentsOf(junctions);\n const title = opts.title ?? 'UPT physics map';\n\n return {\n junctions,\n clusters,\n filterStats,\n filterLegend,\n toMermaid: () => emitMermaid(clusters, byId, title, filterLegend),\n toDot: () => emitDot(clusters, byId, title, filterLegend),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"graph-viz.js","sourceRoot":"","sources":["../../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AC,CAAC,CAAC,EAAE,CAAC;KACpE,CAAC;IACF,MAAM,YAAY,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACrD,8EAA8E;IAC9E,2EAA2E;IAC3E,MAAM,IAAI,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC5C,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;QAC1B,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,QAAQ,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,iBAAiB,CAAC;IAE9C,OAAO;QACL,SAAS;QACT,QAAQ;QACR,WAAW;QACX,YAAY;QACZ,SAAS,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC;QACjE,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC;KAC1D,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Physics-map visualization — turn the composition hypergraph into Mermaid and\n * Graphviz-DOT **source text**.\n *\n * The graph is bipartite in the drawing: round nodes are *quantities*\n * (`mass`, `temperature`, …) and box nodes are *equations* — laws, bridges, or\n * proposed relations — each an n-ary junction (its source quantities point in,\n * its target points out). This makes \"equations as junctions\" literal and draws\n * n-ary edges faithfully (a single Mermaid/DOT edge can only connect two nodes).\n *\n * The model computes its own connected components over the junctions — so a\n * `--proposed` overlay participates in the clustering — and groups each component\n * into its own subgraph so the genuinely disjointed map stays legible. For the\n * pure-`BridgeEdge` case the component count matches the authoritative\n * {@link linkageMap} (pinned by a drift-guard test).\n *\n * Pure string production: no file I/O (the CLI is the only file-touching layer).\n *\n * @module composition/graph-viz\n */\n\nimport type { BridgeEdge } from './edge.js';\nimport { clusterBySharedKeys, quantityCanonicalizer } from './quantity-clusters.js';\nimport type { EvidenceTag, RelationType } from '../relations/types.js';\n\n/**\n * Epistemic status of a junction — drives node colour/shape. Bridges carry\n * their catalog confidence; `law` is a diagonal/established-physics edge;\n * `proposed` is a machine-derived, unadjudicated relation (rendered quarantined).\n *\n * @public\n */\nexport type VizStatus =\n | 'law'\n | 'established'\n | 'speculative'\n | 'highly-speculative'\n | 'proposed'\n | 'user'\n | 'poster'\n | 'association';\n\n/**\n * Every `VizStatus`, as VALUES.\n *\n * Exists so the union can be pinned at RUNTIME. `VizStatus` is a type: the\n * public-surface test pins its NAME and nothing pins its MEMBERS, so widening\n * it is invisible to every existing test. This array is what the three places\n * a status must be registered are checked against — `STATUS_STYLE` (a compile\n * error when incomplete), `STATUSES_IN_ORDER` (a plain array that would\n * SILENTLY omit a Mermaid `classDef`), and the published surface.\n *\n * @internal\n */\nexport const ALL_VIZ_STATUSES: readonly VizStatus[] = [\n 'law',\n 'established',\n 'speculative',\n 'highly-speculative',\n 'proposed',\n 'user',\n 'poster',\n 'association',\n];\n\n/**\n * A normalized equation junction: n source quantities → 1 target. The render\n * model's unit of \"equation\", decoupled from both `BridgeEdge` and the internal\n * `ProposedBridge` type (the CLI converts each into this shape).\n *\n * @public\n */\nexport interface VizJunction {\n /** Graph id, e.g. `'be-42'` or `'IC-…'`. */\n readonly id: string;\n /** Short human label. */\n readonly label: string;\n readonly status: VizStatus;\n /** Source quantity names. */\n readonly sources: readonly string[];\n /** Target quantity name. */\n readonly target: string;\n /**\n * The Atlas Phase 1 relation TYPE this junction's edge records, when one was\n * recorded. Absent means \"nobody has audited this edge\", which is a\n * different statement from \"this edge is not an approximation\" — the\n * filtering in {@link buildVizModel} keeps the two apart and counts them\n * separately.\n */\n readonly relation?: RelationType;\n /**\n * The catalog id this junction's edge cross-references, when it has one.\n * Carried so evidence can be DERIVED at read time; no evidence tag is ever\n * stored on a junction.\n */\n readonly beId?: number | null;\n}\n\n/**\n * Why junctions were left out of a filtered map.\n *\n * The two dropped counts are SEPARATE on purpose. An edge dropped for not\n * matching the filter answered the question; an edge dropped for carrying no\n * overlay never got asked. Folding them together would let an unaudited graph\n * render as a complete answer to a question nobody could put to it.\n *\n * @public\n */\nexport interface VizFilterStats {\n /** Junctions considered, before filtering. */\n readonly total: number;\n /** Junctions rendered. */\n readonly kept: number;\n /** Dropped because their recorded metadata did not match the filter. */\n readonly droppedNotMatching: number;\n /** Dropped because they carry no metadata the filter could read. */\n readonly droppedMissingMetadata: number;\n /** The `relation` filter in force, if any. */\n readonly relation?: RelationType;\n /** The `evidence` filter in force, if any. */\n readonly evidence?: EvidenceTag;\n}\n\n/**\n * One connected component of the bipartite graph.\n *\n * @public\n */\nexport interface VizCluster {\n /** Junction ids in this component. */\n readonly junctionIds: readonly string[];\n /** Distinct (canonical) quantity names touched by this component. */\n readonly quantities: readonly string[];\n /** Number of junctions (the cluster \"size\", matching `linkageMap`). */\n readonly size: number;\n /** Contains a `law`/`established` junction (anchored to known physics). */\n readonly anchored: boolean;\n}\n\n/**\n * Options for {@link buildVizModel}.\n *\n * @public\n */\nexport interface VizOptions {\n /** Diagram title (used as the graph label). */\n readonly title?: string;\n /** Already-normalized extra junctions to overlay (e.g. proposed relations). */\n readonly extraJunctions?: readonly VizJunction[];\n /**\n * Keep only junctions whose recorded relation is this type.\n *\n * ⚠ Setting ANY filter changes what a missing overlay MEANS. Unfiltered, an\n * edge with no `relation` is kept — the map is about connectivity and an\n * unaudited edge still connects. Filtered, it is dropped, because it cannot\n * be shown to satisfy the filter. The count of those drops is reported\n * separately in {@link VizFilterStats} and printed in the legend.\n */\n readonly relation?: RelationType;\n /**\n * Keep only junctions whose DERIVED evidence set contains this tag.\n *\n * Evidence is never stored. It is derived from the catalog row named by the\n * junction's `beId`, every time it is asked for; a junction with no numeric\n * `beId` cannot be evaluated and counts as LACKING metadata, not as\n * non-matching.\n */\n readonly evidence?: EvidenceTag;\n /**\n * The derivation used when `evidence` is set. The catalog derivation lives\n * with the CLI (`cli/map-evidence.ts`), which passes it. This module does\n * not import that derivation. A junction with a numeric `beId` and no\n * function here cannot be evaluated, and the filter throws rather than\n * rendering an unfiltered map as a filtered one. A junction with no numeric\n * `beId` is lacking metadata and does not call the function.\n */\n readonly deriveEvidence?: (beId: number) => ReadonlySet<EvidenceTag>;\n}\n\n/**\n * The render model: normalized junctions, their connected components, and the\n * two serializers.\n *\n * @public\n */\nexport interface VizModel {\n readonly junctions: readonly VizJunction[];\n readonly clusters: readonly VizCluster[];\n /** What filtering did. Present even when no filter was set (all kept). */\n readonly filterStats: VizFilterStats;\n /** One-line legend describing the filter, or `null` when none is in force. */\n readonly filterLegend: string | null;\n toMermaid(): string;\n toDot(): string;\n}\n\n/** Fill colour + dashed flag per status. Tweak here to restyle the whole map. */\nconst STATUS_STYLE: Readonly<\n Record<VizStatus, { readonly fill: string; readonly stroke: string; readonly dashed: boolean }>\n> = {\n law: { fill: '#cfe3f7', stroke: '#3a6ea5', dashed: false }, // textbook law — blue\n established: { fill: '#cde7d3', stroke: '#3f8f5b', dashed: false }, // solid bridge — green\n speculative: { fill: '#fdebc8', stroke: '#c9881b', dashed: false }, // amber\n 'highly-speculative': { fill: '#f5c6c6', stroke: '#c0392b', dashed: false }, // red\n proposed: { fill: '#e6e6e6', stroke: '#888888', dashed: true }, // unadjudicated — grey dashed\n user: { fill: '#e9d8fd', stroke: '#6b46c1', dashed: false }, // user-supplied — violet\n // Poster index (Atlas Phase 3). A derivation is a SOLID box: it is a stated\n // claim with a recorded relation, not an unadjudicated guess like `proposed`.\n poster: { fill: '#dbe7ff', stroke: '#4c6ef5', dashed: false }, // indigo\n // An association is DASHED because it asserts no relation at all\n // (`atlas/association.ts`): the dash is the only thing in the drawing that\n // says \"this line is a resemblance, not a claim\". Do not make it solid.\n association: { fill: '#f3f0e7', stroke: '#8d7b4f', dashed: true }, // khaki dashed\n};\n\n/** Map a `BridgeEdge` to a `VizJunction` (raw quantity names).\n *\n * The display label is the compact catalog id (`BE-<n>`) when the edge is\n * catalog-backed, else the edge's own label — a *map* reads better with short\n * junction names; the full formula stays in the catalog. */\nexport function edgeToJunction(edge: BridgeEdge): VizJunction {\n const status: VizStatus = edge.kind === 'law' ? 'law' : edge.confidence;\n return {\n id: edge.id,\n label: edge.beId != null ? `BE-${edge.beId}` : edge.label,\n status,\n sources: edge.sources.map((s) => s.name),\n target: edge.target.name,\n ...(edge.relation ? { relation: edge.relation.type } : {}),\n beId: edge.beId,\n };\n}\n\n/** How one junction fared against the filters. */\ntype FilterVerdict = 'keep' | 'not-matching' | 'missing-metadata';\n\n/** The overlay a filter reads off a junction or an edge. */\ninterface OverlayView {\n readonly relation?: RelationType;\n readonly beId?: number | null;\n}\n\nfunction judge(\n item: OverlayView,\n opts: Pick<VizOptions, 'relation' | 'evidence' | 'deriveEvidence'>,\n): FilterVerdict {\n if (opts.relation !== undefined) {\n if (item.relation === undefined) return 'missing-metadata';\n if (item.relation !== opts.relation) return 'not-matching';\n }\n if (opts.evidence !== undefined) {\n if (item.beId == null) return 'missing-metadata';\n const derive = opts.deriveEvidence;\n if (derive === undefined) {\n throw new Error(\n 'evidence filter has no deriveEvidence function; catalog derivation is not in this module',\n );\n }\n if (!derive(item.beId).has(opts.evidence)) return 'not-matching';\n }\n return 'keep';\n}\n\n/**\n * Apply the same filters `buildVizModel` applies, to a raw edge list — so the\n * TEXT map and the visual map can never disagree about what a filter selects.\n *\n * @internal — CLI support, reached through `src/cli-api.ts`.\n */\nexport function filterEdges(\n edges: readonly BridgeEdge[],\n opts: Pick<VizOptions, 'relation' | 'evidence' | 'deriveEvidence'>,\n): { readonly kept: BridgeEdge[]; readonly stats: VizFilterStats } {\n const kept: BridgeEdge[] = [];\n let droppedNotMatching = 0;\n let droppedMissingMetadata = 0;\n for (const e of edges) {\n switch (judge({ relation: e.relation?.type, beId: e.beId }, opts)) {\n case 'keep':\n kept.push(e);\n break;\n case 'not-matching':\n droppedNotMatching += 1;\n break;\n case 'missing-metadata':\n droppedMissingMetadata += 1;\n break;\n }\n }\n return {\n kept,\n stats: {\n total: edges.length,\n kept: kept.length,\n droppedNotMatching,\n droppedMissingMetadata,\n ...(opts.relation !== undefined ? { relation: opts.relation } : {}),\n ...(opts.evidence !== undefined ? { evidence: opts.evidence } : {}),\n },\n };\n}\n\n/**\n * The legend line. It always states the lacking-metadata count, including when\n * it is zero: a printed `0` says the graph was checked and nothing was hidden,\n * whereas an omitted line says nothing at all.\n *\n * @internal — CLI support, reached through `src/cli-api.ts`.\n */\nexport function formatFilterLegend(stats: VizFilterStats): string | null {\n const terms: string[] = [];\n if (stats.relation !== undefined) terms.push(`relation=${stats.relation}`);\n if (stats.evidence !== undefined) terms.push(`evidence=${stats.evidence}`);\n if (terms.length === 0) return null;\n return (\n `filter: ${terms.join(' ')} — ${stats.kept} of ${stats.total} kept; ` +\n `${stats.droppedNotMatching} dropped (did not match); ` +\n `${stats.droppedMissingMetadata} dropped (no overlay metadata)`\n );\n}\n\n/** Distinct canonical quantity names of a junction (sources ∪ target). */\nfunction quantitiesOf(j: VizJunction): string[] {\n return [...new Set([...j.sources, j.target])];\n}\n\n/**\n * Component grouping of junctions sharing a (canonical) quantity: the shared partition of\n * `quantity-clusters.ts`, in the order the map always drew (largest first, then by first\n * junction id; input order inside). The anchoring rule below is this module's own.\n */\nfunction componentsOf(junctions: readonly VizJunction[]): VizCluster[] {\n return clusterBySharedKeys(junctions, quantitiesOf, (j) => j.id).map((js): VizCluster => {\n const quantities = [...new Set(js.flatMap(quantitiesOf))].sort();\n return {\n junctionIds: js.map((j) => j.id),\n quantities,\n size: js.length,\n // DELIBERATE: only `law` and `established` anchor. A `poster`,\n // `association`, `proposed` or `user` junction never does — the poster\n // index maps claims and their supports, it does not assert that any of\n // them is textbook physics. Widening this would make an unanchored\n // cluster read as anchored the moment a poster overlay touched it.\n anchored: js.some((j) => j.status === 'law' || j.status === 'established'),\n };\n });\n}\n\n/** A stable, collision-free id factory mapping arbitrary keys to safe ids. */\nfunction idFactory(prefix: string): (key: string) => string {\n const seen = new Map<string, string>();\n const used = new Set<string>();\n return (key) => {\n const cached = seen.get(key);\n if (cached) return cached;\n const base = `${prefix}_${key.replace(/[^A-Za-z0-9]/g, '_')}`;\n let id = base;\n let n = 1;\n while (used.has(id)) id = `${base}_${n++}`;\n used.add(id);\n seen.set(key, id);\n return id;\n };\n}\n\n/** Escape a label for Mermaid `[\"…\"]` — XML-entity-encode the characters that\n * break the quoted form or are read as entities (`&`, `\"`, `<`, `>`). */\nconst mmLabel = (s: string): string =>\n s\n .replace(/\\r\\n|\\r|\\n/g, ' ')\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n/** Escape a label for a DOT double-quoted string. */\nconst dotLabel = (s: string): string =>\n s.replace(/\\r\\n|\\r|\\n/g, ' ').replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n\n/**\n * Mermaid `classDef` emission order.\n *\n * ⚠ A plain array, so a status MISSING here does not fail to compile — it\n * silently omits that status's `classDef` and the node renders unstyled. That\n * is why `ALL_VIZ_STATUSES` exists and why a test compares the two sets.\n */\nconst STATUSES_IN_ORDER: readonly VizStatus[] = [\n 'law',\n 'established',\n 'speculative',\n 'highly-speculative',\n 'proposed',\n 'user',\n 'poster',\n 'association',\n];\n\n/**\n * Drive a format-specific cluster renderer over the standard layout, identical\n * for both emitters: multi-junction components first (each its own subgraph,\n * keyed `0`,`1`,…, labelled `anchored cluster (n)` / `cluster (n)`), then a\n * single `iso` subgraph collecting all singletons. The callback owns all\n * per-format string production; this owns only the traversal and labelling.\n */\nfunction forEachClusterGroup(\n clusters: readonly VizCluster[],\n renderCluster: (label: string, junctionIds: readonly string[], key: string) => void,\n): void {\n const multi = clusters.filter((c) => c.size > 1);\n const singletons = clusters.filter((c) => c.size === 1);\n multi.forEach((c, i) =>\n renderCluster(`${c.anchored ? 'anchored ' : ''}cluster (${c.size})`, c.junctionIds, String(i)),\n );\n if (singletons.length) {\n renderCluster(\n `isolated (${singletons.length})`,\n singletons.flatMap((c) => c.junctionIds),\n 'iso',\n );\n }\n}\n\nfunction emitMermaid(\n clusters: readonly VizCluster[],\n byId: ReadonlyMap<string, VizJunction>,\n title: string,\n legend: string | null,\n): string {\n const qid = idFactory('q');\n const jid = idFactory('j');\n const usedStatuses = new Set<VizStatus>();\n const out: string[] = [`flowchart LR`, `%% ${title}`];\n // The legend is a comment AND a rendered node: a comment alone disappears in\n // every renderer, and a filtered map that does not say it is filtered reads\n // as the whole graph.\n if (legend !== null) out.push(`%% ${legend}`);\n\n const renderCluster = (label: string, junctionIds: readonly string[], key: string): void => {\n out.push(` subgraph cl_${key}[\"${mmLabel(label)}\"]`);\n out.push(` direction LR`);\n const declared = new Set<string>();\n const declareQ = (name: string): string => {\n const id = qid(name);\n if (!declared.has(id)) {\n out.push(` ${id}([\"${mmLabel(name)}\"]):::qty`);\n declared.add(id);\n }\n return id;\n };\n for (const id of junctionIds) {\n const j = byId.get(id)!;\n usedStatuses.add(j.status);\n const jId = jid(j.id);\n out.push(` ${jId}[\"${mmLabel(j.label)}\"]:::${j.status}`);\n for (const s of j.sources) out.push(` ${declareQ(s)} --> ${jId}`);\n out.push(` ${jId} --> ${declareQ(j.target)}`);\n }\n out.push(` end`);\n };\n\n forEachClusterGroup(clusters, renderCluster);\n\n if (legend !== null) out.push(` legend[\"${mmLabel(legend)}\"]:::legend`);\n\n for (const st of STATUSES_IN_ORDER) {\n if (!usedStatuses.has(st)) continue;\n const { fill, stroke, dashed } = STATUS_STYLE[st];\n out.push(\n ` classDef ${st} fill:${fill},stroke:${stroke}${dashed ? ',stroke-dasharray:4 3' : ''}`,\n );\n }\n out.push(` classDef qty fill:#ffffff,stroke:#999999`);\n if (legend !== null) out.push(` classDef legend fill:#ffffff,stroke:#333333`);\n return out.join('\\n') + '\\n';\n}\n\nfunction emitDot(\n clusters: readonly VizCluster[],\n byId: ReadonlyMap<string, VizJunction>,\n title: string,\n legend: string | null,\n): string {\n const qid = idFactory('q');\n const jid = idFactory('j');\n const out: string[] = [\n `digraph PhysicsMap {`,\n // DOT's label is a single quoted string and `dotLabel` collapses newlines,\n // so the legend joins the title on one line rather than being dropped.\n ` label=\"${dotLabel(legend === null ? title : `${title} — ${legend}`)}\";`,\n ` rankdir=LR;`,\n ` node [fontname=\"Helvetica\"];`,\n ];\n\n const renderCluster = (label: string, junctionIds: readonly string[], key: string): void => {\n out.push(` subgraph cluster_${key} {`);\n out.push(` label=\"${dotLabel(label)}\";`);\n const declared = new Set<string>();\n const declareQ = (name: string): string => {\n const id = qid(name);\n if (!declared.has(id)) {\n out.push(` ${id} [shape=ellipse,label=\"${dotLabel(name)}\"];`);\n declared.add(id);\n }\n return id;\n };\n for (const id of junctionIds) {\n const j = byId.get(id)!;\n const jId = jid(j.id);\n const { fill, stroke, dashed } = STATUS_STYLE[j.status];\n const style = dashed ? 'filled,dashed' : 'filled';\n out.push(\n ` ${jId} [shape=box,style=\"${style}\",fillcolor=\"${fill}\",color=\"${stroke}\",label=\"${dotLabel(\n j.label,\n )}\"];`,\n );\n for (const s of j.sources) out.push(` ${declareQ(s)} -> ${jId};`);\n out.push(` ${jId} -> ${declareQ(j.target)};`);\n }\n out.push(` }`);\n };\n\n forEachClusterGroup(clusters, renderCluster);\n out.push(`}`);\n return out.join('\\n') + '\\n';\n}\n\n/**\n * Build the bipartite, clustered render model from a graph (+ optional overlay).\n * Quantity names are canonicalized via `QUANTITY_IDENTIFICATIONS` so the\n * clustering matches the authoritative {@link linkageMap}.\n *\n * @public\n */\nexport function buildVizModel(\n edges: readonly BridgeEdge[],\n opts: VizOptions = {},\n): VizModel {\n const canon = quantityCanonicalizer();\n const normalize = (j: VizJunction): VizJunction => ({\n ...j,\n sources: j.sources.map(canon),\n target: canon(j.target),\n });\n const all: VizJunction[] = [\n ...edges.map((e) => normalize(edgeToJunction(e))),\n ...(opts.extraJunctions ?? []).map(normalize),\n ];\n // Filtering is applied to the OVERLAY junctions too. A proposed or\n // user-supplied junction carries no relation and no beId, so a filtered map\n // drops it as lacking metadata — the same rule as any other edge, and the\n // count says so out loud rather than letting the overlay vanish quietly.\n const junctions: VizJunction[] = [];\n let droppedNotMatching = 0;\n let droppedMissingMetadata = 0;\n for (const j of all) {\n switch (judge(j, opts)) {\n case 'keep':\n junctions.push(j);\n break;\n case 'not-matching':\n droppedNotMatching += 1;\n break;\n case 'missing-metadata':\n droppedMissingMetadata += 1;\n break;\n }\n }\n const filterStats: VizFilterStats = {\n total: all.length,\n kept: junctions.length,\n droppedNotMatching,\n droppedMissingMetadata,\n ...(opts.relation !== undefined ? { relation: opts.relation } : {}),\n ...(opts.evidence !== undefined ? { evidence: opts.evidence } : {}),\n };\n const filterLegend = formatFilterLegend(filterStats);\n // A duplicate junction id (e.g. a proposed overlay colliding with an edge id)\n // would silently drop one from the rendered output — make it a loud error.\n const byId = new Map<string, VizJunction>();\n for (const j of junctions) {\n if (byId.has(j.id)) {\n throw new Error(`buildVizModel: duplicate junction id '${j.id}'`);\n }\n byId.set(j.id, j);\n }\n const clusters = componentsOf(junctions);\n const title = opts.title ?? 'UPT physics map';\n\n return {\n junctions,\n clusters,\n filterStats,\n filterLegend,\n toMermaid: () => emitMermaid(clusters, byId, title, filterLegend),\n toDot: () => emitDot(clusters, byId, title, filterLegend),\n };\n}\n"]}
|
|
@@ -21,12 +21,28 @@
|
|
|
21
21
|
* resulting nonlinear system has a unique numeric solution (undecidable
|
|
22
22
|
* in general for closed-form evaluators). "Independent derivation" means
|
|
23
23
|
* a structurally distinct edge, NOT a provably-independent formula — two
|
|
24
|
-
* edges encoding the same relation are counted as two
|
|
25
|
-
*
|
|
26
|
-
* exactly as
|
|
24
|
+
* edges encoding the same relation are counted as two by the forward
|
|
25
|
+
* count (an honest over-count, kept as `surplusConstraints`). The
|
|
26
|
+
* classifier PROPOSES; humans filter (Part-VI §XXVII-B), exactly as
|
|
27
|
+
* `enumerateCompositions` does.
|
|
28
|
+
*
|
|
29
|
+
* TWO INSTRUMENTS, TWO FIELDS. The forward closure fires an edge only when
|
|
30
|
+
* every source is known, so it never reads a law in reverse. The MONOMIAL
|
|
31
|
+
* edges (a `symbolic` product of powers, or a canonical equation with a
|
|
32
|
+
* stated monomial) are also a linear system in log space: `y = C Π xᵢ^aᵢ`
|
|
33
|
+
* is the row `log y − Σ aᵢ log xᵢ = log C`. Stacked with a unit row per
|
|
34
|
+
* known quantity, the exact null space (MathTS `rationalNullspace`) says
|
|
35
|
+
* which quantities are DETERMINED (their column is zero in every basis
|
|
36
|
+
* vector) whichever way the laws are read, and `distinct rows − rank` is
|
|
37
|
+
* the number of independent consistency checks, where a restated monomial
|
|
38
|
+
* is one row, not two. {@link identifiabilityByRank} is that instrument;
|
|
39
|
+
* {@link classifyIdentifiability} reports both, `determinable` being their
|
|
40
|
+
* union, and names every law the rank read in reverse, because a validity
|
|
41
|
+
* domain is stated on the sources and a caller may refuse the inversion.
|
|
27
42
|
*
|
|
28
43
|
* @module composition/identifiability
|
|
29
44
|
*/
|
|
45
|
+
import { Fraction } from '@danielsimonjr/mathts-core';
|
|
30
46
|
import type { BridgeEdge } from './edge.js';
|
|
31
47
|
import type { QuantityIdentification } from './compose.js';
|
|
32
48
|
/** The four-way structural-identifiability verdict. @public */
|
|
@@ -42,6 +58,34 @@ export interface IdentifiabilityOptions {
|
|
|
42
58
|
*/
|
|
43
59
|
readonly identifications?: readonly QuantityIdentification[];
|
|
44
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* What the log-space rank says about one known set, over the monomial edges
|
|
63
|
+
* of the graph. See the module docs: this is the second instrument beside
|
|
64
|
+
* the forward closure, and its numbers are not the closure's.
|
|
65
|
+
*
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export interface RankIdentifiability {
|
|
69
|
+
/** Every quantity whose column is zero in every null-space basis vector, sorted. */
|
|
70
|
+
readonly determined: readonly string[];
|
|
71
|
+
/** The quantities the rank determines that the forward closure does not, sorted. */
|
|
72
|
+
readonly determinedByRankOnly: readonly string[];
|
|
73
|
+
/**
|
|
74
|
+
* Independent consistency checks the system carries: distinct rows
|
|
75
|
+
* (a restated monomial is one row) minus the rank. Zero when every row
|
|
76
|
+
* is needed to determine what it determines.
|
|
77
|
+
*/
|
|
78
|
+
readonly surplusChecks: number;
|
|
79
|
+
/**
|
|
80
|
+
* Ids of the monomial edges the rank read against their direction: a
|
|
81
|
+
* source of the edge is determined, and not by the forward closure over
|
|
82
|
+
* the monomial edges. A caller whose validity domain is stated on the
|
|
83
|
+
* sources may refuse these.
|
|
84
|
+
*/
|
|
85
|
+
readonly usedInReverse: readonly string[];
|
|
86
|
+
/** Ids of the edges that contributed a row (a readable monomial, target not among its sources). */
|
|
87
|
+
readonly monomialEdges: readonly string[];
|
|
88
|
+
}
|
|
45
89
|
/** The result of classifying one target against one known set. @public */
|
|
46
90
|
export interface IdentifiabilityResult {
|
|
47
91
|
/** The target quantity name that was classified. */
|
|
@@ -70,8 +114,14 @@ export interface IdentifiabilityResult {
|
|
|
70
114
|
* moves the target toward determined. Empty when determinable.
|
|
71
115
|
*/
|
|
72
116
|
readonly blockingFrontier: readonly string[];
|
|
73
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Every quantity determinable from the known set: the forward closure
|
|
119
|
+
* united with what the log-space rank determines through the monomial
|
|
120
|
+
* edges (`rank.determined`), sorted.
|
|
121
|
+
*/
|
|
74
122
|
readonly determinable: readonly string[];
|
|
123
|
+
/** The rank instrument's own report for this known set. */
|
|
124
|
+
readonly rank: RankIdentifiability;
|
|
75
125
|
}
|
|
76
126
|
/**
|
|
77
127
|
* The monotone forward closure: the least set ⊇ `knownNames` closed under
|
|
@@ -84,6 +134,43 @@ export interface IdentifiabilityResult {
|
|
|
84
134
|
* @public
|
|
85
135
|
*/
|
|
86
136
|
export declare function forwardClosure(edges: readonly BridgeEdge[], knownNames: readonly string[], identifications?: readonly QuantityIdentification[]): Set<string>;
|
|
137
|
+
/**
|
|
138
|
+
* The exact exponents of an edge's monomial over its SOURCE names, or
|
|
139
|
+
* undefined when it is not one. Internal: a `Fraction` is not a root type.
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
export type EdgeMonomialReader = (edge: BridgeEdge) => ReadonlyMap<string, Fraction> | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* The exact exponents of `edge`'s target over its source names, read from
|
|
145
|
+
* its `symbolic` form, or, for a canonical edge with no symbolic form, from
|
|
146
|
+
* the equation's stated monomial and `formulaFactors`. A leaf that is not a
|
|
147
|
+
* source (a constant, a literal, a held stub) is part of the prefactor and
|
|
148
|
+
* contributes no column. Undefined when the form is not a monomial, when an
|
|
149
|
+
* exponent is not a small rational, or when the target is among the sources.
|
|
150
|
+
*
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
export declare function edgeMonomial(edge: BridgeEdge): ReadonlyMap<string, Fraction> | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* {@link identifiabilityByRank} with the monomial reader chosen by the
|
|
156
|
+
* caller (the default is {@link edgeMonomial}). A custom reader's index and
|
|
157
|
+
* results are cached beside the default's, never in its place.
|
|
158
|
+
*
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
export declare function identifiabilityByRankWith(edges: readonly BridgeEdge[], knownNames: readonly string[], reader: EdgeMonomialReader, opts?: IdentifiabilityOptions): RankIdentifiability;
|
|
162
|
+
/**
|
|
163
|
+
* The log-space rank: which quantities the monomial edges determine from
|
|
164
|
+
* `knownNames`, whichever direction each law is read, how many independent
|
|
165
|
+
* consistency checks the system carries, and which laws were read in
|
|
166
|
+
* reverse. Identifications stay directed, as in {@link forwardClosure}: a
|
|
167
|
+
* name they reach joins the known rows, and the system is solved again
|
|
168
|
+
* until nothing new is determined. Non-monomial edges contribute nothing
|
|
169
|
+
* here; the forward closure is their instrument.
|
|
170
|
+
*
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
export declare function identifiabilityByRank(edges: readonly BridgeEdge[], knownNames: readonly string[], opts?: IdentifiabilityOptions): RankIdentifiability;
|
|
87
174
|
/**
|
|
88
175
|
* Classify the structural identifiability of `targetName` given
|
|
89
176
|
* `knownNames` over `edges`. See the module docs and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifiability.d.ts","sourceRoot":"","sources":["../../src/composition/identifiability.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"identifiability.d.ts","sourceRoot":"","sources":["../../src/composition/identifiability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAM3D,+DAA+D;AAC/D,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,kBAAkB,GAClB,oBAAoB,GACpB,iBAAiB,CAAC;AAEtB,0CAA0C;AAC1C,MAAM,WAAW,sBAAsB;IACrC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAC9D;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,oFAAoF;IACpF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,oFAAoF;IACpF,QAAQ,CAAC,oBAAoB,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1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