Re: [eclipse-clp-users] Suspension: "constrained" does not wake on unification of ic variables

From: Ulrich Scholz <Ulrich.Scholz_at_eml-d.villa-bosch.de>
Date: Mon, 16 Nov 2009 15:40:00 +0100
On Mon, Nov 16, 2009 at 11:21:32PM +1100, Joachim Schimpf wrote:
> Ulrich Scholz wrote:
> > Dear all,
> > 
> > Id like to wake a suspension on an ic variables if it becomes more
> > constrained, in particular, if it gets unified with another ic variable
> > (#=).  

> What you have overlooked is that [bounds] reacts only to var-var
> bindings within the set of variables on which a particular goal delays.
> Bindings to unrelated variables don't trigger anything, which is exactly
> the behaviour you need:

Thanks for the clarification.  Actually, it is not what I need because
variables are created dynamically and at the time I set up the suspension I
don't know to which they might be unified.  What to do?

Thanks,

Ulrich


> 
> % unifying any two of the three suspending variables causes waking
> ?- suspend(writeln(reduced(X, Y, Z)), 0, [X,Y,Z]->bound), X = Y.
> reduced(X, X, Z)
> X = X
> Y = X
> Z = Z
> Yes (0.00s cpu)
> 
> % unifying X with an unrelated variable has no effect
> ?- suspend(writeln(reduced(X, Y, Z)), 0, [X,Y,Z]->bound), X = A.
> X = A
> Y = Y
> Z = Z
> A = A
> There is 1 delayed goal.
> Yes (0.00s cpu)
Received on Mon Nov 16 2009 - 14:37:35 CET

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