Hostname: page-component-cd9895bd7-8ctnn Total loading time: 0 Render date: 2024-12-23T04:27:28.464Z Has data issue: false hasContentIssue false

Metamorphism in jigsaw

Published online by Cambridge University Press:  19 October 2012

KEISUKE NAKANO*
Affiliation:
Center for Frontier Science and Engineering, The University of Electro-Communications, Japan (e-mail: ksk@cs.uec.ac.jp)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

A metamorphism is an unfold after a fold, consuming an input by the fold then generating an output by the unfold. It is typically useful for converting data representations, e.g., radix conversion of numbers. (Bird and Gibbons, Lecture Notes in Computer Science, vol. 2638, 2003, pp. 1–26) have shown that metamorphisms can be incrementally processed in streaming style when a certain condition holds because part of the output can be determined before the whole input is given. However, whereas radix conversion of fractions is amenable to streaming, radix conversion of natural numbers cannot satisfy the condition because it is impossible to determine part of the output before the whole input is completed. In this paper, we present a jigsaw model in which metamorphisms can be partially processed for outputs even when the streaming condition does not hold. We start with how to describe the 3-to-2 radix conversion of natural numbers using our model. The jigsaw model allows us to process metamorphisms in a flexible way that includes parallel computation. We also apply our model to other examples of metamorphisms.

Type
Functional Pearls
Copyright
Copyright © Cambridge University Press 2012

References

Baader, F. & Nipkow, T. (1998) Term Rewriting and All That. Cambridge, UK: Cambridge University Press.CrossRefGoogle Scholar
Bird, R. & Gibbons, J. (2003) Arithmetic coding with folds and unfolds. In Proceedings of the 4th Advanced Functional Programming, Lecture Notes in Computer Science, vol. 2638. Springer-Verlag, pp. 126.Google Scholar
Gibbons, J. (2007) Metamorphisms: Streaming representation-changers. Sci. Comput. Program. 65 (2), 108139 (Elsevier).CrossRefGoogle Scholar
Meijer, E., Fokkinga, M. & Paterson, R. (1991) Functional programming with bananas, lenses, envelopes and barbed wire. In Proceedings of the 5th Functional Programming Languages and Computer Architecture, Lecture Notes in Computer Science, vol. 523. Springer-Verlag, pp. 124144.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.