users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cumulative constraint


From: fred bapst
Subject: cumulative constraint
Date: Wed, 08 Aug 2001 08:54:18 +0100

Hello,

I prepare a course on CLP, and want to use Gnu-Prolog.
I think interessant to discuss the "complex" constraint cumulative/4 for 
scheduling problems. I did not found it on Gnu-Prolog.

Where could I find a "naive" implementation (ie in Prolog) of that
predicate, even if the propagation is far from optimal ?

Thanks in advance.



Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/


From address@hidden Wed Aug 08 16:52:41 2001
Received: from arrakis.ldc.usb.ve ([159.90.10.114] helo=post-office.ldc.usb.ve)
        by fencepost.gnu.org with smtp (Exim 3.22 #1 (Debian))
        id 15UaJl-0001xi-00
        for <address@hidden>; Wed, 08 Aug 2001 16:52:41 -0400
Received: from rabban.ldc.usb.ve (rabban [159.90.10.138])
        by post-office.ldc.usb.ve (Postfix) with ESMTP id DD531FAD6
        for <address@hidden>; Wed,  8 Aug 2001 16:51:40 -0400 (VET)
Date: Wed, 8 Aug 2001 16:32:28 -0400 (AST)
From: "Hector Luis Palacios V." <address@hidden>
To: address@hidden
Subject: Re: magic stranger...
In-Reply-To: <address@hidden>
Message-ID: <address@hidden>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: address@hidden
Errors-To: address@hidden
X-BeenThere: address@hidden
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:address@hidden>
List-Post: <mailto:address@hidden>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/users-prolog>,
        <mailto:address@hidden>
List-Id: Users list for the GNU implementation of Prolog <users-prolog.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/users-prolog>,
        <mailto:address@hidden>
List-Archive: <http://mail.gnu.org/pipermail/users-prolog/>

Well, after some read, I found the error. 
I think the answer could be an advice for somebody.

The problem is with the size of vector.
Some variable just lost some values and, because murphy law, 
gprolog didn't detected it.

Reading section 7.1.1 of manual I found that 
I had to increase the max size of vectors.

It's a little confusing this way to work with the domains.
Daniel, could you comment us about this?

Thanks a lot...

 /--------------------------------------------------------------------------\
| Artificial Intelligence Group    | He venido para que tengan vida, y la   |
| Universidad Simon Bolivar        | tengan en abundancia. Jesus de Nazaret |
|---------------------------------------------------------------------------|
| Hector Luis Palacios Verdes      | address@hidden, address@hidden    |
 \--------------------------------------------------------------------------/
On Tue, 7 Aug 2001, Hector Luis Palacios V. wrote:

> 
> Hi.
> 
> I have seen something stranger with gprolog.
> ms3.pl have an implementacion of magic sequence.
> 
> But it start to report fail in N = 132
> as you can see:
> 
> ------------
> 
> address@hidden stp-gprolog]$ gprolog 
> GNU Prolog 1.2.1
> By Daniel Diaz
> Copyright (C) 1999,2000 Daniel Diaz
> | ?- [ms3].
> compiling /home/hlp/tesis/constraint/stp-gprolog/ms3.pl for byte code...
> /home/hlp/tesis/constraint/stp-gprolog/ms3.pl:67--73 warning: singleton 
> variables [S] for constraints/5
> /home/hlp/tesis/constraint/stp-gprolog/ms3.pl compiled, 86 lines read - 5000 
> bytes written, 49 ms
> 
> (10 ms) yes
> | ?- magic(131, L), !.
> 
> L = 
> [127,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0]
> 
> (370 ms) yes
> | ?- magic(130, L), !.
> 
> L = 
> [126,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0]
> 
> (420 ms) yes
> | ?- magic(132, L), !.
> 
> (1460 ms) no
> | ?- 
> 
> address@hidden stp-gprolog]$ echo $TRAILSZ $CSTRSZ 
> 10000 20000
> 
> ----------
> Version: gprolog-1.2.1-1
> Sytem: Linux burns 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST 2000 i686
> ----------
> 
> Any ideas??
> 
> Thanks....
> 
>  /--------------------------------------------------------------------------\
> | Artificial Intelligence Group    | He venido para que tengan vida, y la   |
> | Universidad Simon Bolivar        | tengan en abundancia. Jesus de Nazaret |
> |---------------------------------------------------------------------------|
> | Hector Luis Palacios Verdes      | address@hidden, address@hidden    |
>  \--------------------------------------------------------------------------/
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]