/usr/share/mozart/doc/demo/node3.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>Compiler to create scheduling scripts: Compiler.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="node2.html#code.jobshop.main"><< Prev</A></TD><TD><A href="jobshop.html">- Up -</A></TD><TD><A href="node4.html#code.jobshop.examples">Next >></A></TD></TR></TABLE><DIV class="unnumbered" id="code.jobshop.compiler"><H3><A name="code.jobshop.compiler">Compiler to create scheduling scripts: <CODE>Compiler.oz</CODE></A></H3><P class="margin"><A href="JobShop/Compiler.oz">Source File</A></P><P> </P><BLOCKQUOTE><PRE>%%%<SPAN class="comment"> <BR></SPAN>%%% <SPAN class="comment">The compiler is taken from the document:<BR></SPAN>%%% <SPAN class="comment">Christian Schulte, Gert Smolka, Finite Domain Constraint<BR></SPAN>%%% <SPAN class="comment">Programming in Oz. A Tutorial.<BR></SPAN>%%%<SPAN class="comment"> <BR></SPAN> <BR><SPAN class="keyword">functor</SPAN> <BR> <BR><SPAN class="keyword">import</SPAN> <BR> FD<BR> Schedule<BR> <BR><SPAN class="keyword">export</SPAN> <BR> Compile<BR> <BR><SPAN class="keyword">define</SPAN> <BR> <BR> <SPAN class="keyword">local</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">GetDur</SPAN> TaskSpec}<BR> {List<SPAN class="keyword">.</SPAN>toRecord dur {Map TaskSpec <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> T}<BR> {Label T}<SPAN class="keyword">#</SPAN>T<SPAN class="keyword">.</SPAN>dur<BR> <SPAN class="keyword">end</SPAN>}}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">GetStart</SPAN> TaskSpec}<BR> MaxTime = {FoldL TaskSpec <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> Time T} <BR> Time<SPAN class="keyword">+</SPAN>T<SPAN class="keyword">.</SPAN>dur<BR> <SPAN class="keyword">end</SPAN> 0}<BR> Tasks = {Map TaskSpec Label}<BR> <SPAN class="keyword">in</SPAN> <BR> {FD<SPAN class="keyword">.</SPAN>record start Tasks 0<SPAN class="keyword">#</SPAN>MaxTime}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">GetTasksOnResource</SPAN> TaskSpec}<BR> D={Dictionary<SPAN class="keyword">.</SPAN>new}<BR> <SPAN class="keyword">in</SPAN> <BR> {ForAll TaskSpec <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> T}<BR> <SPAN class="keyword">if</SPAN> {HasFeature T res} <SPAN class="keyword">then</SPAN> R=T<SPAN class="keyword">.</SPAN>res <SPAN class="keyword">in</SPAN> <BR> {Dictionary<SPAN class="keyword">.</SPAN>put D R {Label T}<SPAN class="keyword">|</SPAN>{Dictionary<SPAN class="keyword">.</SPAN>condGet D R nil}}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN>}<BR> {Dictionary<SPAN class="keyword">.</SPAN>toRecord tor D}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">in</SPAN> <BR> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Compile</SPAN> TaskSpec}<BR> Dur = {GetDur TaskSpec}<BR> TasksOnRes = {GetTasksOnResource TaskSpec}<BR> <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> Start}<BR> Start = {GetStart TaskSpec}<BR> {ForAll TaskSpec<BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> T}<BR> {ForAll {CondSelect T pre nil}<BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> P}<BR> Start<SPAN class="keyword">.</SPAN>P <SPAN class="keyword">+</SPAN> Dur<SPAN class="keyword">.</SPAN>P <SPAN class="keyword">=<:</SPAN> Start<SPAN class="keyword">.</SPAN>{Label T}<BR> <SPAN class="keyword">end</SPAN>}<BR> <SPAN class="keyword">end</SPAN>}<BR> {Schedule<SPAN class="keyword">.</SPAN>serialized TasksOnRes Start Dur}<BR> {Schedule<SPAN class="keyword">.</SPAN>firstsLastsDist TasksOnRes Start Dur}<BR> <SPAN class="keyword">choice</SPAN> <SPAN class="keyword">skip</SPAN> <SPAN class="keyword">end</SPAN> <BR> {Record<SPAN class="keyword">.</SPAN>forAll Start <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> S} <BR> S={FD<SPAN class="keyword">.</SPAN>reflect<SPAN class="keyword">.</SPAN>min S} <BR> <SPAN class="keyword">end</SPAN>}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR><SPAN class="keyword">end</SPAN> <BR></PRE></BLOCKQUOTE><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node2.html#code.jobshop.main"><< Prev</A></TD><TD><A href="jobshop.html">- Up -</A></TD><TD><A href="node4.html#code.jobshop.examples">Next >></A></TD></TR></TABLE><HR><ADDRESS><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|