doc update

parent ea1de2a7
......@@ -26,24 +26,26 @@ Version 0.5, TODO
- f-cons and similar tools for functional AST creation.
- Debug features
* Multi threading capabilities (all)
* Tablating (all) DONE
* Circular datastructures (all) DONE
* Refined index lookup datastructure (guile-log)
* Sandboxing (prolog)
* Improved documentation (all)
* Improved documentation (all)
* Keyword objects and logic values (prolog) DONE
* GC of prolog variables (all) DONE
* Attributed variables (all) DONE
* corouttines (prolog) DONE
* Debugging facilities (prolog) DONE
* Better error messages (prolog) DONE
* Better compilation errors (prolog) DONE
* Use guile variables when possible (prolog) DONE
Version 0.6, TODO
* GC of the (almost) unreachable tail of a stream (all)
* Multi threading capabilities (all)
* Sandboxing (prolog)
* More general functional hashmps (all)
* Ordinary hash maps (all)
* Attributed variables (all) DONE
* corouttines (prolog) DONE
* Debugging facilities (prolog)
* Better error messages (prolog)
* Better compilation errors (prolog)
* Faster compilation (prolog)
* Better compilation errors (prolog)
* Improved matcher (prolog)
* Use guile variables when possible (prolog) DONE
* vectors (prolog)
* structs (prolog)
......@@ -1808,6 +1808,7 @@ Guile log also sports an iso-prolog interface as a logic programming interface b
* prolog-dynamic-functions:: A discussion of guile log's version of this
* dynamic-features:: Special construct to manage dynamic objects
* prolog-libraries:: Libraries that exposes guile-log features
* debugging:: How to debug prolog programs
@end menu
@node running
......@@ -2298,6 +2299,7 @@ There are a few interesting datastructures and algorithm taken from guile-log th
* prolog postpone:: Postpone facilities.
* prolog attributes:: Attributed vairbales for prolog
* prolog coroutines:: Coroutining
* prolog canonical:: Canonical representation of rational data
@end menu
@node prolog interleaving
......@@ -2502,9 +2504,10 @@ you find this library at @code{(logic guile-log guile-prolog attribute)}, the in
@subsection Prolog coroutines framework
Guile prolog coroutining is a development ontop of attributed variables, it contains code that can be used from the library @code{(logic guile-log guile-prolog coroutine)}.
@findex freeze
@code{prolog freeze(Var,Goal)}, evaluate @code{Goal} when @code{Var} is bound.
@findex freezeBig
@code{prolog freezeBig(Var, Goal, Unwinder)}, the same as above, but @code{Unwinder}, will be called at backtracking over this signal.
......@@ -2520,14 +2523,18 @@ prolog@(guile-user)> freeze(X,write(bound)),X=Y.
more (y/n/a/s) >
@end verbatim
@findex frozen
@code{prolog frozen(Var, Goal)}, find the goals @code{Goal} associated to fromzen var @code{Var}
@findex freezeId
@code{freezeId}, the identity of the attribute associated with @code{freeze}
@findex when
@code{prolog when(Signal, Goal)}, @code{Signal} is an expression using operators ``,'' ``;'' ``='', @code{nonvar(X)} and @code{ground(X)}. When an binding appears this expression will be checked for validity and if so @code{Goal} is executed.
@code{prolog when(Signal, Goal, Off)}, the same as above but @code{Off} is true a no signals will be applied if the variable is reseted to a new value.
@findex whenBig
@code{prolog whenBig(Signal, Goal, PreGoal, Unwinder)}, the same as above, but @code{PreGoal} is executed before the binding is done, and @code{Unwinder} is code that is executed at the unwinding of an successful signaled.
......@@ -2543,10 +2550,12 @@ more (y/n/a/s) > n
@code{prolog whenBig(Signal, Goal, Off, PreGoal, Unwinder)} The same as above but with an @code{Off} variable.
@findex with_coroutine
@code{with_coroutines(X,Constructor, Code)}, this will apply a coroutine constructor @code{Constructor}, and in that there is a reference to @code{X}, that needs to be an attribute, this will then be a model for variables that are created under an auto atributize environmentm kike using a functor @code{adaptable_vars}. inside the @code{Code} goal.
@code{prolog with_coroutines(X,[References,...],Constr,Code)}, the same as above, but all variables inside @code{References} will not be copied but referenced. The default is to copy.
@findex auto
@code{prolog auto(Var)}, this will asume that @code{Var} is a variable and will bless is throug binding it to an auto coroutine variable as descrived above.
......@@ -2579,8 +2588,39 @@ ok
Z = 1
Y = [1, 1]
@end verbatim
@node prolog canonical
@subsection Prolog Canonical Representation
In especially tablating, but also in other recursive datastructures like printing of these datastructures one need a canonical representation that conforms to a unique referential structure. One such is implemented in @code{(logiv guile-log guile-prolog canon)}. To enable this feature in e.g. tablating one need to use,
@findex canonize
@code{prolog canonize(f,arg ...)}, this goal will apply the goal @code{f} to args @code{arg ...} so that any tablating operation or memo operation will be done using a canonical representation, it is also possible to use this goal function together with @code{functorize}, as a prolog functor. You may get a direct representation through,
@findex recursive_canonize
@code{prolog recursive_canonize(X,Out)}, which will produce as output a canonical representation of @code{X}.
@node debugging
@section How to debug prolog programs
@findex Trace
@findex Level
@findex trace
@findex trace-level
There is a simple tracing framework that can be used. If one are using @code{compile-prolog-string} use syntax parameters @code{Trace = #f/#t} to make all function goals defined to be under tracing supervision and use the syntax parameter @code{Level} do define the default level. It is possible to force a single defineition of a goal functions to be traced by using the prolog functor
@code{prolog -trace}.
To define the level of the traced function use
@code{prolog -trace(level)}.
When running the level of the run is controled by @code{trace-level} and all defined goal functions that have trace enabled will be printed if,
@code{Level <= trace-level}
The simplest way to use this feature is to just use the functot @code{-trace} on the functions that needs to be traced.
@node garbage-collect
@chapter Prolog
@chapter Garbage Collection
Guile log sports full garbage collection of logical variables which makes it suitable to run server like prolog code. It is experimental but working. Unfourtunately the bdw-gc that guile uses does not allow this to work effectively and hence you need to download and replace the standard bdw-gc with a modified version of it. You may find it at
This diff is collapsed.
......@@ -16,7 +16,7 @@ Copyright (C) 2012 Stefan Israelsson Tampe -->
<link href="Index.html#Index" rel="index" title="Index">
<link href="index.html#Top" rel="up" title="Top">
<link href="Index.html#Index" rel="next" title="Index">
<link href="prolog-coroutines.html#prolog-coroutines" rel="prev" title="prolog coroutines">
<link href="debugging.html#debugging" rel="prev" title="debugging">
<style type="text/css">
a.summary-letter {text-decoration: none}
......@@ -56,8 +56,8 @@ {list-style: none}
Next: <a href="Index.html#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="prolog.html#prolog" accesskey="p" rel="prev">prolog</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
<a name="Prolog-1"></a>
<h2 class="chapter">14 Prolog</h2>
<a name="Garbage-Collection"></a>
<h2 class="chapter">14 Garbage Collection</h2>
<p>Guile log sports full garbage collection of logical variables which makes it suitable to run server like prolog code. It is experimental but working. Unfourtunately the bdw-gc that guile uses does not allow this to work effectively and hence you need to download and replace the standard bdw-gc with a modified version of it. You may find it at
......@@ -81,6 +81,8 @@ Next: <a href="garbage_002dcollect.html#garbage_002dcollect" accesskey="n" rel="
<tr><td align="left" valign="top">&bull; <a href="prolog_002dlibraries.html#prolog_002dlibraries">prolog-libraries</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Libraries that exposes guile-log features
<tr><td align="left" valign="top">&bull; <a href="debugging.html#debugging">debugging</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to debug prolog programs
......@@ -19,6 +19,7 @@
#:use-module (logic guile-log)
#:export (reset-flags reset-prolog set)
#:re-export (;; Functor management
Trace Level trace-level
functorize adaptable_vars trace
;; Scheme functions
......@@ -27,7 +27,8 @@
#:use-module (logic guile-log parser)
#:export (compile-prolog-string compile-prolog-file
trace read-prolog-term save-operator-table))
trace read-prolog-term save-operator-table
Trace Level trace-level))
(define (goal stx x)
((@ (logic guile-log prolog goal) goal) stx x))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment