Commits

Pjotr Kourzanov committed 05600a6

add generated docs for beseq and sequel

Comments (0)

Files changed (27)

doc/beseq.pdf

Binary file added.

doc/beseq/00534a7a980de9db23c1bdf9cdbde215.png

Added
New image

doc/beseq/064ca85ebfbf827b38f7748e090ec817.png

Added
New image

doc/beseq/24eb46e832268b3a8c101a6ec5c9084a.png

Added
New image

doc/beseq/24f530dc6e7abdf262696f88ecb8e1c6.png

Added
New image

doc/beseq/2a67cc44007effce3be5a8d3b4cea6c2.png

Added
New image

doc/beseq/3001ead682a2ec7da223718d8ab237bd.png

Added
New image

doc/beseq/4a3e7e08d8d24dbb2c48cbcf4f2f3cf5.png

Added
New image

doc/beseq/4c5483de1c496c527527b927f80f9bb0.png

Added
New image

doc/beseq/530493bfd3dcb7fec6593c8c346a4ebd.png

Added
New image

doc/beseq/6364d3f0f495b6ab9dcf8d3b5c6e0b01.png

Added
New image

doc/beseq/6bacb9986c36fa85a5cec411d8d9e1cd.png

Added
New image

doc/beseq/a159b61a2221d23bb55d352231cab456.png

Added
New image

doc/beseq/b9c41f923a7807abea1fc28ab8c9fdde.png

Added
New image

doc/beseq/beseq-hier.png

Added
New image
+<!-- this file was generated automatically by noweave; better not edit it-->
+<html><head><title>/dev/fd/63 beseq.nw common.nw /dev/fd/62</title></head><body><!-- TeX header to include in literal output-->
+
+<!--Copyright (C) 2008 NXP Semiconductors B.V.-->
+
+<!--This file is part of LIME.-->
+
+<!--LIME is free software: you can redistribute it and/or modify-->
+<!--it under the terms of the GNU General Public License version 2-->
+<!--as published by the Free Software Foundation; either version 2-->
+<!--of the License, or (at your option) any later version.-->
+
+<!--LIME is distributed in the hope that it will be useful,-->
+<!--but WITHOUT ANY WARRANTY; without even the implied warranty of-->
+<!--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-->
+<!--GNU General Public License for more details.-->
+
+<!--You should have received a copy of the GNU General Public License-->
+<!--along with LIME.  If not, see <http://www.gnu.org/licenses/>.-->
+
+
+
+
+
+
+<p>
+
+
+<p>
+
+
+
+<p>
+<!-- TeX definitions to include in literal output--><!--Copyright (C) 2008 NXP Semiconductors B.V.--><!--This file is part of LIME.--><!--LIME is free software: you can redistribute it and/or modify--><!--it under the terms of the GNU General Public License version 2--><!--as published by the Free Software Foundation; either version 2--><!--of the License, or (at your option) any later version.--><!--LIME is distributed in the hope that it will be useful,--><!--but WITHOUT ANY WARRANTY; without even the implied warranty of--><!--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the--><!--GNU General Public License for more details.--><!--You should have received a copy of the GNU General Public License--><!--along with LIME.  If not, see <http://www.gnu.org/licenses/>.--><h1><a name=toc1>beseq: design and specification</a></h1><h2></h2><h2>including implementation</h2><p><address>Pjotr Kourzanov</address>
+<p>
+
+
+
+
+
+
+<h1><a name=toc2><br></a></h1>
+<address></address>
+
+<!--title goes here-->
+<p>
+<tableofcontents>
+<ul compact>
+<li><a href="#toc3">Introduction</a></li>
+<li><a href="#toc4">Processing</a></li>
+  <ul compact>
+  <li><a href="#toc5">Finding unconnected ports</a></li>
+  <li><a href="#toc6">Generating static schedule</a></li>
+    <ul compact>
+    <li><a href="#toc7">Preliminaries</a></li>
+    <li><a href="#toc8">Activating static schedule</a></li>
+    </ul>
+  <li><a href="#toc9">Integration</a></li>
+  </ul>
+<li><a href="#toc10">Common and miscellaneous stuff</a></li>
+  <ul compact>
+  <li><a href="#toc11">Generic FP helpers</a></li>
+  <li><a href="#toc12">SXPath trickery</a></li>
+  <li><a href="#toc13">GXF preprocessing</a></li>
+  <li><a href="#toc14">Debugging</a></li>
+  <li><a href="#toc15">Trashbin</a></li>
+  </ul>
+<li><a href="#toc16">Acronyms</a></li>
+<li><a href="#toc17">Revisions</a></li>
+<li><a href="#toc18">Indices</a></li>
+  <ul compact>
+  <li><a href="#toc19">Chunks</a></li>
+  <li><a href="#toc20">Identifiers</a></li>
+  </ul>
+</ul>
+</tableofcontents>
+<p>
+
+<center><p><b>Figure 1: Refinement hierarchy<p><a name="NWref-beseq-hier"><img src="beseq-hier.png" usemap="#beseq_hier"></a></p></b></center>
+<h2><a name=toc3><a name="NWD1myE43-2">Introduction</a></a></h2><a name="sec:intro"><b>[*]</b></a><!---*- mode:Noweb; noweb-code-mode:bee-mode -*--->
+<p>
+<a name="NWD1myE43-3">In future, do </a><em>buffer minimization</em> (via C unions)
+<p><a name="NWD1myE43-4">In future, do sparation of stages into several contexts (for e.g., state handling)</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-2L4jyQ-1" href="#NWD1myE43-4"><dfn>&lt;Interpreted.scm&gt;=</dfn></a><a name="Interpreted.scm"/> <b>[D<a href="#NWD1myE43-W">-&gt;</a>]</b>
+(module
+  <a href="#NWD1myE43-4">beseq</a>
+<a name="NW1myE43-2L4jyQ-1-u1" href="#NWD1myE43-5"><i>&lt;libraries&gt;</i></a>
+  (import (sequel &quot;sequel-Interpreted.scm&quot;))
+  (<a href="#NWD1myE43-6">main</a> <a href="#NWD1myE43-6">main</a>))
+<a name="NW1myE43-2L4jyQ-1-u2" href="#NWD3ENQke-a"><i>&lt;Miscellaneous&gt;</i></a>
+<a name="NW1myE43-2L4jyQ-1-u3" href="#NWD3ENQke-10"><i>&lt;Interpreted globals&gt;</i></a>
+<a name="NW1myE43-2L4jyQ-1-u4" href="#NWD1myE43-A"><i>&lt;process&gt;</i></a>
+<a name="NW1myE43-2L4jyQ-1-u5" href="#NWD1myE43-6"><i>&lt;main&gt;</i></a>
+</pre><blockquote>Defines <a href="#NWI-beseq"><code>beseq</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-3szo1W-1" href="#NW1myE43-3szo1W-1"><dfn>&lt;Compiled.scm&gt;=</dfn></a><a name="Compiled.scm"/>
+(module
+  <a href="#NWD1myE43-4">beseq</a>
+<a name="NW1myE43-3szo1W-1-u1" href="#NWD1myE43-5"><i>&lt;libraries&gt;</i></a>
+  (import sequel)
+  (<a href="#NWD1myE43-6">main</a> <a href="#NWD1myE43-6">main</a>))
+<a name="NW1myE43-3szo1W-1-u2" href="#NWD3ENQke-a"><i>&lt;Miscellaneous&gt;</i></a>
+<a name="NW1myE43-3szo1W-1-u3" href="#NW3ENQke-4Gqms7-1"><i>&lt;Compiled globals&gt;</i></a>
+<a name="NW1myE43-3szo1W-1-u4" href="#NWD1myE43-A"><i>&lt;process&gt;</i></a>
+<a name="NW1myE43-3szo1W-1-u5" href="#NWD1myE43-6"><i>&lt;main&gt;</i></a>
+</pre><blockquote>Defines <a href="#NWI-beseq"><code>beseq</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-5">We rely heavily on the SSAX-SXML library. Other library imports are strictly only </a>
+needed in compiled mode...
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-3kQVLb-1" href="#NWD1myE43-5"><dfn>&lt;libraries&gt;=</dfn></a><a name="libraries"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b>
+(library ssax-sxml)
+(library glpk)
+(library slib)
+</pre></td></tr></table></center></font></pre><p><a name="NWD1myE43-6">Entry point to the tool.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-23uoZy-1" href="#NWD1myE43-6"><dfn>&lt;main&gt;=</dfn></a><a name="main"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b>
+(define
+  (<a href="#NWD1myE43-6">main</a> args)
+  (printf &quot;starting ~a ~a~<a href="#NWD3ENQke-14">n</a>&quot; (car args) (cdr args))
+  (<a href="#NWD3ENQke-k">return</a>
+    (with-input-from-file
+      input
+      (delay (<a href="#NWD1myE43-O">let</a>* ((in (ssax:xml-&gt;sxml (current-input-port) <a href="#NWD3ENQke-p">Namespaces</a>))
+                    (stem (list-ref (string-split (basename input) &quot;.&quot;) 0))
+                    (<a href="#NWD3ENQke-18">out</a> (<a href="#NWD1myE43-V">process</a> in stem)))
+                   ;(<a href="#NWD3ENQke-19">debug</a> in)                                                                  
+                   (print (<a href="#NWD3ENQke-l">cat</a> &quot;&lt;!DOCTYPE gxf PUBLIC &quot;
+                               &quot;'-//LIME/DTD gxf 1.0 Transitional//EN' &quot;
+                               &quot;'/home/pjotr/LIME/doc/gxf.dtd'&gt;&quot;))
+                   (srl:parameterizable
+                     <a href="#NWD3ENQke-18">out</a>
+                     (current-output-port)
+                     '(indent . #t)
+                     '(omit-xml-declaration . #t)
+                     '(standalone . yes)
+                     '(cdata-section-elements code)
+                     `(ns-prefix-assig <a href="#NWD3ENQke-10">,</a>@Namespaces))
+                   (newline)
+                   ;(<a href="#NWD1myE43-Q">gxf:activate</a> 'source_0 in)                                                 
+                   ;(<a href="#NWD1myE43-Q">gxf:activate</a> 'copy_0 in)                                                   
+                   ;(<a href="#NWD1myE43-Q">gxf:activate</a> 'sink_0 in)                                                   
+)))
+    where
+    (input = (<a href="#NWD3ENQke-1A">args-ref</a> args 1 &quot;test.gxf&quot;))))
+</pre><blockquote>Defines <a href="#NWI-main"><code>main</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><h2><a name=toc4>Processing</a></h2><a name="sec:process"><b>[*]</b></a>
+<p>
+For this transformation module, processing consists of 
+<p>
+<ol>
+<li><a name="NWD1myE43-7">hiding all connected ports (i.e., not passing then through)</a>
+<li>hiding all other internal structures (i.e., sub-nodes and codes)
+<li>finding unconnected ports (covered in unconnected)
+<li>finding a static schedule (covered in schedule)
+<li>collapsing internal nodes and codes into one single code block
+</ol>
+<p>
+<h3><a name=toc5><a name="NWD1myE43-8">Finding unconnected ports</a></a></h3><a name="ssec:unconnected"><b>[*]</b></a>
+<p>
+<a name="NWD1myE43-9">The main idea for the sequential BE is to collect all unconnected ports and make them</a>
+externally visible ports for the only node this back-end produces.
+<p>
+<a name="NWD1myE43-A">Ports are passed-through ``as-is''.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-354rpJ-1" href="#NWD1myE43-A"><dfn>&lt;process&gt;=</dfn></a><a name="process"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[D<a href="#NWD1myE43-B">-&gt;</a>]</b>
+(define <a href="#NWD1myE43-A">gxf:handle-port</a> <a href="#NWD3ENQke-a">Identity</a>)
+</pre><blockquote>Defines <a href="#NWI-gxf:handle-port"><code>gxf:handle-port</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-B">For each endpoint of an edge, retrieve the port structure from the supernode.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-354rpJ-2" href="#NWD1myE43-A"><dfn>&lt;process&gt;+=</dfn></a><a name="process"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD1myE43-A">&lt;-</a>D<a href="#NW1myE43-354rpJ-3">-&gt;</a>]</b>
+(define
+  (<a href="#NWD1myE43-B">gxf:handle-endpoint</a> sxml i p)
+  (begin ;(<a href="#NWD3ENQke-19">debug</a> i p)                                                                 
+         `((<a href="#NWD3ENQke-10">,</a>i
+            <a href="#NWD3ENQke-10">,</a>(car (<a href="#NWD1myE43-A">gxf:handle-port</a>
+                    (<a href="#NWD3ENQke-u">Xs</a> sxml
+                        &quot;gxf/node[id=<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a>]/port[id=<a href="#NWD3ENQke-l">$</a>p]&quot;
+                        where
+                        (<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a> = (<a href="#NWD3ENQke-11">gxf:super-node</a> sxml i))
+                        (<a href="#NWD3ENQke-l">$</a>p = p))))))))
+</pre><blockquote>Defines <a href="#NWI-gxf:handle-endpoint"><code>gxf:handle-endpoint</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-C">The function to retrieve unconnected ports for a graph</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-3qzw56-1" href="#NWD1myE43-C"><dfn>&lt;retrieve input and output ports&gt;=</dfn></a><a name="retrieve input and output ports"/> <b>(<a href="#NW1myE43-354rpJ-3">U-&gt;</a>)</b>
+(<a href="#NWD1myE43-M">labels</a>
+  ((<a href="#NWD1myE43-C">types-&gt;ports</a>
+     (expr x)
+     (<a href="#NWD3ENQke-j">forall</a>
+       ((nt &lt;- x))
+       where
+       (pair? (<a href="#NWD3ENQke-u">Xs</a> (cdr nt) expr))
+       returns
+       (<a href="#NWD1myE43-O">let</a> <a href="#NWD1myE43-C">loop</a>
+            ((l (<a href="#NWD3ENQke-u">Xs</a> (cdr nt) expr)) (res '()))
+            (cond ((null? l) res)
+                  (else (<a href="#NWD1myE43-C">loop</a> (cdr l)
+                              (append `((<a href="#NWD3ENQke-10">,</a>(car nt) <a href="#NWD3ENQke-10">,</a>(car l))) res))))))))
+  `((all-in <a href="#NWD3ENQke-10">,</a>@(<a href="#NWD1myE43-C">types-&gt;ports</a> &quot;port[const]&quot; x))
+    (all-<a href="#NWD3ENQke-18">out</a> <a href="#NWD3ENQke-10">,</a>@(<a href="#NWD1myE43-C">types-&gt;ports</a> &quot;port[not(const)]&quot; x))))
+</pre><blockquote>Defines <a href="#NWI-loop"><code>loop</code></a>, <a href="#NWI-types-&gt;ports"><code>types-&gt;ports</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-2GSHEW-1" href="#NW1myE43-2GSHEW-1"><dfn>&lt;find all unconnected ports using 4 lists&gt;=</dfn></a><a name="find all unconnected ports using 4 lists"/> <b>(<a href="#NW1myE43-354rpJ-3">U-&gt;</a>)</b>
+(<a href="#NWD1myE43-M">labels</a>
+  ((<a href="#NW1myE43-2GSHEW-1">find-unconnected</a>
+     (all connected)
+     (<a href="#NWD1myE43-O">let</a> <a href="#NWD1myE43-C">loop</a>
+          ((x (cdr all)) (res '()))
+          ;(and (pair? x) (printf &quot;x=~s~<a href="#NWD3ENQke-14">n</a>&quot; (car x)))                                   
+          ;(and (pair? x) (printf &quot;i=~s~<a href="#NWD3ENQke-14">n</a>&quot; (cdr connected)))                           
+          (cond ((null? x) res)
+                (else (if (assoc (car x) (cdr connected))
+                          (<a href="#NWD1myE43-C">loop</a> (cdr x) res)
+                          (<a href="#NWD1myE43-C">loop</a> (cdr x)
+                                (cons (<a href="#NWD3ENQke-y">copy-port</a> (cadar x) (caar x)) res))))))))
+  (append
+    (<a href="#NW1myE43-2GSHEW-1">find-unconnected</a> all-in incoming)
+    (<a href="#NW1myE43-2GSHEW-1">find-unconnected</a> all-<a href="#NWD3ENQke-18">out</a> <a href="#NW1myE43-354rpJ-3">outgoing</a>)))
+</pre><blockquote>Defines <a href="#NWI-find-unconnected"><code>find-unconnected</code></a>, <a href="#NWI-loop"><code>loop</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-354rpJ-3" href="#NWD1myE43-A"><dfn>&lt;process&gt;+=</dfn></a><a name="process"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD1myE43-B">&lt;-</a>D<a href="#NWD1myE43-G">-&gt;</a>]</b>
+(define
+  (<a href="#NW1myE43-354rpJ-3">gxf:collapsed-ports</a> sxml)
+  ;(<a href="#NWD3ENQke-19">debug</a> sxml)                                                                
+  (<a href="#NWD3ENQke-k">return</a>
+    (<a href="#NWD1myE43-O">let</a> ((<a href="#NW1myE43-354rpJ-3">outgoing</a> (caar <a href="#NWD3ENQke-v">r</a>))
+          (incoming (cadar <a href="#NWD3ENQke-v">r</a>))
+          (all-in (caadr <a href="#NWD3ENQke-v">r</a>))
+          (all-<a href="#NWD3ENQke-18">out</a> (cadadr <a href="#NWD3ENQke-v">r</a>)))
+<a name="NW1myE43-354rpJ-3-u1" href="#NW1myE43-2GSHEW-1"><i>&lt;find all unconnected ports using 4 lists&gt;</i></a>
+)
+    where
+    (<a href="#NWD3ENQke-v">r</a> =
+       (pre-post-order
+         sxml
+         `((*TOP* *macro*
+                  unquote
+                  (lambda
+                    top
+                    (list `((<a href="#NW1myE43-354rpJ-3">outgoing</a>
+                              <a href="#NWD3ENQke-10">,</a>@(<a href="#NWD3ENQke-u">Xs</a> top '(gxf stream edge from-node)))
+                            (incoming <a href="#NWD3ENQke-10">,</a>@(<a href="#NWD3ENQke-u">Xs</a> top '(gxf stream edge to-node))))
+                          ; must be one expression since we don't want duplicates here                 
+                          `(nodeinst
+                             <a href="#NWD3ENQke-10">,</a>@(<a href="#NWD3ENQke-u">Xs</a> top
+                                   (<a href="#NWD3ENQke-l">cat</a> &quot;gxf/node[&quot;
+                                        &quot;id=/gxf/stream/edge/from-node/id&quot;
+                                        &quot; or &quot;
+                                        &quot;id=/gxf/stream/edge/to-node/id&quot;
+                                        &quot;]&quot;))))))
+           ; Don't look into node details                                               
+           (node *macro* unquote <a href="#NWD3ENQke-a">Void</a>)
+           (from-node
+             unquote
+             (lambda
+               (t id port)
+               (begin ;(<a href="#NWD3ENQke-19">debug</a> id port)                                                             
+                      (<a href="#NWD1myE43-B">gxf:handle-endpoint</a> sxml (cadr id) (cadr port)))))
+           (to-node
+             unquote
+             (lambda
+               (t id port)
+               (begin ;(<a href="#NWD3ENQke-19">debug</a> id port)                                                             
+                      (<a href="#NWD1myE43-B">gxf:handle-endpoint</a> sxml (cadr id) (cadr port)))))
+           ; Retrieve all type nodes<a href="#NWD3ENQke-10">,</a> one for each instance node (so<a href="#NWD3ENQke-10">,</a> duplicates are possible)
+           (nodeinst
+             *macro*
+             unquote
+             (lambda
+               (t . x)
+               `(nodetype
+                  <a href="#NWD3ENQke-10">,</a>@(<a href="#NWD3ENQke-j">forall</a>
+                      ((ni &lt;- x))
+                      <a href="#NWD3ENQke-k">return</a>
+                      (list (<a href="#NWD3ENQke-w">X</a> ni id)
+                            (car (<a href="#NWD3ENQke-u">Xs</a> sxml
+                                     &quot;gxf/node[id=<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a>]&quot;
+                                     where
+                                     (<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a> = (cadr (cadddr ni))))))))))
+           ; Retrieve all input (and output) ports for each type node                   
+           (nodetype
+             unquote
+             (lambda
+               (t . x)
+<a name="NW1myE43-354rpJ-3-u2" href="#NWD1myE43-C"><i>&lt;retrieve input and output ports&gt;</i></a>
+))
+           (@ *preorder* unquote <a href="#NWD3ENQke-a">Id</a>)
+           (*text* unquote <a href="#NWD3ENQke-a">Unmeta</a>)
+           (*default* unquote <a href="#NWD3ENQke-a">Id</a>))))))
+</pre><blockquote>Defines <a href="#NWI-gxf:collapsed-ports"><code>gxf:collapsed-ports</code></a>, <a href="#NWI-outgoing"><code>outgoing</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><h3><a name=toc6><a name="NWD1myE43-D">Generating static schedule</a></a></h3><a name="ssec:schedule"><b>[*]</b></a>
+<p>
+Some observations before we start: 
+<p>
+<ol>
+<li>All connected ports become internal variables (buffers) and all internal nodes 
+<a name="NWD1myE43-E">(which are required to be flat) become function calls.</a>
+<li>Creation of sequential code that hides all connected ports and fully connected nodes 
+requires data-flow analysis.
+</ol>
+<p>
+In general, we avoid double-buffering by using the buffers directly. However, even if the buffers are used with a wrap-around (what can be statically checked), we can avoid double buffering by using a ``spill'' for each such buffer. This allows internal function calls to access the buffer directly, writing past the ``official'' end of the buffer into the spill area. The spill is then copied to the expected location in the buffer using <code>memcpy</code>.
+<p>
+Traditional solution consists of always using a (contigous) temporary buffer and then conditionally splitting it into the FIFO buffer with wrap-around. Our solution is always more efficient than that, since major part of the MTU is done in-place and we only copy a part of it.
+<p>
+<h4><a name=toc7><a name="NWD1myE43-F">Preliminaries</a></a></h4><a name="sssec:prelims"><b>[*]</b></a>
+<p>
+<a name="NWD1myE43-G">We start by checking if the graph is </a><em>consistent</em> (i.e., admits a <em>feasible</em> 
+static schedule). If so, we start the simulator to obtain maximal buffer occupation <code>mb</code> 
+and a list of activations <code>cy</code>.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-354rpJ-4" href="#NWD1myE43-A"><dfn>&lt;process&gt;+=</dfn></a><a name="process"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NW1myE43-354rpJ-3">&lt;-</a>D<a href="#NWD1myE43-Q">-&gt;</a>]</b>
+(define
+  (<a href="#NWD1myE43-G">gxf:collapse-code</a> in)
+  ;(<a href="#NWD3ENQke-19">debug</a> in)                                                                  
+  (<a href="#NWD1myE43-O">let</a>* ((ll (gxf:incidence in))
+         (actors (lists-&gt;actors ll))
+         (edges (lists-&gt;edges ll))
+         (imat (eval (cdr `(list quasiquote <a href="#NWD3ENQke-10">,</a>(lists-&gt;matrix ll actors)))
+                     (my-environment)))
+         (G (imat-&gt;array imat))
+         (buf (list-&gt;vector (car (gxf:delays in))))
+         (repvec (gxf:rep-vector G)))
+        (begin (<a href="#NWD3ENQke-19">debug</a> actors imat)
+               ; edges)                                                                     
+               (if (not (<a href="#NWD3ENQke-i">vector:check</a> repvec positive?))
+                   (error &quot;simulate&quot;
+                          &quot;data-flow graph is inconsistent&quot;
+                          repvec)
+                   (begin (printf &quot;<a href="#NWD3ENQke-v">r</a>=~s~nb=~s~<a href="#NWD3ENQke-14">n</a>&quot; repvec buf) #t))
+               (<a href="#NWD1myE43-O">let</a>* ((sr (simulate
+                            G
+                            (vector-&gt;array buf '#(0) (incidence:edges G) 1)
+                            '()))
+                      (mb (car sr))
+                      (cy (cadr sr)))
+                     (<a href="#NWD3ENQke-19">debug</a> (array-&gt;vector mb))
+                     ; cy)                                                                        
+                     (<a href="#NWD3ENQke-l">outs</a><a name="NW1myE43-354rpJ-4-u1" href="#NWD1myE43-H"><i>&lt;pre-compute and output static schedule&gt;</i></a>
+)))))
+</pre><blockquote>Defines <a href="#NWI-gxf:collapse-code"><code>gxf:collapse-code</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-H">Armed with with info, we compute auxiliary databases </a><code><a href="#NWD1myE43-H">edge-names</a></code>, <code><a href="#NWD1myE43-H">edge-occs</a></code> and 
+<code><a href="#NWD1myE43-H">edge-conns</a></code>, which allows us to generate C function calls in the the static <code><a href="#NWD1myE43-H">schedule</a></code>. 
+We delay output for this string until we have output the variable definitions for the buffers, 
+since some compilers we target don't support C99 mixing of variable definitions and statements 
+(and we have to declare buffer variables before they can be used anyway). We can only do that after 
+we know what the maximal ``spill'' was (<code>cddddr x</code>), since that has to be pre-allocated.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-1BxjTm-1" href="#NWD1myE43-H"><dfn>&lt;pre-compute and output static schedule&gt;=</dfn></a><a name="pre-compute and output static schedule"/> <b>(<a href="#NWD1myE43-G">&lt;-U</a>)</b>
+(<a href="#NWD1myE43-O">let</a> ((<a href="#NWD1myE43-H">edge-names</a>
+<a name="NW1myE43-1BxjTm-1-u1" href="#NWD1myE43-I"><i>&lt;declare internal buffers&gt;</i></a>
+))
+     ;(<a href="#NWD3ENQke-19">debug</a> <a href="#NWD1myE43-H">edge-names</a>)                                                          
+     (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD1myE43-H">edge-occs</a>
+<a name="NW1myE43-1BxjTm-1-u2" href="#NWD1myE43-J"><i>&lt;compute initial buffer administration&gt;</i></a>
+))
+          ;(<a href="#NWD3ENQke-19">debug</a> <a href="#NWD1myE43-H">edge-occs</a>)                                                           
+          (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD1myE43-H">edge-conns</a>
+<a name="NW1myE43-1BxjTm-1-u3" href="#NWD1myE43-K"><i>&lt;compute edge connectivity&gt;</i></a>
+))
+               ;(<a href="#NWD3ENQke-19">debug</a> <a href="#NWD1myE43-H">edge-conns</a>)                                                          
+               (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD1myE43-H">schedule</a>
+                       (<a href="#NWD3ENQke-l">outs</a><a name="NW1myE43-1BxjTm-1-u4" href="#NWD1myE43-M"><i>&lt;activate static schedule&gt;</i></a>
+)))
+                    ;(<a href="#NWD3ENQke-19">debug</a> <a href="#NWD1myE43-H">schedule</a>)                                                            
+                    ;(<a href="#NWD3ENQke-19">debug</a> <a href="#NWD1myE43-H">edge-names</a> <a href="#NWD1myE43-H">edge-conns</a> <a href="#NWD1myE43-H">edge-occs</a>)                                     
+                    (<a href="#NWD3ENQke-j">forall</a>
+                      ((x &lt;- <a href="#NWD1myE43-H">edge-occs</a>))
+                      do
+                      (<a href="#NWD3ENQke-18">out</a> &quot;char&quot;
+                           (car x)
+                           (<a href="#NWD3ENQke-l">cat</a> &quot;[&quot; (<a href="#NWD3ENQke-l">%</a><a href="#NWD3ENQke-m">cadddr</a> x) &quot;+&quot; (<a href="#NWD3ENQke-l">%</a><a href="#NWD3ENQke-m">caddddr</a> x) &quot;];&quot;)))
+                    (<a href="#NWD3ENQke-18">out</a> tail:&quot;&quot; <a href="#NWD1myE43-H">schedule</a>)))))
+</pre><blockquote>Defines <a href="#NWI-edge-conns"><code>edge-conns</code></a>, <a href="#NWI-edge-names"><code>edge-names</code></a>, <a href="#NWI-edge-occs"><code>edge-occs</code></a>, <a href="#NWI-schedule"><code>schedule</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-I">This code snippet returns an association between the edge and corresponding (generated) variable name.</a>
+Note that actual output (<code><a href="#NWD3ENQke-18">out</a></code>) of the buffer variable definitions has to happen later, after 
+<code><a href="#NWD1myE43-M"><i>&lt;activate static schedule&gt;</i></a></code> because the <code>spill </code> value is only known after simulation with
+known buffer sizes.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-4IgMwD-1" href="#NWD1myE43-I"><dfn>&lt;declare internal buffers&gt;=</dfn></a><a name="declare internal buffers"/> <b>(<a href="#NWD1myE43-H">&lt;-U</a>)</b>
+(<a href="#NWD3ENQke-j">forall</a>
+  ((ed &lt;- edges) (x &lt;- (array-&gt;list mb)))
+  <a href="#NWD3ENQke-k">return</a>
+  (list (<a href="#NWD3ENQke-l">cat</a> (<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-m">caar</a> ed) &quot;_&quot; (<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-m">caadr</a> ed))
+        ed
+        (car x)))
+</pre></td></tr></table></center></font></pre><p>Buffer administration consists of the following info per edge: <ol>
+<li><a name="NWD1myE43-J">variable name (which is generated by </a><code><a href="#NWD1myE43-I"><i>&lt;declare internal buffers&gt;</i></a></code> above)
+<li>an improper list containing: <ol>
+<li>initial value for the <em>read pointer</em>: 0
+<li>initial value for the <em>write pointer</em>: 0
+<li>buffer size (calculated by simulation procedure beforehand)
+<li>initial value for the <em>spill</em>: 0
+</ol>
+</ol>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-3Mate2-1" href="#NWD1myE43-J"><dfn>&lt;compute initial buffer administration&gt;=</dfn></a><a name="compute initial buffer administration"/> <b>(<a href="#NWD1myE43-H">&lt;-U</a>)</b>
+((<a href="#NWD3ENQke-f">zip2-with</a> cons)
+ (map car <a href="#NWD1myE43-H">edge-names</a>)
+ (<a href="#NWD3ENQke-j">forall</a>
+   ((y &lt;- (map car (array-&gt;list mb))))
+   <a href="#NWD3ENQke-k">return</a>
+   (cons 0 (cons 0 (cons y (cons 0 #f))))))
+</pre></td></tr></table></center></font></pre><p><a name="NWD1myE43-K">This returns a ``database'' of all edges and rates, indexed by the node/port pair. Note</a>
+that the rates have to be calculated using type information right here.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-3Cbe2f-1" href="#NWD1myE43-K"><dfn>&lt;compute edge connectivity&gt;=</dfn></a><a name="compute edge connectivity"/> <b>(<a href="#NWD1myE43-H">&lt;-U</a>)</b>
+(<a href="#NWD3ENQke-j">forall</a>
+  ((x &lt;- <a href="#NWD1myE43-H">edge-names</a>))
+  returns
+  (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD1myE43-K">producer</a> (caadr x)) (consumer (cadadr x)))
+       `(<a href="#NWD3ENQke-10">,</a>(cons (cons (car <a href="#NWD1myE43-K">producer</a>) (cadr <a href="#NWD1myE43-K">producer</a>))
+                (cons (car x)
+                      (eval (caddr <a href="#NWD1myE43-K">producer</a>) (my-environment))))
+         <a href="#NWD3ENQke-10">,</a>(cons (cons (car consumer) (cadr consumer))
+                (cons (car x)
+                      (eval (caddr consumer) (my-environment)))))))
+</pre><blockquote>Defines <a href="#NWI-producer"><code>producer</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><h4><a name=toc8><a name="NWD1myE43-L">Activating static schedule</a></a></h4><a name="sssec:activation"><b>[*]</b></a>
+<p>
+<a name="NWD1myE43-M">For each iteration of the schedule </a><code>cy</code>, find out what actor <code><a href="#NWD3ENQke-14">n</a></code> gets activated 
+(its a unit vector in the <code>cy</code> list) and then generate activation call using the
+edge connectivity database <code><a href="#NWD1myE43-H">edge-conns</a></code> and port info database <code><a href="#NWD1myE43-H">edge-occs</a></code>.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-2XroOZ-1" href="#NWD1myE43-M"><dfn>&lt;activate static schedule&gt;=</dfn></a><a name="activate static schedule"/> <b>(<a href="#NWD1myE43-H">&lt;-U</a>)</b>
+(<a href="#NWD3ENQke-j">forall</a>
+  ((x &lt;- cy))
+  do
+  (<a href="#NWD1myE43-M">labels</a>
+    ((find-activation
+       (v a)
+       (do ((i 0 (+ 1 i)))
+           ((or (positive? (vector-ref v i))
+                (&gt;= i (vector-length v)))
+            (list-ref a i)))))
+    ;(<a href="#NWD3ENQke-19">debug</a> x)                                                                   
+    (<a href="#NWD1myE43-O">let</a>* ((v (cddr x)) (<a href="#NWD3ENQke-14">n</a> (find-activation v actors)))
+          ;(<a href="#NWD3ENQke-19">debug</a> v <a href="#NWD3ENQke-14">n</a> <a href="#NWD1myE43-H">edge-conns</a> <a href="#NWD1myE43-H">edge-occs</a>)                                            
+          (<a href="#NWD1myE43-Q">gxf:activate</a> <a href="#NWD3ENQke-14">n</a> in <a href="#NWD1myE43-H">edge-conns</a> <a href="#NWD1myE43-H">edge-occs</a>))))
+</pre><blockquote>Defines <a href="#NWI-labels"><code>labels</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-N">Each activation call consists of the function name (containing node id </a><code>N</code> augmented with
+contained node id <code><a href="#NWD3ENQke-14">n</a></code>) and a list of arguments, which by virtue of being constrained to LIME
+model are always pointers to data (future: handle multi-ports).
+<p>
+<a name="NWD1myE43-O">Per activation call, we start with an empty </a><code>spill</code> strings for production and consumption.
+If any wrap-around is detected by <code><a href="#NWD1myE43-S"><i>&lt;calculate current access pointer&gt;</i></a></code>, <code>spill</code> is <code>set!</code> 
+to corresponding compensation call using <code>memcpy</code>. The toplevel doesn't have to be aware of this. 
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-PjWvh-1" href="#NWD1myE43-O"><dfn>&lt;activate sub-nodes&gt;=</dfn></a><a name="activate sub-nodes"/> <b>(<a href="#NWD1myE43-Q">U-&gt;</a>)</b>
+(<a href="#NWD3ENQke-j">forall</a>
+  ((<a href="#NWD3ENQke-14">n</a> &lt;-
+      (<a href="#NWD3ENQke-u">Xs</a> in
+          &quot;gxf/node[id=<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a>]/node&quot;
+          where
+          (<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a> = (<a href="#NWD3ENQke-11">gxf:super-node</a> in (<a href="#NWD3ENQke-l">$</a> N))))))
+  do
+  (<a href="#NWD1myE43-O">let</a> ((spill `(<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-18">empty</a> unquote <a href="#NWD3ENQke-18">empty</a>))
+        (prod-spill <a href="#NWD3ENQke-18">empty</a>))
+       (<a href="#NWD3ENQke-k">return</a>
+         (<a href="#NWD3ENQke-18">out</a> &quot;\<a href="#NWD3ENQke-14">n</a>/* activating sub-node&quot;
+              (<a href="#NWD3ENQke-w">X</a> <a href="#NWD3ENQke-14">n</a> id)
+              &quot;of node&quot;
+              (<a href="#NWD3ENQke-l">$</a> N)
+              &quot;*/\<a href="#NWD3ENQke-14">n</a>&quot;
+              (car spill)
+              (<a href="#NWD3ENQke-l">cat</a> (<a href="#NWD3ENQke-l">$</a> N) &quot;_&quot; (<a href="#NWD3ENQke-w">X</a> <a href="#NWD3ENQke-14">n</a> id))
+              &quot;(&quot;
+              (<a href="#NWD3ENQke-l">outs</a> (<a href="#NWD3ENQke-18">out</a>-list args))
+              &quot;);&quot;
+              (cdr spill))
+         where
+         (args =
+               (<a href="#NWD1myE43-R">gxf:argument-list</a>
+                 N
+                 <a href="#NWD3ENQke-14">n</a>
+                 <a href="#NWD1myE43-H">edge-conns</a>
+                 <a href="#NWD1myE43-H">edge-occs</a>
+                 spill)))))
+</pre><blockquote>Defines <a href="#NWI-let"><code>let</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-P">Activation of a node that contains sub-codes is simply setting up the right macros for </a>
+the buffer access pointer and appending the code verbatim.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-1gStXd-1" href="#NWD1myE43-P"><dfn>&lt;activate sub-codes&gt;=</dfn></a><a name="activate sub-codes"/> <b>(<a href="#NWD1myE43-Q">U-&gt;</a>)</b>
+(<a href="#NWD3ENQke-j">forall</a>
+  ((<a href="#NWD3ENQke-14">n</a> &lt;-
+      (<a href="#NWD3ENQke-u">Xs</a> in
+          &quot;gxf/node[id=<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a> and meta/code[@context='iterative']]&quot;
+          where
+          (<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a> = (<a href="#NWD3ENQke-11">gxf:super-node</a> in (<a href="#NWD3ENQke-l">$</a> N))))))
+  do
+  (<a href="#NWD1myE43-O">let</a> ((spill `(<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-18">empty</a> unquote <a href="#NWD3ENQke-18">empty</a>))
+        (ports (<a href="#NWD3ENQke-u">Xs</a> <a href="#NWD3ENQke-14">n</a> '(port id *text*))))
+       (<a href="#NWD3ENQke-k">return</a>
+         (<a href="#NWD3ENQke-18">out</a> &quot;\<a href="#NWD3ENQke-14">n</a>/* activating node&quot;
+              (<a href="#NWD3ENQke-w">X</a> <a href="#NWD3ENQke-14">n</a> id)
+              &quot;*/\<a href="#NWD3ENQke-14">n</a>&quot;
+              (car spill)
+              (<a href="#NWD3ENQke-b">lfold&lt;</a>
+                <a href="#NWD3ENQke-l">cat</a>
+                &quot;&quot;
+                ((<a href="#NWD3ENQke-f">zip2-with</a>
+                   (lambda (v b) (<a href="#NWD3ENQke-l">cat</a> &quot;#define &quot; v &quot; &quot; b <a href="#NWD3ENQke-18">nl</a>)))
+                 ports
+                 args))
+              &quot;{&quot;
+              (<a href="#NWD3ENQke-z">remove-cdata</a>
+                (<a href="#NWD3ENQke-w">X</a> <a href="#NWD3ENQke-14">n</a> &quot;meta/code[@context='iterative']&quot;))
+              &quot;}&quot;
+              (<a href="#NWD3ENQke-b">lfold&lt;</a>
+                (lambda (<a href="#NWD3ENQke-v">r</a> v) (<a href="#NWD3ENQke-l">cat</a> <a href="#NWD3ENQke-v">r</a> <a href="#NWD3ENQke-18">nl</a> &quot;#undef &quot; v))
+                <a href="#NWD3ENQke-18">empty</a>
+                ports)
+              (cdr spill))
+         where
+         (args =
+               (<a href="#NWD1myE43-R">gxf:argument-list</a>
+                 N
+                 <a href="#NWD3ENQke-14">n</a>
+                 <a href="#NWD1myE43-H">edge-conns</a>
+                 <a href="#NWD1myE43-H">edge-occs</a>
+                 spill)))))
+</pre><blockquote>Defines <a href="#NWI-let"><code>let</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-Q">Note that a node always contains either sub-nodes or a code fragment.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-354rpJ-5" href="#NWD1myE43-A"><dfn>&lt;process&gt;+=</dfn></a><a name="process"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD1myE43-G">&lt;-</a>D<a href="#NWD1myE43-V">-&gt;</a>]</b>
+<a name="NW1myE43-354rpJ-5-u1" href="#NWD1myE43-R"><i>&lt;output argument list&gt;</i></a>
+<a name="NW1myE43-354rpJ-5-u2" href="#NWD1myE43-S"><i>&lt;calculate current access pointer&gt;</i></a>
+(define
+  (<a href="#NWD1myE43-Q">gxf:activate</a>
+    N
+    in
+    #!optional
+    <a href="#NWD1myE43-H">edge-conns</a>
+    <a href="#NWD1myE43-H">edge-occs</a>)
+  (begin ;(<a href="#NWD3ENQke-19">debug</a> N)                                                                   
+<a name="NW1myE43-354rpJ-5-u3" href="#NWD1myE43-O"><i>&lt;activate sub-nodes&gt;</i></a>
+<a name="NW1myE43-354rpJ-5-u4" href="#NWD1myE43-P"><i>&lt;activate sub-codes&gt;</i></a>
+))
+</pre><blockquote>Defines <a href="#NWI-gxf:activate"><code>gxf:activate</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-R">For each port, we retrieve the name of the buffer its connected to from the </a><code><a href="#NWD1myE43-H">edge-conns</a></code> database,
+and its rate in bytes. Obviously, the accessor for the port data is then <code>&amp;buf[offset]</code>. 
+If <code><a href="#NWD1myE43-H">edge-conns</a></code> was not supplied, we just generate <code>port</code>, in the hope that continuation has 
+set up appropriate pointer named as such. If we fail to find <code>info</code> in <code><a href="#NWD1myE43-H">edge-conns</a></code>, we
+generate an error.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-EcAln-1" href="#NWD1myE43-R"><dfn>&lt;output argument list&gt;=</dfn></a><a name="output argument list"/> <b>(<a href="#NWD1myE43-Q">&lt;-U</a>)</b>
+(define
+  (<a href="#NWD1myE43-R">gxf:argument-list</a>
+    N
+    <a href="#NWD3ENQke-14">n</a>
+    <a href="#NWD1myE43-H">edge-conns</a>
+    <a href="#NWD1myE43-H">edge-occs</a>
+    spill)
+  (<a href="#NWD3ENQke-j">forall</a>
+    ((p &lt;- (<a href="#NWD3ENQke-u">Xs</a> <a href="#NWD3ENQke-14">n</a> '(port))))
+    <a href="#NWD3ENQke-k">return</a>
+    (if (eq? <a href="#NWD1myE43-H">edge-conns</a> #f)
+        (<a href="#NWD3ENQke-w">X</a> p id)
+        (<a href="#NWD1myE43-O">let</a>* ((info (or (assoc `(<a href="#NWD3ENQke-10">,</a>N unquote (<a href="#NWD3ENQke-w">X</a><a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-x"> p id)) </a><a href="#NWD1myE43-H">edge-conns</a>)
+                         `(@noname <a href="#NWD3ENQke-10">,</a>(<a href="#NWD3ENQke-w">X</a> p id) unquote (<a href="#NWD3ENQke-w">X</a> p size))))
+               (buf (cadr info))
+               (rate (cddr info)))
+              (if (eq? (car info) '@noname)
+                  ; Postpone specialization of the buffer access to the continuation           
+                  (begin ;(<a href="#NWD3ENQke-19">debug</a> buf)                                                                 
+                         (<a href="#NWD3ENQke-w">X</a> p id))
+                  (case (<a href="#NWD3ENQke-w">X</a><a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-x"> p (default &quot;pointer_type&quot;) calltype)</a>
+                        ((pointer_type)
+                         (<a href="#NWD3ENQke-l">cat</a> &quot;&amp;&quot;
+                              buf
+                              &quot;[&quot;
+                              (<a href="#NWD3ENQke-l">%</a> (<a href="#NWD1myE43-S">gxf:access-pointer</a>
+                                   p
+                                   buf
+                                   rate
+                                   <a href="#NWD1myE43-H">edge-occs</a>
+                                   spill))
+                              &quot;]&quot;))
+                        ((integer_type enumeral_type)
+                         (<a href="#NWD3ENQke-l">cat</a> &quot;*((&quot;
+                              (<a href="#NWD3ENQke-w">X</a> p type)
+                              &quot;*)&quot;
+                              &quot;&amp;&quot;
+                              buf
+                              &quot;[&quot;
+                              (<a href="#NWD3ENQke-l">%</a> (<a href="#NWD1myE43-S">gxf:access-pointer</a>
+                                   p
+                                   buf
+                                   rate
+                                   <a href="#NWD1myE43-H">edge-occs</a>
+                                   spill))
+                              &quot;]&quot;
+                              &quot;)&quot;))
+                        (else (error &quot;<a href="#NWD1myE43-R">gxf:argument-list</a>&quot;
+                                     &quot;unknown calltype&quot;
+                                     (<a href="#NWD3ENQke-w">X</a><a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-x"> p calltype)))))))))</a>
+;<a href="#NWD3ENQke-l">$</a>                                                                           
+</pre><blockquote>Defines <a href="#NWI-gxf:argument-list"><code>gxf:argument-list</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-S">Each pointer that is written has to point to a unique range in the buffer, since we follow the </a>
+SSA model. Also each pointer that is read is restricted (future: handle in-place edges 
+and state). Therefore, we keep updating the <code><a href="#NWD1myE43-H">edge-occs</a></code> database with ``current'' values of the 
+read- and write-pointers for each buffer.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-3aEUc2-1" href="#NWD1myE43-S"><dfn>&lt;calculate current access pointer&gt;=</dfn></a><a name="calculate current access pointer"/> <b>(<a href="#NWD1myE43-Q">&lt;-U</a>)</b>
+(define
+  (<a href="#NWD1myE43-S">gxf:access-pointer</a> p buf rate <a href="#NWD1myE43-H">edge-occs</a> spill)
+  (if (eq? <a href="#NWD1myE43-H">edge-occs</a> #f)
+
+      (<a href="#NWD1myE43-O">let</a>* ((adm (or (assq buf <a href="#NWD1myE43-H">edge-occs</a>)
+                      `(foo none0 none1 none2 . none3)))
+             (old-rp (cadr adm))
+             (old-wp (caddr adm))
+             (bufsize (cadddr adm))
+             (old-spill (car (cddddr adm)))
+             (full (cdr (cddddr adm)))
+             (avail (+ (- old-wp old-rp)
+                       (if (or (&lt; old-wp old-rp) full) bufsize 0)))
+             (free (+ (- old-rp old-wp)
+                      (if (or (&gt; old-rp old-wp) full) 0 bufsize)))
+             (new-rp (+ old-rp (if (<a href="#NW3ENQke-1h8OQs-2">is-prod</a> p) 0 rate)))
+             (new-wp (+ old-wp (if (<a href="#NW3ENQke-1h8OQs-2">is-cons</a> p) 0 rate)))
+             (nrp (modulo new-rp bufsize))
+             (nwp (modulo new-wp bufsize))
+             (new-spill
+               (- (if (<a href="#NW3ENQke-1h8OQs-2">is-cons</a> p) new-rp new-wp) bufsize))
+             (new-adm
+               (cons nrp
+                     (cons nwp
+                           (cons bufsize
+                                 (cons (max old-spill new-spill)
+                                       (if (<a href="#NW3ENQke-1h8OQs-2">is-cons</a> p) #f (= nrp nwp))))))))
+            ;(<a href="#NWD3ENQke-19">debug</a> new-spill)                                                           
+            (if (&gt; new-rp bufsize)
+                (set-car!
+                  spill
+                  (<a href="#NWD3ENQke-l">cat</a> (car spill)
+                       &quot;memcpy(&quot;
+                       &quot;&amp;&quot;
+                       buf
+                       &quot;[&quot;
+                       (<a href="#NWD3ENQke-l">%</a> bufsize)
+                       &quot;]<a href="#NWD3ENQke-10">,</a>&quot;
+                       &quot;&amp;&quot;
+                       buf
+                       &quot;[0]<a href="#NWD3ENQke-10">,</a>&quot;
+                       (<a href="#NWD3ENQke-l">%</a> new-spill)
+                       &quot;);&quot;
+                       <a href="#NWD3ENQke-18">nl</a>)))
+            (if (&gt; new-wp bufsize)
+                (set-cdr!
+                  spill
+                  (<a href="#NWD3ENQke-l">cat</a> <a href="#NWD3ENQke-18">nl</a>
+                       (cdr spill)
+                       &quot;memcpy(&quot;
+                       &quot;&amp;&quot;
+                       buf
+                       &quot;[0]<a href="#NWD3ENQke-10">,</a>&quot;
+                       &quot;&amp;&quot;
+                       buf
+                       &quot;[&quot;
+                       (<a href="#NWD3ENQke-l">%</a> bufsize)
+                       &quot;]<a href="#NWD3ENQke-10">,</a>&quot;
+                       (<a href="#NWD3ENQke-l">%</a> new-spill)
+                       &quot;);&quot;)))
+            (set-cdr! adm new-adm)
+            (if (<a href="#NW3ENQke-1h8OQs-2">is-cons</a> p)
+                (begin ;(if [&gt; rate avail] (error &quot;<a href="#NWD1myE43-S">gxf:access-pointer</a>&quot; &quot;underflow&quot; `(&gt; <a href="#NWD3ENQke-10">,</a>rate <a href="#NWD3ENQke-10">,</a>avail <a href="#NWD3ENQke-10">,</a>p)))
+                       old-rp)
+                (begin ;(if [&gt; rate free] (error &quot;<a href="#NWD1myE43-S">gxf:access-pointer</a>&quot; &quot;overflow&quot; `(&gt; <a href="#NWD3ENQke-10">,</a>rate <a href="#NWD3ENQke-10">,</a>free <a href="#NWD3ENQke-10">,</a>p)))
+                       old-wp)))))
+</pre><blockquote>Defines <a href="#NWI-gxf:access-pointer"><code>gxf:access-pointer</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-T">A version using one less element in each FIFO buffer.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-1x976B-1" href="#NWD1myE43-T"><dfn>&lt;calculate current access pointer using one less element&gt;=</dfn></a><a name="calculate current access pointer using one less element"/>
+(define
+  (<a href="#NWD1myE43-S">gxf:access-pointer</a> p buf rate <a href="#NWD1myE43-H">edge-occs</a> spill)
+  (if (eq? <a href="#NWD1myE43-H">edge-occs</a> #f)
+
+      (<a href="#NWD1myE43-O">let</a>* ((adm (or (assq buf <a href="#NWD1myE43-H">edge-occs</a>)
+                      `(foo none0 none1 none2 . none3)))
+             (old-rp (cadr adm))
+             (old-wp (caddr adm))
+             (new-rp (+ old-rp (if (<a href="#NW3ENQke-1h8OQs-2">is-prod</a> p) 0 rate)))
+             (new-wp (+ old-wp (if (<a href="#NW3ENQke-1h8OQs-2">is-cons</a> p) 0 rate)))
+             (bufsize (cadddr adm))
+             (buflen (+ bufsize 1))
+             (old-spill (car (cddddr adm)))
+             (new-spill
+               (- (if (<a href="#NW3ENQke-1h8OQs-2">is-cons</a> p) new-rp new-wp) buflen))
+             (new-adm
+               (cons (modulo new-rp buflen)
+                     (cons (modulo new-wp buflen)
+                           (cons bufsize
+                                 (cons (max old-spill new-spill) #t)))))
+             (avail (+ (- old-wp old-rp)
+                       (if (&lt; old-wp old-rp) buflen 0)
+                       0))
+             (free (+ (- old-rp old-wp)
+                      (if (&gt; old-rp old-wp) 0 buflen)
+                      -1)))
+            ;(<a href="#NWD3ENQke-19">debug</a> new-spill)                                                           
+            (if (&gt; new-rp buflen)
+                (set-car!
+                  spill
+                  (<a href="#NWD3ENQke-l">cat</a> <a href="#NWD3ENQke-18">nl</a>
+                       (car spill)
+                       &quot;memcpy(&quot;
+                       &quot;&amp;&quot;
+                       buf
+                       &quot;[&quot;
+                       (<a href="#NWD3ENQke-l">%</a> buflen)
+                       &quot;]<a href="#NWD3ENQke-10">,</a>&quot;
+                       &quot;&amp;&quot;
+                       buf
+                       &quot;[0]<a href="#NWD3ENQke-10">,</a>&quot;
+                       (<a href="#NWD3ENQke-l">%</a> new-spill)
+                       &quot;);&quot;)))
+            (if (&gt; new-wp buflen)
+                (set-cdr!
+                  spill
+                  (<a href="#NWD3ENQke-l">cat</a> <a href="#NWD3ENQke-18">nl</a>
+                       (cdr spill)
+                       &quot;memcpy(&quot;
+                       &quot;&amp;&quot;
+                       buf
+                       &quot;[0]<a href="#NWD3ENQke-10">,</a>&quot;
+                       &quot;&amp;&quot;
+                       buf
+                       &quot;[&quot;
+                       (<a href="#NWD3ENQke-l">%</a> buflen)
+                       &quot;]<a href="#NWD3ENQke-10">,</a>&quot;
+                       (<a href="#NWD3ENQke-l">%</a> new-spill)
+                       &quot;);&quot;)))
+            (set-cdr! adm new-adm)
+            (if (<a href="#NW3ENQke-1h8OQs-2">is-cons</a> p)
+                (begin (if (&gt; rate avail)
+                           (error &quot;<a href="#NWD1myE43-S">gxf:access-pointer</a>&quot;
+                                  &quot;underflow&quot;
+                                  `(&gt; <a href="#NWD3ENQke-10">,</a>rate <a href="#NWD3ENQke-10">,</a>avail <a href="#NWD3ENQke-10">,</a>p)))
+                       old-rp)
+                (begin (if (&gt; rate free)
+                           (error &quot;<a href="#NWD1myE43-S">gxf:access-pointer</a>&quot;
+                                  &quot;overflow&quot;
+                                  `(&gt; <a href="#NWD3ENQke-10">,</a>rate <a href="#NWD3ENQke-10">,</a>free <a href="#NWD3ENQke-10">,</a>p)))
+                       old-wp)))))
+</pre><blockquote>Defines <a href="#NWI-gxf:access-pointer"><code>gxf:access-pointer</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><h3><a name=toc9><a name="NWD1myE43-U">Integration</a></a></h3><a name="ssec:integration"><b>[*]</b></a>
+<p>
+<a name="NWD1myE43-V">All of the above is connected together in a </a><code>&lt;code&gt;</code> fragment attached to the produced node
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-354rpJ-6" href="#NWD1myE43-A"><dfn>&lt;process&gt;+=</dfn></a><a name="process"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD1myE43-Q">&lt;-</a>D]</b>
+(define
+  (<a href="#NWD1myE43-V">process</a> in #!optional stem)
+  (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD1myE43-V">wrap-id</a>
+          (case stem ((#f) '()) (else `((id <a href="#NWD3ENQke-10">,</a>stem))))))
+       `(*TOP* (@@ (*<a href="#NWD3ENQke-r">NAMESPACES</a>* <a href="#NWD3ENQke-10">,</a>@NAMESPACES))
+               (*PI* xml &quot;version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;&quot;)
+               (*PI* xml-stylesheet
+                     &quot;type='text/xsl' href='gxf.xsl'&quot;)
+               (gxf (@ (<a href="#NWD3ENQke-p">xlink</a>:type &quot;extended&quot;) <a href="#NWD3ENQke-10">,</a>@wrap-id)
+                    (node (@ (<a href="#NWD3ENQke-p">xlink</a>:type &quot;resource&quot;)
+                             <a href="#NWD3ENQke-10">,</a>@(gxf:<a href="#NWD1myE43-M">labels</a><a href="#NWD3ENQke-s"> &quot;</a><a href="#NWD1myE43-V">process</a><a href="#NWD1myE43-V">&quot;</a>))
+                          <a href="#NWD3ENQke-10">,</a>@(<a href="#NW1myE43-354rpJ-3">gxf:collapsed-ports</a> in)
+                          (meta (@ (id &quot;passthrough&quot;))
+                                (code (@ (context &quot;iterative&quot;))
+                                      <a href="#NWD3ENQke-10">,</a>(<a href="#NWD3ENQke-b">lfold&lt;</a>
+                                         <a href="#NWD3ENQke-l">cat</a>
+                                         &quot;CDATA[\<a href="#NWD3ENQke-14">n</a>&quot;
+                                         `(<a href="#NWD3ENQke-10">,</a>(<a href="#NWD1myE43-G">gxf:collapse-code</a> in))))))))))
+</pre><blockquote>Defines <a href="#NWI-&quot;process&quot;"><code>&quot;process&quot;</code></a>, <a href="#NWI-process"><code>process</code></a>, <a href="#NWI-wrap-id"><code>wrap-id</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD1myE43-W">Invoke the main with some default parameters (if inside custom interpreter such as </a><tt>limette</tt>)
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW1myE43-2L4jyQ-2" href="#NWD1myE43-4"><dfn>&lt;Interpreted.scm&gt;+=</dfn></a><a name="Interpreted.scm"/> <b>[<a href="#NWD1myE43-4">&lt;-</a>D]</b>
+(<a href="#NWD1myE43-6">main</a> '(<a href="#NWD1myE43-4">beseq</a> &quot;/tmp/test.gxf&quot;))
+</pre></td></tr></table></center></font></pre><p><!-- Emacs trickery-->
+<!--%% Local Variables:-->
+<!--%% mode: latex-->
+<!--%% TeX-master: "beseq"-->
+<!--%% LaTeX-command: "nolatex"-->
+<!--%% eval: (set 'compile-command "make deps")-->
+<!--%% End:-->
+<a name="NWD1myE43-X">*</a>
+<h2><a name=toc10><a name="NWD3ENQke-Y">Common and miscellaneous stuff</a></a></h2><a name="sec:misc"><b>[*]</b></a><!---*- mode:Noweb; noweb-code-mode:bee-mode -*--->
+<p>
+<h3><a name=toc11><a name="NWD3ENQke-Z">Generic FP helpers</a></a></h3><a name="ssec:genfp"><b>[*]</b></a>
+<p>
+<a name="NWD3ENQke-a">Handy lambda shortcuts for e.g., </a><code>pre-post-order</code>...
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-1" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[D<a href="#NWD3ENQke-b">-&gt;</a>]</b>
+(define <a href="#NWD3ENQke-a">Id</a> (lambda x x))
+(define <a href="#NWD3ENQke-a">Void</a> (lambda x '()))
+(define <a href="#NWD3ENQke-a">Identity</a> (lambda (x) x))
+(define <a href="#NWD3ENQke-a">Unmeta</a> (lambda (tag x) x))
+</pre><blockquote>Defines <a href="#NWI-Id"><code>Id</code></a>, <a href="#NWI-Identity"><code>Identity</code></a>, <a href="#NWI-Unmeta"><code>Unmeta</code></a>, <a href="#NWI-Void"><code>Void</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-b">Left and Right folds, with non-commutative versions.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-2" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-a">&lt;-</a>D<a href="#NWD3ENQke-c">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-b">lfold&gt;</a> f id l)
+  (<a href="#NWD1myE43-M">labels</a>
+    ((<a href="#NWD3ENQke-b">lfold&gt;</a><a href="#NWD3ENQke-f">helper</a>
+<a href="#NWD3ENQke-b">       (l </a><a href="#NWD3ENQke-v">r</a>)
+       (cond ((null? l) <a href="#NWD3ENQke-v">r</a>)
+             ((pair? l) (<a href="#NWD3ENQke-b">lfold&gt;</a><a href="#NWD3ENQke-f">helper</a><a href="#NWD3ENQke-b"> (cdr l) (f (car l) </a><a href="#NWD3ENQke-v">r</a>))))))
+    (<a href="#NWD3ENQke-b">lfold&gt;</a><a href="#NWD3ENQke-f">helper</a><a href="#NWD3ENQke-b"> l id)))</a>
+(define
+  (<a href="#NWD3ENQke-b">lfold&lt;</a> f id l)
+  (<a href="#NWD3ENQke-b">lfold&gt;</a> (lambda (x y) (f y x)) id l))
+</pre><blockquote>Defines <a href="#NWI-lfold&lt;"><code>lfold&lt;</code></a>, <a href="#NWI-lfold&gt;"><code>lfold&gt;</code></a>, <a href="#NWI-lfold&gt;helper"><code>lfold&gt;helper</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-c">Right fold is unfortunately not easy to represent with a </a><em>tail-recursive</em> function.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-3" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-b">&lt;-</a>D<a href="#NWD3ENQke-d">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-c">Rfold&gt;</a> f id l)
+  (cond ((null? l) id)
+        ((pair? l) (f (car l) (<a href="#NWD3ENQke-c">Rfold&gt;</a> f id (cdr l))))))
+(define
+  (<a href="#NWD3ENQke-c">Rfold&lt;</a> f id l)
+  (<a href="#NWD3ENQke-c">Rfold&gt;</a> (lambda (x y) (f y x)) id l))
+</pre><blockquote>Defines <a href="#NWI-Rfold&lt;"><code>Rfold&lt;</code></a>, <a href="#NWI-Rfold&gt;"><code>Rfold&gt;</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-d">Fortunately, </a><code>reverse</code> is a R5RS standard function, so we can rely on its ``efficient'' 
+implementation.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-4" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-c">&lt;-</a>D<a href="#NWD3ENQke-e">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-d">rfold&lt;</a> f id l)
+  (<a href="#NWD3ENQke-b">lfold&lt;</a> f id (reverse l)))
+(define
+  (<a href="#NWD3ENQke-d">rfold&gt;</a> f id l)
+  (<a href="#NWD3ENQke-b">lfold&gt;</a> f id (reverse l)))
+</pre><blockquote>Defines <a href="#NWI-rfold&lt;"><code>rfold&lt;</code></a>, <a href="#NWI-rfold&gt;"><code>rfold&gt;</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-e">Functional composition functor</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-5" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-d">&lt;-</a>D<a href="#NWD3ENQke-f">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-e">compose2</a> f g)
+  (lambda x (apply g (list (apply f x)))))
+(define
+  (<a href="#NWD3ENQke-e">compose</a> . fs)
+  (<a href="#NWD3ENQke-b">lfold&lt;</a> <a href="#NWD3ENQke-e">compose2</a> <a href="#NWD3ENQke-a">Identity</a> fs))
+</pre><blockquote>Defines <a href="#NWI-compose"><code>compose</code></a>, <a href="#NWI-compose2"><code>compose2</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-f">Zipper</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-6" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-e">&lt;-</a>D<a href="#NWD3ENQke-g">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-f">zip2-with</a> c)
+  (lambda
+    (a b)
+    (<a href="#NWD1myE43-M">labels</a>
+      ((<a href="#NWD3ENQke-f">helper</a>
+         (a b <a href="#NWD3ENQke-v">r</a>)
+         (cond ((or (null? a) (null? b)) <a href="#NWD3ENQke-v">r</a>)
+               (else (<a href="#NWD3ENQke-f">helper</a>
+                       (cdr a)
+                       (cdr b)
+                       (append <a href="#NWD3ENQke-v">r</a> `(<a href="#NWD3ENQke-10">,</a>(c (car a) (car b)))))))))
+      (<a href="#NWD3ENQke-f">helper</a> a b '()))))
+(define
+  (<a href="#NWD3ENQke-f">zip-with</a> c . ls)
+  (<a href="#NWD3ENQke-b">lfold&lt;</a> (<a href="#NWD3ENQke-f">zip2-with</a> <a href="#NWD3ENQke-f">zip2-with</a>) '() ls))
+</pre><blockquote>Defines <a href="#NWI-helper"><code>helper</code></a>, <a href="#NWI-zip-with"><code>zip-with</code></a>, <a href="#NWI-zip2-with"><code>zip2-with</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-g">Like </a><code>map</code>, but if the predicate <code>p</code> returns a list, then its spliced onto the result.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-7" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-f">&lt;-</a>D<a href="#NWD3ENQke-h">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-g">map-splice</a> p l)
+  (cond ((null? l) '())
+        (else (<a href="#NWD1myE43-O">let</a> <a href="#NWD1myE43-C">loop</a>
+                   ((<a href="#NWD3ENQke-v">r</a> (p (car l))))
+                   (cond ((null? <a href="#NWD3ENQke-v">r</a>) (<a href="#NWD3ENQke-g">map-splice</a> p (cdr l)))
+                         ((pair? <a href="#NWD3ENQke-v">r</a>) (cons (car <a href="#NWD3ENQke-v">r</a>) (<a href="#NWD1myE43-C">loop</a> (cdr <a href="#NWD3ENQke-v">r</a>))))
+                         (else (cons <a href="#NWD3ENQke-v">r</a> (<a href="#NWD1myE43-C">loop</a> '()))))))))
+</pre><blockquote>Defines <a href="#NWI-loop"><code>loop</code></a>, <a href="#NWI-map-splice"><code>map-splice</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-h">Like </a><code>filter-map</code>, but if the predicate <code>p</code> returns a list, then its spliced onto the result.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-8" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-g">&lt;-</a>D<a href="#NWD3ENQke-i">-&gt;</a>]</b>
+(define
+  (filter-<a href="#NWD3ENQke-g">map-splice</a><a href="#NWD3ENQke-h"> p l)</a>
+  (<a href="#NWD1myE43-M">labels</a>
+    ((filter-<a href="#NWD3ENQke-g">map-splice</a><a href="#NWD3ENQke-h">-</a><a href="#NWD3ENQke-f">helper</a>
+<a href="#NWD3ENQke-h">       (p l res)</a>
+       (cond ((null? l) res)
+             ((pair? l)
+              (<a href="#NWD1myE43-O">let</a> <a href="#NWD1myE43-C">loop</a>
+                   ((v (p (car l))) (<a href="#NWD3ENQke-v">r</a> res))
+                   (cond ((or (not v) (null? v))
+                          (filter-<a href="#NWD3ENQke-g">map-splice</a><a href="#NWD3ENQke-h">-</a><a href="#NWD3ENQke-f">helper</a><a href="#NWD3ENQke-h"> p (cdr l) </a><a href="#NWD3ENQke-v">r</a>))
+                         ((pair? v) (<a href="#NWD1myE43-C">loop</a> (cdr v) (cons (car v) <a href="#NWD3ENQke-v">r</a>)))
+                         (else (<a href="#NWD1myE43-C">loop</a> '() (cons v <a href="#NWD3ENQke-v">r</a>))))))
+             (else (error &quot;filter-<a href="#NWD3ENQke-g">map-splice</a><a href="#NWD3ENQke-h">&quot; &quot;unexpected object&quot; l)))))</a>
+    (filter-<a href="#NWD3ENQke-g">map-splice</a><a href="#NWD3ENQke-h">-</a><a href="#NWD3ENQke-f">helper</a><a href="#NWD3ENQke-h"> p l '())))</a>
+</pre><blockquote>Defines <a href="#NWI-filter-map-splice"><code>filter-map-splice</code></a>, <a href="#NWI-filter-map-splice-helper"><code>filter-map-splice-helper</code></a>, <a href="#NWI-loop"><code>loop</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-i">Check whether a certain property </a><code>p</code> holds for all elements of a vector.
+Since <code>and</code> is a special form, we define a funtional version, <code><a href="#NWD3ENQke-i">and-fun</a></code> here in-place.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-9" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-h">&lt;-</a>D<a href="#NWD3ENQke-j">-&gt;</a>]</b>
+(define
+  <a href="#NWD3ENQke-i">and-fun</a>
+  (lambda
+    x
+    (cond ((null? x) #t)
+          ((not (car x)) #f)
+          (else (apply <a href="#NWD3ENQke-i">and-fun</a> (cdr x))))))
+(define
+  (<a href="#NWD3ENQke-i">vector:check</a> v p)
+  (apply <a href="#NWD3ENQke-i">and-fun</a> (map p (vector-&gt;list v))))
+</pre><blockquote>Defines <a href="#NWI-and-fun"><code>and-fun</code></a>, <a href="#NWI-vector:check"><code>vector:check</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-j">Handy replacement macro for </a><code>for-each</code>, <code>filter</code>, <code>filter-map</code>, <code>map</code>, 
+<code><a href="#NWD3ENQke-g">map-splice</a></code> and <code>filter-<a href="#NWD3ENQke-g">map-splice</a></code>.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-A" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-i">&lt;-</a>D<a href="#NWD3ENQke-k">-&gt;</a>]</b>
+<a href="#NWD3ENQke-h">(define-syntax</a>
+  <a href="#NWD3ENQke-j">forall</a>
+  (syntax-rules
+    (&lt;- do where with <a href="#NWD3ENQke-k">return</a> returns)
+    ((_ (vars ...) &lt;- (l ...) do a ...)
+     (for-each (lambda (vars ...) a ...) l ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) do a ...)
+     (for-each (lambda (<a href="#NWD3ENQke-k">var</a> ...) a ...) l ...))
+    ((_ (vars ...) &lt;- (l ...) where (p ...) do a ...)
+     (for-each
+       (lambda (vars ...) (if (p ...) (begin a ...) #f))
+       l
+       ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) where (p ...) do a ...)
+     (for-each
+       (lambda (<a href="#NWD3ENQke-k">var</a> ...) (if (p ...) (begin a ...) #f))
+       l
+       ...))
+    ((_ (vars ...) &lt;- (l ...) with (p ...))
+     (filter-map
+       (lambda
+         (vars ...)
+         (if (p ...) (list vars ...) #f))
+       l
+       ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) with (p ...))
+     (filter-map
+       (lambda (<a href="#NWD3ENQke-k">var</a> ...) (if (p ...) (list <a href="#NWD3ENQke-k">var</a> ...) #f))
+       l
+       ...))
+    ;<a href="#NWD3ENQke-g">map-splice</a> is largely equivalent to filter-<a href="#NWD3ENQke-g">map-splice</a><a href="#NWD3ENQke-h"> since                 </a>
+    ;if <a href="#NWD3ENQke-18">empty</a> list is returned<a href="#NWD3ENQke-10">,</a> its spliced result is void...                    
+    ;((_ (vars ...) &lt;- (l ...) where (p ...) returns f ...)                      
+    ;(<a href="#NWD3ENQke-g">map-splice</a> (lambda (vars ...) (if (p ...) (begin f ...)                    
+    ;                          '())) l ...))                                     
+    ;((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) where (p ...) returns f ...)                           
+    ;(<a href="#NWD3ENQke-g">map-splice</a> (lambda (<a href="#NWD3ENQke-k">var</a> ...) (if (p ...) (begin f ...)                     
+    ;                         '())) l ...))                                      
+    ((_ (vars ...)
+        &lt;-
+        (l ...)
+        where
+        (p ...)
+        returns
+        f
+        ...)
+     (filter-<a href="#NWD3ENQke-g">map-splice</a>
+<a href="#NWD3ENQke-h">       (lambda</a>
+         (vars ...)
+         (if (p ...) (begin f ...) '()))
+       l
+       ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) where (p ...) returns f ...)
+     (filter-<a href="#NWD3ENQke-g">map-splice</a>
+<a href="#NWD3ENQke-h">       (lambda (</a><a href="#NWD3ENQke-k">var</a> ...) (if (p ...) (begin f ...) '()))
+       l
+       ...))
+    ((_ (vars ...) &lt;- (l ...) where p ...)
+     (filter (lambda (vars ...) p ...) l ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) where p ...)
+     (filter (lambda (<a href="#NWD3ENQke-k">var</a> ...) p ...) l ...))
+    ((_ (vars ...) &lt;- (l ...) <a href="#NWD3ENQke-k">return</a> f ...)
+     (map (lambda (vars ...) f ...) l ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) <a href="#NWD3ENQke-k">return</a> f ...)
+     (map (lambda (<a href="#NWD3ENQke-k">var</a> ...) f ...) l ...))
+    ((_ (vars ...) &lt;- (l ...) returns f ...)
+     (<a href="#NWD3ENQke-g">map-splice</a> (lambda (vars ...) f ...) l ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) returns f ...)
+     (<a href="#NWD3ENQke-g">map-splice</a> (lambda (<a href="#NWD3ENQke-k">var</a> ...) f ...) l ...))
+    ((_ (vars ...) &lt;- (l ...))
+     (map (lambda (vars ...) (list vars ...)) l ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...))
+     (map (lambda (<a href="#NWD3ENQke-k">var</a> ...) (list <a href="#NWD3ENQke-k">var</a> ...)) l ...))))
+</pre><blockquote>Defines <a href="#NWI-forall"><code>forall</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-k">Haskell-like </a><code><a href="#NWD3ENQke-k">return</a>-where</code> syntax.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-B" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-j">&lt;-</a>D<a href="#NWD3ENQke-l">-&gt;</a>]</b>
+(define-syntax
+  <a href="#NWD3ENQke-k">return</a>
+  (syntax-rules
+    (where =)
+    ((_ (expr ...) where (<a href="#NWD3ENQke-k">var</a> = value) ...)
+     (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD3ENQke-k">var</a> value) ...) (expr ...)))))
+</pre><blockquote>Defines <a href="#NWI-return"><code>return</code></a>, <a href="#NWI-var"><code>var</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-l">Shortcuts for </a><code>with-output-to-string</code>, <code>string-append</code>, <code>number-&gt;string</code> 
+and <code>symbol-&gt;string</code>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-C" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-k">&lt;-</a>D<a href="#NWD3ENQke-m">-&gt;</a>]</b>
+(define-syntax
+  <a href="#NWD3ENQke-l">outs</a>
+  (syntax-rules
+    ()
+    ((_ x) (with-output-to-string (delay x)))))
+(define <a href="#NWD3ENQke-l">cat</a> string-append)
+(define <a href="#NWD3ENQke-l">%</a> number-&gt;string)
+(define <a href="#NWD3ENQke-l">$</a> symbol-&gt;string)
+;<a href="#NWD3ENQke-l">$</a>                                                                           
+</pre><blockquote>Defines <a href="#NWI-$"><code>$</code></a>, <a href="#NWI-%"><code>%</code></a>, <a href="#NWI-cat"><code>cat</code></a>, <a href="#NWI-outs"><code>outs</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-m">A few useful compositions of the above with list accessors</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-D" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-l">&lt;-</a>D<a href="#NWD3ENQke-p">-&gt;</a>]</b>
+(define <a href="#NWD3ENQke-l">%</a><a href="#NWD3ENQke-m">car</a> (<a href="#NWD3ENQke-e">compose</a> car <a href="#NWD3ENQke-l">%</a>))
+(define <a href="#NWD3ENQke-l">%</a><a href="#NWD3ENQke-m">caddr</a> (<a href="#NWD3ENQke-e">compose</a> caddr <a href="#NWD3ENQke-l">%</a>))
+(define <a href="#NWD3ENQke-l">%</a><a href="#NWD3ENQke-m">cadddr</a> (<a href="#NWD3ENQke-e">compose</a> cadddr <a href="#NWD3ENQke-l">%</a>))
+(define <a href="#NWD3ENQke-l">%</a><a href="#NWD3ENQke-m">cddddr</a> (<a href="#NWD3ENQke-e">compose</a> cddddr <a href="#NWD3ENQke-l">%</a>))
+(define <a href="#NWD3ENQke-l">%</a><a href="#NWD3ENQke-m">caddddr</a> (<a href="#NWD3ENQke-e">compose</a> cddddr car <a href="#NWD3ENQke-l">%</a>))
+(define <a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-m">caar</a> (<a href="#NWD3ENQke-e">compose</a> caar <a href="#NWD3ENQke-l">$</a>))
+(define <a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-m">caadr</a> (<a href="#NWD3ENQke-e">compose</a> caadr <a href="#NWD3ENQke-l">$</a>))
+</pre><blockquote>Defines <a href="#NWI-$caadr"><code>$caadr</code></a>, <a href="#NWI-$caar"><code>$caar</code></a>, <a href="#NWI-%caddddr"><code>%caddddr</code></a>, <a href="#NWI-%cadddr"><code>%cadddr</code></a>, <a href="#NWI-%caddr"><code>%caddr</code></a>, <a href="#NWI-%car"><code>%car</code></a>, <a href="#NWI-%cddddr"><code>%cddddr</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><h3><a name=toc12><a name="NWD3ENQke-n">SXPath trickery</a></a></h3><a name="ssec:sxpath"><b>[*]</b></a>
+<p>
+<a name="NWD3ENQke-o">Miscellaneous functions for SXML transformations and namespace support.</a>
+<p>
+<a name="NWD3ENQke-p">We hake use of the following XML namespaces inside GXF files. We</a>
+represent that as a list of pairs, just in a format that's needed for <code>ssax:xml-&gt;sxml</code> 
+and <code>srl:parameterizable</code>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-E" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-m">&lt;-</a>D<a href="#NWD3ENQke-q">-&gt;</a>]</b>
+(define
+  <a href="#NWD3ENQke-p">Namespaces</a>
+  (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD3ENQke-p">xlink</a> &quot;http://www.w3.org/1999/<a href="#NWD3ENQke-p">xlink</a>&quot;)
+        (xi &quot;http://www.w3.org/2001/XInclude&quot;))
+       `((<a href="#NWD3ENQke-p">xlink</a> unquote <a href="#NWD3ENQke-p">xlink</a>) (xi unquote xi))))
+</pre><blockquote>Defines <a href="#NWI-Namespaces"><code>Namespaces</code></a>, <a href="#NWI-xlink"><code>xlink</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-q">Abbreviations of common namespaces and their elements.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-F" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-p">&lt;-</a>D<a href="#NWD3ENQke-r">-&gt;</a>]</b>
+(define
+  <a href="#NWD3ENQke-q">XLink:type</a>
+  'http://www.w3.org/1999/<a href="#NWD3ENQke-p">xlink</a>:type)
+(define
+  <a href="#NWD3ENQke-q">XLink:label</a>
+  'http://www.w3.org/1999/<a href="#NWD3ENQke-p">xlink</a>:label)
+(define
+  <a href="#NWD3ENQke-q">XLink:href</a>
+  'http://www.w3.org/1999/<a href="#NWD3ENQke-p">xlink</a>:href)
+(define
+  <a href="#NWD3ENQke-q">XLink:from</a>
+  'http://www.w3.org/1999/<a href="#NWD3ENQke-p">xlink</a>:from)
+(define
+  <a href="#NWD3ENQke-q">XLink:to</a>
+  'http://www.w3.org/1999/<a href="#NWD3ENQke-p">xlink</a>:to)
+</pre><blockquote>Defines <a href="#NWI-XLink:from"><code>XLink:from</code></a>, <a href="#NWI-XLink:href"><code>XLink:href</code></a>, <a href="#NWI-XLink:label"><code>XLink:label</code></a>, <a href="#NWI-XLink:to"><code>XLink:to</code></a>, <a href="#NWI-XLink:type"><code>XLink:type</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-r">Turn a list of pairs into a list of lists (needed for literal GXF generation)</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-G" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-q">&lt;-</a>D<a href="#NWD3ENQke-s">-&gt;</a>]</b>
+(define
+  <a href="#NWD3ENQke-r">NAMESPACES</a>
+  (<a href="#NWD1myE43-O">let</a> <a href="#NWD1myE43-C">loop</a>
+       ((x <a href="#NWD3ENQke-p">Namespaces</a>) (<a href="#NWD3ENQke-v">r</a> '()))
+       (cond ((null? x) <a href="#NWD3ENQke-v">r</a>)
+             ((pair? x)
+              (<a href="#NWD1myE43-C">loop</a> (cdr x) (cons (list (caar x) (cdar x)) <a href="#NWD3ENQke-v">r</a>)))
+             (else (error &quot;<a href="#NWD3ENQke-r">NAMESPACES</a>&quot; &quot;unknown object&quot; x)))))
+</pre><blockquote>Defines <a href="#NWI-loop"><code>loop</code></a>, <a href="#NWI-NAMESPACES"><code>NAMESPACES</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-s">Handy function to define an XML </a><code>id</code> and an XLink <code>label</code> at once.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-H" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-r">&lt;-</a>D<a href="#NWD3ENQke-t">-&gt;</a>]</b>
+(define
+  (gxf:<a href="#NWD1myE43-M">labels</a><a href="#NWD3ENQke-s"> id)</a>
+  `((id <a href="#NWD3ENQke-10">,</a>id) (<a href="#NWD3ENQke-p">xlink</a>:label <a href="#NWD3ENQke-10">,</a>id)))
+</pre><blockquote>Defines <a href="#NWI-gxf:labels"><code>gxf:labels</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-t">Nice shortcut for XPath expressions...</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-I" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-s">&lt;-</a>D<a href="#NWD3ENQke-u">-&gt;</a>]</b>
+(define (<a href="#NWD3ENQke-t">sxpath/link</a> e) (sxpath/c e <a href="#NWD3ENQke-p">Namespaces</a>))
+</pre><blockquote>Defines <a href="#NWI-sxpath/link"><code>sxpath/link</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-u">SXpath queries with some syntactic sugar for variable bindings. Do some checking on the</a>
+where clauses at run-time
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-J" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-t">&lt;-</a>D<a href="#NWD3ENQke-v">-&gt;</a>]</b>
+(define-syntax
+  <a href="#NWD3ENQke-u">Xs</a>
+  (syntax-rules
+    (where =)
+    ((_ t x where (<a href="#NWD3ENQke-k">var</a> = value) ...)
+     (if (apply <a href="#NWD3ENQke-i">and-fun</a>
+                (<a href="#NWD3ENQke-j">forall</a>
+                  ((v &lt;- `(<a href="#NWD3ENQke-k">var</a> ...)))
+                  <a href="#NWD3ENQke-k">return</a>
+                  (eq? (string-ref (symbol-&gt;string v) 0) #\<a href="#NWD3ENQke-l">$</a>)))
+         ((sxpath x)
+          t
+          `((<a href="#NWD3ENQke-10">,</a>(string-&gt;symbol
+                (substring (symbol-&gt;string 'var) 1))
+             unquote
+             value)
+            ...))
+         (error &quot;<a href="#NWD3ENQke-u">Xs</a>&quot; &quot;bad syntax&quot; `(<a href="#NWD3ENQke-k">var</a> ...))))
+    ((_ t x) ((sxpath x) t))))
+</pre><blockquote>Defines <a href="#NWI-Xs"><code>Xs</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-v">Retrieve just the first result (assumed to be at most one). If no result comes out, use the </a>
+values tagged by the <code>default</code> symbol.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-K" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-u">&lt;-</a>D<a href="#NWD3ENQke-w">-&gt;</a>]</b>
+(define-syntax
+  <a href="#NWD3ENQke-v">X@</a>
+  (syntax-rules
+    (default)
+    ((_ t (default <a href="#NWD3ENQke-v">r</a> ...) x ...)
+     (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD3ENQke-v">r</a> ((sxpath '(x ...)) t)))
+          (cond ((pair? <a href="#NWD3ENQke-v">r</a>) (car <a href="#NWD3ENQke-v">r</a>)) (else <a href="#NWD3ENQke-v">r</a> ...))))
+    ((_ t x ...) (car ((sxpath '(x ...)) t)))))
+</pre><blockquote>Defines <a href="#NWI-r"><code>r</code></a>, <a href="#NWI-X@"><code>X@</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-w">Use the string value from the first result</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-L" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-v">&lt;-</a>D<a href="#NWD3ENQke-x">-&gt;</a>]</b>
+(define-syntax
+  <a href="#NWD3ENQke-w">X</a>
+  (syntax-rules
+    ()
+    ((_ t x ...) (<a href="#NWD3ENQke-v">X@</a> t x ... *text*))))
+</pre><blockquote>Defines <a href="#NWI-X"><code>X</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-x">Auto-convert the value to numbers resp. symbols</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-M" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-w">&lt;-</a>D<a href="#NWD3ENQke-y">-&gt;</a>]</b>
+(define-syntax
+  <a href="#NWD3ENQke-w">X</a><a href="#NWD3ENQke-l">%</a>
+<a href="#NWD3ENQke-x">  (syntax-rules</a>
+    ()
+    ((_ t x ...) (string-&gt;number (<a href="#NWD3ENQke-w">X</a> t x ...)))))
+(define-syntax
+  <a href="#NWD3ENQke-w">X</a><a href="#NWD3ENQke-l">$</a>
+<a href="#NWD3ENQke-x">  (syntax-rules</a>
+    ()
+    ((_ t x ...) (string-&gt;symbol (<a href="#NWD3ENQke-w">X</a> t x ...)))))
+;<a href="#NWD3ENQke-l">$</a>                                                                           
+</pre><blockquote>Defines <a href="#NWI-X$"><code>X$</code></a>, <a href="#NWI-X%"><code>X%</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-y">Copy a GXF port structure, with all its formal contents (see the DTD)</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-N" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-x">&lt;-</a>D<a href="#NWD3ENQke-z">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-y">copy-port</a> p prefix)
+  `(port (@ (<a href="#NWD3ENQke-p">xlink</a>:type &quot;resource&quot;)
+            <a href="#NWD3ENQke-10">,</a>@(gxf:<a href="#NWD1myE43-M">labels</a><a href="#NWD3ENQke-s"> (</a><a href="#NWD3ENQke-l">cat</a> prefix &quot;:&quot; (<a href="#NWD3ENQke-w">X</a> p id))))
+         <a href="#NWD3ENQke-10">,</a>@(<a href="#NWD3ENQke-u">Xs</a> p
+               &quot;id|type|size|calltype|const|static|restrict&quot;)))
+</pre><blockquote>Defines <a href="#NWI-cat"><code>cat</code></a>, <a href="#NWI-copy-port"><code>copy-port</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-z">Optionally remove a &quot;CDATA[&quot; prefix from a string</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-O" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-y">&lt;-</a>D<a href="#NWD3ENQke-11">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-z">remove-cdata</a> x)
+  (<a href="#NWD1myE43-O">let</a>* ((s &quot;CDATA[&quot;) (l (string-length s)))
+        (if (substring=? x s l) (substring x l) x)))
+</pre><blockquote>Defines <a href="#NWI-remove-cdata"><code>remove-cdata</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-10">A macro to define any SXPath getters and predicates.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-1h8OQs-1" href="#NWD3ENQke-10"><dfn>&lt;Interpreted globals&gt;=</dfn></a><a name="Interpreted globals"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a>)</b> <b>[D<a href="#NW3ENQke-1h8OQs-2">-&gt;</a>]</b>
+(define-syntax
+  <a href="#NWD3ENQke-f">helper</a>
+  (syntax-rules
+    ()
+    ((_ (<a href="#NWD3ENQke-v">r</a> ...)) (eval `(begin <a href="#NWD3ENQke-v">r</a> ...)))
+    ((_ (<a href="#NWD3ENQke-v">r</a> ...) t x rest ...)
+     (<a href="#NWD3ENQke-f">helper</a> (<a href="#NWD3ENQke-v">r</a> ... <a href="#NWD3ENQke-10">,</a>@(<a href="#NWD3ENQke-10">geng</a> t x)) rest ...))))
+(define-syntax
+  <a href="#NWD3ENQke-10">geng</a>
+  (syntax-rules
+    (^ <a href="#NWD3ENQke-l">%</a> ?)
+    ((_ ^ s)
+     `((define
+         (<a href="#NWD3ENQke-10">,</a>(symbol-append `get- `s) p)
+         (car ((sxpath `(s *text*)) p)))))
+    ((_ <a href="#NWD3ENQke-l">%</a> s)
+     `((define
+         (<a href="#NWD3ENQke-10">,</a>(symbol-append `get- `s) p)
+         (string-&gt;number (car ((sxpath `(s *text*)) p))))))
+    ((_ ? s)
+     `((define
+         (<a href="#NWD3ENQke-10">,</a>(symbol-append `is- `s) p)
+         (pair? ((sxpath `(s)) p)))
+       (define
+         (<a href="#NWD3ENQke-10">,</a>(symbol-append `is-not- `s) p)
+         (null? ((sxpath `(s)) p)))))
+    ((_ t s rest ...) (<a href="#NWD3ENQke-f">helper</a> () t s rest ...))))
+</pre><blockquote>Defines <a href="#NWI-,"><code>,</code></a>, <a href="#NWI-geng"><code>geng</code></a>, <a href="#NWI-helper"><code>helper</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-1h8OQs-2" href="#NWD3ENQke-10"><dfn>&lt;Interpreted globals&gt;+=</dfn></a><a name="Interpreted globals"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-10">&lt;-</a>D]</b>
+(<a href="#NWD3ENQke-10">geng</a> ? const ? static ? restrict ^ type <a href="#NWD3ENQke-l">%</a> size)
+(define <a href="#NW3ENQke-1h8OQs-2">is-cons</a> is-const)
+(define <a href="#NW3ENQke-1h8OQs-2">is-prod</a> is-not-const)
+</pre><blockquote>Defines <a href="#NWI-is-cons"><code>is-cons</code></a>, <a href="#NWI-is-prod"><code>is-prod</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-4Gqms7-1" href="#NW3ENQke-4Gqms7-1"><dfn>&lt;Compiled globals&gt;=</dfn></a><a name="Compiled globals"/> <b>(<a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b>
+(define
+  <a href="#NW3ENQke-1h8OQs-2">is-cons</a>
+  (lambda (p) (pair? ((sxpath '(const)) p))))
+(define
+  <a href="#NW3ENQke-1h8OQs-2">is-prod</a>
+  (lambda (p) (null? ((sxpath '(const)) p))))
+</pre><blockquote>Defines <a href="#NWI-is-cons"><code>is-cons</code></a>, <a href="#NWI-is-prod"><code>is-prod</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-11">Find the super-node (a node that defines the class, i.e., all ports and sub-nodes)</a>
+given a node <code>N</code>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-P" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-z">&lt;-</a>D<a href="#NWD3ENQke-13">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-11">gxf:super-node</a> sxml N)
+  (<a href="#NWD3ENQke-u">Xs</a> sxml
+      &quot;gxf/node[id=<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a>]/stereo-type/text()&quot;
+      where
+      (<a href="#NWD3ENQke-l">$</a><a href="#NWD3ENQke-14">n</a> = N)))
+</pre><blockquote>Defines <a href="#NWI-gxf:super-node"><code>gxf:super-node</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><h3><a name=toc13><a name="NWD3ENQke-12">GXF preprocessing</a></a></h3><a name="ssec:preproc"><b>[*]</b></a>
+<p>
+<a name="NWD3ENQke-13">Dump the GXF to the filesystem...</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-Q" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-11">&lt;-</a>D<a href="#NWD3ENQke-14">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-13">gxf:convert</a> in <a href="#NWD3ENQke-18">out</a>)
+  (with-output-to-file
+    <a href="#NWD3ENQke-18">out</a>
+    (lambda
+      ()
+      (print &quot;&lt;?xml version='1.0' encoding='utf-8'?&gt;&quot;)
+      (print (string-append
+               &quot;&lt;!DOCTYPE gxf PUBLIC &quot;
+               &quot;'-//LIME/DTD gxf 1.0 Transitional//EN' &quot;
+               &quot;'/home/pjotr/LIME/doc/gxf.dtd'&gt;&quot;))
+      (srl:parameterizable
+        (<a href="#NWD3ENQke-14">gxf:stream-splice</a>
+          (<a href="#NWD3ENQke-p">xlink</a>:find-doc in (<a href="#NWD3ENQke-p">xlink</a>:documents in)))
+        (current-output-port)
+        ;'(indent . &quot;&quot;)                                                              
+        '(omit-xml-declaration . #t)
+        '(standalone . yes)
+        '(cdata-section-elements code)))))
+</pre><blockquote>Defines <a href="#NWI-gxf:convert"><code>gxf:convert</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-14">A transformation to splice the contents of the </a><code>&lt;stream&gt;</code> node into the context. This is needed to support outport-inport traversals (along edges); for some reason XLinks do not work if they are not enclosed directly by the root context.
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-R" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-13">&lt;-</a>D<a href="#NWD3ENQke-17">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-14">gxf:stream-splice</a> sxml)
+  (pre-post-order
+    sxml
+    `((*TOP* *macro*
+             unquote
+             (lambda top (car ((sxpath &quot;*&quot;) top))))
+      (@ *preorder* unquote <a href="#NWD3ENQke-a">Id</a>)
+      (gxf unquote
+           (lambda
+             gxf
+             `(gxf (@ <a href="#NWD3ENQke-10">,</a>@(map-union
+                          <a href="#NWD3ENQke-a">Identity</a>
+                          ((sxpath &quot;attribute::*&quot;) gxf)))
+                   <a href="#NWD3ENQke-10">,</a>@(map-union <a href="#NWD3ENQke-a">Identity</a> ((sxpath &quot;node&quot;) gxf))
+                   <a href="#NWD3ENQke-10">,</a>@(map-union <a href="#NWD3ENQke-a">Identity</a> ((sxpath &quot;stream/*&quot;) gxf))
+                   <a href="#NWD3ENQke-10">,</a>@(map-union
+                       (lambda
+                         (x)
+                         (<a href="#NWD1myE43-O">let</a> ((<a href="#NWD3ENQke-14">n</a> (cadadr x)) (p (cadadr (cdr x))))
+                              (list<a name="NW3ENQke-2uScsB-R-u1" href="#NWD3ENQke-15"><i>&lt;stream-splice nodes&gt;</i></a>
+)))
+                       ((sxpath &quot;stream/edge/from-node&quot;) gxf)))))
+      (*text* unquote <a href="#NWD3ENQke-a">Unmeta</a>)
+      (*default* unquote <a href="#NWD3ENQke-a">Id</a>))))
+</pre><blockquote>Defines <a href="#NWI-gxf:stream-splice"><code>gxf:stream-splice</code></a>, <a href="#NWI-n"><code>n</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-15">Also, add these handy link nodes for outport-edge, edge-outport traversals.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-47NVKf-1" href="#NWD3ENQke-15"><dfn>&lt;stream-splice nodes&gt;=</dfn></a><a name="stream-splice nodes"/> <b>(<a href="#NWD3ENQke-14">&lt;-U</a>)</b>
+`(el (@ (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:type</a> &quot;locator&quot;)
+        (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:label</a> <a href="#NWD3ENQke-10">,</a>(string-append <a href="#NWD3ENQke-14">n</a> &quot;_&quot; p &quot;_fanout&quot;))
+        (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:href</a>
+         <a href="#NWD3ENQke-10">,</a>(string-append
+            &quot;#xpointer(gxf//edge[contains(from-node/id<a href="#NWD3ENQke-10">,</a>'&quot;
+            <a href="#NWD3ENQke-14">n</a>
+            &quot;') &quot;
+            &quot;and contains(from-node/port-id<a href="#NWD3ENQke-10">,</a>'&quot;
+            p
+            &quot;')])&quot;))))
+`(<a href="#NWD3ENQke-18">nl</a> (@ (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:type</a> &quot;locator&quot;)
+        (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:label</a> <a href="#NWD3ENQke-10">,</a>(string-append <a href="#NWD3ENQke-14">n</a> &quot;:&quot; p))
+        (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:href</a> <a href="#NWD3ENQke-10">,</a>(string-append &quot;#&quot; <a href="#NWD3ENQke-14">n</a> &quot;:&quot; p))))
+`(ea (@ (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:type</a> &quot;arc&quot;)
+        (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:from</a> <a href="#NWD3ENQke-10">,</a>(string-append <a href="#NWD3ENQke-14">n</a> &quot;_&quot; p &quot;_fanout&quot;))
+        (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:to</a> <a href="#NWD3ENQke-10">,</a>(string-append <a href="#NWD3ENQke-14">n</a> &quot;:&quot; p))))
+`(pa (@ (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:type</a> &quot;arc&quot;)
+        (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:from</a> <a href="#NWD3ENQke-10">,</a>(string-append <a href="#NWD3ENQke-14">n</a> &quot;:&quot; p))
+        (<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-q">XLink:to</a> <a href="#NWD3ENQke-10">,</a>(string-append <a href="#NWD3ENQke-14">n</a> &quot;_&quot; p &quot;_fanout&quot;))))
+</pre></td></tr></table></center></font></pre><p><h3><a name=toc14><a name="NWD3ENQke-16">Debugging</a></a></h3><a name="ssec:debugging"><b>[*]</b></a>
+<p>
+<a name="NWD3ENQke-17">Possibly force a promise...</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-S" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-14">&lt;-</a>D<a href="#NWD3ENQke-18">-&gt;</a>]</b>
+(define
+  (<a href="#NWD3ENQke-17">==</a> x)
+  (cond ((procedure? x) (force x)) (else x)))
+</pre><blockquote>Defines <a href="#NWI-=="><code>==</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-18">A small printer.</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-T" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-17">&lt;-</a>D<a href="#NWD3ENQke-19">-&gt;</a>]</b>
+(define <a href="#NWD3ENQke-18">nl</a> &quot;\<a href="#NWD3ENQke-14">n</a>&quot;)
+(define <a href="#NWD3ENQke-18">empty</a> &quot;&quot;)
+(define (<a href="#NWD3ENQke-18">empty</a><a href="#NWD3ENQke-18">?</a> x) (string=? x <a href="#NWD3ENQke-18">empty</a>))
+(define
+  (<a href="#NWD3ENQke-18">out</a> #!key
+       (head &quot;&quot;)
+       (tail #\newline)
+       (separator #\space)
+       #!rest
+       l)
+  (<a href="#NWD3ENQke-k">return</a>
+    (<a href="#NWD3ENQke-j">forall</a>
+      ((x &lt;- l))
+      do
+      (begin (and first (not (<a href="#NWD3ENQke-18">empty</a><a href="#NWD3ENQke-18">?</a> x)) (display head))
+             (or first (<a href="#NWD3ENQke-18">empty</a><a href="#NWD3ENQke-18">?</a> x) cr (display separator))
+             (or (<a href="#NWD3ENQke-18">empty</a><a href="#NWD3ENQke-18">?</a> x)
+                 (begin (display x)
+                        (set! first #f)
+                        (set! cr (string-suffix? &quot;\<a href="#NWD3ENQke-14">n</a>&quot; x))))))
+    where
+    (first = #t)
+    (cr = #t))
+  (display tail))
+</pre><blockquote>Defines <a href="#NWI-empty"><code>empty</code></a>, <a href="#NWI-empty?"><code>empty?</code></a>, <a href="#NWI-nl"><code>nl</code></a>, <a href="#NWI-out"><code>out</code></a>, <a href="#NWI-out-list1"><code>out-list1</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-19">A debugging facility</a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-U" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-18">&lt;-</a>D<a href="#NWD3ENQke-1A">-&gt;</a>]</b>
+(define-syntax
+  <a href="#NWD3ENQke-19">debug</a>
+  (syntax-rules
+    ()
+    ((_)
+     (begin (display &quot;MARK: &quot;)
+            (display (gensym))
+            (newline)))
+    ((_ term)
+     (begin (display `term) (display &quot;: &quot;) (pp term)))
+    ((_ term rest ...)
+     (begin (<a href="#NWD3ENQke-19">debug</a> term) (<a href="#NWD3ENQke-19">debug</a> rest ...)))))
+</pre><blockquote>Defines <a href="#NWI-debug"><code>debug</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><a name="NWD3ENQke-1A">A handy macro to retrieve an argument </a><code>ind</code> from a list of <code>args</code>, or use a default value <code>def</code> 
+(<code>&quot;*&quot;</code> if that is not specified)
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-2uScsB-V" href="#NWD3ENQke-a"><dfn>&lt;Miscellaneous&gt;+=</dfn></a><a name="Miscellaneous"/> <b>(<a href="#NWD1myE43-4">&lt;-U</a> <a href="#NW1myE43-3szo1W-1">&lt;-U</a>)</b> <b>[<a href="#NWD3ENQke-19">&lt;-</a>D]</b>
+(define-syntax
+  <a href="#NWD3ENQke-1A">args-ref</a>
+  (syntax-rules
+    ()
+    ((_ args ind) (<a href="#NWD3ENQke-1A">args-ref</a> args ind &quot;*&quot;))
+    ((_ args ind def)
+     (cond ((&gt; (length args) ind) (list-ref args ind))
+           (else def)))))
+</pre><blockquote>Defines <a href="#NWI-args-ref"><code>args-ref</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><h3><a name=toc15><a name="NWD3ENQke-1B">Trashbin</a></a></h3><a name="ssec:trash"><b>[*]</b></a>
+<p>
+<pre><font color=black><center><table border width="100%" bgcolor=#F0F8FF><tr><td><pre><a name="NW3ENQke-3YXXFl-1" href="#NWD3ENQke-1B"><dfn>&lt;Trash&gt;=</dfn></a><a name="Trash"/>
+(define
+  (<a href="#NWD3ENQke-1B">gxf:body</a> sxml)
+  (pre-post-order
+    sxml
+    `((*TOP* *macro*
+             unquote
+             (lambda top (car ((sxpath &quot;*&quot;) top))))
+      (@ *preorder* unquote <a href="#NWD3ENQke-a">Id</a>)
+      (*text* unquote <a href="#NWD3ENQke-a">Unmeta</a>)
+      (*default* unquote <a href="#NWD3ENQke-a">Id</a>))))
+(map (lambda
+       (s)
+       (eval `(define
+                (is-<a href="#NWD3ENQke-10">,</a><a href="#NWD3ENQke-1B">s</a> p)
+                (pair? ((sxpath <a href="#NWD3ENQke-10">,</a>(symbol-&gt;string s)) p)))
+             (interaction-environment)))
+     '(const static restrict))
+(define (<a href="#NWD3ENQke-1B">for-all</a> l p) (for-each p l))
+(define-syntax
+  <a href="#NWD3ENQke-1B">@forall</a>
+  (syntax-rules
+    (&lt;- do where)
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) do a ...)
+     (for-each (lambda (<a href="#NWD3ENQke-k">var</a> ...) a ...) l ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...) where p ...)
+     (filter (lambda (<a href="#NWD3ENQke-k">var</a> ...) p ...) l ...))
+    ((_ ((<a href="#NWD3ENQke-k">var</a> &lt;- l) ...))
+     (map (lambda (<a href="#NWD3ENQke-k">var</a> ...) (list <a href="#NWD3ENQke-k">var</a> ...)) l ...))))
+(define-macro
+  (<a href="#NWD3ENQke-1B">gen-getter</a> s)
+  `(define
+     (<a href="#NWD3ENQke-10">,</a>(symbol-append 'get- s) p)
+     (car ((sxpath (<a href="#NWD3ENQke-10">,</a>s *text*)) p))))
+(define-macro
+  (<a href="#NWD3ENQke-1B">gen-getter</a><a href="#NWD3ENQke-1B">-num</a> s)
+  `(define
+     (<a href="#NWD3ENQke-10">,</a>(symbol-append 'get- s) p)
+     (string-&gt;number (car ((sxpath (<a href="#NWD3ENQke-10">,</a>s *text)) p)))))
+(define-macro
+  (<a href="#NWD3ENQke-1B">gen-predicate</a> s)
+  (eval `(begin(define
+                  (<a href="#NWD3ENQke-10">,</a>(symbol-append 'is- s) p)
+                  (pair? ((sxpath '(<a href="#NWD3ENQke-10">,</a>s)) p)))
+                (define
+                  (<a href="#NWD3ENQke-10">,</a>(symbol-append 'is-not- s) p)
+                  (null? ((sxpath '(<a href="#NWD3ENQke-10">,</a>s)) p))))))
+(<a href="#NWD3ENQke-1B">gen-predicate</a> const)
+(<a href="#NWD3ENQke-1B">gen-predicate</a> static)
+(<a href="#NWD3ENQke-1B">gen-predicate</a> restrict)
+(<a href="#NWD3ENQke-1B">gen-getter</a> type)
+(<a href="#NWD3ENQke-1B">gen-getter</a><a href="#NWD3ENQke-1B">-num</a> size)
+</pre><blockquote>Defines <a href="#NWI-,"><code>,</code></a>, <a href="#NWI-@forall"><code>@forall</code></a>, <a href="#NWI-for-all"><code>for-all</code></a>, <a href="#NWI-gen-getter"><code>gen-getter</code></a>, <a href="#NWI-gen-getter-num"><code>gen-getter-num</code></a>, <a href="#NWI-gen-predicate"><code>gen-predicate</code></a>, <a href="#NWI-gxf:body"><code>gxf:body</code></a>, <a href="#NWI-is-,s"><code>is-,s</code></a> (links are to index).<p>
+</blockquote></td></tr></table></center></font></pre><p><!-- Emacs trickery-->
+<!--%% Local Variables:-->
+<!--%% mode: latex-->
+<!--%% TeX-master: "beseq"-->
+<!--%% LaTeX-command: "nolatex"-->
+<!--%% eval: (set 'compile-command "make deps")-->
+<!--%% End:-->
+<a name="NWD3ENQke-1C">*</a>
+<!-- TeX Trailer to include in literal output-->
+
+<!--Copyright (C) 2008 NXP Semiconductors B.V.-->
+
+<!--This file is part of LIME.-->
+
+<!--LIME is free software: you can redistribute it and/or modify-->
+<!--it under the terms of the GNU General Public License version 2-->
+<!--as published by the Free Software Foundation; either version 2-->
+<!--of the License, or (at your option) any later version.-->
+
+<!--LIME is distributed in the hope that it will be useful,-->
+<!--but WITHOUT ANY WARRANTY; without even the implied warranty of-->
+<!--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-->
+<!--GNU General Public License for more details.-->
+
+<!--You should have received a copy of the GNU General Public License-->
+<!--along with LIME.  If not, see <http://www.gnu.org/licenses/>.-->
+
+
+<h2><a name=toc16>Acronyms</a></h2>
+<p>
+
+<dl>
+<dt>BE<dd>Back-End
+<dt>DTD<dd>Document Type Definition
+<dt>FIFO<dd>First-In First-Out
+<dt>FP<dd>Functional Programming
+<dt>GXF<dd>Graph Exchange Format
+<dt>LIME<dd>Less Is More
+<dt>MTU<dd>Maximal Transfer Unit
+<dt>R5RS<dd>Revised Report on algorithmic language Scheme
+<dt>SSA<dd>Static Single Assignment 
+<dt>SSAX<dd>Scheme SAX
+<dt>SXML<dd>Scheme XML
+<dt>XML<dd>Extensible Markup Language
+</dl>
+<!-- TeX Trailer to include in literal output-->
+
+<!--Copyright (C) 2008 NXP Semiconductors B.V.-->
+
+<!--This file is part of LIME.-->
+
+<!--LIME is free software: you can redistribute it and/or modify-->
+<!--it under the terms of the GNU General Public License version 2-->
+<!--as published by the Free Software Foundation; either version 2-->
+<!--of the License, or (at your option) any later version.-->
+
+<!--LIME is distributed in the hope that it will be useful,-->
+<!--but WITHOUT ANY WARRANTY; without even the implied warranty of-->
+<!--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-->
+<!--GNU General Public License for more details.-->
+
+<!--You should have received a copy of the GNU General Public License-->
+<!--along with LIME.  If not, see <http://www.gnu.org/licenses/>.-->
+<p>
+<h2><a name=toc17>Revisions</a></h2>
+<tt><tt>beseq.nw</tt>
+<dl>
+<p>
+1341:82b557acd4b7&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Sep 15 2010 10:51:18 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>more refactoring
+<p>
+1340:4a02a4f60850&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Sep 15 2010 00:04:20 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>separate optimized FIFO access method to a separate chunk
+<p>
+1337:908c004dc01f&nbsp;(<b>LIME-sequel</b>)&nbsp;Tue Sep 14 2010 16:21:07 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>add fifo checking
+<p>
+1335:599c8ba7be03&nbsp;(<b>LIME-sequel</b>)&nbsp;Tue Sep 14 2010 09:55:32 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>separated common.nw
+<p>
+1334:2afaeb4bc87a&nbsp;(<b>LIME-sequel</b>)&nbsp;Fri Sep 10 2010 17:16:06 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>first steps in support for external state
+<p>
+1333:1b8a7081cce3&nbsp;(<b>LIME-sequel</b>)&nbsp;Fri Sep 10 2010 12:31:43 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>fix bugs around spill etc.
+<p>
+1332:8469a084d7b7&nbsp;(<b>LIME-sequel</b>)&nbsp;Fri Sep 10 2010 12:14:38 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>support code fragments now
+<p>
+1331:d317bdbf6f8b&nbsp;(<b>LIME-sequel</b>)&nbsp;Thu Sep 09 2010 12:13:46 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>cleanups, allow spill for consumers and producers
+<p>
+1330:b29ba187c400&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Sep 08 2010 16:48:56 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>fixes
+<p>
+1329:d157b1bb6fac&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Sep 08 2010 16:26:21 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>spill handling
+<p>
+1328:f190875e97f2&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Sep 08 2010 11:34:50 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>cleanups
+<p>
+1327:a713c257fd10&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Sep 08 2010 10:55:23 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>it works, finally
+<p>
+1326:eeb4e566bee7&nbsp;(<b>LIME-sequel</b>)&nbsp;Tue Sep 07 2010 23:50:02 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>it almost works!
+<p>
+1325:4a9f7738136c&nbsp;(<b>LIME-sequel</b>)&nbsp;Tue Sep 07 2010 18:13:32 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>more syntax
+<p>
+1324:393db2922475&nbsp;(<b>LIME-sequel</b>)&nbsp;Tue Sep 07 2010 16:42:38 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>more syntactic sugar, save port info in edges
+<p>
+1323:c87e01799bc9&nbsp;(<b>LIME-sequel</b>)&nbsp;Tue Sep 07 2010 14:04:58 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>use R5RS macros everywhere
+<p>
+1322:89b36aabae88&nbsp;(<b>LIME-sequel</b>)&nbsp;Mon Sep 06 2010 17:29:38 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>use SXpath native syntax, if possible
+<p>
+1321:3b2cd2f51f0e&nbsp;(<b>LIME-sequel</b>)&nbsp;Mon Sep 06 2010 16:37:31 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>abbreviate common procs
+<p>
+1320:b851214e0945&nbsp;(<b>LIME-sequel</b>)&nbsp;Fri Aug 13 2010 15:13:18 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>switch to forall
+<p>
+1319:b5699c04457a&nbsp;(<b>LIME-sequel</b>)&nbsp;Thu Aug 12 2010 18:05:27 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>fix map/for-each and add for-all...
+<p>
+1318:a8c41679397a&nbsp;(<b>LIME-sequel</b>)&nbsp;Tue Aug 10 2010 18:07:48 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>some progress...
+<p>
+1317:ed58f5fcff7a&nbsp;(<b>LIME-sequel</b>)&nbsp;Sat Aug 07 2010 17:11:55 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>simulation part almost integrated
+<p>
+1316:37a23f9af292&nbsp;(<b>LIME-sequel</b>)&nbsp;Fri Aug 06 2010 17:16:08 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>beseq integrated with sequel
+<p>
+1315:cc48a28bd278&nbsp;(<b>LIME-sequel</b>)&nbsp;Fri Aug 06 2010 16:19:05 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>integration in progress...
+<p>
+1313:237a770120aa&nbsp;(<b>LIME-sequel</b>)&nbsp;Thu Aug 05 2010 17:48:17 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>refactorings, prepare for integration with sequel
+<p>
+1312:51a4029fd8ad&nbsp;(<b>LIME-sequel</b>)&nbsp;Thu Aug 05 2010 13:49:17 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>all loops are tail-recursive now
+<p>
+1311:86b092066328&nbsp;(<b>LIME-sequel</b>)&nbsp;Thu Aug 05 2010 13:34:28 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>works correctly now
+<p>
+1310:400e22ec39fa&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Aug 04 2010 22:20:11 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>filtering unconnected ports works!
+<p>
+1309:eee1f0dd89f8&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Aug 04 2010 18:08:41 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>made some progress (filtering unconnected ports almost works now)
+<p>
+1308:4cae67b09a02&nbsp;(<b>LIME-sequel</b>)&nbsp;Mon Aug 02 2010 17:21:12 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>add emacs trickery
+<p>
+1305:1181fd9a2445&nbsp;(<b>LIME-sequel</b>)&nbsp;Mon Aug 02 2010 16:37:05 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>made some progress in &quot;empty&quot; transformation
+<p>
+1304:4430699393a0&nbsp;(<b>LIME-sequel</b>)&nbsp;Mon Aug 02 2010 13:41:53 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>started work on a new tool
+</dl>
+<tt><tt>common.nw</tt>
+<dl>
+<p>
+1341:82b557acd4b7&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Sep 15 2010 10:51:18 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>more refactoring
+<p>
+1339:191e0e131fe7&nbsp;(<b>LIME-sequel</b>)&nbsp;Wed Sep 15 2010 00:03:11 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>extend common with stuff from sequel.
+<p>
+1335:599c8ba7be03&nbsp;(<b>LIME-sequel</b>)&nbsp;Tue Sep 14 2010 09:55:32 (zone +0200)<br><em>Pjotr Kourzanov &lt;peter.kourzanov@xs4all.nl&gt;</em> <br>separated common.nw
+</dl>
+<!-- TeX Trailer to include in literal output-->
+
+<!--Copyright (C) 2008 NXP Semiconductors B.V.-->
+
+<!--This file is part of LIME.-->
+
+<!--LIME is free software: you can redistribute it and/or modify-->
+<!--it under the terms of the GNU General Public License version 2-->
+<!--as published by the Free Software Foundation; either version 2-->
+<!--of the License, or (at your option) any later version.-->
+
+<!--LIME is distributed in the hope that it will be useful,-->
+<!--but WITHOUT ANY WARRANTY; without even the implied warranty of-->
+<!--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-->
+<!--GNU General Public License for more details.-->
+
+<!--You should have received a copy of the GNU General Public License-->
+<!--along with LIME.  If not, see <http://www.gnu.org/licenses/>.-->
+<p>
+<h2><a name=toc18>Indices</a></h2>
+<p>
+
+<center><p><b>Figure 2: Refinement hierarchy for beseq module<p><a name="NWref-beseq-hier"><img src="beseq-hier.png" usemap="#beseq_hier"></a></p></b></center>
+
+<center><p><b>Figure 3: Refinement hierarchy for common module<p><a name="NWref-common-hier"><img src="common-hier.png" usemap="#common_hier"></a></p></b></center>
+
+<h3><a name=toc19><a name="NWD3NtdaB-1D">Chunks</a></a></h3>
+<ul>
+<li><a href="#NWD1myE43-M"><i>&lt;activate static schedule&gt;</i></a>: <a href="#NWD1myE43-H">U1</a>, <a href="#NWD1myE43-M">D2</a>
+<li><a href="#NWD1myE43-P"><i>&lt;activate sub-codes&gt;</i></a>: <a href="#NWD1myE43-P">D1</a>, <a href="#NWD1myE43-Q">U2</a>
+<li><a href="#NWD1myE43-O"><i>&lt;activate sub-nodes&gt;</i></a>: <a href="#NWD1myE43-O">D1</a>, <a href="#NWD1myE43-Q">U2</a>
+<li><a href="#NWD1myE43-S"><i>&lt;calculate current access pointer&gt;</i></a>: <a href="#NWD1myE43-Q">U1</a>, <a href="#NWD1myE43-S">D2</a>
+<li><a href="#NWD1myE43-T"><i>&lt;calculate current access pointer using one less element&gt;</i></a>: <a href="#NWD1myE43-T">D1</a>
+<li><a href="#NW3ENQke-4Gqms7-1"><i>&lt;Compiled globals&gt;</i></a>: <a href="#NW1myE43-3szo1W-1">U1</a>, <a href="#NW3ENQke-4Gqms7-1">D2</a>
+<li><a href="#NW1myE43-3szo1W-1"><i>&lt;Compiled.scm&gt;</i></a>: <a href="#NW1myE43-3szo1W-1">D1</a>
+<li><a href="#NWD1myE43-K"><i>&lt;compute edge connectivity&gt;</i></a>: <a href="#NWD1myE43-H">U1</a>, <a href="#NWD1myE43-K">D2</a>
+<li><a href="#NWD1myE43-J"><i>&lt;compute initial buffer administration&gt;</i></a>: <a href="#NWD1myE43-H">U1</a>, <a href="#NWD1myE43-J">D2</a>
+<li><a href="#NWD1myE43-I"><i>&lt;declare internal buffers&gt;</i></a>: <a href="#NWD1myE43-H">U1</a>, <a href="#NWD1myE43-I">D2</a>
+<li><a href="#NW1myE43-2GSHEW-1"><i>&lt;find all unconnected ports using 4 lists&gt;</i></a>: <a href="#NW1myE43-2GSHEW-1">D1</a>, <a href="#NW1myE43-354rpJ-3">U2</a>
+<li><a href="#NWD3ENQke-10"><i>&lt;Interpreted globals&gt;</i></a>: <a href="#NWD1myE43-4">U1</a>, <a href="#NWD3ENQke-10">D2</a>, <a href="#NW3ENQke-1h8OQs-2">D3</a>
+<li><a href="#NWD1myE43-4"><i>&lt;Interpreted.scm&gt;</i></a>: <a href="#NWD1myE43-4">D1</a>, <a href="#NWD1myE43-W">D2</a>
+<li><a href="#NWD1myE43-5"><i>&lt;libraries&gt;</i></a>: <a href="#NWD1myE43-4">U1</a>, <a href="#NW1myE43-3szo1W-1">U2</a>, <a href="#NWD1myE43-5">D3</a>
+<li><a href="#NWD1myE43-6"><i>&lt;main&gt;</i></a>: <a href="#NWD1myE43-4">U1</a>, <a href="#NW1myE43-3szo1W-1">U2</a>, <a href="#NWD1myE43-6">D3</a>
+<li><a href="#NWD3ENQke-a"><i>&lt;Miscellaneous&gt;</i></a>: <a href="#NWD1myE43-4">U1</a>, <a href="#NW1myE43-3szo1W-1">U2</a>, <a href="#NWD3ENQke-a">D3</a>, <a href="#NWD3ENQke-b">D4</a>, <a href="#NWD3ENQke-c">D5</a>, <a href="#NWD3ENQke-d">D6</a>, <a href="#NWD3ENQke-e">D7</a>, <a href="#NWD3ENQke-f">D8</a>, <a href="#NWD3ENQke-g">D9</a>, <a href="#NWD3ENQke-h">D10</a>, <a href="#NWD3ENQke-i">D11</a>, <a href="#NWD3ENQke-j">D12</a>, <a href="#NWD3ENQke-k">D13</a>, <a href="#NWD3ENQke-l">D14</a>, <a href="#NWD3ENQke-m">D15</a>, <a href="#NWD3ENQke-p">D16</a>, <a href="#NWD3ENQke-q">D17</a>, <a href="#NWD3ENQke-r">D18</a>, <a href="#NWD3ENQke-s">D19</a>, <a href="#NWD3ENQke-t">D20</a>, <a href="#NWD3ENQke-u">D21</a>, <a href="#NWD3ENQke-v">D22</a>, <a href="#NWD3ENQke-w">D23</a>, <a href="#NWD3ENQke-x">D24</a>, <a href="#NWD3ENQke-y">D25</a>, <a href="#NWD3ENQke-z">D26</a>, <a href="#NWD3ENQke-11">D27</a>, <a href="#NWD3ENQke-13">D28</a>, <a href="#NWD3ENQke-14">D29</a>, <a href="#NWD3ENQke-17">D30</a>, <a href="#NWD3ENQke-18">D31</a>, <a href="#NWD3ENQke-19">D32</a>, <a href="#NWD3ENQke-1A">D33</a>
+<li><a href="#NWD1myE43-R"><i>&lt;output argument list&gt;</i></a>: <a href="#NWD1myE43-Q">U1</a>, <a href="#NWD1myE43-R">D2</a>
+<li><a href="#NWD1myE43-H"><i>&lt;pre-compute and output static schedule&gt;</i></a>: <a href="#NWD1myE43-G">U1</a>, <a href="#NWD1myE43-H">D2</a>
+<li><a href="#NWD1myE43-A"><i>&lt;process&gt;</i></a>: <a href="#NWD1myE43-4">U1</a>, <a href="#NW1myE43-3szo1W-1">U2</a>, <a href="#NWD1myE43-A">D3</a>, <a href="#NWD1myE43-B">D4</a>, <a href="#NW1myE43-354rpJ-3">D5</a>, <a href="#NWD1myE43-G">D6</a>, <a href="#NWD1myE43-Q">D7</a>, <a href="#NWD1myE43-V">D8</a>
+<li><a href="#NWD1myE43-C"><i>&lt;retrieve input and output ports&gt;</i></a>: <a href="#NWD1myE43-C">D1</a>, <a href="#NW1myE43-354rpJ-3">U2</a>
+<li><a href="#NWD3ENQke-15"><i>&lt;stream-splice nodes&gt;</i></a>: <a href="#NWD3ENQke-14">U1</a>, <a href="#NWD3ENQke-15">D2</a>
+<li><a href="#NWD3ENQke-1B"><i>&lt;Trash&gt;</i></a>: <a href="#NWD3ENQke-1B">D1</a>
+</ul>
+
+<p>
+<h3><a name=toc20>Identifiers</a></h3>
+<ul>
+<li><a name="NWI-&quot;process&quot;" href="#NWD1myE43-V">"process"</a>: <a href="#NWD1myE43-V">D1</a>
+<li><a name="NWI-$" href="#NWD3ENQke-l">$</a>: <a href="#NWD1myE43-B">U1</a>, <a href="#NW1myE43-354rpJ-3">U2</a>, <a href="#NWD1myE43-I">U3</a>, <a href="#NWD1myE43-O">U4</a>, <a href="#NWD1myE43-P">U5</a>, <a href="#NWD1myE43-R">U6</a>, <a href="#NWD3ENQke-l">D7</a>, <a href="#NWD3ENQke-m">U8</a>, <a href="#NWD3ENQke-u">U9</a>, <a href="#NWD3ENQke-x">U10</a>, <a href="#NWD3ENQke-11">U11</a>
+<li><a name="NWI-$caadr" href="#NWD3ENQke-m">$caadr</a>: <a href="#NWD1myE43-I">U1</a>, <a href="#NWD3ENQke-m">D2</a>
+<li><a name="NWI-$caar" href="#NWD3ENQke-m">$caar</a>: <a href="#NWD1myE43-I">U1</a>, <a href="#NWD3ENQke-m">D2</a>
+<li><a name="NWI-%" href="#NWD3ENQke-l">%</a>: <a href="#NWD1myE43-H">U1</a>, <a href="#NWD1myE43-R">U2</a>, <a href="#NWD1myE43-S">U3</a>, <a href="#NWD1myE43-T">U4</a>, <a href="#NWD3ENQke-l">D5</a>, <a href="#NWD3ENQke-m">U6</a>, <a href="#NWD3ENQke-x">U7</a>, <a href="#NWD3ENQke-10">U8</a>, <a href="#NW3ENQke-1h8OQs-2">U9</a>
+<li><a name="NWI-%caddddr" href="#NWD3ENQke-m">%caddddr</a>: <a href="#NWD1myE43-H">U1</a>, <a href="#NWD3ENQke-m">D2</a>
+<li><a name="NWI-%cadddr" href="#NWD3ENQke-m">%cadddr</a>: <a href="#NWD1myE43-H">U1</a>, <a href="#NWD3ENQke-m">D2</a>
+<li><a name="NWI-%caddr" href="#NWD3ENQke-m">%caddr</a>: <a href="#NWD3ENQke-m">D1</a>
+<li><a name="NWI-%car" href="#NWD3ENQke-m">%car</a>: <a href="#NWD3ENQke-m">D1</a>
+<li><a name="NWI-%cddddr" href="#NWD3ENQke-m">%cddddr</a>: <a href="#NWD3ENQke-m">D1</a>
+<li><a name="NWI-," href="#NWD3ENQke-10">,</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD1myE43-B">U2</a>, <a href="#NWD1myE43-C">U3</a>, <a href="#NW1myE43-354rpJ-3">U4</a>, <a href="#NWD1myE43-G">U5</a>, <a href="#NWD1myE43-K">U6</a>, <a href="#NWD1myE43-O">U7</a>, <a href="#NWD1myE43-P">U8</a>, <a href="#NWD1myE43-R">U9</a>, <a href="#NWD1myE43-S">U10</a>, <a href="#NWD1myE43-T">U11</a>, <a href="#NWD1myE43-V">U12</a>, <a href="#NWD3ENQke-f">U13</a>, <a href="#NWD3ENQke-j">U14</a>, <a href="#NWD3ENQke-s">U15</a>, <a href="#NWD3ENQke-u">U16</a>, <a href="#NWD3ENQke-y">U17</a>, <a href="#NWD3ENQke-10">D18</a>, <a href="#NWD3ENQke-14">U19</a>, <a href="#NWD3ENQke-15">U20</a>, <a href="#NWD3ENQke-1B">D21</a>
+<li><a name="NWI-==" href="#NWD3ENQke-17">==</a>: <a href="#NWD3ENQke-17">D1</a>
+<li><a name="NWI-@forall" href="#NWD3ENQke-1B">@forall</a>: <a href="#NWD3ENQke-1B">D1</a>
+<li><a name="NWI-and-fun" href="#NWD3ENQke-i">and-fun</a>: <a href="#NWD3ENQke-i">D1</a>, <a href="#NWD3ENQke-u">U2</a>
+<li><a name="NWI-args-ref" href="#NWD3ENQke-1A">args-ref</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD3ENQke-1A">D2</a>
+<li><a name="NWI-beseq" href="#NWD1myE43-4">beseq</a>: <a href="#NWD1myE43-4">D1</a>, <a href="#NW1myE43-3szo1W-1">D2</a>, <a href="#NWD1myE43-W">U3</a>
+<li><a name="NWI-cat" href="#NWD3ENQke-l">cat</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NW1myE43-354rpJ-3">U2</a>, <a href="#NWD1myE43-H">U3</a>, <a href="#NWD1myE43-I">U4</a>, <a href="#NWD1myE43-O">U5</a>, <a href="#NWD1myE43-P">U6</a>, <a href="#NWD1myE43-R">U7</a>, <a href="#NWD1myE43-S">U8</a>, <a href="#NWD1myE43-T">U9</a>, <a href="#NWD1myE43-V">U10</a>, <a href="#NWD3ENQke-l">D11</a>, <a href="#NWD3ENQke-y">D12</a>
+<li><a name="NWI-compose" href="#NWD3ENQke-e">compose</a>: <a href="#NWD3ENQke-e">D1</a>, <a href="#NWD3ENQke-m">U2</a>
+<li><a name="NWI-compose2" href="#NWD3ENQke-e">compose2</a>: <a href="#NWD3ENQke-e">D1</a>
+<li><a name="NWI-copy-port" href="#NWD3ENQke-y">copy-port</a>: <a href="#NW1myE43-2GSHEW-1">U1</a>, <a href="#NWD3ENQke-y">D2</a>
+<li><a name="NWI-debug" href="#NWD3ENQke-19">debug</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD1myE43-B">U2</a>, <a href="#NW1myE43-354rpJ-3">U3</a>, <a href="#NWD1myE43-G">U4</a>, <a href="#NWD1myE43-H">U5</a>, <a href="#NWD1myE43-M">U6</a>, <a href="#NWD1myE43-Q">U7</a>, <a href="#NWD1myE43-R">U8</a>, <a href="#NWD1myE43-S">U9</a>, <a href="#NWD1myE43-T">U10</a>, <a href="#NWD3ENQke-19">D11</a>
+<li><a name="NWI-edge-conns" href="#NWD1myE43-H">edge-conns</a>: <a href="#NWD1myE43-H">D1</a>, <a href="#NWD1myE43-L">U2</a>, <a href="#NWD1myE43-M">U3</a>, <a href="#NWD1myE43-O">U4</a>, <a href="#NWD1myE43-P">U5</a>, <a href="#NWD1myE43-Q">U6</a>, <a href="#NWD1myE43-R">U7</a>
+<li><a name="NWI-edge-names" href="#NWD1myE43-H">edge-names</a>: <a href="#NWD1myE43-H">D1</a>, <a href="#NWD1myE43-J">U2</a>, <a href="#NWD1myE43-K">U3</a>
+<li><a name="NWI-edge-occs" href="#NWD1myE43-H">edge-occs</a>: <a href="#NWD1myE43-H">D1</a>, <a href="#NWD1myE43-L">U2</a>, <a href="#NWD1myE43-M">U3</a>, <a href="#NWD1myE43-O">U4</a>, <a href="#NWD1myE43-P">U5</a>, <a href="#NWD1myE43-Q">U6</a>, <a href="#NWD1myE43-R">U7</a>, <a href="#NWD1myE43-S">U8</a>, <a href="#NWD1myE43-T">U9</a>
+<li><a name="NWI-empty" href="#NWD3ENQke-18">empty</a>: <a href="#NWD1myE43-O">U1</a>, <a href="#NWD1myE43-P">U2</a>, <a href="#NWD3ENQke-j">U3</a>, <a href="#NWD3ENQke-18">D4</a>
+<li><a name="NWI-empty?" href="#NWD3ENQke-18">empty?</a>: <a href="#NWD3ENQke-18">D1</a>
+<li><a name="NWI-filter-map-splice" href="#NWD3ENQke-h">filter-map-splice</a>: <a href="#NWD3ENQke-h">D1</a>, <a href="#NWD3ENQke-j">U2</a>
+<li><a name="NWI-filter-map-splice-helper" href="#NWD3ENQke-h">filter-map-splice-helper</a>: <a href="#NWD3ENQke-h">D1</a>
+<li><a name="NWI-find-unconnected" href="#NW1myE43-2GSHEW-1">find-unconnected</a>: <a href="#NW1myE43-2GSHEW-1">D1</a>
+<li><a name="NWI-for-all" href="#NWD3ENQke-1B">for-all</a>: <a href="#NWD3ENQke-1B">D1</a>
+<li><a name="NWI-forall" href="#NWD3ENQke-j">forall</a>: <a href="#NWD1myE43-C">U1</a>, <a href="#NW1myE43-354rpJ-3">U2</a>, <a href="#NWD1myE43-H">U3</a>, <a href="#NWD1myE43-I">U4</a>, <a href="#NWD1myE43-J">U5</a>, <a href="#NWD1myE43-K">U6</a>, <a href="#NWD1myE43-M">U7</a>, <a href="#NWD1myE43-O">U8</a>, <a href="#NWD1myE43-P">U9</a>, <a href="#NWD1myE43-R">U10</a>, <a href="#NWD3ENQke-j">D11</a>, <a href="#NWD3ENQke-u">U12</a>, <a href="#NWD3ENQke-18">U13</a>
+<li><a name="NWI-gen-getter" href="#NWD3ENQke-1B">gen-getter</a>: <a href="#NWD3ENQke-1B">D1</a>
+<li><a name="NWI-gen-getter-num" href="#NWD3ENQke-1B">gen-getter-num</a>: <a href="#NWD3ENQke-1B">D1</a>
+<li><a name="NWI-gen-predicate" href="#NWD3ENQke-1B">gen-predicate</a>: <a href="#NWD3ENQke-1B">D1</a>
+<li><a name="NWI-geng" href="#NWD3ENQke-10">geng</a>: <a href="#NWD3ENQke-10">D1</a>, <a href="#NW3ENQke-1h8OQs-2">U2</a>
+<li><a name="NWI-gxf:access-pointer" href="#NWD1myE43-S">gxf:access-pointer</a>: <a href="#NWD1myE43-R">U1</a>, <a href="#NWD1myE43-S">D2</a>, <a href="#NWD1myE43-T">D3</a>
+<li><a name="NWI-gxf:activate" href="#NWD1myE43-Q">gxf:activate</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD1myE43-M">U2</a>, <a href="#NWD1myE43-Q">D3</a>
+<li><a name="NWI-gxf:argument-list" href="#NWD1myE43-R">gxf:argument-list</a>: <a href="#NWD1myE43-O">U1</a>, <a href="#NWD1myE43-P">U2</a>, <a href="#NWD1myE43-R">D3</a>
+<li><a name="NWI-gxf:body" href="#NWD3ENQke-1B">gxf:body</a>: <a href="#NWD3ENQke-1B">D1</a>
+<li><a name="NWI-gxf:collapse-code" href="#NWD1myE43-G">gxf:collapse-code</a>: <a href="#NWD1myE43-G">D1</a>, <a href="#NWD1myE43-V">U2</a>
+<li><a name="NWI-gxf:collapsed-ports" href="#NW1myE43-354rpJ-3">gxf:collapsed-ports</a>: <a href="#NW1myE43-354rpJ-3">D1</a>, <a href="#NWD1myE43-V">U2</a>
+<li><a name="NWI-gxf:convert" href="#NWD3ENQke-13">gxf:convert</a>: <a href="#NWD3ENQke-13">D1</a>
+<li><a name="NWI-gxf:handle-endpoint" href="#NWD1myE43-B">gxf:handle-endpoint</a>: <a href="#NWD1myE43-B">D1</a>, <a href="#NW1myE43-354rpJ-3">U2</a>
+<li><a name="NWI-gxf:handle-port" href="#NWD1myE43-A">gxf:handle-port</a>: <a href="#NWD1myE43-A">D1</a>, <a href="#NWD1myE43-B">U2</a>
+<li><a name="NWI-gxf:labels" href="#NWD3ENQke-s">gxf:labels</a>: <a href="#NWD1myE43-V">U1</a>, <a href="#NWD3ENQke-s">D2</a>, <a href="#NWD3ENQke-y">U3</a>
+<li><a name="NWI-gxf:stream-splice" href="#NWD3ENQke-14">gxf:stream-splice</a>: <a href="#NWD3ENQke-13">U1</a>, <a href="#NWD3ENQke-14">D2</a>
+<li><a name="NWI-gxf:super-node" href="#NWD3ENQke-11">gxf:super-node</a>: <a href="#NWD1myE43-B">U1</a>, <a href="#NWD1myE43-O">U2</a>, <a href="#NWD1myE43-P">U3</a>, <a href="#NWD3ENQke-11">D4</a>
+<li><a name="NWI-helper" href="#NWD3ENQke-f">helper</a>: <a href="#NWD3ENQke-b">U1</a>, <a href="#NWD3ENQke-f">D2</a>, <a href="#NWD3ENQke-h">U3</a>, <a href="#NWD3ENQke-10">D4</a>
+<li><a name="NWI-Id" href="#NWD3ENQke-a">Id</a>: <a href="#NW1myE43-354rpJ-3">U1</a>, <a href="#NWD3ENQke-a">D2</a>, <a href="#NWD3ENQke-14">U3</a>, <a href="#NWD3ENQke-1B">U4</a>
+<li><a name="NWI-Identity" href="#NWD3ENQke-a">Identity</a>: <a href="#NWD1myE43-A">U1</a>, <a href="#NWD3ENQke-a">D2</a>, <a href="#NWD3ENQke-e">U3</a>, <a href="#NWD3ENQke-14">U4</a>
+<li><a name="NWI-is-,s" href="#NWD3ENQke-1B">is-,s</a>: <a href="#NWD3ENQke-1B">D1</a>
+<li><a name="NWI-is-cons" href="#NW3ENQke-1h8OQs-2">is-cons</a>: <a href="#NWD1myE43-S">U1</a>, <a href="#NWD1myE43-T">U2</a>, <a href="#NW3ENQke-1h8OQs-2">D3</a>, <a href="#NW3ENQke-4Gqms7-1">D4</a>
+<li><a name="NWI-is-prod" href="#NW3ENQke-1h8OQs-2">is-prod</a>: <a href="#NWD1myE43-S">U1</a>, <a href="#NWD1myE43-T">U2</a>, <a href="#NW3ENQke-1h8OQs-2">D3</a>, <a href="#NW3ENQke-4Gqms7-1">D4</a>
+<li><a name="NWI-labels" href="#NWD1myE43-M">labels</a>: <a href="#NWD1myE43-C">U1</a>, <a href="#NW1myE43-2GSHEW-1">U2</a>, <a href="#NWD1myE43-M">D3</a>, <a href="#NWD1myE43-V">U4</a>, <a href="#NWD3ENQke-b">U5</a>, <a href="#NWD3ENQke-f">U6</a>, <a href="#NWD3ENQke-h">U7</a>, <a href="#NWD3ENQke-s">U8</a>, <a href="#NWD3ENQke-y">U9</a>
+<li><a name="NWI-let" href="#NWD1myE43-O">let</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD1myE43-C">U2</a>, <a href="#NW1myE43-2GSHEW-1">U3</a>, <a href="#NW1myE43-354rpJ-3">U4</a>, <a href="#NWD1myE43-G">U5</a>, <a href="#NWD1myE43-H">U6</a>, <a href="#NWD1myE43-K">U7</a>, <a href="#NWD1myE43-M">U8</a>, <a href="#NWD1myE43-O">D9</a>, <a href="#NWD1myE43-P">D10</a>, <a href="#NWD1myE43-R">U11</a>, <a href="#NWD1myE43-S">U12</a>, <a href="#NWD1myE43-T">U13</a>, <a href="#NWD1myE43-V">U14</a>, <a href="#NWD3ENQke-g">U15</a>, <a href="#NWD3ENQke-h">U16</a>, <a href="#NWD3ENQke-k">U17</a>, <a href="#NWD3ENQke-p">U18</a>, <a href="#NWD3ENQke-r">U19</a>, <a href="#NWD3ENQke-v">U20</a>, <a href="#NWD3ENQke-z">U21</a>, <a href="#NWD3ENQke-14">U22</a>
+<li><a name="NWI-lfold&lt;" href="#NWD3ENQke-b">lfold<</a>: <a href="#NWD1myE43-P">U1</a>, <a href="#NWD1myE43-V">U2</a>, <a href="#NWD3ENQke-b">D3</a>, <a href="#NWD3ENQke-d">U4</a>, <a href="#NWD3ENQke-e">U5</a>, <a href="#NWD3ENQke-f">U6</a>
+<li><a name="NWI-lfold&gt;" href="#NWD3ENQke-b">lfold></a>: <a href="#NWD3ENQke-b">D1</a>, <a href="#NWD3ENQke-d">U2</a>
+<li><a name="NWI-lfold&gt;helper" href="#NWD3ENQke-b">lfold>helper</a>: <a href="#NWD3ENQke-b">D1</a>
+<li><a name="NWI-loop" href="#NWD1myE43-C">loop</a>: <a href="#NWD1myE43-C">D1</a>, <a href="#NW1myE43-2GSHEW-1">D2</a>, <a href="#NWD3ENQke-g">D3</a>, <a href="#NWD3ENQke-h">D4</a>, <a href="#NWD3ENQke-r">D5</a>
+<li><a name="NWI-main" href="#NWD1myE43-6">main</a>: <a href="#NWD1myE43-4">U1</a>, <a href="#NW1myE43-3szo1W-1">U2</a>, <a href="#NWD1myE43-6">D3</a>, <a href="#NWD1myE43-W">U4</a>
+<li><a name="NWI-map-splice" href="#NWD3ENQke-g">map-splice</a>: <a href="#NWD3ENQke-g">D1</a>, <a href="#NWD3ENQke-h">U2</a>, <a href="#NWD3ENQke-j">U3</a>
+<li><a name="NWI-n" href="#NWD3ENQke-14">n</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD1myE43-B">U2</a>, <a href="#NW1myE43-2GSHEW-1">U3</a>, <a href="#NW1myE43-354rpJ-3">U4</a>, <a href="#NWD1myE43-G">U5</a>, <a href="#NWD1myE43-L">U6</a>, <a href="#NWD1myE43-M">U7</a>, <a href="#NWD1myE43-O">U8</a>, <a href="#NWD1myE43-P">U9</a>, <a href="#NWD1myE43-R">U10</a>, <a href="#NWD1myE43-V">U11</a>, <a href="#NWD3ENQke-11">U12</a>, <a href="#NWD3ENQke-14">D13</a>, <a href="#NWD3ENQke-15">U14</a>, <a href="#NWD3ENQke-18">U15</a>
+<li><a name="NWI-NAMESPACES" href="#NWD3ENQke-r">NAMESPACES</a>: <a href="#NWD1myE43-V">U1</a>, <a href="#NWD3ENQke-r">D2</a>
+<li><a name="NWI-Namespaces" href="#NWD3ENQke-p">Namespaces</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD3ENQke-p">D2</a>, <a href="#NWD3ENQke-r">U3</a>, <a href="#NWD3ENQke-t">U4</a>
+<li><a name="NWI-nl" href="#NWD3ENQke-18">nl</a>: <a href="#NWD1myE43-P">U1</a>, <a href="#NWD1myE43-S">U2</a>, <a href="#NWD1myE43-T">U3</a>, <a href="#NWD3ENQke-15">U4</a>, <a href="#NWD3ENQke-18">D5</a>
+<li><a name="NWI-out" href="#NWD3ENQke-18">out</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD1myE43-C">U2</a>, <a href="#NW1myE43-2GSHEW-1">U3</a>, <a href="#NW1myE43-354rpJ-3">U4</a>, <a href="#NWD1myE43-H">U5</a>, <a href="#NWD1myE43-O">U6</a>, <a href="#NWD1myE43-P">U7</a>, <a href="#NWD3ENQke-13">U8</a>, <a href="#NWD3ENQke-18">D9</a>
+<li><a name="NWI-out-list1" href="#NWD3ENQke-18">out-list1</a>: <a href="#NWD3ENQke-18">D1</a>
+<li><a name="NWI-outgoing" href="#NW1myE43-354rpJ-3">outgoing</a>: <a href="#NW1myE43-2GSHEW-1">U1</a>, <a href="#NW1myE43-354rpJ-3">D2</a>
+<li><a name="NWI-outs" href="#NWD3ENQke-l">outs</a>: <a href="#NWD1myE43-G">U1</a>, <a href="#NWD1myE43-H">U2</a>, <a href="#NWD1myE43-O">U3</a>, <a href="#NWD3ENQke-l">D4</a>
+<li><a name="NWI-process" href="#NWD1myE43-V">process</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NWD1myE43-V">D2</a>
+<li><a name="NWI-producer" href="#NWD1myE43-K">producer</a>: <a href="#NWD1myE43-K">D1</a>
+<li><a name="NWI-r" href="#NWD3ENQke-v">r</a>: <a href="#NW1myE43-354rpJ-3">U1</a>, <a href="#NWD1myE43-G">U2</a>, <a href="#NWD1myE43-P">U3</a>, <a href="#NWD3ENQke-b">U4</a>, <a href="#NWD3ENQke-f">U5</a>, <a href="#NWD3ENQke-g">U6</a>, <a href="#NWD3ENQke-h">U7</a>, <a href="#NWD3ENQke-r">U8</a>, <a href="#NWD3ENQke-v">D9</a>, <a href="#NWD3ENQke-10">U10</a>
+<li><a name="NWI-remove-cdata" href="#NWD3ENQke-z">remove-cdata</a>: <a href="#NWD1myE43-P">U1</a>, <a href="#NWD3ENQke-z">D2</a>
+<li><a name="NWI-return" href="#NWD3ENQke-k">return</a>: <a href="#NWD1myE43-6">U1</a>, <a href="#NW1myE43-354rpJ-3">U2</a>, <a href="#NWD1myE43-I">U3</a>, <a href="#NWD1myE43-J">U4</a>, <a href="#NWD1myE43-O">U5</a>, <a href="#NWD1myE43-P">U6</a>, <a href="#NWD1myE43-R">U7</a>, <a href="#NWD3ENQke-j">U8</a>, <a href="#NWD3ENQke-k">D9</a>, <a href="#NWD3ENQke-u">U10</a>, <a href="#NWD3ENQke-18">U11</a>
+<li><a name="NWI-Rfold&lt;" href="#NWD3ENQke-c">Rfold<</a>: <a href="#NWD3ENQke-c">D1</a>
+<li><a name="NWI-rfold&lt;" href="#NWD3ENQke-d">rfold<</a>: <a href="#NWD3ENQke-d">D1</a>
+<li><a name="NWI-Rfold&gt;" href="#NWD3ENQke-c">Rfold></a>: <a href="#NWD3ENQke-c">D1</a>
+<li><a name="NWI-rfold&gt;" href="#NWD3ENQke-d">rfold></a>: <a href="#NWD3ENQke-d">D1</a>
+<li><a name="NWI-schedule" href="#NWD1myE43-H">schedule</a>: <a href="#NWD1myE43-H">D1</a>
+<li><a name="NWI-sxpath/link" href="#NWD3ENQke-t">sxpath/link</a>: <a href="#NWD3ENQke-t">D1</a>
+<li><a name="NWI-types-&gt;ports" href="#NWD1myE43-C">types->ports</a>: <a href="#NWD1myE43-C">D1</a>
+<li><a name="NWI-Unmeta" href="#NWD3ENQke-a">Unmeta</a>: <a href="#NW1myE43-354rpJ-3">U1</a>, <a href="#NWD3ENQke-a">D2</a>, <a href="#NWD3ENQke-14">U3</a>, <a href="#NWD3ENQke-1B">U4</a>
+<li><a name="NWI-var" href="#NWD3ENQke-k">var</a>: <a href="#NWD3ENQke-j">U1</a>, <a href="#NWD3ENQke-k">D2</a>, <a href="#NWD3ENQke-u">U3</a>, <a href="#NWD3ENQke-1B">U4</a>
+<li><a name="NWI-vector:check" href="#NWD3ENQke-i">vector:check</a>: <a href="#NWD1myE43-G">U1</a>, <a href="#NWD3ENQke-i">D2</a>
+<li><a name="NWI-Void" href="#NWD3ENQke-a">Void</a>: <a href="#NW1myE43-354rpJ-3">U1</a>, <a href="#NWD3ENQke-a">D2</a>
+<li><a name="NWI-wrap-id" href="#NWD1myE43-V">wrap-id</a>: <a href="#NWD1myE43-V">D1</a>
+<li><a name="NWI-X" href="#NWD3ENQke-w">X</a>: <a href="#NW1myE43-354rpJ-3">U1</a>, <a href="#NWD1myE43-O">U2</a>, <a href="#NWD1myE43-P">U3</a>, <a href="#NWD1myE43-R">U4</a>, <a href="#NWD3ENQke-w">D5</a>, <a href="#NWD3ENQke-x">U6</a>, <a href="#NWD3ENQke-y">U7</a>
+<li><a name="NWI-X$" href="#NWD3ENQke-x">X$</a>: <a href="#NWD1myE43-R">U1</a>, <a href="#NWD3ENQke-x">D2</a>
+<li><a name="NWI-X%" href="#NWD3ENQke-x">X%</a>: <a href="#NWD3ENQke-x">D1</a>
+<li><a name="NWI-X@" href="#NWD3ENQke-v">X@</a>: <a href="#NWD3ENQke-v">D1</a>, <a href="#NWD3ENQke-w">U2</a>
+<li><a name="NWI-xlink" href="#NWD3ENQke-p">xlink</a>: <a href="#NWD1myE43-V">U1</a>, <a href="#NWD3ENQke-p">D2</a>, <a href="#NWD3ENQke-q">U3</a>, <a href="#NWD3ENQke-s">U4</a>, <a href="#NWD3ENQke-y">U5</a>, <a href="#NWD3ENQke-13">U6</a>
+<li><a name="NWI-XLink:from" href="#NWD3ENQke-q">XLink:from</a>: <a href="#NWD3ENQke-q">D1</a>, <a href="#NWD3ENQke-15">U2</a>
+<li><a name="NWI-XLink:href" href="#NWD3ENQke-q">XLink:href</a>: <a href="#NWD3ENQke-q">D1</a>, <a href="#NWD3ENQke-15">U2</a>
+<li><a name="NWI-XLink:label" href="#NWD3ENQke-q">XLink:label</a>: <a href="#NWD3ENQke-q">D1</a>, <a href="#NWD3ENQke-15">U2</a>
+<li><a name="NWI-XLink:to" href="#NWD3ENQke-q">XLink:to</a>: <a href="#NWD3ENQke-q">D1</a>, <a href="#NWD3ENQke-15">U2</a>
+<li><a name="NWI-XLink:type" href="#NWD3ENQke-q">XLink:type</a>: <a href="#NWD3ENQke-q">D1</a>, <a href="#NWD3ENQke-15">U2</a>
+<li><a name="NWI-Xs" href="#NWD3ENQke-u">Xs</a>: <a href="#NWD1myE43-B">U1</a>, <a href="#NWD1myE43-C">U2</a>, <a href="#NW1myE43-354rpJ-3">U3</a>, <a href="#NWD1myE43-O">U4</a>, <a href="#NWD1myE43-P">U5</a>, <a href="#NWD1myE43-R">U6</a>, <a href="#NWD3ENQke-u">D7</a>, <a href="#NWD3ENQke-y">U8</a>, <a href="#NWD3ENQke-11">U9</a>
+<li><a name="NWI-zip-with" href="#NWD3ENQke-f">zip-with</a>: <a href="#NWD3ENQke-f">D1</a>
+<li><a name="NWI-zip2-with" href="#NWD3ENQke-f">zip2-with</a>: <a href="#NWD1myE43-J">U1</a>, <a href="#NWD1myE43-P">U2</a>, <a href="#NWD3ENQke-f">D3</a>
+</ul>
+
+<p>
+</tt></tt>
+
+
+</body></html>
+
+<map id="beseq_hier" name="beseq_hier">
+<area shape="poly" href="#pre-compute and output static schedule" title="pre&#45;compute and output static schedule" alt="" coords="1147,137 1134,130 1095,123 1036,118 961,115 877,113 794,115 719,118 659,123 621,130 608,137 621,145 659,151 719,157 794,160 877,161 961,160 1036,157 1095,151 1134,145"/>
+<area shape="poly" href="#activate static schedule" title="activate static schedule" alt="" coords="1608,29 1600,22 1576,15 1540,10 1494,7 1443,5 1392,7 1346,10 1309,15 1286,22 1278,29 1286,37 1309,43 1346,49 1392,52 1443,53 1494,52 1540,49 1576,43 1600,37"/>
+<area shape="poly" href="#declare internal buffers" title="declare internal buffers" alt="" coords="1607,101 1599,94 1575,87 1539,82 1493,79 1443,77 1392,79 1346,82 1310,87 1287,94 1279,101 1287,109 1310,115 1346,121 1392,124 1443,125 1493,124 1539,121 1575,115 1599,109"/>
+<area shape="poly" href="#compute initial buffer administration" title="compute initial buffer administration" alt="" coords="1691,173 1679,166 1644,159 1589,154 1519,151 1443,149 1366,151 1297,154 1242,159 1207,166 1194,173 1207,181 1242,187 1297,193 1366,196 1443,197 1519,196 1589,193 1644,187 1679,181"/>
+<area shape="poly" href="#compute edge connectivity" title="compute edge connectivity" alt="" coords="1629,245 1620,238 1593,231 1552,226 1500,223 1443,221 1385,223 1333,226 1292,231 1266,238 1256,245 1266,253 1292,259 1333,265 1385,268 1443,269 1500,268 1552,265 1593,259 1620,253"/>
+<area shape="poly" href="#Compiled.scm" title="Compiled.scm" alt="" coords="225,497 220,490 205,483 183,478 154,475 123,473 91,475 63,478 40,483 26,490 21,497 26,505 40,511 63,517 91,520 123,521 154,520 183,517 205,511 220,505"/>
+<area shape="poly" href="#main" title="main" alt="" coords="470,425 468,418 461,411 451,406 438,403 424,401 410,403 397,406 387,411 380,418 378,425 380,433 387,439 397,445 410,448 424,449 438,448 451,445 461,439 468,433"/>
+<area shape="poly" href="#process" title="process" alt="" coords="486,353 483,346 474,339 460,334 443,331 424,329 405,331 388,334 374,339 365,346 362,353 365,361 374,367 388,373 405,376 424,377 443,376 460,373 474,367 483,361"/>
+<area shape="poly" href="#Compiled globals" title="Compiled globals" alt="" coords="545,641 539,634 522,627 495,622 462,619 424,617 386,619 353,622 326,627 309,634 303,641 309,649 326,655 353,661 386,664 424,665 462,664 495,661 522,655 539,649"/>
+<area shape="poly" href="#libraries" title="libraries" alt="" coords="490,497 487,490 477,483 463,478 444,475 424,473 404,475 385,478 371,483 361,490 358,497 361,505 371,511 385,517 404,520 424,521 444,520 463,517 477,511 487,505"/>
+<area shape="poly" href="#Miscellaneous" title="Miscellaneous" alt="" coords="527,569 522,562 507,555 484,550 456,547 424,545 392,547 364,550 341,555 326,562 321,569 326,577 341,583 364,589 392,592 424,593 456,592 484,589 507,583 522,577"/>
+<area shape="poly" href="#activate sub-codes" title="activate sub&#45;codes" alt="" coords="1011,209 1004,202 985,195 956,190 919,187 877,185 836,187 799,190 769,195 750,202 744,209 750,217 769,223 799,229 836,232 877,233 919,232 956,229 985,223 1004,217"/>
+<area shape="poly" href="#activate sub-nodes" title="activate sub&#45;nodes" alt="" coords="1013,281 1006,274 987,267 957,262 919,259 877,257 836,259 798,262 768,267 749,274 742,281 749,289 768,295 798,301 836,304 877,305 919,304 957,301 987,295 1006,289"/>
+<area shape="poly" href="#calculate current access pointer" title="calculate current access pointer" alt="" coords="1094,353 1084,346 1053,339 1005,334 944,331 877,329 810,331 750,334 702,339 671,346 661,353 671,361 702,367 750,373 810,376 877,377 944,376 1005,373 1053,367 1084,361"/>
+<area shape="poly" href="#retrieve input and output ports" title="retrieve input and output ports" alt="" coords="1092,425 1082,418 1051,411 1004,406 944,403 877,401 811,403 751,406 703,411 673,418 662,425 673,433 703,439 751,445 811,448 877,449 944,448 1004,445 1051,439 1082,433"/>
+<area shape="poly" href="#find all unconnected ports using 4 lists" title="find all unconnected ports using 4 lists" alt="" coords="1138,497 1125,490 1088,483 1030,478 958,475 877,473 797,475 724,478 667,483 630,490 617,497 630,505 667,511 724,517 797,520 877,521 958,520 1030,517 1088,511 1125,505"/>
+<area shape="poly" href="#output argument list" title="output argument list" alt="" coords="1025,569 1017,562 997,555 964,550 923,547 877,545 832,547 791,550 758,555 737,562 730,569 737,577 758,583 791,589 832,592 877,593 923,592 964,589 997,583 1017,577"/>
+<area shape="poly" href="#Interpreted.scm" title="Interpreted.scm" alt="" coords="239,425 234,418 217,411 191,406 159,403 123,401 87,403 54,406 28,411 12,418 6,425 12,433 28,439 54,445 87,448 123,449 159,448 191,445 217,439 234,433"/>
+<area shape="poly" href="#Interpreted globals" title="Interpreted globals" alt="" coords="560,281 554,274 534,267 504,262 466,259 424,257 382,259 344,262 314,267 294,274 288,281 294,289 314,295 344,301 382,304 424,305 466,304 504,301 534,295 554,289"/>
+</map>
+<map id="common_hier" name="common_hier">
+<area shape="poly" href="#Miscellaneous" title="Miscellaneous" alt="" coords="211,29 206,22 191,15 168,10 140,7 108,5 76,7 48,10 25,15 10,22 5,29 10,37 25,43 48,49 76,52 108,53 140,52 168,49 191,43 206,37"/>
+<area shape="poly" href="#stream-splice nodes" title="stream&#45;splice nodes" alt="" coords="541,29 534,22 514,15 483,10 444,7 400,5 356,7 317,10 286,15 266,22 259,29 266,37 286,43 317,49 356,52 400,53 444,52 483,49 514,43 534,37"/>
+</map>

doc/beseq/c81e728d9d4c2f636f067f89cc14862c.png

Added
New image

doc/beseq/common-hier.png

Added
New image

doc/beseq/de6f268021310dd0e42f79bcb451aa12.png