Re: [eclipse-clp-users] strange behaviour of minimize/bb_min

From: Stephan Schiffel <stephan.schiffel_at_inf.tu-dresden.de>
Date: Thu, 5 Aug 2010 11:13:40 +0200
Hi Joachim,

On Thursday 05 August 2010, Joachim Schimpf wrote:
> Stephan Schiffel wrote:
> > The output I'd like would be:
> >
> > ? hash_create(H), minimize((member(X,[3,2,1,4,5]),
> > hash_add(H,solution,X)), X).
> > ...
> > H = hash(4, 1, [solution -> 1])
> > X = 1
>
> But then why not simply
>
> ?- hash_create(H), minimize(member(X,[3,2,1,4,5]), X),
> hash_add(H,solution,X).

Because in the real application the information that I need is a bit more 
complex. :-) I just tried to keep the example simple. Anyway, that's what I'm 
doing now. It is just a bit more complicated because I need two different 
data-structures now, one in the goal in minimize/2 and one outside.

> You could use lib(m_map), which is a pure tree-based data structure.

Thanks. I'll look into that.

Regards,
Stephan
-- 
                              Stephan Schiffel
                       Technische Universität Dresden,
                 Fakultät Informatik, 01062 Dresden, Germany
           Tel: [49] (351) 463-39243    Fax: [49] (351) 463-37924
                  Email: stephan.schiffel_at_inf.tu-dresden.de
Received on Thu Aug 05 2010 - 09:13:54 CEST

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