Re: Interraction between main programs and events

From: ludovic picouays <>
Date: Tue 26 Jul 2005 02:06:52 PM GMT
Message-ID: <>
After some tests and verifications about the failure of a predicate
which is wake up by an event (demon/1 and suspend/1) the failure of
this predicate doesn't return a fail to the main program.

When the domain of a variable is modified  by indomain, the associated
event is awakened (I've looked with the tracer what was happening). In
order to say if the modification is valid or not, there are some
verifications. If modifications are not valid, the predicate fails,
and the failure goes back to the wake and not to the indomain. I think
the wake creates another tree where it is the root of another tree. So
when it fail, the main programm doesn't fail and continues to run.

I want a solution to the interactions between the wake and the main
programm. When the predicate wakes  due to the event fail, I want to
cut the current branche in the search tree.

Could you give me a solution that allows this ?

Best Regards
Ludovic Picouays

2005/7/25, Joachim Schimpf <>:
> ludovic picouays wrote:
> > Hello everybody.
> >
> > We want to develop a new global constraint with adjustment.
> >
> > We use some events (suspend/4 and demon/1) on modification of domain
> > of variable and we call a C++ program which gives us if there is some
> > adjustments, no adjustement or no solution.
> >
> > During the search (indomain),  we want that the main program fails if
> > there is no solution. At the moment, only the predicate calls by
> > events fails. But there is no repercussion on the main program.
> >
> > Could you give us a solution to make interact the main program and the
> > predicate calls by the event ?
> I do not understand precisely what your problem is.
> When you have a delayed goal (demon or not), and it it woken
> (e.g. because of a domain modification) during your search,
> and it detects failure, then the system will backtrack to the
> most recent choice (e.g. indomain) in your search tree and
> continue to search another part of the tree. It does not mean
> that your whole program fails - this only happens when all
> alternatives of the search tree are exhausted.
> This is what constraints do - they cut off branches in the
> search tree.
> --
>   Joachim Schimpf              /             phone: +44 20 7594 8187
>   IC-Parc                     /
>   Imperial College London    /
Received on Tue Jul 26 15:08:40 2005

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:38 PM GMT GMT