The Semantics of Rank Polymorphism
Justin Slepak, Olin Shivers, Panagiotis Manolios

TL;DR
This paper introduces Remora, a core language for rank-polymorphic array operations, with formal semantics and a sound static type system that prevents shape errors and supports dynamic array shapes.
Contribution
It develops a formal, dynamic and static semantics for rank polymorphism, including a dependent type system that ensures shape safety and supports dynamic array shapes.
Findings
Proves soundness of the type system with progress and preservation
Shows static shape safety prevents runtime errors
Demonstrates alignment between fully-typed and partially erased semantics
Abstract
Iverson's APL and its descendants (such as J, K and FISh) are examples of the family of "rank-polymorphic" programming languages. The principal control mechanism of such languages is the general lifting of functions that operate on arrays of rank (or dimension) to operate on arrays of any higher rank . We present a core, functional language, Remora, that captures this mechanism, and develop both a formal, dynamic semantics for the language, and an accompanying static, rank-polymorphic type system for the language. Critically, the static semantics captures the shape-based lifting mechanism of the language. We establish the usual progress and preservation properties for the type system, showing that it is sound, which means that "array shape" errors cannot occur at run time in a well-typed program. Our type system uses dependent types, including an existential type abstraction…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Software Engineering Research · Advanced Malware Detection Techniques
