Skip to main content

Real-Time Persistent Queues and Deques with Logic Variables (Declarative Pearl)

Long title

Real-Time Persistent Queues and Deques with Logic Variables (Declarative Pearl)

Authors

Gerlof Bouma

Abstract

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.

APA

Gerlof Bouma (2012): Real-Time Persistent Queues and Deques with Logic Variables (Declarative Pearl), in Proceedings of the 11th International Symposium on Functional and Logic Programming (FLOPS 2012), pages 62--73

BibTeX

@inProceedings{bouma-2012-real-158261,
	title        = {Real-Time Persistent Queues and Deques with Logic Variables (Declarative Pearl)},
	abstract     = {             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.
},
	booktitle    = {Proceedings of the 11th International Symposium on Functional and Logic Programming (FLOPS 2012)},
	author       = {Bouma, Gerlof},
	year         = {2012},
	url          = {https://svn.spraakdata.gu.se/repos/gerlof/pub/www/Docs/rtpqadwlvdp.pdf},
	pages        = {62----73},
}