Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
125 tokens/sec
GPT-4o
53 tokens/sec
Gemini 2.5 Pro Pro
42 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
47 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

XSB: Extending Prolog with Tabled Logic Programming (1012.5123v1)

Published 23 Dec 2010 in cs.PL

Abstract: The paradigm of Tabled Logic Programming (TLP) is now supported by a number of Prolog systems, including XSB, YAP Prolog, B-Prolog, Mercury, ALS, and Ciao. The reasons for this are partly theoretical: tabling ensures termination and optimal known complexity for queries to a large class of programs. However the overriding reasons are practical. TLP allows sophisticated programs to be written concisely and efficiently, especially when mechanisms such as tabled negation and call and answer subsumption are supported. As a result TLP has now been used in a variety of applications from program analysis to querying over the semantic web. This paper provides a survey of TLP and its applications as implemented in XSB Prolog, along with discussion of how XSB supports tabling with dynamically changing code, and in a multi-threaded environment.

Citations (206)

Summary

  • The paper introduces tabling in Prolog to improve query termination and efficiency in processing recursive queries.
  • The paper details the integration of Well-Founded Semantics and advanced indexing methods for robust handling of negation and dynamic code.
  • The paper demonstrates practical applications in ontology management, constraint programming, and multi-threaded execution for scalable logic processing.

XSB: Extending Prolog with Tabled Logic Programming

The paper by Terrance Swift and David S. Warren on the XSB system explores the incorporation of Tabled Logic Programming (TLP) within Prolog, thereby extending its capabilities. TLP is implemented in various Prolog systems to ensure the termination and complexity optimization of queries across a broad class of programs. While theoretical motivations underlie these developments, the pragmatic utility of TLP in enhancing efficiency and expressiveness is emphasized as the primary driver for its adoption in practical applications.

Fundamental Contributions and Technical Analysis

  1. Tabling Mechanism: XSB introduces tabling to Prolog, allowing for subgoals to be stored upon their first encounter and reused when revisited. This approach, combined with mechanisms for tabled negation and subsumption, enables the concise and efficient evaluation of recursive queries, which historically posed challenges in traditional Prolog due to potential non-termination.
  2. Handling of Negation: The Well-Founded Semantics (WFS) is utilized within XSB to handle programs with negation. This paradigm supports non-deterministic strategies through delay and simplification operations within the SLG resolution framework. Such integration allows complex non-monotonic reasoning tasks to be executed within Prolog's logic programming paradigm.
  3. Indexing and Dynamic Code Support: XSB enhances indexing through a variety of techniques, including trie indexing and main-functor/star indexing. These indexing schemes facilitate efficient handling of both static and dynamic predicates, crucial for large knowledge bases that frequently undergo updates.
  4. Incremental and Multi-threaded Execution: Incremental tabling in XSB maintains table consistency in response to changes in dynamic predicates, ensuring efficient updates during query evaluation. Additionally, XSB provides multi-threading support, allowing concurrent evaluations and scaling Prolog's capabilities to multi-core architectures.

Applications and Practical Implications

XSB's extensions and optimizations potentiate a multitude of applications across domains. Key applications include ontology management and classification systems, combining rule-based logic and ontological reasoning inspired by semantic web standards. For instance, XSB's use in ontology-driven classification showcases its capability to process extensive rule sets efficiently.

Furthermore, the integration of TLP with constraints enables applications in abstract syntax interpretation and domains requiring constraint satisfaction, exemplifying XSB's versatility in accommodating CLP paradigms.

Theoretical Implications and Future Prospects

From a theoretical perspective, XSB's implementation provides a robust foundation for exploring fixed-point semantics and recursive query processing within logic programming frameworks. The paper delineates subtle complexities in embedding tabling and non-monotonic reasoning, offering a fertile ground for advancing the theoretical underpinnings of declarative programming languages.

Future developments could explore augmented reasoning capabilities by integrating deeper learning models and efficiently managing increasingly complex rule-based systems. As AI systems continue to demand more sophisticated reasoning capabilities, further exploration of Prolog systems like XSB is warranted.

In summary, the paper on XSB makes a significant contribution to the field of logic programming by extending Prolog's capabilities with Tabled Logic Programming. The innovations discussed are critical in addressing the complexity and evaluation challenges of recursive queries, offering a potent toolkit for both theoretical explorations and practical applications in AI and logic programming languages.