/usr/share/mozart/doc/cpitut/node14.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>A Definition Class for Real-Interval Constraints</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="node13.html">- Up -</A></TD><TD><A href="node15.html#ct.casestudy.impl.profilewakeup">Next >></A></TD></TR></TABLE><DIV id="ct.casestudy.impl.ridef"><H4><A name="ct.casestudy.impl.ridef">A Definition Class for Real-Interval Constraints</A></H4><P>The class <CODE>RIDefinition</CODE> is derived from the C<SPAN class="allcaps">PI</SPAN> class <CODE>OZ_CtDefinition</CODE>. It gathers all information needed to handle real-interval constraints properly by the runtime system. It allows the runtime system to distinguish real-interval constraint from other constraints by calling the member function <CODE>getKind()</CODE>. Note that <CODE>_kind</CODE> is static and to obtain a unique identifier the function <CODE>OZ_getUniqueId()</CODE> is recommended to be used. For testing Oz values to be compatible with real-intervals <CODE>isValidValue()</CODE>, is to be defined appropriately. </P><P>Further, <CODE>RIDefinition</CODE> allows the runtime system to determine the number of possible events causing suspending computation to be woken up. There are two possible events for which a suspending computation may want to be notified: the lower bound is increased or the upper bound is decreased (or both). Therefore, two wake-up lists are used (see <CODE>getNoOfWakeUpLists()</CODE>). </P><BLOCKQUOTE class="linenumbers"><PRE><SPAN class="keyword">class</SPAN> <SPAN class="type">RIDefinition</SPAN> : <SPAN class="keyword">public</SPAN> <SPAN class="type">OZ_CtDefinition</SPAN> {<BR><SPAN class="keyword">private</SPAN>:<BR> <SPAN class="keyword">static</SPAN> <SPAN class="type">int</SPAN> <SPAN class="variablename">_kind</SPAN>; <BR> <BR><SPAN class="keyword">public</SPAN>: <BR> <SPAN class="keyword">virtual</SPAN> <SPAN class="type">int</SPAN> <SPAN class="functionname">getKind</SPAN>(<SPAN class="type">void</SPAN>) { <SPAN class="keyword">return</SPAN> _kind; }<BR> <SPAN class="keyword">virtual</SPAN> <SPAN class="type">char</SPAN> * <SPAN class="functionname">getName</SPAN>(<SPAN class="type">void</SPAN>) { <SPAN class="keyword">return</SPAN> <SPAN class="string">"real interval"</SPAN>; }<BR> <SPAN class="keyword">virtual</SPAN> <SPAN class="type">int</SPAN> <SPAN class="functionname">getNoOfWakeUpLists</SPAN>(<SPAN class="type">void</SPAN>) { <SPAN class="keyword">return</SPAN> 2; }<BR> <SPAN class="keyword">virtual</SPAN> <SPAN class="type">char</SPAN> ** <SPAN class="functionname">getNamesOfWakeUpLists</SPAN>(<SPAN class="type">void</SPAN>) {<BR> <SPAN class="keyword">static</SPAN> <SPAN class="type">char</SPAN> * <SPAN class="variablename">names</SPAN>[2] = {<SPAN class="string">"lower"</SPAN>, <SPAN class="string">"upper"</SPAN>};<BR> <SPAN class="keyword">return</SPAN> names;<BR> }<BR> <SPAN class="keyword">virtual</SPAN> <SPAN class="type">OZ_Ct</SPAN> * <SPAN class="functionname">leastConstraint</SPAN>(<SPAN class="type">void</SPAN>) {<BR> <SPAN class="keyword">return</SPAN> <SPAN class="reference">RI</SPAN>::leastConstraint();<BR> }<BR> <SPAN class="keyword">virtual</SPAN> <SPAN class="type">OZ_Boolean</SPAN> <SPAN class="functionname">isValidValue</SPAN>(<SPAN class="type">OZ_Term</SPAN> <SPAN class="variablename">f</SPAN>) {<BR> <SPAN class="keyword">return</SPAN> <SPAN class="reference">RI</SPAN>::isValidValue(f);<BR> } <BR>};<BR> <BR><SPAN class="type">int</SPAN> <SPAN class="reference">RIDefinition</SPAN>::<SPAN class="variablename">_kind</SPAN> = OZ_getUniqueId();<BR></PRE></BLOCKQUOTE><P> </P><P>The function <CODE>leastConstraint()</CODE> is required to enable the runtime system to constrain a variable to a real-interval with greatest possible width, i. e., ranging from <CODE>RI_FLOAT_MIN</CODE> to <CODE>RI_FLOAT_MAX</CODE>. For example this is necessary when nested variables are to be constrained. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node13.html">- Up -</A></TD><TD><A href="node15.html#ct.casestudy.impl.profilewakeup">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~tmueller/">Tobias Müller</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|