[Top][All Lists]

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

Max of list with constrained variables

From: Georgios Samaras
Subject: Max of list with constrained variables
Date: Fri, 24 May 2013 17:23:13 +0300
User-agent: SquirrelMail/1.4.22 []

I have a list, which, for N = 5 (for instance), it is like this:

I am working on a finite domain constraint environment and I tried this
max_list(MaxFilter, M0),

and I got this error (since the variable does not have a value at this
uncaught exception: error(type_error(evaluable,_#4195373(0..1)),(=<)/2)

In Eclipse, I would use eval and in SWI, I used this predicate
lmax([H|T], X):-
        foldl(max_, T, H, Exp),
        X #= Exp.
max_(E, X, max(E, X)).

but I did not find any equiivalent of foldl in GNU.

What should I do? Any ideas? I am stuck and I have been searching the
whole internet for days...

//G. Samaras

reply via email to

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