[eclipse-clp-users] Suspend till tentative value change

From: Edgaonkar, Shrirang <Shrirang.Edgaonkar_at_...390...>
Date: Thu, 4 Feb 2016 02:01:27 +0000
Dear clp users,



 I wish to suspend a predicate till a change in tentative value occurs to one of its variables. I get the following error "out of range in suspend(cast(_612, _613), 1, _613 -> tent_chg, 'SUSP-5-susp') in module eclipse"



for the following script



:- lib(tentative).
solve(R):-
cast(Number,String),
tent_set(String, 1).


cast(Number,String):-
  (var(String)->
  suspend(cast(Number,String),
   1, String->tent_chg, Susp2);writeln(instantiated),true).



Whenever tentative value of String changes it should invoke cast(Number,String) is the intention.



Kindly guide me into this. I also checked the register_fornotification but its usage was not clear to me from the example.



Thanks and Regards,

Shrirang Edgaonkar







______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.
Received on Thu Feb 04 2016 - 02:22:22 CET

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST