Internalizing representation independence with univalence
Open Access
- 4 January 2021
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 5 (POPL) , 1-30
Abstract
In their usual form, representation independence metatheorems provide an external guarantee that two implementations of an abstract interface are interchangeable when they are related by an operation-preserving correspondence. If our programming language is dependently-typed, however, we would like to appeal to such invariance results within the language itself, in order to obtain correctness theorems for complex implementations by transferring them from simpler, related implementations. Recent work in proof assistants has shown that Voevodsky's univalence principle allows transferring theorems between isomorphic types, but many instances of representation independence in programming involve non-isomorphic representations. In this paper, we develop techniques for establishing internal relational representation independence results in dependent type theory, by using higher inductive types to simultaneously quotient two related implementation types by a heterogeneous correspondence between them. The correspondence becomes an isomorphism between the quotiented types, thereby allowing us to obtain an equality of implementations by univalence. We illustrate our techniques by considering applications to matrices, queues, and finite multisets. Our results are all formalized in Cubical Agda, a recent extension of Agda which supports univalence and higher inductive types in a computationally well-behaved way.Keywords
All Related Versions
Funding Information
- Vetenskapsrådet (2019-04545)
- Air Force Office of Scientific Research (FA9550-15-1-0053,FA9550-19-1-0216)
This publication has 27 references indexed in Scilit:
- An experimental library of formalized Mathematics based on the univalent foundationsMathematical Structures in Computer Science, 2015
- Automatic Data Refinement2013
- Bag Equivalence via a Proof-Relevant Membership Relation2012
- Changing Data Representation within the Coq SystemLecture Notes in Computer Science, 2003
- A coherence theorem for Martin-Löf's type theoryJournal of Functional Programming, 1998
- Applicative functors and fully transparent higher-order modules1995
- Parametricity as isomorphismTheoretical Computer Science, 1994
- Theorems for free!1989
- On observational equivalence and algebraic specificationJournal of Computer and System Sciences, 1987
- Representation independence and data abstraction1986