This file is indexed.

/usr/share/mozart/doc/cpitut/node24.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>3.4 Combining Both Models</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="node23.html#lp.tutorial.lp">&lt;&lt; Prev</A></TD><TD><A href="lp.html">- Up -</A></TD><TD><A href="node25.html#lp.tutorial.eval">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="lp.tutorial.fdlp"><H2><A name="lp.tutorial.fdlp">3.4 Combining Both Models</A></H2><P>Combining both models is simply done by adding the finite domain model without distribution to the linear programming model. The propagator <CODE>{RI<SPAN class="keyword">.</SPAN>intBounds&nbsp;F&nbsp;I}</CODE> is used to connect real-interval constraints with finite domain constraints. It constrains <CODE>F</CODE> and <CODE>I</CODE> to denote the same integer either as float or as integer, respectively. </P><BLOCKQUOTE class="linenumbers"><PRE><SPAN class="keyword">declare</SPAN>&nbsp;<BR><SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">KnapsackFDLP</SPAN>&nbsp;Problem}<BR>&nbsp;&nbsp;&nbsp;NumProducts&nbsp;=&nbsp;{Length&nbsp;Problem<SPAN class="keyword">.</SPAN>profit}<BR>&nbsp;&nbsp;&nbsp;Resources&nbsp;&nbsp;&nbsp;=&nbsp;Problem<SPAN class="keyword">.</SPAN>resources<BR><SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;Sol}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sol(maxprofit:&nbsp;FDMaxProfit&nbsp;=&nbsp;{FD<SPAN class="keyword">.</SPAN>decl}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;products:&nbsp;FDProducts&nbsp;=&nbsp;{FD<SPAN class="keyword">.</SPAN>list&nbsp;NumProducts&nbsp;0<SPAN class="keyword">#</SPAN>FD<SPAN class="keyword">.</SPAN>sup})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;Sol<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjFn&nbsp;Constraints<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MaxProfit&nbsp;=&nbsp;{RI<SPAN class="keyword">.</SPAN>var<SPAN class="keyword">.</SPAN>decl}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Products&nbsp;&nbsp;=&nbsp;{MakeList&nbsp;NumProducts}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%<SPAN class="comment">&nbsp;<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&nbsp;<SPAN class="comment">finite&nbsp;domain&nbsp;constraints&nbsp;part<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%<SPAN class="comment">&nbsp;<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FDMaxProfit&nbsp;=&nbsp;{FD<SPAN class="keyword">.</SPAN>sumC&nbsp;Problem<SPAN class="keyword">.</SPAN>profit&nbsp;FDProducts&nbsp;<SPAN class="string">'=:'</SPAN>}<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ForAll&nbsp;{Arity&nbsp;Resources}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;ResourceName}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resource&nbsp;=&nbsp;Resources<SPAN class="keyword">.</SPAN>ResourceName<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{FD<SPAN class="keyword">.</SPAN>sumC&nbsp;Resource<SPAN class="keyword">.</SPAN>npp&nbsp;FDProducts&nbsp;<SPAN class="string">'=&lt;:'</SPAN>&nbsp;Resource<SPAN class="keyword">.</SPAN>ta}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>}<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%<SPAN class="comment">&nbsp;<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">linear&nbsp;programming&nbsp;part<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%<SPAN class="comment">&nbsp;<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ForAll&nbsp;Products<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;V}&nbsp;{RI<SPAN class="keyword">.</SPAN>var<SPAN class="keyword">.</SPAN>bounds&nbsp;0<SPAN class="keyword">.</SPAN>0&nbsp;RI<SPAN class="keyword">.</SPAN>sup&nbsp;V}&nbsp;<SPAN class="keyword">end</SPAN>}<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ObjFn&nbsp;=&nbsp;objfn(row:&nbsp;{Map&nbsp;Problem<SPAN class="keyword">.</SPAN>profit&nbsp;{IntToFloat&nbsp;I}}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opt:&nbsp;max)<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constraints&nbsp;=&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Map&nbsp;{Arity&nbsp;Resources}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;ResourceName}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resource&nbsp;=&nbsp;Resources<SPAN class="keyword">.</SPAN>ResourceName<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;constr(row:&nbsp;{Map&nbsp;Resource<SPAN class="keyword">.</SPAN>npp&nbsp;IntToFloat}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type:&nbsp;<SPAN class="string">'=&lt;'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rhs:&nbsp;{IntToFloat&nbsp;Resource<SPAN class="keyword">.</SPAN>ta})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>}<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%<SPAN class="comment">&nbsp;<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">connecting&nbsp;both&nbsp;constraint&nbsp;systems<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%<SPAN class="comment">&nbsp;<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{RI<SPAN class="keyword">.</SPAN>intBounds&nbsp;MaxProfit&nbsp;FDMaxProfit}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Map&nbsp;Products<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;R&nbsp;D}&nbsp;{RI<SPAN class="keyword">.</SPAN>intBounds&nbsp;R&nbsp;D}&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;FDProducts}<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{DistributeKnapSackLP&nbsp;Products&nbsp;ObjFn&nbsp;Constraints<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MaxProfit}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR><SPAN class="keyword">end</SPAN>&nbsp;<BR></PRE></BLOCKQUOTE><P> </P><P>The Oz Explorer produces the following search tree by calling </P><BLOCKQUOTE class="code"><CODE>{ExploreBest&nbsp;{KnapsackFDLP&nbsp;Problem}&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;O&nbsp;N}&nbsp;O<SPAN class="keyword">.</SPAN>maxprofit&nbsp;<SPAN class="keyword">&lt;:</SPAN>&nbsp;N<SPAN class="keyword">.</SPAN>maxprofit&nbsp;<SPAN class="keyword">end</SPAN>}</CODE></BLOCKQUOTE><P>. </P><DIV align="center"><IMG alt="" src="mks_fdlp_explorer.gif" id="mks_fdlp_explorer.pic"></DIV><P> </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node23.html#lp.tutorial.lp">&lt;&lt; Prev</A></TD><TD><A href="lp.html">- Up -</A></TD><TD><A href="node25.html#lp.tutorial.eval">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>