Re: [eclipse-clp-users] How to extend lib(ic) to get stronger propagation?

From: Ulrich Scholz <Ulrich.Scholz_at_eml-d.villa-bosch.de>
Date: Tue, 17 Nov 2009 14:17:20 +0100
Helmut, thanks for your answer.

On Tue, Nov 17, 2009 at 12:46:49PM -0000, Helmut Simonis wrote:
> Ulrich,
> 
> there are two possibilities there:
> 
> a) you can use something like CHR to detect combinations of constraints from
> which you can detect new constraints. 

I know CHR and use it for some constraints.  But re-writing lib(ic) with
CHRs will be my last resort because it is a lot of work for some small extra
propagation.  And most likely lib(ic) is more correct and more efficient.

I don't know how to add an extension to lib(ic) with CHRs, e.g., how to
trigger a CHR in case two ic constraints are posted.

 
> b) You can treat a set of inequalities as a global constraint, set up a
> graph and then detect properties (e.g. cycles) in that graph. 

I don't think I need such a complex solution.  The simple case #=< + #>= =>
#= would be fine.  Furthermore, the inequalities are generated by a
non-deterministic contraint program, so it is not easy to determine which
set of inequalities is posted.  In the end, this approach would result in a
CHR re-implementation of lib(ic), too.


Best regard,

Ulrich

> -----Original Message-----
> Subject: [eclipse-clp-users] How to extend lib(ic) to get stronger
> propagation?
> 
> Hi again,
> 
> It is clear that a constraint package cannot detect and propagate all
> possible simplifications.  But sometimes, a specific simplification can be
> of great help.
> 
> Consider the following constraint program.
> 
>   [eclipse 3]: lib(ic), [A, B] :: [0, 100], A #=< B, B #=< A.
> 
>   A = A{[0, 100]}
>   B = B{[0, 100]}
> 
> 
>   Delayed goals:
>           -(B{[0, 100]}) + A{[0, 100]} #=< 0
>           B{[0, 100]} - A{[0, 100]} #=< 0
>   Yes (0.00s cpu)
> 
> 
> It would really help me if (an extended) ic would simplify this case to
> A#=B.  Labeling is no option for me, I need to detect this case early.
> 
> Could you suggest an approach?  Maybe checking some conditions on every
> posting of #=<?  Depending on the outcome, I could thenpost one of #=, #<,
> or #=<.
> 
> Thanks,
> 
> Ulrich
> 
Received on Tue Nov 17 2009 - 13:14:47 CET

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