Re: [eclipse-clp-users] eclipse university time tabling

From: Kish Shen <kisshen_at_cisco.com>
Date: Fri, 23 Jul 2010 18:07:37 +0100
paniz alipour wrote:
> Hello
> I can't run this part with eclipse,i get this error:
> 
> instantiation fault in functor(_120, [], _85)
> 

You did not say how you are running this goal. The most likely reason 
for your problem is because you called model/7 with V or B unbound,
and dim(Matrix,[V,B]) will then raise the error you see (it probably 
should be more informative in its error, saying the error comes from 
dim/2 rather than functor).

> model(V,B,R,K,L,Matrix,Method):-
> dim(Matrix,[V,B]),
> Matrix[1..V,1..B] :: 0..1,
> (for(I,1,V), param(Matrix,B,R) do
> sumlist(Matrix[I,1..B],R)
> ),
> (for(J,1,B), param(Matrix,V,K) do
> sumlist(Matrix[1..V,J],K)
> ),
> (for(I,1,V-1), param(Matrix,V,B,L) do
> (for(I1,I+1,V), param(Matrix,I,B,L) do
> scalar_product(Matrix[I,1..B],
> Matrix[I1,1..B],L)
> )
> ).

You should also consider formatting your code with indentations -- it 
should make it much easier to read.

Cheers,

Kish



-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
Received on Fri Jul 23 2010 - 17:42:12 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET