[eclipse-clp-users] Sum of Products

From: Yahya Mowiena <mowiena_at_...6...>
Date: Wed, 17 Jun 2009 13:11:27 +0300
Dear All,

I have a data structure (The data structure style is down) with some
variables C, N and A. There are some Vars representing different values for
the previous variables where some variables have common Cs and others don't.
Each "A" value has a unique corresponding "N" value . I have a fact with 2
atoms one of them is the A variable's value (i.e. a1,a2,a3.....a14) and the
other atom is numeric value, let's give it an abbreviation (P).. For a
certain C, I retrieve the value P via the fact mentioned using A and then I
multiply the value of P by the value of N corresponds to the same A to fit a
certain criteria. What if I want to get the sum of the previous products for
the different Ns and Ps of the whole C?.. to make it clearer what if I want
to have (N*P) of A1 + (N*P) of A2 + (N*P) of A3+................(N*P)

data structure

var1 = xxxxx{c= C, a=A, n=N}

Is it doable?

Thanks a lot

Best Regards
Yahya Mowiena
Received on Wed Jun 17 2009 - 10:11:38 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 22 2019 - 06:14:48 CEST