[Paper Review] On Applying Or-Parallelism and Tabling to Logic Programs
This paper presents OPTYap, the first or-parallel tabling engine for logic programs, which integrates or-parallelism with tabling by extending Yap's sequential Prolog engine with SLG-WAM-based tabling and environment copying for or-parallelism. It achieves good performance on shared-memory machines, especially in programs with high or-parallelism and limited tabled nodes, demonstrating that tabling and or-parallelism are a strong match for improving logic programming scalability.
The past years have seen widening efforts at increasing Prolog's declarativeness and expressiveness. Tabling has proved to be a viable technique to efficiently overcome SLD's susceptibility to infinite loops and redundant subcomputations. Our research demonstrates that implicit or-parallelism is a natural fit for logic programs with tabling. To substantiate this belief, we have designed and implemented an or-parallel tabling engine -- OPTYap -- and we used a shared-memory parallel machine to evaluate its performance. To the best of our knowledge, OPTYap is the first implementation of a parallel tabling engine for logic programming systems. OPTYap builds on Yap's efficient sequential Prolog engine. Its execution model is based on the SLG-WAM for tabling, and on the environment copying for or-parallelism. Preliminary results indicate that the mechanisms proposed to parallelize search in the context of SLD resolution can indeed be effectively and naturally generalized to parallelize tabled computations, and that the resulting systems can achieve good performance on shared-memory parallel machines. More importantly, it emphasizes our belief that through applying or-parallelism and tabling to logic programs the range of applications for Logic Programming can be increased.
Motivation & Objective
- To design and implement a system that combines or-parallelism and tabling in logic programming to improve performance and scalability.
- To evaluate whether or-parallelism can be effectively generalized to tabled computations, overcoming limitations of SLD resolution.
- To demonstrate that tabling and or-parallelism together can expand the range of viable applications for logic programming.
- To assess the performance of the resulting system on shared-memory parallel machines, particularly under contention and data structure constraints.
Proposed method
- OPTYap is built on Yap’s efficient sequential Prolog engine, leveraging its existing execution model as a foundation.
- It uses the SLG-WAM as the underlying execution model for tabling, enabling efficient subgoal memoization and handling of negation and non-monotonic reasoning.
- Or-parallelism is implemented via environment copying, allowing independent execution of alternative clauses in parallel.
- The system uses tries as the underlying data structure for tables, enabling efficient indexing and compression of answers.
- Parallel execution is managed through worker threads that handle subgoal computation and answer retrieval, with synchronization via shared memory and frame-based coordination.
- Performance is evaluated on benchmarks like rgrid/2 and lgrid/2, focusing on contention points in table access and subgoal frame management.
Experimental results
Research questions
- RQ1Can or-parallelism be effectively generalized to tabled logic programs, maintaining the benefits of both techniques?
- RQ2What are the performance bottlenecks when combining or-parallelism with tabling in shared-memory systems?
- RQ3How does the choice of table data structure (e.g., tries) affect parallel scalability and contention?
- RQ4To what extent can OPTYap achieve speedups in tabled programs with high or-parallelism and large numbers of tabled nodes?
- RQ5How do dependencies between suspended subgoal computation and answer consumption affect parallel performance?
Key findings
- OPTYap achieves good speedups on applications with high or-parallelism and a limited number of tabled nodes, demonstrating effective integration of tabling and or-parallelism.
- The system maintains low overheads for sequential execution and performs favorably compared to XSB, a leading sequential tabling system.
- Contention for subgoal frames and high numbers of resumed subgoal computation (SCCs) are major performance bottlenecks, especially in benchmarks like rgrid/2.
- Despite high numbers of answer trie nodes and frequent table updates, the use of tries enables efficient indexing and compression, though concurrency is restricted during updates.
- The number of resumed SCCs remains approximately constant with increasing workers, indicating inherent sequencing constraints in answer discovery that limit parallelism.
- The completion algorithm and table access patterns are not the primary performance factors in current workloads, but complex dependencies in non-monotonic reasoning may stress these components in future applications.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.