Lazy Stream Programming in Prolog

07/26/2019
by   Paul Tarau, et al.
0

In recent years, stream processing has become a prominent approach for incrementally handling large amounts of data, with special support and libraries in many programming languages. Unfortunately, support in Prolog has so far been lacking and most existing approaches are ad-hoc. To remedy this situation, we present lazy stream generators as a unified Prolog interface for stateful computations on both finite and infinite sequences of data that are produced incrementally through I/O and/or algorithmically. We expose stream generators to the application programmer in two ways: 1) through an abstract sequence manipulation API, convenient for defining custom generators, and 2) as idiomatic lazy lists, compatible with many existing list predicates. We define an algebra of stream generator operations that extends Prolog via an embedded language interpreter, provides a compact notation for composing generators and supports moving between the two isomorphic representations. As a special instance, we introduce answer stream generators that encapsulate the work of coroutining first-class logic engines and support interoperation between forward recursive AND-streams and backtracking-generated OR-streams. Keywords: lazy stream generators, lazy lists, first-class logic engines, stream combinators, AND-stream / OR-stream interoperation, Prolog extensions

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/10/2017

A Lambda Calculus for Transfinite Arrays: Unifying Arrays and Streams

Array programming languages allow for concise and generic formulations o...
research
12/22/2021

An algebraic attack on stream ciphers with application to nonlinear filter generators and WG-PRNG

In this paper, we propose a new algebraic attack on stream ciphers. Star...
research
07/29/2019

A Distributed Approach to LARS Stream Reasoning (System paper)

Stream reasoning systems are designed for complex decision-making from p...
research
11/24/2022

Highest-performance Stream Processing

We present the stream processing library that achieves the highest perfo...
research
04/19/2020

A practical approach to testing random number generators in computer algebra systems

This paper has a practical aim. For a long time, implementations of pseu...
research
08/30/2023

Natlog: Embedding Logic Programming into the Python Deep-Learning Ecosystem

Driven by expressiveness commonalities of Python and our Python-based em...
research
02/28/2020

Declarative Stream Runtime Verification (hLola)

Stream Runtime Verification is a formal dynamic analysis technique that ...

Please sign up or login with your details

Forgot password? Click here to reset