Abstract
The PEPSys (Parallel ECRC Prolog System) project addresses the challenge of introducing parallelism into logic programming without compromising declarative semantics. This paper describes a language that combines modularity with explicit programmer-controlled property declarations to exploit OR-parallelism and independent AND-parallelism. By allowing users to specify execution strategies (eager vs. lazy) and clause ordering, PEPSys provides a flexible framework for optimizing performance on multiprocessor systems. Simulated results on benchmark programs demonstrate substantial speedup potential, reaching up to 267x for specific logic puzzles.
Introduction
In the mid-1980s, the logic programming landscape was divided between traditional sequential Prolog and "Committed Choice Languages" like Parlog. While the former was easy to reason about, the latter often sacrificed semantic clarity for parallelism, frequently leading to process explosions that overwhelmed hardware resources. PEPSys was developed to bridge this gap, focusing on a user-oriented approach that allows programmers to control the granularity of parallelism to avoid excessive overhead while maintaining the ability to explore multiple solution paths simultaneously.
The PEPSys Approach
The PEPSys language architecture rests on three primary pillars designed to balance ease of use with execution efficiency:
- Modularity: Programs are partitioned into serial (
.ser) and parallel (.par) modules. Serial modules function as standard Prolog, while parallel modules are restricted to side-effect-free predicates to ensure safety during concurrent execution. - Explicit AND-Parallelism: The language introduces the
#operator as an alternative to the standard comma (,). This explicitly signals to the runtime that two goals are independent and can be executed concurrently. - Predicate Property Declarations: This core innovation allows programmers to "tune" parallelism via
properties()declarations. These declarations cover three orthogonal aspects: - Solutions: Specifies whether the engine should find
allsolutions or justone. - Clauses: Defines whether clause order is
orderedorunordered. - Execution: A toggle between
eager(parallel) andlazy(sequential/backtracking) execution.
Evaluation and Results
The system was evaluated using five benchmark programs: Argl (a logic puzzle), Four Queens, Mapl (map coloring), Pathsearch (transport network search), and Warplan (robot planning). Execution traces were generated using a CProlog-based interpreter and analyzed under idealized conditions of unlimited resources and zero overhead.
As shown in Table 1, the results indicate significant potential for speedup. The Argl program achieved a 267x improvement, while even the smallest benchmark, Pathsearch, saw an 8x speedup.
A key finding was the impact of incremental tuning. In a "soccer team selection" test case, the transition from purely sequential execution to full OR- and AND-parallelism resulted in a dramatic performance increase.
As illustrated in Table 2, the combination of full OR-parallelism and full AND-parallelism yielded an 81.6x speedup compared to the sequential baseline. This highlights the importance of the programmer's ability to advise the runtime scheduler on resource allocation through property declarations.
Discussion
The PEPSys philosophy treats non-determinism as a feature rather than a hurdle. By prioritizing an "all-solutions" approach, the system leverages OR-parallelism as a vital source of performance. Furthermore, the execution(lazy/eager) toggle addresses the critical issue of granularity control. Automatic detection often fails to account for the overhead of process management; by giving this control to the programmer, PEPSys prevents the creation of inefficiently small processes that cost more to manage than they save in compute time.
Conclusion and Future Work
While the current results are based on simulated traces under idealized conditions, they provide a strong proof of concept for the PEPSys approach. The modular structure and property declarations successfully preserve declarative integrity while unlocking significant parallel potential.
Future research will focus on:
- Implementing PEPSys on physical multiprocessor hardware, such as the Siemens MX-500.
- Developing a global dynamic database for memoization (lemmas) to reduce redundant computations across parallel branches.
- Incorporating vector relations for more efficient data-parallel operations on lists.
Summary updated