## Real-Time Deques, Multihead Turing Machines, and Purely Functional Programming (1993)

Venue: | In Conference on Functional Programming Languages and Computer Architecture |

Citations: | 13 - 1 self |

### BibTeX

@INPROCEEDINGS{Chuang93real-timedeques,,

author = {Tyng-Ruey Chuang and Benjamin Goldberg},

title = {Real-Time Deques, Multihead Turing Machines, and Purely Functional Programming},

booktitle = {In Conference on Functional Programming Languages and Computer Architecture},

year = {1993},

pages = {289--298},

publisher = {ACM Press}

}

### OpenURL

### Abstract

We answer the following question: Can a deque (double-- ended queue) be implemented in a purely functional language such that each push or pop operation on either end of a queue is accomplished in O(1) time in the worst case? The answer is yes, thus solving a problem posted by Gajewska and Tarjan [14] and by Ponder, McGeer, and Ng [25], and refining results of Sarnak [26] and Hoogerwoord [18]. We term such a deque real--time, since its constant worstcase behavior might be useful in real time programs (assuming real--time garbage collection [3], etc.) Furthermore, we show that no restriction of the functional language is necessary, and that push and pop operations on previous versions of a deque can also be achieved in constant time. We present a purely functional implementation of real-- time deques and its complexity analysis. We then show that the implementation has some interesting implications, and can be used to give a real--time simulation of a multihead Turing machine in a purel...

### Citations

1354 | Introduction to Functional Programming
- Bird
- 1998
(Show Context)
Citation Context ...o their newest versions. Thus, all update operations in a single--threaded program can be performed in place because previous versions of aggregates will never be needed and can be safely overwritten =-=[2, 16, 24, 31, 32]-=-. Another general approach is to design efficient algorithms to make aggregate data structures fully persistent (i.e., purely functional), such that after a sequence of updates the newest version and ... |

498 | The Science of Programming - Gries - 1981 |

467 | Comprehending monads
- Wadler
- 1990
(Show Context)
Citation Context ...o their newest versions. Thus, all update operations in a single--threaded program can be performed in place because previous versions of aggregates will never be needed and can be safely overwritten =-=[2, 16, 24, 31, 32]-=-. Another general approach is to design efficient algorithms to make aggregate data structures fully persistent (i.e., purely functional), such that after a sequence of updates the newest version and ... |

257 | Making data structures persistent
- Discroll, Sarnak, et al.
- 1989
(Show Context)
Citation Context ... to make aggregate data structures fully persistent (i.e., purely functional), such that after a sequence of updates the newest version and all previous versions of the aggregate are still accessible =-=[1, 4, 5, 10, 11, 17, 21, 22, 26, 27]-=-. General techniques for making aggregate data structures fully persistent are described by Driscoll, Sarnak, Sleator, and Tarjan [11]. However, the techniques often rely on side-- effects to achieve ... |

240 | I-structures: Data structure for parallel computing
- Arvind, Nikhil, et al.
- 1989
(Show Context)
Citation Context ...o their newest versions. Thus, all update operations in a single--threaded program can be performed in place because previous versions of aggregates will never be needed and can be safely overwritten =-=[2, 16, 24, 31, 32]-=-. Another general approach is to design efficient algorithms to make aggregate data structures fully persistent (i.e., purely functional), such that after a sequence of updates the newest version and ... |

216 | List Processing in Real Time on a Serial Computer. CACM
- Baker
- 1978
(Show Context)
Citation Context ...ining results of Sarnak [26] and Hoogerwoord [18]. We term such a deque real--time, since its constant worstcase behavior might be useful in real time programs (assuming real--time garbage collection =-=[3]-=-, etc.) Furthermore, we show that no restriction of the functional language is necessary, and that push and pop operations on previous versions of a deque can also be achieved in constant time. We pre... |

92 | Is there a use for linear logic
- Wadler
- 1991
(Show Context)
Citation Context |

73 |
Single-threaded polymorphic lambda calculus
- Guzmán, Hudak
- 1990
(Show Context)
Citation Context |

46 |
The aggregate update problem in functional programming systems
- Hudak, Bloss
- 1985
(Show Context)
Citation Context ...lem. If compile--time program analysis or run--time tests can determine that the original version of an aggregate will not be referenced following an update, then the update can be performed in place =-=[6, 7, 19, 23, 28, 29]-=-. A functional language can also provide language primitives for writing single--threaded programs such that they can easily be recognized and implemented by the compiler. A program is single--threade... |

36 |
Efficient applicative data types
- Myers
- 1984
(Show Context)
Citation Context ... to make aggregate data structures fully persistent (i.e., purely functional), such that after a sequence of updates the newest version and all previous versions of the aggregate are still accessible =-=[1, 4, 5, 10, 11, 17, 21, 22, 26, 27]-=-. General techniques for making aggregate data structures fully persistent are described by Driscoll, Sarnak, Sleator, and Tarjan [11]. However, the techniques often rely on side-- effects to achieve ... |

33 | Shallow binding in LISP 1.5
- Baker
- 1978
(Show Context)
Citation Context ... to make aggregate data structures fully persistent (i.e., purely functional), such that after a sequence of updates the newest version and all previous versions of the aggregate are still accessible =-=[1, 4, 5, 10, 11, 17, 21, 22, 26, 27]-=-. General techniques for making aggregate data structures fully persistent are described by Driscoll, Sarnak, Sleator, and Tarjan [11]. However, the techniques often rely on side-- effects to achieve ... |

31 |
Update analysis and the efficient implementation of functional aggregates
- Bloss
- 1989
(Show Context)
Citation Context ...lem. If compile--time program analysis or run--time tests can determine that the original version of an aggregate will not be referenced following an update, then the update can be performed in place =-=[6, 7, 19, 23, 28, 29]-=-. A functional language can also provide language primitives for writing single--threaded programs such that they can easily be recognized and implemented by the compiler. A program is single--threade... |

22 |
Fully persistent lists with catenation
- Driscoll, Sleator, et al.
- 1994
(Show Context)
Citation Context ...tenation and push operation, but at the cost of O(log n) for each pop operation, where n is the deque size. 1 All costs are amortized. This improves a previous result of Driscoll, Sleator, and Tarjan =-=[12]-=-. Using our purely functional implementation of real--time deques, their implementation can be made purely functional, with amortized complexity improved to worst--case complexity for each operation [... |

22 |
Deques with heap order
- Gajewska, Tarjan
- 1986
(Show Context)
Citation Context ...nctional language such that each push or pop operation on either end of a queue is accomplished in O(1) time in the worst case? The answer is yes, thus solving a problem posted by Gajewska and Tarjan =-=[14]-=- and by Ponder, McGeer, and Ng [25], and refining results of Sarnak [26] and Hoogerwoord [18]. We term such a deque real--time, since its constant worstcase behavior might be useful in real time progr... |

17 |
Path Analysis and the Optimization of Non-strict Functional Languages
- Bloss
- 1989
(Show Context)
Citation Context ...lem. If compile--time program analysis or run--time tests can determine that the original version of an aggregate will not be referenced following an update, then the update can be performed in place =-=[6, 7, 19, 23, 28, 29]-=-. A functional language can also provide language primitives for writing single--threaded programs such that they can easily be recognized and implemented by the compiler. A program is single--threade... |

16 |
An efficiency comparison of some representations of purely functional arrays
- Aasa, Holmström, et al.
- 1988
(Show Context)
Citation Context |

15 | Confluently persistent deques via data structuaral bootstrapping
- Buchsbaum, Tarjan
- 1993
(Show Context)
Citation Context ... the same. An open problem is whether deque concatenation can also be implemented in real--time in a purely functional way, in addition to the real--time pop and push operations. Buchsbaum and Tarjan =-=[9]-=- recently show that deques can be made confluently persistent (i.e., concatenateable) with constant cost for each concatenation and push operation, but at the cost of O(log n) for each pop operation, ... |

15 | How to Make Destructive Update Less Destructive
- Odersky
- 1991
(Show Context)
Citation Context |

15 |
Endre Tarjan. Amortized computational complexity
- Robert
- 1985
(Show Context)
Citation Context ...ons ? While a worst--case analysis measures the cost of an operation in an isolated context, an amortized analysis measures the cost of an operation averaged over a worst--case sequence of operations =-=[30]-=-. Amortized analysis should not be confused with average--case analysis, which is often based on some probabilistic assumptions. An implementation is said to be real--time if each operation costs only... |

14 | An applicative random-access stack
- Myers
- 1983
(Show Context)
Citation Context |

13 |
Persistent data structures
- Sarnak
- 1986
(Show Context)
Citation Context ...a queue is accomplished in O(1) time in the worst case? The answer is yes, thus solving a problem posted by Gajewska and Tarjan [14] and by Ponder, McGeer, and Ng [25], and refining results of Sarnak =-=[26]-=- and Hoogerwoord [18]. We term such a deque real--time, since its constant worstcase behavior might be useful in real time programs (assuming real--time garbage collection [3], etc.) Furthermore, we s... |

13 |
Optimization of Very High Level Languages - I: Value Transmission
- Schwartz
- 1975
(Show Context)
Citation Context |

12 | A symmetric set of efficient list operations - Hoogerwoord - 1992 |

11 |
New real-time simulations of multihead tape units
- Leong, Seiferas
- 1981
(Show Context)
Citation Context ...d Work and Future Work A real--time simulation of a multihead Turing machine in a purely functional language does not come as a big surprise. Fischer, Meyer, and Rosenberg [13] and Leong and Seiferas =-=[20]-=- has shown that a multihead Turing machine can be simulated in real--time by a multitape Turing machine with only one head per tape. A single tape, single head Turing machine can be simulated in real-... |

11 | Data Structures and Amortized Complexity in a Functional Setting - Schoenmakers - 1992 |

9 |
Real-time queue operations in pure lisp
- Hood, Melville
- 1981
(Show Context)
Citation Context |

7 | Fully persistent arrays for efficient incremental updates and voluminous reads
- Chuang
(Show Context)
Citation Context |

6 |
Are applicative languages inefficient
- Ponder, McGeer, et al.
- 1988
(Show Context)
Citation Context ...sh or pop operation on either end of a queue is accomplished in O(1) time in the worst case? The answer is yes, thus solving a problem posted by Gajewska and Tarjan [14] and by Ponder, McGeer, and Ng =-=[25]-=-, and refining results of Sarnak [26] and Hoogerwoord [18]. We term such a deque real--time, since its constant worstcase behavior might be useful in real time programs (assuming real--time garbage co... |

4 |
Optimization of very high level languages --- ii. deducing relationships of inclusion and membership
- Schwartz
- 1975
(Show Context)
Citation Context |

3 |
binding makes functional arrays fast
- Shallow
- 1991
(Show Context)
Citation Context |

1 |
time simulation of multihead tape units
- Real--
- 1972
(Show Context)
Citation Context ... threaded programs. 7 Related Work and Future Work A real--time simulation of a multihead Turing machine in a purely functional language does not come as a big surprise. Fischer, Meyer, and Rosenberg =-=[13]-=- and Leong and Seiferas [20] has shown that a multihead Turing machine can be simulated in real--time by a multitape Turing machine with only one head per tape. A single tape, single head Turing machi... |