# Interacting with Tabling contents

**URL:** <https://swi-prolog.discourse.group/t/interacting-with-tabling-contents/4138>\
**Category:** General\
**Created:** [July 5, 2021, 3:29pm UTC](https://swi-prolog.discourse.group/t/interacting-with-tabling-contents/4138 "2021-07-05T15:29:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveMoyle](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@SteveMoyle](https://swi-prolog.discourse.group/u/SteveMoyle)\
**Post date:** [July 5, 2021, 3:29pm UTC](https://swi-prolog.discourse.group/t/interacting-with-tabling-contents/4138/1 "2021-07-05T15:29:49Z")

</div>

Hi

I have enjoyed getting to know the capabilities provided by Tabling in SWI-Prolog.

(The very draft book by D S Warren is a delight – particularly his chapter on Negation. He explains different semantics of negation in a gentle and lucid fashion.)

In my experimentations, I would like to be able to peek inside the tables to see a bit more of what is going on.

- Is there a way to list the contents of a table?
- Is it possible watch the table grow (e.g. from the debugger)?
- Is it possible to reason with the contents of the table (e.g. get the number of atoms; get all atoms that match a pattern)?

I don’t really want to get into the implementation of the tables, but rather what their contents are.

Many thanks,

Steve

Many thanks,

Steve

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 5, 2021, 3:54pm UTC](https://swi-prolog.discourse.group/t/interacting-with-tabling-contents/4138/2 "2021-07-05T15:54:56Z")

</div>

Yes. Most is possible. See get\_calls/3 and get\_returns/2. You find some handy command line utilities in [GitHub - JanWielemaker/my-prolog-lib: Personal SWI-Prolog utilities library](https://github.com/JanWielemaker/my-prolog-lib). Notably tdump/0,1, idg/0,1 and the statistics predicates in tstat.pl can be helpful. Eventually this should go into the normal library. “Seeing the table grow” is not there.

There is also [GitHub - SWI-Prolog/webstat: Examine SWI-Prolog resources and data using your browser](https://github.com/SWI-Prolog/webstat), though it is not very complete. The idea of this tool was provide a comprehensive web tool to monitor the state of a SWI-Prolog program in real time. If anyone wishes to turn it into a full featured tool … I’m happy to explain all the low level stuff that allows getting the data out of Prolog. Mostly requires JavaScript skills.
