]> Repositorios git - scryer-prolog.git/commitdiff
DOC: initial documentation for library(tabling) in DocLog format
authorMarkus Triska <[email protected]>
Wed, 25 Jan 2023 23:20:53 +0000 (00:20 +0100)
committerMarkus Triska <[email protected]>
Wed, 25 Jan 2023 23:20:53 +0000 (00:20 +0100)
src/lib/tabling.pl

index 94dd4238bfa01ff4d3753122a675baea6cd9fb89..a63dd54f39fe3774ecfa0ccd57f6800c310dae5b 100644 (file)
@@ -1,3 +1,27 @@
+/** Tabling, also called SLG resolution.
+
+    SLG resolution is an alternative execution strategy that sometimes
+    helps to improve termination and performance characters of Prolog
+    predicates.
+
+    To enable this execution strategy for a Prolog predicate, add a
+    `(table)/1` directive, using the prefix operator `table` that this
+    module defines. For example, to enable tabling for the predicate
+    `p/2`, use:
+
+```
+:- use_module(library(tabling)).
+
+:- table p/2.
+
+...
+```
+
+    The possibility to apply different execution strategies is one of
+    the greatest attractions of pure Prolog code, and one of the
+    strongest arguments for keeping to the pure core of Prolog as far
+    as possible.
+*/
 
 :- module(tabling,
          [ start_tabling/2,            % +Wrapper, :Worker.