Re: [eclipse-clp-users] Predicate search/6 over Real Numbers

From: <mskala_at_...206...>
Date: Sat, 17 Apr 2021 18:15:20 -0400 (EDT)
On Sat, 17 Apr 2021, Amine Marref wrote:
> In the page search/6, it says "A generic search routine for finite domains
> or IC", then in the page library(ic) it says "The IC (Interval Constraint)
> library is a hybrid integer/real interval arithmetic constraint solver";
> aren't these "ICs" the same? That's what made me think that search/6 works
> for reals.

The solver library as a whole handles integers and real intervals, but
search/6 in particular only seems to be designed to work on variables with
finite domains.

> Incidentally, is there a way to control how values are tried in locate/4?
> How would I make the solver favorise using the largest values from the
> domain?

Probably the easiest thing would be to invert your variables so that the
values you want to try first are less than the values you want to try
later.  Just multiply each variable by -1.  But you might also consider
writing your own replacement for locate.  I don't think it's a very
complicated algorithm, and then you could try different subranges in
whatever order you want.

> Also, when you said locate/4 and friends, did you mean locate/3 and
> locate/2, or are there other friends as well?

I meant locate/2, locate/3, locate/4, but also squash/3.

-- 
Matthew Skala
mskala_at_...206...                 People before tribes.
https://ansuz.sooke.bc.ca/
Received on Sat Apr 17 2021 - 22:15:46 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:21 CEST