Content area

Abstract

Invertibility is a fundamental concept in computer science, with various manifestations in software development (serializer/deserializer, parser/printer, redo/undo, compressor/decompressor, and so on). Full invertibility necessarily requires bijectivity, but the direct approach of composing bijective functions to develop invertible programs is too restrictive to be useful. In this paper, we take a different approach by focusing on partially invertible functions—functions that become invertible if some of their arguments are fixed. The simplest example of such is addition, which becomes invertible when fixing one of the operands. More involved examples include entropy-based compression methods (e.g., Huffman coding), which carry the occurrence frequency of input symbols (in certain formats such as Huffman tree), and fixing this frequency information makes the compression methods invertible.

We develop a language Sparcl for programming such functions in a natural way, where partial invertibility is the norm and bijectivity is a special case, hence gaining significant expressiveness without compromising correctness. The challenge in designing such a language is to allow ordinary programming (the “partially” part) to interact with the invertible part freely, and yet guarantee invertibility by construction. The language Sparcl is linear-typed and has a type constructor to distinguish data that are subject to invertible computation and those that are not. We present the syntax, type system, and semantics of the language and prove that Sparcl correctly guarantees invertibility for its programs. We demonstrate the expressiveness of Sparcl with examples including tree rebuilding from preorder and inorder traversals, Huffman coding, arithmetic coding, and LZ77 compression.

Details

Title
Sparcl: A language for partially invertible computation
Author
Matsuda, Kazutaka 1   VIAFID ORCID Logo  ; Wang, Meng 2   VIAFID ORCID Logo 

 Tohoku University, 6-3-09 Aramaki, Aza-Aoba, Aoba-ku, Sendai, Japan (e-mail: [email protected]
 University of Bristol, BS8 1TH, Bristol, UK (e-mail: [email protected]
Publication title
Volume
34
Publication year
2024
Publication date
Jan 2024
Publisher
Cambridge University Press
Place of publication
Cambridge
Country of publication
United Kingdom
ISSN
09567968
e-ISSN
14697653
Source type
Scholarly Journal
Language of publication
English
Document type
Journal Article
Publication history
 
 
Online publication date
2024-01-26
Milestone dates
2022-09-30 (Received); 2023-09-26 (Revised); 2023-11-27 (Accepted)
Publication history
 
 
   First posting date
26 Jan 2024
ProQuest document ID
2918434399
Document URL
https://www.proquest.com/scholarly-journals/sparcl-language-partially-invertible-computation/docview/2918434399/se-2?accountid=208611
Copyright
© The Author(s), 2024. Published by Cambridge University Press. This work is licensed under the Creative Commons Attribution License This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited. (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Last updated
2024-08-27
Database
ProQuest One Academic