Fractional Types: Expressive and Safe Space Management for Ancilla Bits

Chao-Hong Chen, Vikraman Choudhury, Jacques Carette, Amr Sabry
2/17/2020
cs.PLcs.LO

Official code: DreamLinuxer/FracAncilla (6 stars, Agda, last commit 2020-02-15).

Abstract

In reversible computing, the management of space is subject to two broad classes of constraints. First, as with general-purpose computation, every allocation must be paired with a matching de-allocation.

Show full abstract

Second, space can only be safely de-allocated if its contents are restored to their initial value from allocation time. Generally speaking, the state of the art provides limited partial solutions that address the first constraint by imposing a stack discipline and by leaving the second constraint to programmers' assertions. We propose a novel approach based on the idea of fractional types. As a simple intuitive example, allocation of a new boolean value initialized to $\texttt{false}$ also creates a value $1/{\texttt{false}}$ that can be thought of as a garbage collection (GC) process specialized to reclaim, and only reclaim, storage containing the value $\texttt{false}$. This GC process is a first-class entity that can be manipulated, decomposed into smaller processes and combined with other GC processes. We formalize this idea in the context of a reversible language founded on type isomorphisms, prove its fundamental correctness properties, and illustrate its expressiveness using a wide variety of examples. The development is backed by a fully-formalized Agda implementation.

View on arXivView PDF

Code Implementations(1)

60AgdaNov 27, 20196 years ago

Similar Papers

Cite this paper

@article{chen2020fractional,
  title  = {Fractional Types: Expressive and Safe Space Management for Ancilla Bits},
  author = {Chao-Hong Chen and Vikraman Choudhury and Jacques Carette and Amr Sabry},
  year   = {2020},
  eprint = {2002.07020},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2002.07020}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2002.07020.svg)](https://codeofpaper.com/paper/2002.07020)

Discussion