A Portable Prolog Predicate for Printing Rational Terms

Theofrastos Mantadelis and Ricardo Rocha

July 2014


Rational terms or rational trees are terms with one or more infinite sub-terms but with a finite representation. Rational terms appeared as a side effect of omitting the occurs check in the unification of terms, but their support across Prolog systems varies and often fails to provide the expected functionality. A common problem is the lack of support for printing query bindings with rational terms. In this paper, we present a survey discussing the support of rational terms among different Prolog systems and we propose the integration of a Prolog predicate, that works in several existing Prolog systems, in order to overcome the technical problem of printing rational terms. Our rational term printing predicate could be easily adapted to work for the top query printouts, for user printing and for debugging purposes.


  author =    {T. Mantadelis and R. Rocha},
  title =     {{A Portable Prolog Predicate for Printing Rational Terms}},
  booktitle = {Proceedings of the International Joint Workshop on Implementation of Constraint and Logic 
               Programming Systems and Logic-based Methods in Programming Environments (CICLOPS-WLPE 2014)},
  pages =     {141--153},
  editor =    {T. Stroeder and T. Swift},
  month =     {July},
  year =      {2014},
  address =   {Vienna, Austria},

Download Paper

PDF file
RWTH Aachen University