Questions tagged [prolog-tabling]

Tabling is a memoization technique for Prolog and in general Tabled Logic Programming that improves efficiency and termination.

Tabling is a memoization technique for Prolog and in general Tabled Logic Programming that improves efficiency and termination. While very simplistic forms of tabling can be implemented using the dynamic database, more sophisticated approaches require specific implementation support.

Current implementations offering various forms of tabling:

, , .

11 questions
6
votes
4 answers

Removing left recursion in DCG - Prolog

I've got a small problem with left recursion in this grammar. I'm trying to write it in Prolog, but I don't know how to remove left recursion. -> ->
Finley Osbert
  • 103
  • 2
  • 8
5
votes
1 answer

Bounded tabling

Quite recently, I started playing around with tabling in Prolog; some experiments that I did with b-prolog and xsb can be found in this question. With the tables getting bigger and bigger, I realized that I needed to find some tabling options /…
repeat
  • 18,496
  • 4
  • 54
  • 166
5
votes
0 answers

How does tabling improve efficiency?

I am curious about how tabling works to improve efficiency of Prolog programs. How is it implemented? Both explanation and references are welcome.
day
  • 2,292
  • 1
  • 20
  • 23
4
votes
3 answers

Prolog Query Duplicates

I've seen a few questions on this topic, however none of them really answers my question properly. I'll write a small example, here are some facts: football(john). football(sam). tennis(john). tennis(pete). netball(sandy). I want to create a rule…
4
votes
1 answer

Uneven tabling performance in BProlog 8.1

I did a few experiments with the tabling capabilities of b-prolog version 8.1 and was quite surprised by the performance I observed. Here is the code that I used. It counts the number of Collatz steps N required for reducing some positive integer I…
repeat
  • 18,496
  • 4
  • 54
  • 166
2
votes
2 answers

Memorising (and caching) solutions found in a Prolog query?

In this question on StackExchange I've asked (and it has been solved) about a Prolog program I have been trying to create. But while it works in principle, it doesn't scale to my real world need. Before I start learning yet another language…
gctwnl
  • 217
  • 1
  • 8
2
votes
2 answers

Optimal planning with incrementally tabled abductive logic programming

I'd like to use abductive logic programming to find optimal plans. Exhaustively searching the space of plans would be impractical but there are ordering heuristics that, in ordinary logic programming, would be used to represent facts (ground…
user3673
  • 665
  • 5
  • 21
1
vote
1 answer

Anytime strongly connected components via Prolog

Markus Triska has reported an algorithm to determine strongly connected components (SCC). Is there a solution which determines the SCC without making use of attributed variable and that can work anytime. So that some vertices can have infinitely…
user502187
0
votes
2 answers

XSB Prolog partial order tabling

I'm trying an example from XSB Version 3.3.5 manual (from "Partial Order Answer Subsumption"): :- table sp(_,_,po(
Sergii Dymchenko
  • 6,890
  • 1
  • 21
  • 46
0
votes
1 answer

Tabling in Prolog Game Search for Tic-Tac-Toe

Many Prolog systems meanwhile implement tabling. SWI-Prolog has adopted much of XSB tabling. XSB tabling suggest converting game search: win(X) :- move(X,Y), \+ win(Y). Into this tabling: :- table win/1. win(X) :- move(X,Y), tnot(win(Y)) Is it…
user502187
0
votes
2 answers

Prolog Database Recording

I have this factorial predicate. fact(0, 1). fact(N, F) :- N > 0, N1 is N-1, fact(N1, F1), F is F1 * N. How do I change this predicate such that every time a query is issued, the result of the calculation is stored in the…