/usr/share/mozart/doc/base/node13.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>10.1 General</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node12.html">- Up -</A></TD><TD><A href="loop.html#section.control.loops">Next >></A></TD></TR></TABLE><DIV id="section.control.general"><H2><A name="section.control.general">10.1 General</A></H2><P> The module <A name="label674"></A><SPAN class="index"><CODE>Value</CODE></SPAN> contains the following general control procedures. </P><DL><DT><A name="label675"></A><SPAN class="index"><CODE>Wait</CODE></SPAN> <A name="label676"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>wait </CODE><CODE>+<I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>blocks until <CODE><I>X</I></CODE> is determined. This statement makes <CODE><I>X</I></CODE> needed, causing all by-need computations on <CODE><I>X</I></CODE> to be triggered. If <CODE><I>X</I></CODE> is or becomes bound to a failed value, then its encapsulated exception is raised. </P></DD><DT><A name="label677"></A><SPAN class="index"><CODE>WaitOr</CODE></SPAN> <A name="label678"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>waitOr </CODE><CODE><I>X</I></CODE><CODE> </CODE><CODE><I>Y</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>blocks until at least one of <CODE><I>X</I></CODE> or <CODE><I>Y</I></CODE> is determined. </P></DD><DT><A name="label679"></A><SPAN class="index"><CODE>waitQuiet</CODE></SPAN> <A name="label680"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>waitQuiet </CODE><CODE>+<I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>blocks until <CODE><I>X</I></CODE> is determined or failed. Contrary to <CODE>Wait</CODE>, <CODE>Value<SPAN class="keyword">.</SPAN>waitQuiet</CODE> does not make <CODE><I>X</I></CODE> needed. Also, if <CODE><I>X</I></CODE> is or becomes bound to a failed value, no exception is raised. </P></DD><DT><A name="label681"></A><SPAN class="index"><CODE><SPAN class="keyword">!!</SPAN></CODE></SPAN> <A name="label682"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN><SPAN class="string">'!!'</SPAN> </CODE><CODE><I>X</I></CODE><CODE> </CODE><CODE><I>Y</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>returns a <EM>future</EM> <CODE><I>Y</I></CODE> for <CODE><I>X</I></CODE>, i. e., a read-only placeholder for <CODE><I>X</I></CODE>. If <CODE><I>Y</I></CODE> becomes needed, <CODE><I>X</I></CODE> is made needed too. </P></DD><DT><A name="label683"></A><SPAN class="index"><CODE>WaitNeeded</CODE></SPAN> <A name="label684"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>waitNeeded </CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>blocks until <CODE><I>X</I></CODE> is <A name="label685"></A><SPAN class="index">needed</SPAN>. This operation is the <A name="label686"></A><SPAN class="index">by-need synchronization</SPAN>. </P></DD><DT><A name="label687"></A><SPAN class="index"><CODE>IsNeeded</CODE></SPAN> <A name="label688"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>isNeeded </CODE><CODE><I>X</I></CODE><CODE> </CODE><CODE>?<I>B</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>tests whether <CODE><I>X</I></CODE> is needed. </P></DD><DT><CODE>makeNeeded</CODE> <A name="label690"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>makeNeeded </CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>makes <CODE><I>X</I></CODE> needed. This statement is useful for triggering by-need computations on <CODE><I>X</I></CODE> with having to suspend on <CODE><I>X</I></CODE>. </P></DD><DT><A name="label691"></A><SPAN class="index"><CODE>ByNeed</CODE></SPAN> <A name="label692"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>byNeed </CODE><CODE><I>P</I></CODE><CODE> </CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>concurrently evaluates <CODE>{P X}</CODE> as soon as <CODE><I>X</I></CODE> becomes needed. It can be defined as follows: </P><BLOCKQUOTE class="code"><CODE><SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">ByNeed</SPAN> P X}<BR> <SPAN class="keyword">thread</SPAN> {WaitNeeded X} {P X} <SPAN class="keyword">end</SPAN> <BR><SPAN class="keyword">end</SPAN></CODE></BLOCKQUOTE><P> </P></DD><DT><A name="label693"></A><SPAN class="index"><CODE>ByNeedFuture</CODE></SPAN> <A name="label694"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>byNeedFuture </CODE><CODE><I>P</I></CODE><CODE> </CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>creates a by-need computation that evaluates the expression <CODE>{P}</CODE>, and returns a future <CODE><I>X</I></CODE> of its result. If the call to <CODE><I>P</I></CODE> raises an exception <CODE><I>E</I></CODE>, then <CODE><I>X</I></CODE> is bound to a failed value (see below) that encapsulates <CODE><I>E</I></CODE>. It can be defined as follows: </P><BLOCKQUOTE class="code"><CODE><SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">ByNeedFuture</SPAN> P}<BR> <SPAN class="keyword">!!</SPAN>{ByNeed <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN>}<BR> <SPAN class="keyword">try</SPAN> {P} <SPAN class="keyword">catch</SPAN> E <SPAN class="keyword">then</SPAN> {Value<SPAN class="keyword">.</SPAN>failed E} <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN>}<BR><SPAN class="keyword">end</SPAN></CODE></BLOCKQUOTE><P> </P></DD><DT><CODE>failed</CODE> <A name="label696"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P><CODE>{Value<SPAN class="keyword">.</SPAN>failed </CODE><CODE><I>E</I></CODE><CODE> </CODE><CODE><I>X</I></CODE><CODE>}</CODE> </P></BLOCKQUOTE></DD><DD><P>creates a <A name="label697"></A><SPAN class="index">failed value</SPAN> <CODE><I>X</I></CODE> encapsulating exception <CODE><I>E</I></CODE>. Whenever a statement needs <CODE><I>X</I></CODE>, in particular, whenever a thread synchronizes on <CODE><I>X</I></CODE>, exception term <CODE><I>E</I></CODE> is raised. This is convenient in concurrent designs: if a concurrent generator encounters a problem while computing a value, it may catch the corresponding exception, package it as a failed value and return the latter instead. Thus each consumer will be able to synchronously handle the exception when it attempts to use the ``failed'' value. For example, the module manager returns failed futures for modules that cannot be found or linked. </P><P> The failed value <CODE><I>X</I></CODE> can only unify to itself. An attempt to unify <CODE><I>X</I></CODE> to any other value results in exception <CODE><I>E</I></CODE> to be raised. Unifying two distinct failed values causes one of them to raise its exception, the choice of which being nondeterministic. </P></DD></DL><P> </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node12.html">- Up -</A></TD><TD><A href="loop.html#section.control.loops">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif Kornstaedt</A> and <A href="http://www.ps.uni-sb.de/~schulte/">Christian Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|