The Design of ESSENCE: A Constraint Language for Specifying Combinatorial Problems

Alan M. Frisch, Matthew Grum, Christopher Jefferson, Bernadette Martínez Hernández, Ian MiguelIJCAI 2007

Abstract

ESSENCE is a high-level formal language designed to specify combinatorial problems using the natural language of discrete mathematics. By allowing decision variables to be complex, nested objects—such as sets of partitions or multisets of relations—it removes the requirement for manual "modelling." This process traditionally involves the tedious and error-prone encoding of abstract problems into low-level formats that constraint solvers can interpret. ESSENCE aims to bridge the gap between human problem understanding and automated solver execution.

Introduction: The Gap in Constraint Programming

In constraint programming, a significant divide exists between how humans conceptualize a problem and how solvers require it to be presented. For instance, a human might think of scheduling golfers, while a solver requires hundreds of integer variables subject to thousands of linear equations.

Currently, "modelling" is considered an art form. Experts must manually translate abstract concepts into atomic variables (integers or simple sets). This process often introduces artificial symmetries that degrade solver performance and requires deep expertise in constraint satisfaction problems (CSPs). ESSENCE addresses this by providing a problem specification language that sits above modelling decisions, allowing for automated refinement into solver-ready code.

Specification vs. Modelling

The fundamental philosophy behind ESSENCE is that a specification should contain zero modelling decisions. Deciding whether to represent a set as a bit-string or an array is a modelling choice, not a part of the problem's inherent definition.

ESSENCE specifications for the Mystery Problem and the Golomb Ruler Problem.

As shown in the figure above, ESSENCE specifications are often nearly identical to the formal "INSTANCE/QUESTION" descriptions found in classic complexity theory textbooks. This "naturalness" allows users with a mathematical background to specify problems without prior experience in constraint programming.

The ESSENCE Language: Core Innovations

ESSENCE introduces several key features that distinguish it from traditional constraint languages:

  • Complex and Nested Decision Variables: Variables can be combinatorial objects like multisets, relations, functions, and partitions, which can be nested to arbitrary depth.
  • Quantification over Decision Variables: Constraints can quantify over the values of the variables being searched for (e.g., "for every subset in this partition...").
  • Unnamed Types: By supporting types with indistinguishable elements, ESSENCE handles symmetry by design. If elements are identical, the language treats them as such, preventing solvers from exploring redundant permutations.
The SONET problem specified in ESSENCE using nested types.

In the SONET communication network problem, the network is specified directly as a multiset of sets of nodes, rather than being forced into a 2D matrix of integers.

Automated Refinement with CONJURE

To bridge the gap to execution, the authors developed CONJURE, a system that uses rule-based translation to turn abstract ESSENCE specifications into "model kernels." These kernels are written in a lower-level subset called ESSENCE', which existing solvers like Eclipse or Minion can execute. This pipeline allows the high-level abstractions of ESSENCE to be automatically refined into valid, executable CSP models.

Evaluation and Results

The language was evaluated against a suite of 58 problems, including 26 from CSPLib and 32 from general literature. Key results include:

  • Expressiveness: ESSENCE successfully specified a wide range of problems with significantly less code than traditional languages.
  • Efficiency: For the Golomb Ruler Problem, the ESSENCE-generated model resulted in $\Theta(n^4)$ constraints. In contrast, a naive manual encoding without high-level quantification would result in an awkward $\Theta(2^{4n})$ constraints.
  • Accessibility: Testing with an undergraduate student demonstrated that the barrier to entry for formal problem specification can be significantly lowered for those with a math background.

Conclusion and Future Work

While ESSENCE and CONJURE represent a major step forward, the authors acknowledge that creating a system that produces highly efficient models for any specification is a monumental task—one they describe as a "lifetime" goal. Future work will focus on expanding supported types to include lists, trees, and graphs, and enhancing CONJURE to automatically generate advanced features like implied constraints and sophisticated symmetry-breaking used by human experts.

Summary updated

BibTeX
@inproceedings{frisch2007design,
  author = {Alan M. Frisch and Matthew Grum and Christopher Jefferson and Bernadette Martínez Hernández and Ian Miguel},
  title = {{The Design of ESSENCE: A Constraint Language for Specifying Combinatorial Problems}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2007},
}
Figure