For the more complex constraint behaviours (beyond those waiting for instantiations), we need to employ lower-level primitives of the ECLiPSe kernel (suspensions and priorities). If we want to add a new constraint to an existing solver, we also need to use the lower-level interface that the particular solver provides.
Apart from the delay clauses used above, ECLiPSe also provides a more powerful (though less declarative) way of causing a goal to delay. The following is another implementation of the constraint checking behaviour, this time using the suspend/3 built-in predicate to create a delayed goal for capacity/2:
|
Figure 14.3: The Basic Suspension Facilities