Annals of Operations Research

, Volume 184, Issue 1, pp 179–207

The weighted Grammar constraint


  • George Katsirelos
    • University of New South Wales and NICTA
    • University of New South Wales and NICTA
  • Toby Walsh
    • University of New South Wales and NICTA

DOI: 10.1007/s10479-010-0697-y

Cite this article as:
Katsirelos, G., Narodytska, N. & Walsh, T. Ann Oper Res (2011) 184: 179. doi:10.1007/s10479-010-0697-y


We introduce the WeightedGrammar constraint and propose propagation algorithms based on the CYK parser and the Earley parser. We show that the traces of these algorithms can be encoded as a weighted negation normal form (WNNF), a generalization of NNF that allows nodes to carry weights. Based on this connection, we prove the correctness and complexity of these algorithms. Specifically, these algorithms enforce domain consistency on the WeightedGrammar constraint in time O(n3). Further, we propose that the WNNF constraint can be decomposed into a set of primitive arithmetic constraint without hindering propagation.


Constraint programmingGlobal constraintsContext free grammarsNegation normal form
Download to read the full article text

Copyright information

© Springer Science+Business Media, LLC 2010