Relational Models for Tabling Logic Programs in a Database

Pedro Costa, Ricardo Rocha and Michel Ferreira

October 2007


Resolution strategies based on tabling are considered to be particularly effective in Logic Programming. Unfortunately, when faced with applications that compute large and/or many answers, memory exhaustion is a potential problem. In such cases, table deletion is the most common approach to recover space. In this work, we propose a different approach, storing tables into a relational database. Subsequent calls to stored tables import answers from the database, rather than performing a complete re-computation. To validate this approach, we have extended the YapTab tabling system, providing engine support for exporting and importing tables to and from the MySQL RDBMS. Three different relational models for data storage and two recordset retrieval strategies are compared.


  author =    {P. Costa and R. Rocha and M. Ferreira},
  title =     {{Relational Models for Tabling Logic Programs in a Database}},
  booktitle = {Proceedings of the 21st Workshop on (Constraint) Logic Programming (WLP 2007)},
  pages =     {99--116},
  number =    {5437},
  series =    {LNAI},
  publisher = {Springer},
  editor =    {D. Seipel and M. Hanus and A. Wolf},
  month =     {October},
  year =      {2007},
  address =   {W├╝rzburg, Germany},
  note =      {Published in 2009},

Download Paper

PDF file