tabling changing semantics?

32 views
Skip to first unread message

Dan

unread,
Aug 6, 2018, 4:36:19 PM8/6/18
to SWI-Prolog
Hello, 

To speed up my program i tried to use tabling, adding a tabling directive to one key predicate that that was found in high demand via profiling. 

However, interestingly, the tabling changed the programs behavior leading to test cases to fail. Removing tabling, the test cases work again. 

Btw, I then tried to instead cache results with an assertion and looking up the asserted fact first, before trying to re"compute it". This worked, i.e. did not change the semantics of the program -- however, it slowed the program down very significantly ...


any thoughts on tabling and semantics would be much appreciated, 

thank you,

Dan

Kuniaki Mukai

unread,
Aug 7, 2018, 11:37:34 PM8/7/18
to Dan, SWI-Prolog

On Aug 7, 2018, at 5:36, Dan <gros...@gmail.com> wrote:

Hello, 

To speed up my program i tried to use tabling, adding a tabling directive to one key predicate that that was found in high demand via profiling. 

However, interestingly, the tabling changed the programs behavior leading to test cases to fail. Removing tabling, the test cases work again. 

Yes,  sounds interesting.   Could you give us a simplified sample to reproduce the changing semantics.

Kuniaki Mukai



Btw, I then tried to instead cache results with an assertion and looking up the asserted fact first, before trying to re"compute it". This worked, i.e. did not change the semantics of the program -- however, it slowed the program down very significantly ...


any thoughts on tabling and semantics would be much appreciated, 

thank you,

Dan

--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
Visit this group at https://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.

Dan

unread,
Aug 8, 2018, 4:07:31 PM8/8/18
to SWI-Prolog
thank you, for your response ...

I will try to isolate an example ...

Dan

Dan

unread,
Aug 25, 2018, 1:56:09 PM8/25/18
to SWI-Prolog
Hi Kuniaki,

I think I found the problem:

I was running unit tests, with each test initializing the system again. Once i added tabling, i wasn't aware of the need for abolishing tables during the initialization of the system and hence each new unit tests. So, it seems that cached results stayed around across unit tests which made certain tests fail. 


Dan

Kuniaki Mukai

unread,
Aug 26, 2018, 5:01:47 AM8/26/18
to Dan, SWI-Prolog
Hi Dan,

> On Aug 26, 2018, at 2:56, Dan <gros...@gmail.com> wrote:
>
> Hi Kuniaki,
>
> I think I found the problem:
>
> I was running unit tests, with each test initializing the system again. Once i added tabling, i wasn't aware of the need for abolishing tables during the initialization of the system and hence each new unit tests. So, it seems that cached results stayed around across unit tests which made certain tests fail.
>

Your analysis sounds right. Yes, tabling seems to keep by default the table
across queries.

Now I am wondering if the tabling library can be applied to my ROZDD tasks, which is
currently done manually using rehashing to reuse intermediate results.
Tabling looks much smarter.

Kuniaki Mukai
Reply all
Reply to author
Forward
0 new messages