Skip to main content
QUICK REVIEW

[Paper Review] The YAP Prolog System

Vı́tor Santos Costa, Luı́s Damas|arXiv (Cornell University)|Feb 18, 2011
Logic, programming, and type systems36 references4 citations
TL;DR

This paper presents the YAP Prolog system, a high-performance logic programming environment that enhances efficiency through a C-based emulator, a dynamic just-in-time indexing mechanism (JITI) for automatic argument-order optimization, and integrated support for or-parallelism and tabling. The system achieves competitive performance in data-intensive applications, particularly in bioinformatics and semantic web processing.

ABSTRACT

Yet Another Prolog (YAP) is a Prolog system originally developed in the mid-eighties and that has been under almost constant development since then. This paper presents the general structure and design of the YAP system, focusing on three important contributions to the Logic Programming community. First, it describes the main techniques used in YAP to achieve an efficient Prolog engine. Second, most Logic Programming systems have a rather limited indexing algorithm. YAP contributes to this area by providing a dynamic indexing mechanism, or just-in-time indexer (JITI). Third, a important contribution of the YAP system has been the integration of both or-parallelism and tabling in a single Logic Programming system.

Motivation & Objective

  • To design a high-performance Prolog engine that maintains efficiency across diverse workloads, especially with large-scale data.
  • To address the critical issue of argument order sensitivity in Prolog, which can drastically affect performance in large databases.
  • To integrate advanced features like or-parallelism and tabling into a single, unified Prolog system to improve scalability and expressiveness.
  • To enhance portability and maintainability by migrating from assembly to C-based emulation while preserving performance.
  • To support modern programming needs such as interoperability with SQL, R, and probabilistic reasoning systems like ProbLog and PRISM.

Proposed method

  • Adopting a C-based emulator instead of assembly language to improve portability and maintainability while retaining high performance through optimized low-level techniques.
  • Implementing a just-in-time indexer (JITI) that dynamically indexes clauses based on runtime access patterns, reducing the need for manual argument reordering.
  • Integrating tabling with or-parallelism in the OPTYAP engine, enabling efficient handling of recursive and non-monotonic logic programs.
  • Using a depth-first traversal strategy for term manipulation and extending the WAM model with sub-term indexing to accelerate clause lookup.
  • Designing a flexible compiler and runtime system that supports dynamic compilation and efficient handling of attributed variables and constraints.
  • Enabling seamless interoperability with external systems through standardized interfaces, supporting integration with databases and statistical tools.

Experimental results

Research questions

  • RQ1How can a Prolog system achieve high performance while remaining portable and maintainable across different architectures?
  • RQ2To what extent can a dynamic indexing mechanism eliminate the performance penalty caused by suboptimal argument ordering in Prolog predicates?
  • RQ3Can or-parallelism and tabling be effectively combined in a single Prolog engine without sacrificing performance or correctness?
  • RQ4How does the integration of advanced features like JITI and tabling improve the usability of Prolog in real-world data-intensive applications?
  • RQ5What role can Prolog systems play in emerging domains such as the semantic web and probabilistic reasoning, and how can they be extended to support them?

Key findings

  • The C-based emulator in YAP achieves performance competitive with hand-optimized assembly code, significantly improving portability and maintainability.
  • The just-in-time indexer (JITI) enables Prolog to compete with dedicated database managers in performance for large-scale data queries, eliminating the need for manual optimization.
  • YAP’s integration of or-parallelism and tabling in OPTYAP enables efficient execution of recursive and non-monotonic programs, with tabling being the most widely used extension in the system.
  • The system demonstrates strong performance in semantic web and bioinformatics workloads, with YAPTAB showing competitiveness against specialized systems.
  • YAP has become a key platform for research in probabilistic logic programming, supporting systems like ProbLog and CLP(BN), and enabling advances in statistical relational learning.
  • Despite its capabilities, the adoption of advanced features like tabling remains limited in other Prolog systems, highlighting the need for collaborative standardization and library sharing.

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.