Domain Views for Constraint Programming

Pascal Van Hentenryck, Laurent D. Michel

TL;DR

This paper introduces "domain views," a novel abstraction for constraint programming that simplifies the implementation of value-based propagation and elegantly handles non-injective functions. By delegating only domain operations and allowing views to manage their own constraints, domain views offer a more efficient and flexible alternative to existing "variable views."

What Problem Does This Paper Address?

Constraint programming systems rely on a vast number of global constraints, each potentially having many variants to handle different expression types. This leads to a maintenance nightmare for system developers. A common workaround is to introduce new variables and constraints to flatten complex expressions, but this incurs significant time and space overhead. "Variable views" were introduced to mitigate this by allowing a view variable to delegate operations to an underlying variable, avoiding new variables and constraints. However, implementing value-based propagation with variable views can be cumbersome, especially for non-injective functions (where multiple inputs map to the same output). This paper addresses the complexity and limitations of existing view mechanisms, particularly for value-based propagation and non-injective functions.

Methods

The core contribution is the introduction of domain views. Unlike variable views, which delegate all operations (domain and constraint) to an underlying variable, domain views delegate only domain operations. The domain view itself maintains its own set of constraints. This means that when a variable's domain changes, it notifies its views, and the views then schedule their own constraints.

Key aspects of domain views:

  • Delegation of Domain Operations: Methods like member and remove are delegated to the underlying variable, potentially using an inverse function.
  • Local Constraint Management: Domain views maintain their own SC (set of constraints for variable-based propagation) and SCv (set of constraints for value-based propagation).
  • Simplified Value-Based Propagation: The implementation of value-based propagation is simplified because the view directly manages its constraints, avoiding the need for complex function composition or a map method on variables.
  • Elegant Handling of Non-Injective Functions: Domain views naturally support non-injective functions, which are crucial for reified constraints. The view "knows" when its constraints need to be scheduled for propagation.
  • Compositionality: Domain views can be composed, allowing for views on views.

The paper also revisits and refines the implementation of variable views, particularly for handling non-injective functions, highlighting the complexities that domain views aim to overcome.

Datasets

Not discussed in the paper. The paper focuses on the theoretical framework and experimental validation of the proposed domain views mechanism.

Key Insights and Ideas

  • Separation of Concerns: The key insight is that separating domain operations from constraint watching in views leads to a simpler and more powerful abstraction. Domain views manage their own constraints, which is critical for efficient propagation, especially with non-injective functions.
  • Non-Injective Functions are Key: The paper emphasizes the importance of handling non-injective functions, particularly for reified constraints. Domain views provide an elegant solution where variable views struggle.
  • Simplification of Value-Based Propagation: By allowing views to directly manage their constraints, the complexity of implementing value-based propagation is significantly reduced, eliminating the need for first-order functions or complex mapping mechanisms.
  • Practical Benefits: The experimental results demonstrate that domain views introduce negligible overhead for injective views and offer significant benefits for non-injective views, making them a practical and valuable addition to constraint programming systems.

Key Results

The experimental evaluation, conducted on various benchmarks using the OBJECTIVE-CP system, shows that:

  • Injective Views: Domain views perform comparably to optimized variable views, with only a slight, often statistically insignificant, difference in time and memory efficiency. In some cases, variable views are slightly more efficient, but the difference is minimal.
  • Non-Injective Views: Domain views provide substantial benefits for benchmarks involving non-injective functions (e.g., reified constraints like in slab and magicserie). For instance, the Steel Mill Slab problem saw its runtime halved.
  • Memory Efficiency: Domain views require less memory than variable views for managing constraints, as they only store pointers to their own lists rather than full constraint tuples.
  • Reduced Propagation: For non-injective views, the number of propagations can be significantly reduced, leading to faster execution.

Limitations and Future Work

  • Recursive needToSchedule: The paper mentions that the implementation of needToSchedule for variable views with non-injective functions needs to be recursive to handle views on views. This is noted as a complexity that domain views avoid.
  • Further Exploration of Advisors: The paper briefly contrasts domain views with "advisors" and "delta sets," suggesting that further exploration of how these concepts interact or can be unified might be beneficial.
  • Experimental Scope: The experiments primarily focus on demonstrating the practicability and benefits of domain views, particularly for non-injective functions. While comprehensive, the paper points to [9] for a deeper dive into the benefits of views in general.
  • Future Work: The paper implicitly suggests that the elegance and efficiency of domain views for non-injective functions open up new possibilities for implementing complex constraints and improving the overall performance of constraint programming systems. The authors also mention that the implementation of needToSchedule for variable views needs further recursive handling.

Summary updated

BibTeX
@inproceedings{hentenryck2014domain,
  author = {Pascal Van Hentenryck and Laurent D. Michel},
  title = {{Domain Views for Constraint Programming}},
  booktitle = {CP},
  year = {2014},
  doi = {10.1007/978-3-319-10428-7\_51},
}
Figure