<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.10">
<title>Stabilizers</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css">
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20201002</a>
</div>
</div>
<div id="header">
<h1>Stabilizers</h1>
</div>
<div id="content">
<div class="sect1">
<h2 id="_installation">Installation</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Stabilizers currently require the MLton sources, this should be fixed by the next release
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_license">License</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Stabilizers are released under the MLton License
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_instructions">Instructions</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Download and build a source copy of MLton
</p>
</li>
<li>
<p>
Extract the tar.gz file attached to this page
</p>
</li>
<li>
<p>
Some examples are provided in the "examples/" sub directory, more examples will be added to this page in the following week
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_bug_reports_suggestions">Bug reports / Suggestions</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
Please send any errors you encounter to schatzp and lziarek at cs.purdue.edu
</p>
</li>
<li>
<p>
We are looking to expand the usability of stabilizers
</p>
</li>
<li>
<p>
Please send any suggestions and desired functionality to the above email addresses
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_note">Note</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
This is an alpha release. We expect to have another release shortly with added functionality soon
</p>
</li>
<li>
<p>
More documentation, such as signatures and descriptions of functionality, will be forthcoming
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_documentation">Documentation</h2>
<div class="sectionbody">
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="k">signature</span><span class="w"> </span><span class="n">STABLE</span><span class="w"> </span><span class="p">=</span><span class="w"></span>
<span class="w">  </span><span class="k">sig</span><span class="w"></span>
<span class="w">     </span><span class="k">type</span><span class="w"> </span><span class="n">checkpoint</span><span class="w"></span>

<span class="w">     </span><span class="k">val</span><span class="w"> </span><span class="n">stable</span><span class="p">:</span><span class="w"> </span><span class="p">(</span><span class="n">&#39;a</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;b</span><span class="p">)</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="p">(</span><span class="n">&#39;a</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;b</span><span class="p">)</span><span class="w"></span>
<span class="w">     </span><span class="k">val</span><span class="w"> </span><span class="n">stabilize</span><span class="p">:</span><span class="w"> </span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"></span>

<span class="w">     </span><span class="k">val</span><span class="w"> </span><span class="n">stableCP</span><span class="p">:</span><span class="w"> </span><span class="p">((</span><span class="n">&#39;a</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;b</span><span class="p">)</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="p">(</span><span class="n">unit</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="p">))</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"></span>
<span class="w">                    </span><span class="p">((</span><span class="n">&#39;a</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;b</span><span class="p">)</span><span class="w"> </span><span class="n">*</span><span class="w">  </span><span class="n">checkpoint</span><span class="p">)</span><span class="w"></span>
<span class="w">     </span><span class="k">val</span><span class="w"> </span><span class="n">stabilizeCP</span><span class="p">:</span><span class="w"> </span><span class="n">checkpoint</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>

<span class="w">     </span><span class="k">val</span><span class="w"> </span><span class="n">unmonitoredAssign</span><span class="p">:</span><span class="w"> </span><span class="p">(</span><span class="n">&#39;a</span><span class="w"> </span><span class="n">ref</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">&#39;a</span><span class="p">)</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">     </span><span class="k">val</span><span class="w"> </span><span class="n">monitoredAssign</span><span class="p">:</span><span class="w"> </span><span class="p">(</span><span class="n">&#39;a</span><span class="w"> </span><span class="n">ref</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">&#39;a</span><span class="p">)</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">  </span><span class="k">end</span><span class="w"></span>
</pre></div></div></div>
<div class="paragraph"><p><span class="monospaced">Stable</span> provides functions to manage stable sections.</p></div>
<div class="ulist"><ul>
<li>
<p>
<span class="monospaced">type checkpoint</span>
</p>
<div class="paragraph"><p>handle used to stabilize contexts other than the current one.</p></div>
</li>
<li>
<p>
<span class="monospaced">stable f</span>
</p>
<div class="paragraph"><p>returns a function identical to <span class="monospaced">f</span> that will execute within a stable section.</p></div>
</li>
<li>
<p>
<span class="monospaced">stabilize ()</span>
</p>
<div class="paragraph"><p>unrolls the effects made up to the current context to at least the
nearest enclosing <em>stable</em> section.  These effects may have propagated
to other threads, so all affected threads are returned to a globally
consistent previous state.  The return is undefined because control
cannot resume after stabilize is called.</p></div>
</li>
<li>
<p>
<span class="monospaced">stableCP (f, comp)</span>
</p>
<div class="paragraph"><p>returns a function <span class="monospaced">f'</span> and checkpoint tag <span class="monospaced">cp</span>.  Function <span class="monospaced">f'</span> is
identical to <span class="monospaced">f</span> but when applied will execute within a stable
section.  <span class="monospaced">comp</span> will be executed if <span class="monospaced">f'</span> is later stabilized.  <span class="monospaced">cp</span>
is used by <span class="monospaced">stabilizeCP</span> to stabilize a given checkpoint.</p></div>
</li>
<li>
<p>
<span class="monospaced">stabilizeCP cp</span>
</p>
<div class="paragraph"><p>same as stabilize except that the (possibly current) checkpoint to
stabilize is provided.</p></div>
</li>
<li>
<p>
<span class="monospaced">unmonitoredAssign (r, v)</span>
</p>
<div class="paragraph"><p>standard assignment (<span class="monospaced">:=</span>).  The version of CML distributed rebinds
<span class="monospaced">:=</span> to a monitored version so interesting effects can be recorded.</p></div>
</li>
<li>
<p>
<span class="monospaced">monitoredAssign (r, v)</span>
</p>
<div class="paragraph"><p>the assignment operator that should be used in programs that use
stabilizers. <span class="monospaced">:=</span> is rebound to this by including CML.</p></div>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_download">Download</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
<a href="Stabilizers.attachments/stabilizers_alpha_2006-10-09.tar.gz"><span class="monospaced">stabilizers_alpha_2006-10-09.tar.gz</span></a>
</p>
</li>
</ul></div>
</div>
</div>
<div class="sect1">
<h2 id="_also_see">Also see</h2>
<div class="sectionbody">
<div class="ulist"><ul>
<li>
<p>
<a href="References#ZiarekEtAl06">ZiarekEtAl06</a>
</p>
</li>
</ul></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
