Ordered, linear, and other substructural type systems allow us to expose deep properties of programs at the syntactic level of types. In this paper, we develop a family of unary logical relations that allow us to prove consequences of parametricity for a range of substructural type systems. A key idea is to parameterize the relation by an algebra, which we exemplify with a monoid and commutative monoid to interpret ordered and linear type systems, respectively. We prove the fundamental theorem of logical relations and apply it to deduce extensional properties of inhabitants of certain types. Examples include demonstrating that the ordered types for list append and reversal are inhabited by exactly one function, as are types of some tree traversals. Similarly, the linear type of the identity function on lists is inhabited only by permutations of the input. Our most advanced example shows that the ordered type of the list fold function is inhabited only by the fold function.
@InProceedings{aberle_et_al:LIPIcs.FSCD.2025.4, author = {Aberl\'{e}, C. B. and Crary, Karl and Martens, Chris and Pfenning, Frank}, title = {{Substructural Parametricity}}, booktitle = {10th International Conference on Formal Structures for Computation and Deduction (FSCD 2025)}, pages = {4:1--4:21}, series = {Leibniz International Proceedings in Informatics (LIPIcs)}, ISBN = {978-3-95977-374-4}, ISSN = {1868-8969}, year = {2025}, volume = {337}, editor = {Fern\'{a}ndez, Maribel}, publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik}, address = {Dagstuhl, Germany}, URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.FSCD.2025.4}, URN = {urn:nbn:de:0030-drops-236193}, doi = {10.4230/LIPIcs.FSCD.2025.4}, annote = {Keywords: Substructural type systems, logical relations, ordered logic} }
Feedback for Dagstuhl Publishing