The craft of Prolog
Real-time deques, multihead Turing machines, and purely functional programming
FPCA '93 Proceedings of the conference on Functional programming languages and computer architecture
Real Time Queue Operations in Pure LISP
Real Time Queue Operations in Pure LISP
ICLP '08 Proceedings of the 24th International Conference on Logic Programming
Hi-index | 0.00 |
We present a Prolog implementation of real-time persistent queues and double-ended queues. Our implementation is inspired by Okasaki's lazy-functional approach, but relies only on standard Prolog, comprising of the pure subset plus if-then-else constructs to efficiently implement guards and meta-calls for convenience. The resulting data structure is a nice demonstration of the fact that the use of logic variables to hold the outcome of an unfinished computation can sometimes give the same kind of elegant and compact solutions as lazy evaluation.