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. © 2012 Springer-Verlag.
CITATION STYLE
Bouma, G. (2012). Real-time persistent queues and deques with logic variables (declarative pearl). In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 7294 LNCS, pp. 62–72). https://doi.org/10.1007/978-3-642-29822-6_8
Mendeley helps you to discover research relevant for your work.