Numerical Representations as Purely Functional Data Structures: a New Approach
Volume 13, Issue 2 (2002), pp. 163–176
Pub. online: 1 January 2002
Type: Research Article
Received
1 May 2001
1 May 2001
Published
1 January 2002
1 January 2002
Abstract
This paper is concerned with design, implementation and verification of persistent purely functional data structures which are motivated by the representation of natural numbers using positional number systems. A new implementation of random-access list based on redundant segmented binary numbers is described. It uses 4 digits and an invariant which guarantees constant worst-case bounds for cons, head, and tail list operations as well as logarithmic time for lookup and update. The relationship of random-access list with positional number system is formalized and benefits of this analogy are demonstrated.