Jump to content

Tabled logic programming

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Felix QW (talk | contribs) at 14:55, 27 October 2023 (Add source). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Tabling is a technique first developed for natural language processing, where it was called Earley parsing (Kay Reference Kay1967; Earley Reference Earley1970). It consists of storing in a table (a.k.a. chart in the context of parsing) partial successful analyses that might come in handy for future reuse.

Its adaptation into a logic programming proof procedure, under the name of Earley deduction, dates from an unpublished note from 1975 by David H.D. Warren, as documented by Pereira and Shieber (Reference Pereira and Shieber1987). An interpretation method based on tabling was later developed by Tamaki and Sato (Reference Tamaki and Sato1986), modeled as a refinement of SLD-resolution.

David S. Warren Footnote5 and his students adopted this technique with the motivation of changing Prolog’s semantics from the completion semantics to the minimal model semantics.

Indeed, the completion semantics cannot faithfully capture important concepts such as the transitive closure of a graph or relation. The minimal model semantics is able to capture such concepts. Moreover, tabled execution terminates for corresponding programs such as for the transitive closure of a cyclic graph. This makes Prolog more declarative.

Tabling consists of maintaining a table of goals that are called during execution, along with their answers, and then using the answers directly when the same goal is subsequently called. Tabling gives a guarantee of total correctness for any (pure) Prolog program without function symbols, which was one of the goals of that work.

XSB Prolog (1994) The concept of tabled Prolog was introduced in XSB Prolog (Sagonas et al. Reference Sagonas, Swift and Warren1994). This resulted in a complete implementation (Rao et al. Reference Rao, Sagonas, Swift, Warren, Freire and Notes1997) of the well-founded semantics (Van Gelder et al. Reference Van Gelder, Ross and Schlipf1991), a three-valued semantics that represents values for true, false and unknown.

As of 17 May 2022, this article is derived in whole or in part from Fifty Years of Prolog and Beyond, authored by Philipp Körner, Michael Leuschel, Joao Barbosa, Vitor Santos Costa, Veronica Dahl, Manuel V. Hermenegildo, Jose F. Morales, Jan Wielemaker, Daniel Diaz, Salvador Abreu, Giovanni Ciatto. The copyright holder has licensed the content in a manner that permits reuse under CC BY-SA 3.0 and GFDL. All relevant terms must be followed.

References

Körner, Pjilipp; Leuschel, Michael; Barbosa, Joao; Costa, VÍTOR SANTOS; DAHL, VERÓNICA; HERMENEGILDO, MANUEL V.; MORALES, JOSE F.; WIELEMAKER, JAN; DIAZ, DANIEL; ABREU, SALVADOR; CIATTO, GIOVANNI (2022-05-17). "Fifty Years of Prolog and Beyond". Theory and Practice of Logic Programming. 22 (6): 776–858. doi:10.1017/s1471068422000102. ISSN 1471-0684.