This file is indexed.

/usr/share/mozart/doc/cpitut/node18.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>Extending OZ_Expect</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="node17.html#ct.casestudy.impl.rivar">&lt;&lt; Prev</A></TD><TD><A href="node13.html">- Up -</A></TD><TD><A href="node19.html#ct.casestudy.impl.propagator">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="ct.casestudy.impl.expect"><H4><A name="ct.casestudy.impl.expect">Extending <CODE>OZ_Expect</CODE></A></H4><P>Propagators are imposed on their parameters by foreign functions which are invoked by the Oz runtime system. Such foreign functions use the C<SPAN class="allcaps">PI</SPAN> class <CODE>OZ_Expect</CODE> to check that the parameters are appropriately kinded (resp. constrained) or represent compatible values. The class <CODE>OZ_Expect</CODE> provides the member function </P><BLOCKQUOTE class="code"><CODE><SPAN class="type">OZ_expect_t</SPAN>&nbsp;<SPAN class="reference">OZ_Expect</SPAN>::<SPAN class="functionname">expectGenCtVar</SPAN>(<SPAN class="type">OZ_Term</SPAN>&nbsp;<SPAN class="variablename">t</SPAN>,&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="type">OZ_CtDefinition</SPAN>&nbsp;*&nbsp;<SPAN class="variablename">d</SPAN>,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="type">OZ_CtWakeUp</SPAN>&nbsp;<SPAN class="variablename">w</SPAN>);&nbsp;</CODE></BLOCKQUOTE><P> to define appropriate expect-functions, e.g., for real-interval constraints. The customized class defines member functions that check for real-intervals and determine the wake-up event. To do that, the static members functions of <CODE>RIWakeUp</CODE> (see <A href="node15.html#ct.casestudy.impl.profilewakeup">Section ``Determining Wake-up Events for Real-Interval Constraints''</A>) are used and the global variable <CODE><SPAN class="type">RIDefinition</SPAN>&nbsp;<SPAN class="variablename">ri_definition</SPAN></CODE> is assumed. </P><BLOCKQUOTE class="linenumbers"><PRE><SPAN class="keyword">class</SPAN>&nbsp;<SPAN class="type">RIExpect</SPAN>&nbsp;:&nbsp;<SPAN class="keyword">public</SPAN>&nbsp;<SPAN class="type">OZ_Expect</SPAN>&nbsp;{<BR><SPAN class="keyword">public</SPAN>:<BR>&nbsp;&nbsp;<SPAN class="type">OZ_expect_t</SPAN>&nbsp;<SPAN class="functionname">expectRIVarMin</SPAN>(<SPAN class="type">OZ_Term</SPAN>&nbsp;<SPAN class="variablename">t</SPAN>)&nbsp;{&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">return</SPAN>&nbsp;expectGenCtVar(t,&nbsp;ri_definition,&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="reference">RIWakeUp</SPAN>::wakeupMin());&nbsp;&nbsp;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;<SPAN class="type">OZ_expect_t</SPAN>&nbsp;<SPAN class="functionname">expectRIVarMax</SPAN>(<SPAN class="type">OZ_Term</SPAN>&nbsp;<SPAN class="variablename">t</SPAN>)&nbsp;{&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">return</SPAN>&nbsp;expectGenCtVar(t,&nbsp;ri_definition,&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="reference">RIWakeUp</SPAN>::wakeupMax());&nbsp;&nbsp;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;<SPAN class="type">OZ_expect_t</SPAN>&nbsp;<SPAN class="functionname">expectRIVarMinMax</SPAN>(<SPAN class="type">OZ_Term</SPAN>&nbsp;<SPAN class="variablename">t</SPAN>)&nbsp;{&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">return</SPAN>&nbsp;expectGenCtVar(t,&nbsp;ri_definition,&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="reference">RIWakeUp</SPAN>::wakeupMinMax());&nbsp;&nbsp;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;...<BR>};<BR></PRE></BLOCKQUOTE><P> The class <CODE>RIEexpect</CODE> can now be used to define foreign functions that impose propagators on their parameters. </P><BLOCKQUOTE class="code"><CODE><SPAN class="functionname">OZ_BI_define</SPAN>(ri_lessEq,&nbsp;2,&nbsp;0)<BR>{<BR>&nbsp;&nbsp;OZ_EXPECTED_TYPE(<SPAN class="string">&quot;real&nbsp;interval,&nbsp;real&nbsp;interval&quot;</SPAN>);<BR>&nbsp;<BR>&nbsp;&nbsp;<SPAN class="type">RIExpect</SPAN>&nbsp;<SPAN class="variablename">pe</SPAN>;<BR>&nbsp;<BR>&nbsp;&nbsp;OZ_EXPECT(pe,&nbsp;0,&nbsp;expectRIVarMinMax);<BR>&nbsp;&nbsp;OZ_EXPECT(pe,&nbsp;1,&nbsp;expectRIVarMinMax);<BR>&nbsp;<BR>&nbsp;&nbsp;<SPAN class="keyword">return</SPAN>&nbsp;pe.impose(<SPAN class="keyword">new</SPAN>&nbsp;<SPAN class="type">RILessEq</SPAN>(OZ_args[0],&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OZ_args[1]));<BR>}<BR>OZ_BI_end</CODE></BLOCKQUOTE><P> The propagator class <CODE>RILessEq</CODE> is partly defined next. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node17.html#ct.casestudy.impl.rivar">&lt;&lt; Prev</A></TD><TD><A href="node13.html">- Up -</A></TD><TD><A href="node19.html#ct.casestudy.impl.propagator">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~tmueller/">Tobias&nbsp;Müller</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>