ptal/pcp

Variable view

Closed this issue · 1 comments

ptal commented

Instead of x < y being desugar to x < y + 0, we could have views of variable and desugaring y + c in a view y' and so x < y + c would desugar to x < y'. The arithmetic might be encoded as view and a cool side effect is that it would be usable in any constraint.

Is it the same as introducing intermediate variables?
How does it relate to propagator view (introduced by Tack and Schulte)?
Is it more efficient?
Is it really more compact?

ptal commented

To answer the questions:

  • Is it the same as introducing intermediate variables? No new variable are introduced, it is more lightweight.
  • How does it relate to propagator view (introduced by Tack and Schulte)? Propagator views encompass variable views, these last are used for creating new propagators.
  • Is it more efficient? Since we introduce an extra layer, it should be less efficient in theory.
  • Is it really more compact? In term of code, it is!

Guido Tack introduced propagator views in its thesis, Constraint propagation. At page 121, he says that multi-variable views might not preserve contraction for some operations as value removal. In GeCode (and others), multi-variable views are not used.

Views act like a proxy to domains, so I guess all operations on domains must be re-implemented for the view.