Decomposing global grammar constraints

  • Authors:
  • Claude-Guy Quimper;Toby Walsh

  • Affiliations:
  • Omega Omptimization;NICTA and UNSW

  • Venue:
  • CP'07 Proceedings of the 13th international conference on Principles and practice of constraint programming
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

A wide range of constraints can be specified using automata or formal languages. The GRAMMAR constraint restricts the values taken by a sequence of variables to be a string from a given context-free language. Based on an AND/OR decomposition, we show that this constraint can be converted into clauses in conjunctive normal form without hindering propagation. Using this decomposition, we can propagate the GRAMMAR constraint in O(n3) time. The decomposition also provides an efficient incremental propagator. Down a branch of the search tree of length k, we can enforce GAC k times in the same O(n3) time. On specialized languages, running time can be even better. For example, propagation of the decomposition requires just O(n|δ|) time for regular languages where |δ| is the size of the transition table of the automaton recognizing the regular language. Experiments on a shift scheduling problem with a constraint solver and a state of the art SAT solver show that we can solve problems using this decomposition that defeat existing constraint solvers.