A Declarative Environment for Concurrent Logic Programming

Keith L. Clark, Ian T. Foster

Abstract

The PARLOG Programming System (PPS) represents a pioneering effort in developing a language-based operating system where both the system software and applications are written in the same concurrent logic language: PARLOG. This approach bridges the traditional gap between high-level declarative programming and the low-level operational requirements of an operating system.

Introduction

In the mid-1980s, programming environments often functioned as "black boxes," creating a disconnect between declarative code and the side-effect-heavy underlying operating system (OS). The PPS addresses this by treating system tasks—such as process management, I/O, and resource allocation—as logic programs. By modeling the OS as a network of communicating processes, the system allows developers to manipulate state and structure using high-level logic.

System Architecture

The PPS architecture is initialized as a network of three primary processes: the console_manager (handling user interface), the user_manager (coordinating tasks), and database_managers (managing storage).

Initial process network of the PARLOG Programming System showing the flow from user to database managers.

Communication between these processes utilizes "back communication" via incomplete messages. By sending a message containing an unbound variable, a process can receive an asynchronous response when the receiver binds that variable, enabling non-blocking interaction.

The Control Meta-Call and Concurrency

A central feature of the PPS is the five-argument control meta-call: call(Module, Resources, Goal, Status, Control). This primitive allows a supervisor process to execute a goal with specific resource constraints while monitoring its status (e.g., success, failure, or exception) and exerting control (e.g., stop, suspend, resume) via message streams.

When a user initiates queries, the system dynamically spawns query_manager processes. Each query manager acts as an intermediary, handling the specific logic of a query and interacting with the database managers.

The dynamic process network during concurrent query execution, illustrating the creation of multiple query managers.

To maintain data integrity without traditional side-effect-heavy locks, the PPS employs "Done" variables. A database manager tracks these variables for all active queries, ensuring updates only proceed once all relevant queries have terminated.

Results and Conclusion

The PPS demonstrates that complex system behaviors, including window management and multiprocessing, can be specified succinctly in PARLOG. It successfully implements "virtual object code," where modules are loaded into memory only when required by a query. Furthermore, the declarative nature of the environment simplifies the creation of system tools; for instance, a static analyzer can be implemented in a few lines of PARLOG by querying the system's own meta-relations.

While the current implementation faces performance overhead from runtime meta-clause evaluation and is primarily single-user, it provides a robust foundation for future research into declarative, concurrent operating systems.

Summary updated

BibTeX
@inproceedings{clark1987declarative,
  author = {Keith L. Clark and Ian T. Foster},
  title = {{A Declarative Environment for Concurrent Logic Programming}},
  booktitle = {TAPSOFT, Vol.2},
  year = {1987},
  doi = {10.1007/bfb0014983},
}
Figure