On Just in Time Indexing of Dynamic Predicates in Prolog

  • Authors:
  • Vítor Santos Costa

  • Affiliations:
  • DCC-FCUP & CRACS-INESC Porto LA, Universidade do Porto, Portugal

  • Venue:
  • EPIA '09 Proceedings of the 14th Portuguese Conference on Artificial Intelligence: Progress in Artificial Intelligence
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Prolog is the most well-known and widely used logic programming language. A large number of Prolog applications maintains information by asserting and retracting clauses from the database. Such dynamic predicates raise a number of issues for Prolog implementations, such as what are the semantics of a procedure where clauses can be retracted and asserted while the procedure is being executed. One advantage of Logical Update semantics is that it allows indexing. In this paper, we discuss how one can implement just-in-time indexing with Logical Update semantics. Our algorithm is based on two ideas: stable structure and fragmented index trees. By stable structure one means that we define a structure for the indexing tree that not change, even as we assert and as we retract clauses. Second, by fragmented index tree we mean that the indexing tree will be built in such a way that the updates will be local to each fragment. The algorithm was implemented and results indicate significant speedups and reduction of memory usage in test applications.