/usr/share/mozart/examples/fd/golomb.oz 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 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | %%%
%%% Authors:
%%% Christian Schulte
%%%
%%% Copyright:
%%% Christian Schulte, 2001
%%%
%%% Last change:
%%% $Date: 2001-05-02 17:57:16 +0200 (Wed, 02 May 2001) $ by $Author: schulte $
%%% $Revision: 13775 $
%%%
%%% This file is part of Mozart, an implementation
%%% of Oz 3
%%% http://www.mozart-oz.org
%%%
%%% See the file "LICENSE" or
%%% http://www.mozart-oz.org/LICENSE.html
%%% for information on usage and redistribution
%%% of this file, and for a DISCLAIMER OF ALL
%%% WARRANTIES.
%%%
declare
fun {MakeGolomb N}
NN = N * N
N2 = 2 * N
in
proc {$ S}
K = {FD.tuple k N 0#FD.sup}
D = {FD.tuple d (NN - N) div 2 0#NN}
fun {DIJ I J}
D.(((I - 1) * (N2 - I)) div 2 + J - I)
end
in
S = s(k:K dm:{DIJ 1 N})
K.1 = 0
K.2 :: 0#NN
for I in 1..N-1 do
K.(I+1) >: K.I
for J in I+1..N do
K.J - K.I =: {DIJ I J}
end
end
{FD.distinctB D}
{FD.distribute naive K}
end
end
proc {Better O N}
O.dm >: N.dm
end
/*
{ExploreBest {MakeGolomb 9} Better}
*/
|