[eclipse-clp-users] Constraints in Loop

From: Igor Kondrasovas <igor_at_inovativatec.com>
Date: Thu, 29 Oct 2009 15:37:29 -0200
Hello All,

 

I’m trying to impose the following constraints in my program, but I’m
getting a "instantiation fault in subscript" when I run it. If I remove the
“#=” and use only “=” the error does not happen (but this is not what I need
of course). I think that I might be mixing constraints programming with
prolog, but I’m not sure how to solve it…

 

Here is the snippet of my predicate:

 

linear(PieceLengths, Bar1, Bar2, Bar3, M) :-    

     

      dim(PieceLengths, [NPieces]),

      dim(M,[NPieces,3]),

      

      M #::0..1,

 

      (for(I,1,NPieces) do

            M[I,1] + M[I,2] + M[I,3] #= 1),

...

...

...

 

I would appretiate any help

 

 

Igor Kondrasovas

Gestão de Projetos

Inovativa Tecnologia

www.inovativatec.com <http://www.inovativatec.com/> 

+55 47 3027-6442

+55 47 8839-1592

 
Received on Thu Oct 29 2009 - 17:38:02 CET

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