On Recursion in Graded Modal Type Theory
Journal article, 2026

We present a graded modal type theory with recursion over natural numbers and prove formally in Agda that it handles resources correctly, in the sense that an abstract machine accesses resources the "correct" number of times. The theory is parametrized, and can for instance be instantiated with grades for erasure, linear types, or affine types. The correctness proof shows that our usage counting is sound. Our eliminator for natural numbers is flexible as it enables different resource-usage patterns and practical in the sense that it can be used both to define functions with expected usage counts for the arguments. Further, it can be used to encode other data types, using large elimination. Finally, we adapt our resource correctness proof to show correctness also for grades tracking information flow, in the form of a non-interference property.

formalization

quantitative type theory

linearity

dependent types

abstract machine

graded modal type theory

Author

Oskar Eriksson

Chalmers, Computer Science and Engineering (Chalmers), Computing Science

University of Gothenburg

Andreas Martin Abel

Chalmers, Computer Science and Engineering (Chalmers), Computing Science

University of Gothenburg

Nils Anders Danielsson

Chalmers, Computer Science and Engineering (Chalmers), Computing Science

University of Gothenburg

Proceedings of the ACM on Programming Languages

24751421 (eISSN)

Vol. 10 ICFP 279

Subject Categories (SSIF 2025)

Computer Sciences

DOI

10.1145/3828677

More information

Latest update

8/31/2026