universal-physics-tensor 10.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -36
- package/bin/upt.mjs +13 -1
- package/data/applied-cases.json +1892 -0
- package/data/applied-cases.schema.json +194 -0
- package/data/atlas/atlas.json +25 -25
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +6 -6
- package/data/atlas/oscillators.json +7 -7
- package/data/atlas/waves.json +14 -14
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +389 -230
- package/data/bridge-catalog.schema.json +45 -7
- package/data/units.json +6 -25
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +21 -15
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +9 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +15 -13
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/loader.js +2 -2
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +2 -2
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +9 -15
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +7 -8
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -12
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -39
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/models.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +106 -3
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -11
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -7
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -34
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +35 -25
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +37 -25
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +34 -31
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +55 -53
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +1 -1
- package/dist/atlas/physjs-reviewed.js +15 -15
- package/dist/atlas/physjs-reviewed.js.map +1 -1
- package/dist/atlas/poster/statements.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/regime.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +2 -6
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -48
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/models.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +30 -0
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +53 -0
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-specs.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +13 -8
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +26 -2
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +31 -1
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +20 -2
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +27 -12
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +11 -0
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +14 -5
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +35 -3
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +117 -23
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/notices.d.ts.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +4 -4
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +15 -16
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +3 -3
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/entries/atomic.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +4 -5
- package/dist/canonical/entries/condensed-matter.js.map +1 -1
- package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
- package/dist/canonical/entries/dimensional-classics.js +3 -4
- package/dist/canonical/entries/dimensional-classics.js.map +1 -1
- package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
- package/dist/canonical/entries/electromagnetism.js +4 -10
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +9 -17
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +25 -44
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +5 -11
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/structural.d.ts +21 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +40 -19
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/catalog-checks.d.ts +10 -0
- package/dist/cases/catalog-checks.d.ts.map +1 -0
- package/dist/cases/catalog-checks.js +241 -0
- package/dist/cases/catalog-checks.js.map +1 -0
- package/dist/cases/catalog.d.ts +83 -0
- package/dist/cases/catalog.d.ts.map +1 -0
- package/dist/cases/catalog.js +118 -0
- package/dist/cases/catalog.js.map +1 -0
- package/dist/cases/engine.d.ts +13 -0
- package/dist/cases/engine.d.ts.map +1 -0
- package/dist/cases/engine.js +179 -0
- package/dist/cases/engine.js.map +1 -0
- package/dist/cases/index.d.ts.map +1 -1
- package/dist/cases/index.js +5 -7
- package/dist/cases/index.js.map +1 -1
- package/dist/cases/methods.d.ts +215 -0
- package/dist/cases/methods.d.ts.map +1 -0
- package/dist/cases/methods.js +743 -0
- package/dist/cases/methods.js.map +1 -0
- package/dist/cases/quadrature.d.ts +7 -9
- package/dist/cases/quadrature.d.ts.map +1 -1
- package/dist/cases/quadrature.js +28 -32
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/types.d.ts +12 -0
- package/dist/cases/types.d.ts.map +1 -1
- package/dist/cases/types.js.map +1 -1
- package/dist/cli/args.d.ts +25 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +30 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts.map +1 -1
- package/dist/cli/bindings.js +5 -4
- package/dist/cli/bindings.js.map +1 -1
- package/dist/cli/command.d.ts +11 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +0 -9
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +8 -18
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts +1 -0
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +9 -9
- package/dist/cli/commands/_discovery-opts.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts.map +1 -1
- package/dist/cli/commands/atlas.js +8 -5
- package/dist/cli/commands/atlas.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +8 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +8 -14
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +22 -22
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/discover.d.ts.map +1 -1
- package/dist/cli/commands/discover.js +122 -73
- package/dist/cli/commands/discover.js.map +1 -1
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +1 -0
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +67 -39
- package/dist/cli/commands/evaluate.js.map +1 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +24 -3
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +7 -1
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +84 -11
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/metric.d.ts.map +1 -1
- package/dist/cli/commands/metric.js +12 -9
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +25 -3
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +59 -16
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +1 -0
- package/dist/cli/commands/regime.js.map +1 -1
- package/dist/cli/commands/retrieve.d.ts.map +1 -1
- package/dist/cli/commands/retrieve.js +1 -0
- package/dist/cli/commands/retrieve.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +1 -0
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.d.ts.map +1 -1
- package/dist/cli/commands/symbolic.js +19 -28
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +4 -2
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/determination.d.ts +1 -0
- package/dist/cli/determination.d.ts.map +1 -1
- package/dist/cli/determination.js.map +1 -1
- package/dist/cli/expr-print.d.ts +0 -2
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +7 -31
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/flag-help.d.ts +1 -0
- package/dist/cli/flag-help.d.ts.map +1 -1
- package/dist/cli/flag-help.js +1 -0
- package/dist/cli/flag-help.js.map +1 -1
- package/dist/cli/graphs.d.ts +2 -0
- package/dist/cli/graphs.d.ts.map +1 -1
- package/dist/cli/graphs.js +1 -0
- package/dist/cli/graphs.js.map +1 -1
- package/dist/cli/main.d.ts +8 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +19 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +28 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +23 -0
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/record-reach.js +2 -2
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +6 -5
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +9 -8
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +7 -6
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +12 -9
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/stored-results.d.ts +7 -0
- package/dist/cli/stored-results.d.ts.map +1 -0
- package/dist/cli/stored-results.js +23 -0
- package/dist/cli/stored-results.js.map +1 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +8 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +36 -5
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +30 -4
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/axes.d.ts +0 -6
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +6 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +17 -0
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +102 -55
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +122 -24
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +3 -3
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +11 -38
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +2 -5
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +8 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +9 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +13 -5
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/consequence.d.ts +15 -5
- package/dist/composition/consequence.d.ts.map +1 -1
- package/dist/composition/consequence.js +6 -4
- package/dist/composition/consequence.js.map +1 -1
- package/dist/composition/discovery.d.ts +129 -9
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +171 -67
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +21 -2
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +23 -1
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +3 -12
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +7 -20
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +6 -15
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +26 -14
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +64 -72
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +23 -4
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +57 -17
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/graph-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/grounding.d.ts.map +1 -1
- package/dist/composition/grounding.js +19 -7
- package/dist/composition/grounding.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +8 -4
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +3 -2
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +7 -8
- package/dist/composition/mathts-quiet.d.ts.map +1 -1
- package/dist/composition/mathts-quiet.js +7 -16
- package/dist/composition/mathts-quiet.js.map +1 -1
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +2 -1
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/own-equation-magnitude.d.ts +95 -0
- package/dist/composition/own-equation-magnitude.d.ts.map +1 -0
- package/dist/composition/own-equation-magnitude.js +270 -0
- package/dist/composition/own-equation-magnitude.js.map +1 -0
- package/dist/composition/probe/backend-protocol.d.ts +3 -0
- package/dist/composition/probe/backend-protocol.d.ts.map +1 -1
- package/dist/composition/probe/backend-protocol.js.map +1 -1
- package/dist/composition/probe/candidate-store.d.ts +1 -0
- package/dist/composition/probe/candidate-store.d.ts.map +1 -1
- package/dist/composition/probe/candidate-store.js +1 -0
- package/dist/composition/probe/candidate-store.js.map +1 -1
- package/dist/composition/probe/corpus.d.ts +8 -4
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +23 -12
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +18 -0
- package/dist/composition/probe/dataset.d.ts.map +1 -1
- package/dist/composition/probe/dataset.js +95 -50
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.d.ts +7 -1
- package/dist/composition/probe/experiment-design.d.ts.map +1 -1
- package/dist/composition/probe/experiment-design.js +44 -24
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/falsify.d.ts +2 -0
- package/dist/composition/probe/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +2 -0
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +7 -0
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +46 -22
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +30 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +58 -36
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +14 -0
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +6 -0
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +25 -1
- package/dist/composition/probe/limits.d.ts.map +1 -1
- package/dist/composition/probe/limits.js +53 -11
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/pipeline.d.ts +5 -0
- package/dist/composition/probe/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +73 -24
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/power-law.d.ts +121 -0
- package/dist/composition/probe/power-law.d.ts.map +1 -0
- package/dist/composition/probe/power-law.js +251 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +8 -4
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +177 -49
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +7 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +10 -7
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/run-manifest.d.ts +1 -0
- package/dist/composition/probe/run-manifest.d.ts.map +1 -1
- package/dist/composition/probe/run-manifest.js.map +1 -1
- package/dist/composition/probe/scalar-search.d.ts +50 -0
- package/dist/composition/probe/scalar-search.d.ts.map +1 -0
- package/dist/composition/probe/scalar-search.js +169 -0
- package/dist/composition/probe/scalar-search.js.map +1 -0
- package/dist/composition/probe/scoring.d.ts +1 -0
- package/dist/composition/probe/scoring.d.ts.map +1 -1
- package/dist/composition/probe/scoring.js.map +1 -1
- package/dist/composition/probe/structure.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +31 -9
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +235 -184
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +16 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +29 -0
- package/dist/composition/probe/t-tail.js.map +1 -0
- package/dist/composition/probe/types.d.ts +3 -0
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +52 -12
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +107 -60
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantity-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +29 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts +15 -0
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +12 -4
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/user-equation.d.ts +1 -0
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +3 -2
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/assignment.d.ts +19 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/assignment.js +19 -0
- package/dist/core/assignment.js.map +1 -0
- package/dist/core/compare.d.ts +32 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +46 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/constants.d.ts +42 -41
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +71 -51
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +2 -0
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +14 -13
- package/dist/core/json-schema.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +0 -8
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +24 -0
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/diff/bridge-ast-gradient.d.ts +27 -23
- package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-ast-gradient.js +75 -173
- package/dist/diff/bridge-ast-gradient.js.map +1 -1
- package/dist/diff/bridge-gradient.d.ts +19 -6
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +19 -11
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +3 -0
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +7 -0
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +11 -0
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/ast-types.d.ts +15 -0
- package/dist/dimensional/ast-types.d.ts.map +1 -1
- package/dist/dimensional/ast-types.js.map +1 -1
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/constant-rows.js +9 -9
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/curvature-composite.d.ts +1 -1
- package/dist/dimensional/curvature-composite.js.map +1 -1
- package/dist/dimensional/dimension-inference.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/errors.d.ts +1 -1
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +1 -15
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +24 -11
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +122 -130
- package/dist/dimensional/exact-scale.js.map +1 -1
- package/dist/dimensional/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +2 -2
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +44 -19
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/mathts-unit-delegation.d.ts +29 -0
- package/dist/dimensional/mathts-unit-delegation.d.ts.map +1 -0
- package/dist/dimensional/mathts-unit-delegation.js +187 -0
- package/dist/dimensional/mathts-unit-delegation.js.map +1 -0
- package/dist/dimensional/mathts-unit-wrapper.d.ts +33 -0
- package/dist/dimensional/mathts-unit-wrapper.d.ts.map +1 -0
- package/dist/dimensional/mathts-unit-wrapper.js +190 -0
- package/dist/dimensional/mathts-unit-wrapper.js.map +1 -0
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -1
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/scalar-lowering.d.ts +21 -0
- package/dist/dimensional/scalar-lowering.d.ts.map +1 -0
- package/dist/dimensional/scalar-lowering.js +45 -0
- package/dist/dimensional/scalar-lowering.js.map +1 -0
- package/dist/dimensional/symbolic-constants.d.ts +9 -0
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +13 -1
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/types.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-data.d.ts +5 -1
- package/dist/dimensional/unit-data.d.ts.map +1 -1
- package/dist/dimensional/unit-data.js +30 -6
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/dimensional/units.d.ts +2 -0
- package/dist/dimensional/units.d.ts.map +1 -1
- package/dist/dimensional/units.js +59 -3
- package/dist/dimensional/units.js.map +1 -1
- package/dist/dimensional/validator.d.ts +2 -0
- package/dist/dimensional/validator.d.ts.map +1 -1
- package/dist/dimensional/validator.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/connection-lowering-helpers.d.ts +3 -1
- package/dist/numerical/connection-lowering-helpers.d.ts.map +1 -1
- package/dist/numerical/connection-lowering-helpers.js +11 -15
- package/dist/numerical/connection-lowering-helpers.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +34 -11
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +3 -2
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +0 -3
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +10 -24
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/pderiv.d.ts.map +1 -1
- package/dist/numerical/pderiv.js +2 -6
- package/dist/numerical/pderiv.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +11 -13
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +12 -0
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +72 -56
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/strides.d.ts +3 -2
- package/dist/numerical/strides.d.ts.map +1 -1
- package/dist/numerical/strides.js +3 -10
- package/dist/numerical/strides.js.map +1 -1
- package/dist/numerical/tensor-engine.d.ts +21 -0
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/relations/regime.d.ts +10 -0
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +18 -1
- package/dist/relations/regime.js.map +1 -1
- package/package.json +9 -12
- package/dist/cases/brownian-sphere.d.ts +0 -68
- package/dist/cases/brownian-sphere.d.ts.map +0 -1
- package/dist/cases/brownian-sphere.js +0 -354
- package/dist/cases/brownian-sphere.js.map +0 -1
- package/dist/cases/damped-resonator.d.ts +0 -23
- package/dist/cases/damped-resonator.d.ts.map +0 -1
- package/dist/cases/damped-resonator.js +0 -224
- package/dist/cases/damped-resonator.js.map +0 -1
- package/dist/cases/kepler-rv.d.ts +0 -13
- package/dist/cases/kepler-rv.d.ts.map +0 -1
- package/dist/cases/kepler-rv.js +0 -172
- package/dist/cases/kepler-rv.js.map +0 -1
- package/dist/cases/lumped-cooling.d.ts +0 -46
- package/dist/cases/lumped-cooling.d.ts.map +0 -1
- package/dist/cases/lumped-cooling.js +0 -261
- package/dist/cases/lumped-cooling.js.map +0 -1
- package/dist/cases/resistor-noise.d.ts +0 -14
- package/dist/cases/resistor-noise.d.ts.map +0 -1
- package/dist/cases/resistor-noise.js +0 -215
- package/dist/cases/resistor-noise.js.map +0 -1
- package/dist/cases/skin-depth.d.ts +0 -21
- package/dist/cases/skin-depth.d.ts.map +0 -1
- package/dist/cases/skin-depth.js +0 -174
- package/dist/cases/skin-depth.js.map +0 -1
|
@@ -10,6 +10,7 @@ import type { DiscoveryBackendDescriptor, DiscoveryRunManifest, SearchBudget, Se
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export { captureEnvironment } from '../canonical-json.js';
|
|
13
|
+
/** The inputs from which openManifest builds one discovery run manifest. */
|
|
13
14
|
export interface ManifestDraft {
|
|
14
15
|
readonly runId: string;
|
|
15
16
|
readonly repositoryCommit: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-manifest.d.ts","sourceRoot":"","sources":["../../../src/composition/probe/run-manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAIpB;;;;GAIG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACpE,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvD,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,oBAAoB,CA0BvE;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAC3B,IAAI,EAAE,oBAAoB,EAC1B,UAAU,EAAE,gBAAgB,EAC5B,WAAW,SAA2B,GACrC,oBAAoB,CAEtB"}
|
|
1
|
+
{"version":3,"file":"run-manifest.d.ts","sourceRoot":"","sources":["../../../src/composition/probe/run-manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EACjB,MAAM,YA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AAE,CAAC,WAAW,EAAE;QACtD,cAAc,EAAE,EAAE;KACnB,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,aAAa,CAC3B,IAA0B,EAC1B,UAA4B,EAC5B,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;IAEtC,OAAO,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * Discovery-run manifest construction (schema v0).\n *\n * @module composition/probe/run-manifest\n */\n\nimport type {\n DiscoveryBackendDescriptor,\n DiscoveryRunManifest,\n SearchBudget,\n SearchStopReason,\n} from './types.js';\nimport { DEFAULT_HOLDOUT_TOL, DEFAULT_SEARCH_BUDGET, SCHEMA_VERSION } from './types.js';\nimport { captureEnvironment, hashCanonical } from '../canonical-json.js';\n\n/**\n * Capture host environment.\n *\n * @internal\n */\nexport { captureEnvironment } from '../canonical-json.js';\n\n/** The inputs from which openManifest builds one discovery run manifest. */\nexport interface ManifestDraft {\n readonly runId: string;\n readonly repositoryCommit: string;\n readonly problem: unknown;\n readonly datasetHashes?: readonly string[];\n readonly backendDescriptors?: readonly DiscoveryBackendDescriptor[];\n readonly randomSeeds?: Readonly<Record<string, string | number>>;\n readonly tolerances?: Readonly<Record<string, number>>;\n readonly searchBudget?: SearchBudget;\n readonly startedAt?: string;\n}\n\n/** Open a run manifest (completedAt / stopReason filled at close). @internal */\nexport function openManifest(draft: ManifestDraft): DiscoveryRunManifest {\n if (!draft.runId.startsWith('dr-')) {\n throw new RangeError(`openManifest: runId must start with 'dr-' (got '${draft.runId}')`);\n }\n return {\n schemaVersion: SCHEMA_VERSION,\n runId: draft.runId,\n repositoryCommit: draft.repositoryCommit,\n problemHash: hashCanonical(draft.problem),\n datasetHashes: draft.datasetHashes ?? [],\n backendDescriptors: draft.backendDescriptors ?? [\n {\n protocolVersion: '0',\n backendId: 'native',\n backendVersion: SCHEMA_VERSION,\n capabilities: ['grammar-enumerator'],\n deterministic: 'yes',\n },\n ],\n randomSeeds: draft.randomSeeds ?? {},\n tolerances: draft.tolerances ?? { holdoutRmse: DEFAULT_HOLDOUT_TOL },\n environment: captureEnvironment(),\n searchBudget: draft.searchBudget ?? DEFAULT_SEARCH_BUDGET,\n startedAt: draft.startedAt ?? new Date().toISOString(),\n nondeterminism: [],\n };\n}\n\n/** Close a manifest with stop reason and completion time. @internal */\nexport function closeManifest(\n open: DiscoveryRunManifest,\n stopReason: SearchStopReason,\n completedAt = new Date().toISOString(),\n): DiscoveryRunManifest {\n return { ...open, stopReason, completedAt };\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MathTS scalar-search trees as UPT probe candidates (plan task P5).
|
|
3
|
+
*
|
|
4
|
+
* `scalarNodeToExpr` converts a MathTS `ScalarNode` to a UPT `ExprNode`.
|
|
5
|
+
* `dimensionToRational` converts a UPT `Dimension` to the MathTS
|
|
6
|
+
* `SiDimensionVector` that the search's `dimensions` filter reads.
|
|
7
|
+
*
|
|
8
|
+
* @module composition/probe/scalar-search
|
|
9
|
+
*/
|
|
10
|
+
import { type ScalarNode, type ScalarOperator } from '@danielsimonjr/mathts-expression';
|
|
11
|
+
import type { SiDimensionVector } from '@danielsimonjr/mathts-core';
|
|
12
|
+
import type { ExprNode } from '../../dimensional/validator.js';
|
|
13
|
+
import type { Dimension } from '../../dimensional/types.js';
|
|
14
|
+
import type { RawCandidate } from './generator.js';
|
|
15
|
+
import type { SearchProblem } from './types.js';
|
|
16
|
+
/** A MathTS `ScalarNode` as a UPT `ExprNode`; a symbol takes its governing variable's dimension. @throws Error on an unknown symbol or a function with no UPT form. @internal */
|
|
17
|
+
export declare function scalarNodeToExpr(node: ScalarNode, variables: ReadonlyMap<string, Dimension>): ExprNode;
|
|
18
|
+
/** A UPT `Dimension` as a MathTS `SiDimensionVector`, by key in BIPM order `[L, M, T, I, Θ, N, J]`. @throws RangeError on an exponent that does not rationalize. @internal */
|
|
19
|
+
export declare function dimensionToRational(dim: Dimension): SiDimensionVector;
|
|
20
|
+
/** The scalar-search grammar lists a function with no UPT form: a caller error, not an abstention. @internal */
|
|
21
|
+
export declare class UnsupportedScalarFunctionError extends Error {
|
|
22
|
+
constructor(name: string);
|
|
23
|
+
}
|
|
24
|
+
/** Options of the opt-in MathTS scalar search (plan task P5). @internal */
|
|
25
|
+
export interface ProbeScalarSearchOptions {
|
|
26
|
+
/** Seed of the MathTS random stream. */
|
|
27
|
+
readonly seed: number;
|
|
28
|
+
/** Cap on tree evaluations. */
|
|
29
|
+
readonly maxEvaluations: number;
|
|
30
|
+
/** Binary operators of the grammar. */
|
|
31
|
+
readonly binary: readonly ScalarOperator[];
|
|
32
|
+
/** Unary functions of the grammar, by MathTS input name. Default none. */
|
|
33
|
+
readonly unary?: readonly string[];
|
|
34
|
+
/** Largest tree size. Default 7. */
|
|
35
|
+
readonly maxSize?: number;
|
|
36
|
+
}
|
|
37
|
+
/** The `originNote` and the backend id of a scalar-search candidate. @internal */
|
|
38
|
+
export declare const SCALAR_SEARCH_ORIGIN = "mathts-scalar-search";
|
|
39
|
+
/**
|
|
40
|
+
* Runs MathTS `runScalarSearch` over the exploratory rows, structure only (no fitted
|
|
41
|
+
* parameters), and converts each front tree to a raw probe candidate. A front tree with no
|
|
42
|
+
* UPT form is skipped and counted in the note.
|
|
43
|
+
* @throws Error when the grammar lists a function with no UPT form.
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
export declare function scalarSearchCandidates(problem: SearchProblem, opts: ProbeScalarSearchOptions, budgetMs: number): Promise<{
|
|
47
|
+
readonly raws: readonly RawCandidate[];
|
|
48
|
+
readonly note?: string;
|
|
49
|
+
}>;
|
|
50
|
+
//# sourceMappingURL=scalar-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalar-search.d.ts","sourceRoot":"","sources":["../../../src/composition/probe/scalar-search.ts"],"names":[],"mappings":"AAAA;;;;;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AM,GACf,OAAO,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAmD7E"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MathTS scalar-search trees as UPT probe candidates (plan task P5).
|
|
3
|
+
*
|
|
4
|
+
* `scalarNodeToExpr` converts a MathTS `ScalarNode` to a UPT `ExprNode`.
|
|
5
|
+
* `dimensionToRational` converts a UPT `Dimension` to the MathTS
|
|
6
|
+
* `SiDimensionVector` that the search's `dimensions` filter reads.
|
|
7
|
+
*
|
|
8
|
+
* @module composition/probe/scalar-search
|
|
9
|
+
*/
|
|
10
|
+
import { SCALAR_FUNCTION_LOWERING, } from '@danielsimonjr/mathts-expression';
|
|
11
|
+
import { runScalarSearch } from '@danielsimonjr/mathts-functions';
|
|
12
|
+
import { rationalize } from '../rational-exponent.js';
|
|
13
|
+
const ZERO_DIMENSION = { L: 0, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };
|
|
14
|
+
const UPT_TRANSCENDENTAL_NAMES = new Set([
|
|
15
|
+
'exp', 'ln', 'log2', 'log10', 'sin', 'cos', 'tan', 'sinh', 'cosh', 'tanh',
|
|
16
|
+
]);
|
|
17
|
+
function isTranscendentalFn(name) {
|
|
18
|
+
return UPT_TRANSCENDENTAL_NAMES.has(name);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The inverse of MathTS `SCALAR_FUNCTION_LOWERING`, restricted to the UPT
|
|
22
|
+
* transcendental names. The table is not one-to-one (`log` and `log10` both
|
|
23
|
+
* lower to `log10`), so an input name equal to its lowered name wins.
|
|
24
|
+
*/
|
|
25
|
+
const TRANSCENDENTAL_BY_LOWERED = (() => {
|
|
26
|
+
const inverse = new Map();
|
|
27
|
+
for (const [inputName, loweredName] of Object.entries(SCALAR_FUNCTION_LOWERING)) {
|
|
28
|
+
if (!isTranscendentalFn(inputName))
|
|
29
|
+
continue;
|
|
30
|
+
if (!inverse.has(loweredName) || inputName === loweredName)
|
|
31
|
+
inverse.set(loweredName, inputName);
|
|
32
|
+
}
|
|
33
|
+
return inverse;
|
|
34
|
+
})();
|
|
35
|
+
function literal(name) {
|
|
36
|
+
return { kind: 'symbol', name, dim: ZERO_DIMENSION };
|
|
37
|
+
}
|
|
38
|
+
/** A MathTS `ScalarNode` as a UPT `ExprNode`; a symbol takes its governing variable's dimension. @throws Error on an unknown symbol or a function with no UPT form. @internal */
|
|
39
|
+
export function scalarNodeToExpr(node, variables) {
|
|
40
|
+
switch (node.kind) {
|
|
41
|
+
case 'number':
|
|
42
|
+
return literal(String(node.value));
|
|
43
|
+
case 'symbol': {
|
|
44
|
+
const dim = variables.get(node.name);
|
|
45
|
+
if (dim === undefined)
|
|
46
|
+
throw new Error(`scalar search: unknown symbol '${node.name}'`);
|
|
47
|
+
return { kind: 'symbol', name: node.name, dim };
|
|
48
|
+
}
|
|
49
|
+
case 'op':
|
|
50
|
+
return { kind: 'op', op: node.op, args: node.args.map((a) => scalarNodeToExpr(a, variables)) };
|
|
51
|
+
case 'call': {
|
|
52
|
+
const arg = scalarNodeToExpr(node.arg, variables);
|
|
53
|
+
if (node.fn === 'abs')
|
|
54
|
+
return { kind: 'abs', arg };
|
|
55
|
+
if (node.fn === 'sqrt')
|
|
56
|
+
return { kind: 'op', op: '^', args: [arg, literal('0.5')] };
|
|
57
|
+
const fn = TRANSCENDENTAL_BY_LOWERED.get(node.fn);
|
|
58
|
+
if (fn === undefined)
|
|
59
|
+
throw new Error(`scalar search: function '${node.fn}' has no UPT form`);
|
|
60
|
+
return { kind: 'transcendental', fn, arg };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function rationalAxis(axis, value) {
|
|
65
|
+
const f = rationalize(value);
|
|
66
|
+
if (f === undefined)
|
|
67
|
+
throw new RangeError(`scalar search: dimension ${axis} = ${value} is not rational`);
|
|
68
|
+
return f;
|
|
69
|
+
}
|
|
70
|
+
/** A UPT `Dimension` as a MathTS `SiDimensionVector`, by key in BIPM order `[L, M, T, I, Θ, N, J]`. @throws RangeError on an exponent that does not rationalize. @internal */
|
|
71
|
+
export function dimensionToRational(dim) {
|
|
72
|
+
return [
|
|
73
|
+
rationalAxis('L', dim.L),
|
|
74
|
+
rationalAxis('M', dim.M),
|
|
75
|
+
rationalAxis('T', dim.T),
|
|
76
|
+
rationalAxis('I', dim.I),
|
|
77
|
+
rationalAxis('Theta', dim.Theta),
|
|
78
|
+
rationalAxis('N', dim.N),
|
|
79
|
+
rationalAxis('J', dim.J),
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
/** The scalar-search grammar lists a function with no UPT form: a caller error, not an abstention. @internal */
|
|
83
|
+
export class UnsupportedScalarFunctionError extends Error {
|
|
84
|
+
constructor(name) {
|
|
85
|
+
super(`scalar search: function '${name}' has no UPT form`);
|
|
86
|
+
this.name = 'UnsupportedScalarFunctionError';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** The `originNote` and the backend id of a scalar-search candidate. @internal */
|
|
90
|
+
export const SCALAR_SEARCH_ORIGIN = 'mathts-scalar-search';
|
|
91
|
+
/** MathTS input names whose lowered form has a UPT form, read from the same table the converter reads. */
|
|
92
|
+
const UNARY_WITH_UPT_FORM = new Set(Object.entries(SCALAR_FUNCTION_LOWERING)
|
|
93
|
+
.filter(([, lowered]) => TRANSCENDENTAL_BY_LOWERED.has(lowered) || lowered === 'abs' || lowered === 'sqrt')
|
|
94
|
+
.map(([input]) => input));
|
|
95
|
+
function isLoweringKey(name) {
|
|
96
|
+
return Object.prototype.hasOwnProperty.call(SCALAR_FUNCTION_LOWERING, name);
|
|
97
|
+
}
|
|
98
|
+
function loweredName(name) {
|
|
99
|
+
if (!isLoweringKey(name))
|
|
100
|
+
throw new Error(`scalar search: unknown function '${name}'`);
|
|
101
|
+
return SCALAR_FUNCTION_LOWERING[name];
|
|
102
|
+
}
|
|
103
|
+
function column(rows, name) {
|
|
104
|
+
return Float64Array.from(rows, (row) => {
|
|
105
|
+
const v = row[name];
|
|
106
|
+
if (v === undefined)
|
|
107
|
+
throw new RangeError(`scalar search: a row has no '${name}'`);
|
|
108
|
+
return v;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Runs MathTS `runScalarSearch` over the exploratory rows, structure only (no fitted
|
|
113
|
+
* parameters), and converts each front tree to a raw probe candidate. A front tree with no
|
|
114
|
+
* UPT form is skipped and counted in the note.
|
|
115
|
+
* @throws Error when the grammar lists a function with no UPT form.
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
export async function scalarSearchCandidates(problem, opts, budgetMs) {
|
|
119
|
+
const unary = opts.unary ?? [];
|
|
120
|
+
for (const name of unary) {
|
|
121
|
+
if (!UNARY_WITH_UPT_FORM.has(name))
|
|
122
|
+
throw new UnsupportedScalarFunctionError(name);
|
|
123
|
+
}
|
|
124
|
+
const data = problem.exploratory;
|
|
125
|
+
if (data === undefined || data.rows.length === 0) {
|
|
126
|
+
return { raws: [], note: 'scalar search did not run: no exploratory data' };
|
|
127
|
+
}
|
|
128
|
+
const rows = data.rows;
|
|
129
|
+
const names = problem.governing.map((g) => g.name);
|
|
130
|
+
const columns = {};
|
|
131
|
+
for (const name of names)
|
|
132
|
+
columns[name] = column(rows, name);
|
|
133
|
+
const symbols = {};
|
|
134
|
+
for (const g of problem.governing)
|
|
135
|
+
symbols[g.name] = dimensionToRational(g.dim);
|
|
136
|
+
const grammar = {
|
|
137
|
+
variables: names,
|
|
138
|
+
parameters: [],
|
|
139
|
+
binary: opts.binary,
|
|
140
|
+
unary: unary.map(loweredName),
|
|
141
|
+
maxSize: opts.maxSize ?? 7,
|
|
142
|
+
};
|
|
143
|
+
const result = await runScalarSearch({ variables: names, columns, observed: column(rows, data.observable), parameters: [] }, {
|
|
144
|
+
seed: opts.seed,
|
|
145
|
+
grammar,
|
|
146
|
+
maxEvaluations: opts.maxEvaluations,
|
|
147
|
+
signal: AbortSignal.timeout(Math.max(1, Math.floor(budgetMs))),
|
|
148
|
+
dimensions: { symbols, target: dimensionToRational(problem.target.dim) },
|
|
149
|
+
});
|
|
150
|
+
const variables = new Map(problem.governing.map((g) => [g.name, g.dim]));
|
|
151
|
+
const raws = [];
|
|
152
|
+
let skipped = 0;
|
|
153
|
+
for (const entry of result.front) {
|
|
154
|
+
try {
|
|
155
|
+
raws.push({ expression: scalarNodeToExpr(entry.item, variables), monomial: null, originNote: SCALAR_SEARCH_ORIGIN });
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
skipped += 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const notes = [];
|
|
162
|
+
if (result.stopReason !== 'max-evaluations') {
|
|
163
|
+
notes.push(`scalar search stopped: ${result.stopReason} after ${result.evaluations} evaluation(s)`);
|
|
164
|
+
}
|
|
165
|
+
if (skipped > 0)
|
|
166
|
+
notes.push(`scalar search: ${skipped} front tree(s) had no UPT form`);
|
|
167
|
+
return notes.length > 0 ? { raws, note: notes.join('; ') } : { raws };
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=scalar-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalar-search.js","sourceRoot":"","sources":["../../../src/composition/probe/scalar-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,wBAAwB,GAIzB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAIlE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,MAAM,cAAc,GAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAA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AO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzE,MAAM,IAAI,GAAmB,EAAE,CAAC;IAChC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC,CAAC;QACvH,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC,CAAC;QACf,CAAC;IACH,CAAC;IACD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,CAAC,UAAU,KAAK,iBAAiB,EAAE,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,0BAA0B,MAAM,CAAC,UAAU,UAAU,MAAM,CAAC,WAAW,gBAAgB,CAAC,CAAC;IACtG,CAAC;IACD,IAAI,OAAO,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,OAAO,gCAAgC,CAAC,CAAC;IACvF,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;AACxE,CAAC","sourcesContent":["/**\n * MathTS scalar-search trees as UPT probe candidates (plan task P5).\n *\n * `scalarNodeToExpr` converts a MathTS `ScalarNode` to a UPT `ExprNode`.\n * `dimensionToRational` converts a UPT `Dimension` to the MathTS\n * `SiDimensionVector` that the search's `dimensions` filter reads.\n *\n * @module composition/probe/scalar-search\n */\n\nimport {\n SCALAR_FUNCTION_LOWERING,\n type ScalarGrammar,\n type ScalarNode,\n type ScalarOperator,\n} from '@danielsimonjr/mathts-expression';\nimport type { Fraction, SiDimensionVector } from '@danielsimonjr/mathts-core';\nimport { runScalarSearch } from '@danielsimonjr/mathts-functions';\n\nimport type { ExprNode } from '../../dimensional/validator.js';\nimport type { Dimension } from '../../dimensional/types.js';\nimport { rationalize } from '../rational-exponent.js';\nimport type { RawCandidate } from './generator.js';\nimport type { SearchProblem } from './types.js';\n\ntype TranscendentalFn = Extract<ExprNode, { kind: 'transcendental' }>['fn'];\n\nconst ZERO_DIMENSION: Dimension = { L: 0, M: 0, T: 0, I: 0, Theta: 0, N: 0, J: 0 };\n\nconst UPT_TRANSCENDENTAL_NAMES: ReadonlySet<string> = new Set([\n 'exp', 'ln', 'log2', 'log10', 'sin', 'cos', 'tan', 'sinh', 'cosh', 'tanh',\n]);\n\nfunction isTranscendentalFn(name: string): name is TranscendentalFn {\n return UPT_TRANSCENDENTAL_NAMES.has(name);\n}\n\n/**\n * The inverse of MathTS `SCALAR_FUNCTION_LOWERING`, restricted to the UPT\n * transcendental names. The table is not one-to-one (`log` and `log10` both\n * lower to `log10`), so an input name equal to its lowered name wins.\n */\nconst TRANSCENDENTAL_BY_LOWERED: ReadonlyMap<string, TranscendentalFn> = (() => {\n const inverse = new Map<string, TranscendentalFn>();\n for (const [inputName, loweredName] of Object.entries(SCALAR_FUNCTION_LOWERING)) {\n if (!isTranscendentalFn(inputName)) continue;\n if (!inverse.has(loweredName) || inputName === loweredName) inverse.set(loweredName, inputName);\n }\n return inverse;\n})();\n\nfunction literal(name: string): ExprNode {\n return { kind: 'symbol', name, dim: ZERO_DIMENSION };\n}\n\n/** A MathTS `ScalarNode` as a UPT `ExprNode`; a symbol takes its governing variable's dimension. @throws Error on an unknown symbol or a function with no UPT form. @internal */\nexport function scalarNodeToExpr(\n node: ScalarNode,\n variables: ReadonlyMap<string, Dimension>,\n): ExprNode {\n switch (node.kind) {\n case 'number':\n return literal(String(node.value));\n case 'symbol': {\n const dim = variables.get(node.name);\n if (dim === undefined) throw new Error(`scalar search: unknown symbol '${node.name}'`);\n return { kind: 'symbol', name: node.name, dim };\n }\n case 'op':\n return { kind: 'op', op: node.op, args: node.args.map((a) => scalarNodeToExpr(a, variables)) };\n case 'call': {\n const arg = scalarNodeToExpr(node.arg, variables);\n if (node.fn === 'abs') return { kind: 'abs', arg };\n if (node.fn === 'sqrt') return { kind: 'op', op: '^', args: [arg, literal('0.5')] };\n const fn = TRANSCENDENTAL_BY_LOWERED.get(node.fn);\n if (fn === undefined) throw new Error(`scalar search: function '${node.fn}' has no UPT form`);\n return { kind: 'transcendental', fn, arg };\n }\n }\n}\n\nfunction rationalAxis(axis: string, value: number): Fraction {\n const f = rationalize(value);\n if (f === undefined) throw new RangeError(`scalar search: dimension ${axis} = ${value} is not rational`);\n return f;\n}\n\n/** A UPT `Dimension` as a MathTS `SiDimensionVector`, by key in BIPM order `[L, M, T, I, Θ, N, J]`. @throws RangeError on an exponent that does not rationalize. @internal */\nexport function dimensionToRational(dim: Dimension): SiDimensionVector {\n return [\n rationalAxis('L', dim.L),\n rationalAxis('M', dim.M),\n rationalAxis('T', dim.T),\n rationalAxis('I', dim.I),\n rationalAxis('Theta', dim.Theta),\n rationalAxis('N', dim.N),\n rationalAxis('J', dim.J),\n ];\n}\n\n/** The scalar-search grammar lists a function with no UPT form: a caller error, not an abstention. @internal */\nexport class UnsupportedScalarFunctionError extends Error {\n constructor(name: string) {\n super(`scalar search: function '${name}' has no UPT form`);\n this.name = 'UnsupportedScalarFunctionError';\n }\n}\n\n/** Options of the opt-in MathTS scalar search (plan task P5). @internal */\nexport interface ProbeScalarSearchOptions {\n /** Seed of the MathTS random stream. */\n readonly seed: number;\n /** Cap on tree evaluations. */\n readonly maxEvaluations: number;\n /** Binary operators of the grammar. */\n readonly binary: readonly ScalarOperator[];\n /** Unary functions of the grammar, by MathTS input name. Default none. */\n readonly unary?: readonly string[];\n /** Largest tree size. Default 7. */\n readonly maxSize?: number;\n}\n\n/** The `originNote` and the backend id of a scalar-search candidate. @internal */\nexport const SCALAR_SEARCH_ORIGIN = 'mathts-scalar-search';\n\n/** MathTS input names whose lowered form has a UPT form, read from the same table the converter reads. */\nconst UNARY_WITH_UPT_FORM: ReadonlySet<string> = new Set(\n Object.entries(SCALAR_FUNCTION_LOWERING)\n .filter(([, lowered]) => TRANSCENDENTAL_BY_LOWERED.has(lowered) || lowered === 'abs' || lowered === 'sqrt')\n .map(([input]) => input),\n);\n\ntype LoweredFn = (typeof SCALAR_FUNCTION_LOWERING)[keyof typeof SCALAR_FUNCTION_LOWERING];\n\nfunction isLoweringKey(name: string): name is keyof typeof SCALAR_FUNCTION_LOWERING {\n return Object.prototype.hasOwnProperty.call(SCALAR_FUNCTION_LOWERING, name);\n}\n\nfunction loweredName(name: string): LoweredFn {\n if (!isLoweringKey(name)) throw new Error(`scalar search: unknown function '${name}'`);\n return SCALAR_FUNCTION_LOWERING[name];\n}\n\nfunction column(rows: readonly Readonly<Record<string, number>>[], name: string): Float64Array {\n return Float64Array.from(rows, (row) => {\n const v = row[name];\n if (v === undefined) throw new RangeError(`scalar search: a row has no '${name}'`);\n return v;\n });\n}\n\n/**\n * Runs MathTS `runScalarSearch` over the exploratory rows, structure only (no fitted\n * parameters), and converts each front tree to a raw probe candidate. A front tree with no\n * UPT form is skipped and counted in the note.\n * @throws Error when the grammar lists a function with no UPT form.\n * @internal\n */\nexport async function scalarSearchCandidates(\n problem: SearchProblem,\n opts: ProbeScalarSearchOptions,\n budgetMs: number,\n): Promise<{ readonly raws: readonly RawCandidate[]; readonly note?: string }> {\n const unary = opts.unary ?? [];\n for (const name of unary) {\n if (!UNARY_WITH_UPT_FORM.has(name)) throw new UnsupportedScalarFunctionError(name);\n }\n const data = problem.exploratory;\n if (data === undefined || data.rows.length === 0) {\n return { raws: [], note: 'scalar search did not run: no exploratory data' };\n }\n const rows = data.rows;\n\n const names = problem.governing.map((g) => g.name);\n const columns: Record<string, Float64Array> = {};\n for (const name of names) columns[name] = column(rows, name);\n const symbols: Record<string, SiDimensionVector> = {};\n for (const g of problem.governing) symbols[g.name] = dimensionToRational(g.dim);\n const grammar: ScalarGrammar = {\n variables: names,\n parameters: [],\n binary: opts.binary,\n unary: unary.map(loweredName),\n maxSize: opts.maxSize ?? 7,\n };\n\n const result = await runScalarSearch(\n { variables: names, columns, observed: column(rows, data.observable), parameters: [] },\n {\n seed: opts.seed,\n grammar,\n maxEvaluations: opts.maxEvaluations,\n signal: AbortSignal.timeout(Math.max(1, Math.floor(budgetMs))),\n dimensions: { symbols, target: dimensionToRational(problem.target.dim) },\n },\n );\n\n const variables = new Map(problem.governing.map((g) => [g.name, g.dim]));\n const raws: RawCandidate[] = [];\n let skipped = 0;\n for (const entry of result.front) {\n try {\n raws.push({ expression: scalarNodeToExpr(entry.item, variables), monomial: null, originNote: SCALAR_SEARCH_ORIGIN });\n } catch {\n skipped += 1;\n }\n }\n const notes: string[] = [];\n if (result.stopReason !== 'max-evaluations') {\n notes.push(`scalar search stopped: ${result.stopReason} after ${result.evaluations} evaluation(s)`);\n }\n if (skipped > 0) notes.push(`scalar search: ${skipped} front tree(s) had no UPT form`);\n return notes.length > 0 ? { raws, note: notes.join('; ') } : { raws };\n}\n"]}
|
|
@@ -7,6 +7,7 @@ import type { ProbeCandidateRecord, ScoreVector } from './types.js';
|
|
|
7
7
|
import type { FalsifyResult } from './falsify.js';
|
|
8
8
|
/** Build a score vector. @internal */
|
|
9
9
|
export declare function scoreCandidate(record: ProbeCandidateRecord, empirical?: number, corpusDistance?: number, falsification?: FalsifyResult): ScoreVector;
|
|
10
|
+
/** One probe candidate with its scores and whether it is on the Pareto front. */
|
|
10
11
|
export interface RankedCandidate {
|
|
11
12
|
readonly record: ProbeCandidateRecord;
|
|
12
13
|
readonly scores: ScoreVector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../src/composition/probe/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Y;KACb,CAAC;IACF,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;YAAE,OAAO,KAAK,CAAC;QACtC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;YAAE,MAAM,GAAG,IAAI,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AASD,0EAA0E;AAC1E,MAAM,UAAU,UAAU,CACxB,KAAuE;IAEvE,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACZ,GAAG,EAAE;QACL,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CACjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAClF;KACF,CAAC,CAAC;SACF,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AACnG,CAAC","sourcesContent":["/**\n * Pareto scoring for probe candidates. Does not touch `VettedCandidate.score`.\n *\n * @module composition/probe/scoring\n */\n\nimport type { ProbeCandidateRecord, ScoreVector } from './types.js';\nimport type { FalsifyResult } from './falsify.js';\n\nfunction clamp01(x: number): number {\n if (!Number.isFinite(x)) return 0;\n return Math.min(1, Math.max(0, x));\n}\n\n/**\n * Robustness is what the falsification batteries recorded: the fraction of\n * the batteries that ran and passed (an `inconclusive` battery did not pass).\n * It is not read from the status label: a survivor awaiting expert review\n * was once scored 1 by its label alone, while two of the five listed\n * batteries could never fail (9.0.0 audit §4 Low). Without a falsification\n * record only the holdout stage is known: 0.7 past the holdout, 0.2 before.\n */\nfunction robustnessOf(record: ProbeCandidateRecord, falsification: FalsifyResult | undefined): number {\n if (falsification !== undefined && falsification.records.length > 0) {\n const passed = falsification.records.filter((r) => r.outcome === 'pass').length;\n return passed / falsification.records.length;\n }\n return record.status === 'heldout-supported' ||\n record.status === 'falsification-survivor' ||\n record.status === 'expert-review-required'\n ? 0.7\n : 0.2;\n}\n\n/** Build a score vector. @internal */\nexport function scoreCandidate(\n record: ProbeCandidateRecord,\n empirical = 0,\n corpusDistance = 1,\n falsification?: FalsifyResult,\n): ScoreVector {\n const parsimony = clamp01(1 / (1 + record.complexity.astNodes / 8));\n const validity = record.fingerprint.dimensionalSignature === 'invalid' ? 0 : 1;\n const robustness = robustnessOf(record, falsification);\n return {\n validity,\n empirical: clamp01(empirical),\n parsimony,\n corpusDistance: clamp01(corpusDistance),\n robustness,\n };\n}\n\nfunction dominates(a: ScoreVector, b: ScoreVector): boolean {\n const keys: (keyof ScoreVector)[] = [\n 'validity',\n 'empirical',\n 'parsimony',\n 'corpusDistance',\n 'robustness',\n ];\n let better = false;\n for (const k of keys) {\n if (a[k] < b[k] - 1e-12) return false;\n if (a[k] > b[k] + 1e-12) better = true;\n }\n return better;\n}\n\n/** One probe candidate with its scores and whether it is on the Pareto front. */\nexport interface RankedCandidate {\n readonly record: ProbeCandidateRecord;\n readonly scores: ScoreVector;\n readonly pareto: boolean;\n}\n\n/** Pareto front (non-dominated) plus the rest, stable by id. @internal */\nexport function rankPareto(\n items: readonly { record: ProbeCandidateRecord; scores: ScoreVector }[],\n): RankedCandidate[] {\n return items\n .map((it) => ({\n ...it,\n pareto: !items.some(\n (other) => other.record.id !== it.record.id && dominates(other.scores, it.scores),\n ),\n }))\n .sort((a, b) => Number(b.pareto) - Number(a.pareto) || a.record.id.localeCompare(b.record.id));\n}\n"]}
|
|
@@ -1,51 +1,116 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cheap structure probes: regime changepoint, scale symmetry,
|
|
2
|
+
* Cheap structure probes as TESTS: a regime changepoint, a scale symmetry, a
|
|
3
|
+
* conserved dQ/dt. Each verdict is scale-free: the same series scaled by 1e6
|
|
4
|
+
* or by 1e-6 gets the same answer, because every threshold is in units of
|
|
5
|
+
* the series' own scatter, never in the units of y.
|
|
3
6
|
*
|
|
4
7
|
* Task-0 style: recover a synthetic signal or honestly abstain. Never flips
|
|
5
8
|
* `axes.ts` `gated`.
|
|
6
9
|
*
|
|
7
10
|
* @internal
|
|
8
11
|
*/
|
|
12
|
+
/** A series sampled at `x` with values `y`, scanned for a step in its mean. @internal */
|
|
9
13
|
export interface ChangepointInput {
|
|
10
14
|
readonly x: readonly number[];
|
|
11
15
|
readonly y: readonly number[];
|
|
16
|
+
/** Significance level of the permutation test; default 0.01. */
|
|
17
|
+
readonly alpha?: number;
|
|
18
|
+
/** Permutation resamples of the null; default 999. */
|
|
19
|
+
readonly resamples?: number;
|
|
20
|
+
/** Seed of the permutation null (MathTS `permutationTest`); default 20261015, never the clock. */
|
|
21
|
+
readonly seed?: number;
|
|
12
22
|
}
|
|
23
|
+
/** The best split of {@link detectMeanChangepoint}, its tests, or an abstention with its reason. @internal */
|
|
13
24
|
export interface ChangepointResult {
|
|
25
|
+
/** The split index (the right segment starts here) when the step is significant; null otherwise. */
|
|
14
26
|
readonly index: number | null;
|
|
27
|
+
/** |Welch t| at the best split: the step in units of its own standard error (scale-free). */
|
|
15
28
|
readonly score: number;
|
|
29
|
+
/** μ_right − μ_left at the best split, in the units of y; null when nothing was scanned. */
|
|
30
|
+
readonly meanDifference: number | null;
|
|
31
|
+
/** MathTS `studentTTest` at the best split: the Welch t and its degrees of freedom. */
|
|
32
|
+
readonly tStatistic: number | null;
|
|
33
|
+
readonly degreesOfFreedom: number | null;
|
|
34
|
+
/**
|
|
35
|
+
* The direct two-sided Welch p at the best split (one split, as if chosen in advance; not
|
|
36
|
+
* corrected for the scan over splits, which is what `pPermutation` is for).
|
|
37
|
+
*/
|
|
38
|
+
readonly pWelch: number | null;
|
|
39
|
+
/** P(max over splits of |t| ≥ observed) under a seeded permutation of the series. */
|
|
40
|
+
readonly pPermutation: number | null;
|
|
16
41
|
readonly abstained: boolean;
|
|
17
42
|
readonly reason?: string;
|
|
18
43
|
}
|
|
19
44
|
/**
|
|
20
|
-
* Two-mean changepoint
|
|
21
|
-
*
|
|
45
|
+
* Two-mean changepoint as a test. The best split maximises Welch's t over
|
|
46
|
+
* the splits that leave at least two samples on each side; MathTS
|
|
47
|
+
* `studentTTest` gives the t, the degrees of freedom and the direct p at that
|
|
48
|
+
* split. Because the split was CHOSEN by the scan, that p is not the test:
|
|
49
|
+
* the verdict is the seeded permutation null (MathTS `permutationTest`) of
|
|
50
|
+
* the maximum over splits, flagged when `pPermutation < alpha` (default
|
|
51
|
+
* 0.01). Every quantity is in units of the series' scatter, so a series and
|
|
52
|
+
* its copy scaled by any factor get one verdict. Abstains below six samples.
|
|
22
53
|
*
|
|
23
54
|
* @internal
|
|
24
55
|
*/
|
|
25
|
-
export declare function detectMeanChangepoint(input: ChangepointInput
|
|
56
|
+
export declare function detectMeanChangepoint(input: ChangepointInput): ChangepointResult;
|
|
57
|
+
/** Positive samples `(x, y)` whose log-log slope is the scale exponent. @internal */
|
|
26
58
|
export interface ScaleSymmetryInput {
|
|
27
59
|
readonly x: readonly number[];
|
|
28
60
|
readonly y: readonly number[];
|
|
29
61
|
}
|
|
62
|
+
/** The log-log slope with its standard error and the direct two-sided p of slope = 0. @internal */
|
|
63
|
+
export interface ScaleExponentResult {
|
|
64
|
+
readonly exponent: number | null;
|
|
65
|
+
/** Standard error of the slope (MathTS `linearRegression.stdErr`). */
|
|
66
|
+
readonly stdErr: number | null;
|
|
67
|
+
/** P(|T_{n−2}| ≥ |exponent/stdErr|), the direct tail ({@link studentTwoSidedP}); null below n = 3. */
|
|
68
|
+
readonly pValue: number | null;
|
|
69
|
+
/** The positive pairs the fit used. */
|
|
70
|
+
readonly n: number;
|
|
71
|
+
readonly abstained: boolean;
|
|
72
|
+
readonly reason?: string;
|
|
73
|
+
}
|
|
30
74
|
/**
|
|
31
|
-
* Ordinary-least-squares log-log slope
|
|
75
|
+
* Ordinary-least-squares log-log slope, MathTS `linearRegression` on the
|
|
76
|
+
* logs, with its standard error. The p-value is NOT the one MathTS reports
|
|
77
|
+
* (`2·(1 − CDF)`, which rounds a far tail to 0): it is the direct t tail from
|
|
78
|
+
* `betainc`. Abstains if x or y are non-positive, or when the log-x spread
|
|
79
|
+
* (core `sumSquaredDeviations`, times n: the normal-equation denominator)
|
|
80
|
+
* is degenerate.
|
|
32
81
|
*
|
|
33
82
|
* @internal
|
|
34
83
|
*/
|
|
35
|
-
export declare function estimateScaleExponent(input: ScaleSymmetryInput):
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
84
|
+
export declare function estimateScaleExponent(input: ScaleSymmetryInput): ScaleExponentResult;
|
|
85
|
+
/** The verdict of {@link probeConservation}: no drift in q beyond k standard errors of its slope. @internal */
|
|
86
|
+
export interface ConservationResult {
|
|
87
|
+
readonly conserved: boolean;
|
|
88
|
+
/** Mean |dq/dt| from MathTS `gradient` (second-order central differences inside, one-sided at the ends). */
|
|
89
|
+
readonly meanAbsRate: number;
|
|
90
|
+
/** The slope of MathTS `linearRegression(t, q)` and its standard error. */
|
|
91
|
+
readonly slope: number | null;
|
|
92
|
+
readonly stdErr: number | null;
|
|
93
|
+
/** The multiple of the standard error a drift must exceed to count. */
|
|
94
|
+
readonly k: number;
|
|
95
|
+
readonly abstained: boolean;
|
|
96
|
+
readonly reason?: string;
|
|
97
|
+
}
|
|
40
98
|
/**
|
|
41
|
-
*
|
|
99
|
+
* Conservation probe as a test: q is conserved when the linear drift
|
|
100
|
+
* `slope` of `linearRegression(t, q)` satisfies |slope| ≤ k·stdErr. The
|
|
101
|
+
* standard error comes from the residual scatter of the same series, so the
|
|
102
|
+
* verdict is scale-free. k = 3 by default: a drift within three standard
|
|
103
|
+
* errors is not distinguishable from none at the series' own noise (a
|
|
104
|
+
* two-sided 0.27% under Gaussian residuals), the usual working threshold
|
|
105
|
+
* for "no effect seen". The test sees a linear drift only; a quantity that
|
|
106
|
+
* oscillates without drifting passes. The mean |dq/dt| is reported beside
|
|
107
|
+
* the verdict from MathTS `gradient` (second order inside the series), not
|
|
108
|
+
* from first-order forward differences, and never decides it. Abstains below
|
|
109
|
+
* three samples or when t is not strictly increasing.
|
|
42
110
|
*
|
|
43
111
|
* @internal
|
|
44
112
|
*/
|
|
45
|
-
export declare function probeConservation(q: readonly number[], t: readonly number[],
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
abstained: boolean;
|
|
49
|
-
reason?: string;
|
|
50
|
-
};
|
|
113
|
+
export declare function probeConservation(q: readonly number[], t: readonly number[], opts?: {
|
|
114
|
+
readonly k?: number;
|
|
115
|
+
}): ConservationResult;
|
|
51
116
|
//# sourceMappingURL=structure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../../src/composition/probe/structure.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../../src/composition/probe/structure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,yFAAyF;AACzF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,kGAAkG;IAClG,QAAQ,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