This file is indexed.

/usr/share/mozart/doc/cpitut/node19.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
3
4
5
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>A Simple Propagator</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="node18.html#ct.casestudy.impl.expect">&lt;&lt; Prev</A></TD><TD><A href="node13.html">- Up -</A></TD></TR></TABLE><DIV id="ct.casestudy.impl.propagator"><H4><A name="ct.casestudy.impl.propagator">A Simple Propagator</A></H4><P>The description of the implementation of real-interval constraints is closed with the discussion of the propagation function of a simple propagator, namely a propagator for the constraint <IMG alt="x \le
y" src="latex89.png">. The rest of the class definition of that propagator is similar to other propagators and therefore omitted here. </P><BLOCKQUOTE class="linenumbers"><PRE><SPAN class="type">OZ_Return</SPAN>&nbsp;<SPAN class="reference">RILessEq</SPAN>::<SPAN class="functionname">propagate</SPAN>(<SPAN class="type">void</SPAN>)<BR>{<BR>&nbsp;&nbsp;<SPAN class="type">RIVar</SPAN>&nbsp;<SPAN class="variablename">x</SPAN>(_x),&nbsp;y(_y);<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;//&nbsp;<SPAN class="comment">step&nbsp;(1)<BR></SPAN>&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;(x-&gt;upperBound()&nbsp;&lt;=&nbsp;y-&gt;lowerBound())&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;x.leave();&nbsp;y.leave();<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">return</SPAN>&nbsp;OZ_ENTAILED;<BR>&nbsp;&nbsp;}<BR>&nbsp;<BR>&nbsp;&nbsp;//&nbsp;<SPAN class="comment">step&nbsp;(2)<BR></SPAN>&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>((*x&nbsp;&lt;=&nbsp;y-&gt;upperBound())&nbsp;&lt;&nbsp;0.0)&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">goto</SPAN>&nbsp;<SPAN class="reference">failure</SPAN>;<BR>&nbsp;<BR>&nbsp;&nbsp;//&nbsp;<SPAN class="comment">step&nbsp;(3)<BR></SPAN>&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>((*y&nbsp;&gt;=&nbsp;x-&gt;lowerBound())&nbsp;&lt;&nbsp;0.0)&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">goto</SPAN>&nbsp;<SPAN class="reference">failure</SPAN>;<BR>&nbsp;<BR>&nbsp;&nbsp;<SPAN class="keyword">return</SPAN>&nbsp;(x.leave()&nbsp;|&nbsp;y.leave())&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;?&nbsp;OZ_SLEEP&nbsp;:&nbsp;OZ_ENTAILED;<BR>&nbsp;<BR><SPAN class="reference">failure</SPAN>:<BR>&nbsp;&nbsp;x.fail();&nbsp;y.fail();<BR>&nbsp;&nbsp;<SPAN class="keyword">return</SPAN>&nbsp;OZ_FAILED;<BR>}<BR></PRE></BLOCKQUOTE><P> Assume that the propagator stores in its state references to its parameters on the Oz heap by the members <CODE><SPAN class="type">OZ_Term</SPAN>&nbsp;<SPAN class="variablename">_x</SPAN>,&nbsp;<SPAN class="variablename">_y</SPAN>;</CODE>. The function <CODE>propagate()</CODE> obtains access to the constraint store by declaring two instances of class <CODE>RIVar</CODE> and passing the Oz terms <CODE>_x</CODE> and <CODE>_y</CODE> as arguments. </P><P>The propagation proceeds in three steps. </P><OL type="1"><LI><P>Test if the constraint <IMG alt="x \le y" src="latex90.png"> is subsumed by the constraint store, i.&nbsp;e., <IMG alt="\overline{x} \le \underline{y}" src="latex91.png">. </P></LI><LI><P>Constrain the upper bound of <IMG alt="x" src="latex4.png">: <IMG alt="x \le
\overline{y}" src="latex92.png">. </P><P> That is implemented by <CODE><SPAN class="type">ri_float</SPAN>&nbsp;<SPAN class="reference">RI</SPAN>::<SPAN class="keyword">operator</SPAN>&nbsp;<BR><SPAN class="functionname">&lt;=</SPAN>&nbsp;(<SPAN class="type">ri_float</SPAN>)</CODE>. </P></LI><LI><P>Constrain the lower bound of <IMG alt="y" src="latex5.png">: <IMG alt="y \ge
\underline{x}" src="latex93.png">. </P><P> That is implemented by <CODE><SPAN class="type">ri_float</SPAN>&nbsp;<SPAN class="reference">RI</SPAN>::<SPAN class="keyword">operator</SPAN>&nbsp;<BR><SPAN class="functionname">&gt;=</SPAN>&nbsp;(<SPAN class="type">ri_float</SPAN>)</CODE>. </P></LI></OL><P> As said in <A href="node16.html#ct.casestudy.impl.constraint">Section ``The Actual Real-Interval Constraint''</A> these operators return the width of the computed constraint. A width less than 0 indicates that the constraint has become inconsistent and propagation branches to label <CODE>failure</CODE>. </P><P>The function <CODE><SPAN class="reference">OZ_CtVar</SPAN>::leave()</CODE> returns <CODE>OZ_True</CODE> if the constraint does not denotes a value. This is used to detect whether the propagator has to be rerun (indicated by <CODE>OZ_SLEEP</CODE>) or not (indicated by <CODE>OZ_ENTAILED</CODE>). </P><P> The return value <CODE>OZ_FAILED</CODE> informs the runtime system that the constraint is inconsistent with the constraint store. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node18.html#ct.casestudy.impl.expect">&lt;&lt; Prev</A></TD><TD><A href="node13.html">- Up -</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>