What is wrong with my code?

From: swarnendu bhushan <sbhushan_99_at_yahoo.com>
Date: Sat 20 Dec 2003 05:27:16 AM GMT
Message-ID: <20031220052716.80577.qmail@web13608.mail.yahoo.com>
Hi,
I am new to eclipse.
I want to write a code for sum(I,sum(J,X[I,J]))=1, in
other words, summation of X[I,J] over I and J, limited
to sum being 1.
I am trying the below but am unsuccessful.
I will be glad for any help.
/***********************************/
/* trying to find sum(I,sum(J,X(I,J))) */

:-lib(ic).


summation(X):-
dim(X,[3,3]),
X::0..1,
dim(Y,[1,3]),

(for(I,1,3),param(X,Y)
   do
     (
     for(J,1,3),
        fromto(0,In,Out,Sum),param(X,I)
           do Out is In+X[I,J]
     ),
     subscript(Y,[1,I],Sum)
),

(for(J1,1,3),
fromto(0,In1,Out1,Sum1),
param(X,Y)
do Out1 is In1+Y[1,J1]),

ic:(Sum1#=1),
labeling(X).
/***********************************/

Thanks in advance...
Swarnendu Bhushan.


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
Received on Mon Jan 05 11:25:37 2004

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:26 PM GMT GMT