This file is indexed.

/usr/share/mozart/doc/demo/node29.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>Distance and route computation: Country.oz</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="node28.html#code.transportation.agents">&lt;&lt; Prev</A></TD><TD><A href="transportation.html">- Up -</A></TD><TD><A href="node30.html#code.transportation.configure">Next &gt;&gt;</A></TD></TR></TABLE><DIV class="unnumbered" id="code.transportation.country"><H3><A name="code.transportation.country">Distance and route computation: <CODE>Country.oz</CODE></A></H3><P class="margin"><A href="Transport/Country.oz">Source File</A></P><P> </P><BLOCKQUOTE><PRE><SPAN class="keyword">functor</SPAN>&nbsp;<BR>&nbsp;<BR><SPAN class="keyword">export</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;GetDist<BR>&nbsp;&nbsp;&nbsp;GetDetourDist<BR>&nbsp;&nbsp;&nbsp;GetRoute<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;Cities<BR>&nbsp;&nbsp;&nbsp;IsCity<BR>&nbsp;&nbsp;&nbsp;GetGraph<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;width:&nbsp;&nbsp;&nbsp;&nbsp;GermanyWidth<BR>&nbsp;&nbsp;&nbsp;height:&nbsp;&nbsp;&nbsp;GermanyHeight<BR>&nbsp;&nbsp;&nbsp;GetCoord<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN class="keyword">prepare</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;Germany&nbsp;=&nbsp;<SPAN class="reference">\insert&nbsp;</SPAN><SPAN class="string">'Germany.oz'</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;GermanyWidth&nbsp;&nbsp;=&nbsp;Germany<SPAN class="keyword">.</SPAN>width<BR>&nbsp;&nbsp;&nbsp;GermanyHeight&nbsp;=&nbsp;Germany<SPAN class="keyword">.</SPAN>height<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">GetDist</SPAN>&nbsp;Src&nbsp;Dst}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;Src<SPAN class="keyword">==</SPAN>Dst&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;V=Germany<SPAN class="keyword">.</SPAN>map<SPAN class="keyword">.</SPAN>Src<SPAN class="keyword">.</SPAN>Dst&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;{IsInt&nbsp;V}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;V&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;V<SPAN class="keyword">.</SPAN>1&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">GetDetourDist</SPAN>&nbsp;Src&nbsp;Via&nbsp;Dst}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;Via<SPAN class="keyword">==</SPAN>Dst&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;Via<SPAN class="keyword">==</SPAN>Src&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">elseif</SPAN>&nbsp;Src<SPAN class="keyword">==</SPAN>Dst&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;2<SPAN class="keyword">*</SPAN>{GetDist&nbsp;Src&nbsp;Via}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">Due&nbsp;to&nbsp;sampling&nbsp;errors&nbsp;in&nbsp;the&nbsp;map&nbsp;data&nbsp;the&nbsp;detour&nbsp;might&nbsp;be<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">negative!<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Max&nbsp;{GetDist&nbsp;Src&nbsp;Via}&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;{GetDist&nbsp;Via&nbsp;Dst}&nbsp;<SPAN class="keyword">-</SPAN>&nbsp;{GetDist&nbsp;Src&nbsp;Dst}&nbsp;0}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">GetRoute</SPAN>&nbsp;Src&nbsp;Dst}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;Src<SPAN class="keyword">==</SPAN>Dst&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;[Dst<SPAN class="keyword">#</SPAN>0]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;SrcDst=Germany<SPAN class="keyword">.</SPAN>map<SPAN class="keyword">.</SPAN>Src<SPAN class="keyword">.</SPAN>Dst&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;{IsInt&nbsp;SrcDst}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;[Src<SPAN class="keyword">#</SPAN>SrcDst&nbsp;Dst<SPAN class="keyword">#</SPAN>0]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;Via=SrcDst<SPAN class="keyword">.</SPAN>2&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;Src<SPAN class="keyword">#</SPAN>Germany<SPAN class="keyword">.</SPAN>map<SPAN class="keyword">.</SPAN>Src<SPAN class="keyword">.</SPAN>Via<SPAN class="keyword">|</SPAN>{GetRoute&nbsp;Via&nbsp;Dst}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;Cities&nbsp;=&nbsp;{Arity&nbsp;Germany<SPAN class="keyword">.</SPAN>map}<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">local</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">MkSrc</SPAN>&nbsp;Cs&nbsp;F}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;Cs&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;nil&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;nil<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;C<SPAN class="keyword">|</SPAN>Cr&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;{IsInt&nbsp;Germany<SPAN class="keyword">.</SPAN>map<SPAN class="keyword">.</SPAN>F<SPAN class="keyword">.</SPAN>C}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;Germany<SPAN class="keyword">.</SPAN>coord<SPAN class="keyword">.</SPAN>C<SPAN class="keyword">|</SPAN>{MkSrc&nbsp;Cr&nbsp;F}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;{MkSrc&nbsp;Cr&nbsp;F}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">MkGraph</SPAN>&nbsp;Cs}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;Cs&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;nil&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;nil<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;C<SPAN class="keyword">|</SPAN>Cr&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;C<SPAN class="keyword">#</SPAN>Germany<SPAN class="keyword">.</SPAN>coord<SPAN class="keyword">.</SPAN>C<SPAN class="keyword">#</SPAN>{MkSrc&nbsp;Cr&nbsp;C}<SPAN class="keyword">|</SPAN>{MkGraph&nbsp;Cr}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">GetGraph</SPAN>}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{MkGraph&nbsp;Cities}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">IsCity</SPAN>&nbsp;A}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{HasFeature&nbsp;Germany<SPAN class="keyword">.</SPAN>map&nbsp;A}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">GetCoord</SPAN>&nbsp;C&nbsp;?X&nbsp;?Y}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X<SPAN class="keyword">#</SPAN>Y=Germany<SPAN class="keyword">.</SPAN>coord<SPAN class="keyword">.</SPAN>C<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR></PRE></BLOCKQUOTE><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node28.html#code.transportation.agents">&lt;&lt; Prev</A></TD><TD><A href="transportation.html">- Up -</A></TD><TD><A href="node30.html#code.transportation.configure">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>