/usr/share/mozart/examples/fd/change.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 | %%%
%%% Authors:
%%% Gert Smolka <smolka@ps.uni-sb.de>
%%%
%%% Copyright:
%%% Gert Smolka, 1998
%%%
%%% Last change:
%%% $Date: 1999-06-09 16:30:43 +0200 (Wed, 09 Jun 1999) $ by $Author: schulte $
%%% $Revision: 11475 $
%%%
%%% 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 {ChangeMoney BillAndCoins Amount}
Available = {Record.map BillAndCoins fun {$ A#_} A end}
Denomination = {Record.map BillAndCoins fun {$ _#D} D end}
NbDenoms = {Width Denomination}
in
proc {$ Change}
{FD.tuple change NbDenoms 0#Amount Change}
{For 1 NbDenoms 1 proc {$ I}
Change.I =<: Available.I
end}
{FD.sumC Denomination Change '=:' Amount}
{FD.distribute generic(order:naive value:max) Change}
end
end
BillAndCoins = r(6#100 8#25 10#10 1#5 5#1)
{ExploreOne {ChangeMoney BillAndCoins 142}}
|