🤖 AI Summary
Physical modeling involves rich dimensional syntax that generic programming languages cannot express effectively. This paper introduces a domain-specific language (DSL) based on dependent types, embedded in Idris, which— for the first time—fully formalizes dimensional algebra and the Buckingham Pi theorem within a type system. The approach enables static verification of dimensional constraints, automatic derivation of Pi terms, and type-level structural validation of physical equations. It unifies the encoding of unit systems, dimensional rules, and nondimensionalization principles, thereby bridging the semantic gap between mathematical physics modeling and functional programming. Experimental evaluation demonstrates robust support for dimensionality-consistency checking and model verification, significantly enhancing correctness guarantees in scientific computing code. Moreover, the framework provides a formally verifiable foundation for interdisciplinary education and tool interoperability.
📝 Abstract
The languages of mathematical physics and modelling are endowed with a rich"grammar of dimensions"that common abstractions of programming languages fail to represent. We propose a dependently typed domain-specific language (embedded in Idris) that captures this grammar. We apply it to explain basic notions of dimensional analysis and Buckingham's Pi theorem. We hope that the language makes mathematical physics more accessible to computer scientists and functional programming more palatable to modelers and physicists.