[eclipse-clp-users] Question about suspend

From: Ulrich Scholz <wanderer_at_...190...>
Date: Fri, 1 Apr 2011 16:46:24 +0200
Hi,

I'd like to write a demon that wakes when an ic variable gets constrained.
Also, it should wake if the ic variable is made equal to another ic variable
with same bounds.  

Somehow, I seem to set up the condition list it in a wrong way.  Consider
the three examples given below.  Only t2 weakes the demon.  How can I set up
a demon that wakes in case t3?

Thanks,

Ulrich


I'm using ECLiPSe Version 6.0 #154 (i386_linux)

----
:- lib(ic).

:- demon d/0.

d :-
    writeln("suspension woken").

t1 :- 
    suspend(d, 0, [X->bound], _S),

    X = Y.
    
t2 :- 
    X :: [0..100],
    
    suspend(d, 0, [X->bound, X->constrained], _S),

    Y :: [0..50],
    
    X = Y.
    
t3 :- 
    X :: [0..100],
    
    suspend(d, 0, [X->bound, X->constrained], _S),

    Y :: [0..100],
    
    X = Y.
    
Received on Fri Apr 01 2011 - 15:10:59 CEST

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