blah blaha

parent af4199c7
......@@ -2342,7 +2342,9 @@ Now you typically build this and make sure to save the old gc.so that guile is u
@code{./configure --with-logical-gc}
And then make, make install and you will run guile-log with garbage collection on. Happy hacking!
And then make, make install and you will run guile-log with garbage collection on. Then on to happy hacking!.
To note is that only variables and cons cells allocated from stacks will support garbage collecting. Knaren style variables is fundamentally broken with respect to this and one need for that style use other techniques like making use of return variables in functions and the small but potent hacks you may find in the kanren sources. Another option is to make use of guile-log's @code{<call>} that will basically only transfer the set of variables in the result essentially skiping all intermediate allocations.
@node Index
@chapter Index of the guile-log api
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<html lang="en">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>expressions - Preliminary Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Preliminary Manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="parsing.html#parsing" title="parsing">
<link rel="prev" href="parser-combinators.html#parser-combinators" title="parser combinators">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<title>Preliminary Manual: expressions</title>
<meta name="description" content="Preliminary Manual: expressions">
<meta name="keywords" content="Preliminary Manual: expressions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index.html#Index" rel="index" title="Index">
<link href="parsing.html#parsing" rel="up" title="parsing">
<link href="sed_002fgrep.html#sed_002fgrep" rel="next" title="sed/grep">
<link href="parser-combinators.html#parser-combinators" rel="prev" title="parser combinators">
<style type="text/css">
<!--
This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body>
<div class="node">
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="expressions"></a>
<div class="header">
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="parser-combinators.html#parser-combinators">parser combinators</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="parsing.html#parsing">parsing</a>
<hr>
Previous: <a href="parser-combinators.html#parser-combinators" accesskey="p" rel="prev">parser combinators</a>, Up: <a href="parsing.html#parsing" accesskey="u" rel="up">parsing</a> &nbsp; [<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Expressions"></a>
<h3 class="section">7.3 Expressions</h3>
<p>This is a configureable expression parser that can be used for prolog parsing as well as parsing C and C++ expressions. To note is that the data is functionally updated and hence one can store the state at will and later reinstate the parser. The parser ideom is a direct translation of the commonly described prolog parser written in prolog to guile-log. It is then extended to allow ternial operators like <code>?</code> in c as well. To use it load the module <code>(logic guile-log parsing operator-parser)</code>
</p>
<a name="Api-2"></a>
<h4 class="subsection">7.3.1 Api</h4>
<p><a name="index-make_002dopdata-217"></a><code>(make-opdata)</code>, initiates a datastructure to containe needed operator data. The result is a fluid pointing to a functional datastructure.
<p><a name="index-add_002doperator-218"></a><code>(add-operator data type name level lf)</code>, This will add operator data to the opdata fluid <code>data</code>. <code>type</code> is the type of operator e.g. any of <code>xf,yf,fx,fy,xfx,xfy,yfx</code>, as of the standard meaning of these operators in prolog. <code>name</code> is a string or symbol representing the name of the operator and <code>level</code> is the anti binding strength of the operator e.g. higher value bind less. <code>lf</code> is a parser function that represents possible values to the right of the op-symbol matched, typically this will be <code>tok-ws</code>, but also for e.g. <code>?</code> it can be a parser function matching the middle part of in this operayor which ends with <code>:</code>.
<p><a name="index-rem_002doperator-219"></a><code>(rem-operator data type name)</code>, removes from the opdata fluid <code>data</code>, the slot represented by the type <code>type</code> and the operator name <code>name</code>.
<p><a name="index-mk_002doperator_002dexpression-220"></a><code>(mk-operator-expression atom rest-atom data)</code>, will return a parser meta function representing the operator configuration in <code>data</code>, with atom parser function <code>atom</code> and a secondary choised atom if that fails in <code>rest-atom</code>. The returned meta parser function, say <code>ff</code> is typically turned into a parser function for the expression through:
<p><code>(ff high-level)</code>, with <code>high-level</code>, the highes level found in the table.
<p>The generator parser <code>f</code> can then be used to match an expression and outpits a syntactic tree with nodes according to e.g.
<pre class="verbatim">(parse ``1 + -2'' f)
-->
<a name="index-make_002dopdata"></a>
<p><code>(make-opdata)</code>, initiates a datastructure to containe needed operator data. The result is a fluid pointing to a functional datastructure.
</p>
<a name="index-add_002doperator"></a>
<p><code>(add-operator data type name level lf)</code>, This will add operator data to the opdata fluid <code>data</code>. <code>type</code> is the type of operator e.g. any of <code>xf,yf,fx,fy,xfx,xfy,yfx</code>, as of the standard meaning of these operators in prolog. <code>name</code> is a string or symbol representing the name of the operator and <code>level</code> is the anti binding strength of the operator e.g. higher value bind less. <code>lf</code> is a parser function that represents possible values to the right of the op-symbol matched, typically this will be <code>tok-ws</code>, but also for e.g. <code>?</code> it can be a parser function matching the middle part of in this operayor which ends with <code>:</code>.
</p>
<a name="index-rem_002doperator"></a>
<p><code>(rem-operator data type name)</code>, removes from the opdata fluid <code>data</code>, the slot represented by the type <code>type</code> and the operator name <code>name</code>.
</p>
<a name="index-mk_002doperator_002dexpression"></a>
<p><code>(mk-operator-expression atom rest-atom data)</code>, will return a parser meta function representing the operator configuration in <code>data</code>, with atom parser function <code>atom</code> and a secondary choised atom if that fails in <code>rest-atom</code>. The returned meta parser function, say <code>ff</code> is typically turned into a parser function for the expression through:
</p>
<p><code>(ff high-level)</code>, with <code>high-level</code>, the highes level found in the table.
</p>
<p>The generator parser <code>f</code> can then be used to match an expression and outpits a syntactic tree with nodes according to e.g.
</p><pre class="verbatim">(parse ``1 + -2'' f)
--&gt;
(('xfy ``+'' _ _) (#:number 1) (('yf ``-'' _ _) (#:number 2) 4 0) 2 0)
</pre>
<p>That is a binary oparator is of the form,
</p>
<p><code>((type operator-name level _) term-left term-right column line)</code>
</p>
<p>And a unary operator is matched by
</p>
<p><code>((type operator-name level _) term column line)</code>.
</p>
<hr>
<div class="header">
<p>
Previous: <a href="parser-combinators.html#parser-combinators" accesskey="p" rel="prev">parser combinators</a>, Up: <a href="parsing.html#parsing" accesskey="u" rel="up">parsing</a> &nbsp; [<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<p>That is a binary oparator is of the form,
<p><code>((type operator-name level _) term-left term-right column line)</code>
<p>And a unary operator is matched by
<p><code>((type operator-name level _) term column line)</code>.
</body></html>
</body>
</html>
<html lang="en">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>garbage-collect - Preliminary Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Preliminary Manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="prolog.html#prolog" title="prolog">
<link rel="next" href="Index.html#Index" title="Index">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<title>Preliminary Manual: garbage-collect</title>
<meta name="description" content="Preliminary Manual: garbage-collect">
<meta name="keywords" content="Preliminary Manual: garbage-collect">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<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-postpone.html#prolog-postpone" rel="prev" title="prolog postpone">
<style type="text/css">
<!--
This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body>
<div class="node">
<a name="garbage-collect"></a>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="garbage_002dcollect"></a>
<div class="header">
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Index.html#Index">Index</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="prolog.html#prolog">prolog</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
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>
</div>
<hr>
<a name="Prolog-1"></a>
<h2 class="chapter">11 Prolog</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
</p>
<p><code>https://gitorious.org/bdw-gc-logical-mod</code>
</p>
<p>Now you typically build this and make sure to save the old gc.so that guile is using (you can google how to find which shared libraries guile is using) and then clobber the bdw-gc .so file with the newly created one (sic). This is of cause not a simple thing to do, but until we can get some comparable feature in bdw-gc this is what you need to do. Then finally when configureing guile log do something like
</p>
<p><code>./configure --with-logical-gc</code>
</p>
<p>And then make, make install and you will run guile-log with garbage collection on. Then on to happy hacking!.
</p>
<p>To note is that only variables and cons cells allocated from stacks will support garbage collecting. Knaren style variables is fundamentally broken with respect to this and one need for that style use other techniques like making use of return variables in functions and the small but potent hacks you may find in the kanren sources. Another option is to make use of guile-log&rsquo;s <code>&lt;call&gt;</code> that will basically only transfer the set of variables in the result essentially skiping all intermediate allocations.
</p>
<p><code>https://gitorious.org/bdw-gc-logical-mod</code>
<p>Now you typically build this and make sure to save the old gc.so that guile is using (you can google how to find which shared libraries guile is using) and then clobber the bdw-gc .so file with the newly created one (sic). This is of cause not a simple thing to do, but until we can get some comparable feature in bdw-gc this is what you need to do. Then finally when configureing guile log do something like
<p><code>./configure --with-logical-gc</code>
<p>And then make, make install and you will run guile-log with garbage collection on. Happy hacking!
</body></html>
</body>
</html>
<html lang="en">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Preliminary Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Preliminary Manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="../index.html#dir" title="(dir)">
<link rel="next" href="umatch.html#umatch" title="umatch">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<title>Preliminary Manual: Top</title>
<meta name="description" content="Preliminary Manual: Top">
<meta name="keywords" content="Preliminary Manual: Top">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="#Top" rel="start" title="Top">
<link href="Index.html#Index" rel="index" title="Index">
<link href="../dir/index.html" rel="up" title="(dir)">
<link href="umatch.html#umatch" rel="next" title="umatch">
<style type="text/css">
<!--
This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body>
<h1 class="settitle">Preliminary Manual</h1>
<div class="node">
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<h1 class="settitle" align="center">Preliminary Manual</h1>
<a name="Top"></a>
<div class="header">
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="umatch.html#umatch">umatch</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="../index.html#dir">(dir)</a>
<hr>
Next: <a href="umatch.html#umatch" accesskey="n" rel="next">umatch</a>, Up: <a href="../dir/index.html" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Guile-Log"></a>
<h1 class="top">Guile Log</h1>
<p>Documentation for the Guile-Log Logic Programming Environment for Guile 2.0 v0.4
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="umatch.html#umatch" accesskey="1">umatch</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">low level infrastructure.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="guile_002dlog.html#guile_002dlog" accesskey="2">guile-log</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">This is the guile-log basic macro environment
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="acumulators_002fgenerators.html#acumulators_002fgenerators" accesskey="3">acumulators/generators</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Hot to collect and generate sequences of solutions.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="postpone.html#postpone" accesskey="4">postpone</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">To postpone a search.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="dynamics.html#dynamics" accesskey="5">dynamics</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">catch prompt abort
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="dynamic_002dfunctions.html#dynamic_002dfunctions" accesskey="6">dynamic-functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Dynamicaly add, remove and execute clauses
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="parsing.html#parsing" accesskey="7">parsing</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A parsing framework.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="sed_002fgrep.html#sed_002fgrep" accesskey="8">sed/grep</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Sed and grep functionalities for scheme
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="kanren.html#kanren" accesskey="9">kanren</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Kanren implemented ontop of guile-log
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="prolog.html#prolog">prolog</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">iso-prolog
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="garbage_002dcollect.html#garbage_002dcollect">garbage-collect</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to enable full garbage colection of logical variables
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Index.html#Index">Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Complete index.
</td></tr>
</table>
<h2 class="unnumbered">Guile Log</h2>
<p>Documentation for the Guile-Log Logic Programming Environment for Guile 2.0 v0.4
<hr>
<div class="header">
<p>
Next: <a href="umatch.html#umatch" accesskey="n" rel="next">umatch</a>, Up: <a href="../dir/index.html" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<ul class="menu">
<li><a accesskey="1" href="umatch.html#umatch">umatch</a>: low level infrastructure.
<li><a accesskey="2" href="guile_002dlog.html#guile_002dlog">guile-log</a>: This is the guile-log basic macro environment
<li><a accesskey="3" href="acumulators_002fgenerators.html#acumulators_002fgenerators">acumulators/generators</a>: Hot to collect and generate sequences of solutions.
<li><a accesskey="4" href="postpone.html#postpone">postpone</a>: To postpone a search.
<li><a accesskey="5" href="dynamics.html#dynamics">dynamics</a>: catch prompt abort
<li><a accesskey="6" href="dynamic_002dfunctions.html#dynamic_002dfunctions">dynamic-functions</a>: Dynamicaly add, remove and execute clauses
<li><a accesskey="7" href="parsing.html#parsing">parsing</a>: A parsing framework.
<li><a accesskey="8" href="sed_002fgrep.html#sed_002fgrep">sed/grep</a>: Sed and grep functionalities for scheme
<li><a accesskey="9" href="kanren.html#kanren">kanren</a>: Kanren implemented ontop of guile-log
<li><a href="prolog.html#prolog">prolog</a>: iso-prolog
<li><a href="garbage_002dcollect.html#garbage_002dcollect">garbage-collect</a>: How to enable full garbage colection of logical variables
<li><a href="Index.html#Index">Index</a>: Complete index.
</ul>
</body></html>
</body>
</html>
<html lang="en">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>postpone - Preliminary Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Preliminary Manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="acumulators_002fgenerators.html#acumulators_002fgenerators" title="acumulators/generators">
<link rel="next" href="dynamics.html#dynamics" title="dynamics">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<title>Preliminary Manual: postpone</title>
<meta name="description" content="Preliminary Manual: postpone">
<meta name="keywords" content="Preliminary Manual: postpone">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index.html#Index" rel="index" title="Index">
<link href="index.html#Top" rel="up" title="Top">
<link href="dynamics.html#dynamics" rel="next" title="dynamics">
<link href="acumulators_002fgenerators.html#acumulators_002fgenerators" rel="prev" title="acumulators/generators">
<style type="text/css">
<!--
This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body>
<div class="node">
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="postpone"></a>
<div class="header">
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="dynamics.html#dynamics">dynamics</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="acumulators_002fgenerators.html#acumulators_002fgenerators">acumulators/generators</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
Next: <a href="dynamics.html#dynamics" accesskey="n" rel="next">dynamics</a>, Previous: <a href="acumulators_002fgenerators.html#acumulators_002fgenerators" accesskey="p" rel="prev">acumulators/generators</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>
</div>
<hr>
<a name="Postpone_002c-a-framework-for-postponing-guile_002dlog-evaluations_002e"></a>
<h2 class="chapter">4 Postpone, a framework for postponing guile-log evaluations.</h2>
<p>This code is available from <code>(logic guile-log postpone)</code> You may have noticed that guile log is a framework to do tree searches to meet a certain criteria and during the path in the tree create data structures that are able to undo and also redo it's state. Most people when approaching this will sooner or later be bitten by the NP hardness of many interesting problems. The solution might then be to try intelligent guesses in which branch the gold is hiding. What one would like to do is try a set of branches, freeze the different states and at that point create some sort of index that represent the likelihood of the gold lying buried beneath. Then an overall global decision can be taken and only the most promising paths will be further examined. It is for this use case the following system is constructed. Postpone mix well with the rest of prolog, but especially the <code>&lt;zip&gt;</code>, forms might behave unexpectedly due to teh postpone mechansim interfering with the synch and produce bad result.
<p>This code is available from <code>(logic guile-log postpone)</code> You may have noticed that guile log is a framework to do tree searches to meet a certain criteria and during the path in the tree create data structures that are able to undo and also redo it&rsquo;s state. Most people when approaching this will sooner or later be bitten by the NP hardness of many interesting problems. The solution might then be to try intelligent guesses in which branch the gold is hiding. What one would like to do is try a set of branches, freeze the different states and at that point create some sort of index that represent the likelihood of the gold lying buried beneath. Then an overall global decision can be taken and only the most promising paths will be further examined. It is for this use case the following system is constructed. Postpone mix well with the rest of prolog, but especially the <code>&lt;zip&gt;</code>, forms might behave unexpectedly due to teh postpone mechansim interfering with the synch and produce bad result.
</p>
<a name="Api_002e"></a>
<h3 class="section">4.1 Api.</h3>
<a name="index-postpone"></a>
<a name="index-postpone_002dframe"></a>
<p><a name="index-postpone-171"></a><a name="index-postpone_002dframe-172"></a>
<pre class="verbatim">G.L. (postpone val power)
G.L. (postpone-frame limit fact maxsize)
</pre>
To be able to postpone we must have a baseline from which we will base our restarts e.g. <code>postpone-frame</code>. The <code>postpone</code> command will basically evaluate <code>val</code> and postpone if it's larger then a certain limit that is governed by an initial value <code>limit</code> and <code>fact</code> - a factor that adds to the limit each postpone turn. The <code>power</code> is the sorting index used to manage a list of possible restarts for and this list is sorted so that we at restarts will try to use <code>maxsize</code> first elements of the list. The list is never larger then <code>10 * maxsize</code>.
</pre><p>To be able to postpone we must have a baseline from which we will base our restarts e.g. <code>postpone-frame</code>. The <code>postpone</code> command will basically evaluate <code>val</code> and postpone if it&rsquo;s larger then a certain limit that is governed by an initial value <code>limit</code> and <code>fact</code> - a factor that adds to the limit each postpone turn. The <code>power</code> is the sorting index used to manage a list of possible restarts for and this list is sorted so that we at restarts will try to use <code>maxsize</code> first elements of the list. The list is never larger then <code>10 * maxsize</code>.
</p>
<hr>
<div class="header">
<p>
Next: <a href="dynamics.html#dynamics" accesskey="n" rel="next">dynamics</a>, Previous: <a href="acumulators_002fgenerators.html#acumulators_002fgenerators" accesskey="p" rel="prev">acumulators/generators</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>
</div>
</body></html>
</body>
</html>
<html lang="en">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>prolog - Preliminary Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Preliminary Manual">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="kanren.html#kanren" title="kanren">
<link rel="next" href="garbage_002dcollect.html#garbage_002dcollect" title="garbage-collect">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<title>Preliminary Manual: prolog</title>
<meta name="description" content="Preliminary Manual: prolog">
<meta name="keywords" content="Preliminary Manual: prolog">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index.html#Index" rel="index" title="Index">
<link href="index.html#Top" rel="up" title="Top">
<link href="running.html#running" rel="next" title="running">
<link href="kanren.html#kanren" rel="prev" title="kanren">
<style type="text/css">
<!--
This is a preliminary manual of guile-log package for guile-2.0
Copyright (C) 2012 Stefan Israelsson Tampe-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body>
<div class="node">
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="prolog"></a>
<div class="header">
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="garbage_002dcollect.html#garbage_002dcollect">garbage-collect</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="kanren.html#kanren">kanren</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
Next: <a href="garbage_002dcollect.html#garbage_002dcollect" accesskey="n" rel="next">garbage-collect</a>, Previous: <a href="kanren.html#kanren" accesskey="p" rel="prev">kanren</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>
</div>
<hr>
<a name="Prolog"></a>
<h2 class="chapter">10 Prolog</h2>
<p>Guile log also sports an iso-prolog interface as a logic programming interface besides kanren. The interface is pretty complete at this point appart a few points that have not yet been resolved but sure it is currently alpha software and help is very very much appriciated. With this most programs written in iso prolog should probably work. The intention is to enhance this interface so that the bulk of already written prolog programs should be able to run on guile. We will also add the fetures unique to guile-log and hence enhance the prolog experience. Featurewise guile-log prolog is taking over many properties of scheme like closures, continuations, delimeted continuations, the interleaving constructs of kanren and a delicate system to treat dynamic objects like dynamic functions, dynamic hashes and a library to tell how you want the dynamism to work at a fine grained level.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="running.html#running" accesskey="1">running</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to hook in prolog code
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="interpreter.html#interpreter" accesskey="2">interpreter</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A interactive shell for prolog
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="deviations.html#deviations" accesskey="3">deviations</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">What is different and not according to standard and why.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="modules.html#modules" accesskey="4">modules</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to handle name spacing
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="scheme.html#scheme" accesskey="5">scheme</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Hooking in scheme expressions
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="closures.html#closures" accesskey="6">closures</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Using closures in prolog
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="prolog_002ddynamic_002dfunctions.html#prolog_002ddynamic_002dfunctions" accesskey="7">prolog-dynamic-functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A discussion of guile log&rsquo;s version of this
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="dynamic_002dfeatures.html#dynamic_002dfeatures" accesskey="8">dynamic-features</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Special construct to manage dynamic objects