[eclipse-clp-users] Hooking into constraint propagation

From: Chris Mears <chris_at_cmears.id.au>
Date: Tue, 16 Aug 2011 17:17:33 +1000
Hello all,

I would like to execute some code before and after the waking of every
ic constraint. I'd like to be able to examine the domains of the
variables involved in the constraint, and obtain the "name" of the
constraint as specified when the constraint is posted.

For example, I would like to do:

  [W,X,Y,Z] #:: 1..5,
  post(first_constraint, alldifferent([W,X,Y])),
  post(second_constraint, alldifferent([X,Y,Z])),

where 'first_constraint' and 'second_constraint' are simply names for
the constraints. Then, if I later (during search, say) assign X=1, I
would like this output to be produced:

  first_constraint waking up, with domains {1..5}, {1}, {1..5}
  first_constraint finished, with domains {2..5}, {1}, {2..5}
  second_constraint waking up, with domains {1}, {2..5}, {1..5}
  second_constraint finished, with domains {1}, {2..5}, {2..5}

Can anyone please suggest what parts of Eclipse to modify, in the ic
library or elsewhere, that would help to achieve this?

Thanks,
Chris Mears
Received on Tue Aug 16 2011 - 07:40:56 CEST

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