[eclipse-clp-users] Storage of delayed goals

From: Daniel Guimarans Serrano <daniel.guimarans_at_...180...>
Date: Mon, 23 Jul 2012 14:41:43 +0200
Hi all,

We are using Java and ECLiPSe for solving a routing problem. Currently, we are using CP for checking feasibility. For efficiency reasons, we would like to store in memory the constraints model and not building it up every time we call the checking predicate.

For instance, let's say we have two predicates, constraints/3 and check/3:

constraints(A,B,C) :-
  constraint_1(A,B),
  constraint_2(B,C),
  constraint_3(A,C).

check(A,B,C).

We would like to keep the delayed goals generated by constraints/3 when called with A,B, and C, uninstantiated, so in a later call to check/3 they are woken up. Instead of having:

[eclipse1]: constraints(A,B,C), check(A,B,C).
Yes(0.00s)            % or No(0.00s)

we would like to get something like the following:

[eclipse1]: constraints(A,B,C).
There are XXX delayed goals.
Yes(0.00s)

[eclipse2]: check(A,B,C).    % where A,B, and C are instantiated
Yes(0.00s)                            % or No(0.00s) 

Right now, we have the call to constraints/3 within the check/3 predicate, but we would like to take it out so we can make two separate calls from Java. The number of generated solutions is quite high, so it would be more computationally efficient to have one call to constraints/3 and several calls to check/3.

We have been through the documentation and the mailing list archives, but couldn't find anything related. Is there any way to do it? And, if so, we are wondering if variables A, B, and C, will remain instantiated after the first call to check/3.

Thanks in advance for your help!

Best regards,
Daniel Guimarans

=====================================================================
Daniel Guimarans Serrano

Unitat de Gestió Aeronàutica
Departament de Telecomunicació i d'Enginyeria de Sistemes
Escola d'Enginyeria - Universitat Autònoma de Barcelona
Emprius, 2
08202 - Sabadell

Despatx: S / 247
Tel.: +34 93 728 77 55
E-mail: daniel.guimarans_at_...180...
=====================================================================
Received on Mon Jul 23 2012 - 13:42:18 CEST

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