/usr/share/mozart/examples/fd/queens.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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | %%%
%%% Authors:
%%% Gert Smolka <smolka@ps.uni-sb.de>
%%%
%%% Copyright:
%%% Gert Smolka, 1998
%%%
%%% Last change:
%%% $Date: 1999-10-15 23:30:30 +0200 (Fri, 15 Oct 1999) $ by $Author: schulte $
%%% $Revision: 12194 $
%%%
%%% 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.
%%%
%%
%% Load graphical plugin for Explorer
%%
declare
%% Changed for Debian/GNU: examples are in /usr/share/mozart/examples
[Graphics]={Module.link ['/usr/share/mozart/examples/fd/graphics/Queens.ozf')]}
{Graphics.add}
declare
fun {Queens N}
proc {$ Row}
L1N = {List.number 1 N 1} % [1 2 3 ... N]
LM1N = {List.number ~1 ~N ~1} % [~1 ~2 ~3 ... ~N]
in
Row = {FD.tuple queens N 1#N}
{FD.distinct Row}
{FD.distinctOffset Row L1N}
{FD.distinctOffset Row LM1N}
{FD.distribute generic(order:size value:mid) Row}
end
end
{ExploreOne {Queens 33}} % tough
/*
declare
fun {Order X Y}
SX={FD.reflect.size X}
SY={FD.reflect.size Y}
in
SX < SY orelse
SX == SY andthen {FD.reflect.min X} < {FD.reflect.min Y}
end
fun {Queens N}
proc {$ Row}
L1N = {List.number 1 N 1} % [1 2 3 ... N]
LM1N = {List.number ~1 ~N ~1} % [~1 ~2 ~3 ... ~N]
in
Row = {FD.tuple queens N 1#N}
{FD.distinct Row}
{FD.distinctOffset Row L1N}
{FD.distinctOffset Row LM1N}
{FD.distribute generic(order:Order) Row}
end
end
% works perfect for large n
{ExploreOne {Queens 913}}
% doesn't work so well for small n
{ExploreOne {Queens 33}}
% timing with recomputation
{Search.one.depth {Queens 913} 4000 _ _}
{Graphics.delete}
*/
|