Dimension-level Buckingham factorization for converting programs #
LambdaS.Pi.den_mulScaleLaw uses independent rescaling of every unit symbol,
which requires a convert-free program (or, for den_mulScaleLaw_driftFree, a
drift-free one). Physics instead
rescales dimensions. The coherent abstraction theorem supplies this weaker
law even for converting programs, but compares denotations at V and
V.comp ψ; a fixed-valuation scaling law needs one further argument.
The instrumented evaluator consults its oracle only after checking that source and target have the same dimension. Oracles agreeing on those pairs therefore produce identical evaluations, at every fuel and without a typing hypothesis. Normalization and adequacy carry that equality to a scalar denotation with scalar inputs. Coherent rescaling preserves precisely those oracle entries.
The resulting den_pi_coherent factors arbitrary signed outputs on positive
inputs through a rational basis of the dimension matrix's kernel, and
den_pi_coherent_dichotomy (the paper's Theorem 8.1) adds the unsolvable case,
in which the program denotes zero. The external unit and dimension scope is
closed (j = k = 0); the program must be parametric (no ucon) but may
convert and bind units and dimensions internally. Extending this bridge to
ungrounded external unit/dimension variables is not claimed here.
Conversion oracles that agree on same-dimension pairs produce identical instrumented evaluations, because the evaluator checks that condition before consulting either oracle. No typing assumption is needed.
Scalar denotational environments as instrumented runtime values.
Equations
- LambdaS.scalarVals [] x_2 = []
- LambdaS.scalarVals (u :: us) ρ = LambdaS.Val.scalar { mag := ρ.1, unit := u } :: LambdaS.scalarVals us ρ.2
Instances For
A first-order scalar denotation depends only on conversion factors between same-dimension units. Unit and dimension binders inside the term are allowed; the external unit/dimension scope is closed.
Composing the valuation with a coherent rescaling leaves the denotation of a first-order scalar program unchanged, even when the program converts.
The fixed-valuation coherent scaling law, for parametric first-order programs that may convert and may contain internal unit/dimension polymorphism.
Exponents of a unit's dimension, in an enumerated dimension basis. The empty summand is retained to reuse the general scaling enumeration.
Equations
- LambdaS.Pi.dimensionExponents eqv u v = Sum.elim (LambdaS.dimOf (LambdaS.DCtx.nil D) u).base (LambdaS.dimOf (LambdaS.DCtx.nil D) u).vars (eqv v)
Instances For
The dimension matrix: different units of one dimension have identical
columns, unlike the stronger unit-level matrix used by den_mulScaleLaw.
Equations
- LambdaS.Pi.dimensionMatrix eqv us = Matrix.of fun (v : Fin m) (i : Fin us.length) => LambdaS.Pi.dimensionExponents eqv (us.get i) v
Instances For
The classical dimension-level scaling law for converting programs. Any parametric first-order program in closed external unit/dimension scope obeys the multiplicative law over dimensions, for a fixed valuation. The program may contain internal polymorphism and conversion.
Buckingham's reduced-arity factorization for converting programs.
Given a solution X of the dimension-level system, the program factors as in
mulScaleLaw_factorization_reduced: over the dimension matrix, on positive
arguments, with output of either sign.
The Pi theorem for programs with conversion, as a dichotomy. Either
some power product of the arguments has the result's dimension, and the
program factors on positive arguments through the dimensionless products
(den_pi_coherent), or none does, and the program denotes zero on every
argument (den_mulScaleLaw_coherent with mulScaleLaw_eq_zero_of_unsolvable).
This is the statement the paper's Pi theorem cites.