Types, equations, dimensions and the Pi theorem

📅 2023-08-16
🏛️ arXiv.org
📈 Citations: 0
Influential: 0
📄 PDF
🤖 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.
Problem

Research questions and friction points this paper is trying to address.

Capturing dimensional grammar in programming languages
Explaining dimensional analysis and Buckingham's Pi theorem
Bridging mathematical physics with functional programming
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dependently typed DSL embedded in Idris
Captures dimensional grammar of physics
Enables dimensional analysis and Pi theorem
N
N. Botta
Potsdam Institute for Climate Impact Research, Potsdam, Germany, Chalmers University of Technology, Göteborg, Sweden
Patrik Jansson
Patrik Jansson
Professor of Computer Science, Chalmers University of Technology and University of Gothenburg
Computer ScienceSoftware TechnologyFunctional ProgrammingProgramming LanguagesClimate Impact
G
Guilherme Horta Alvares Da Silva
Chalmers University of Technology, Göteborg, Sweden