ABSTRACT
Constraint Handling Rules (CHR) is a concurrent committed-choice constraint logic programming language to describe transformations (rewritings) among multi-sets of constraints (atomic formulae). CHR is widely used in a range of applications spanning from type system design to artificial intelligence. However, none of the existing CHR implementations we are aware of exploits concurrency or parallelism explicitly. We give a concurrent CHR implementation using GHC (Glasgow Haskell Compiler) with support for Software Transactional Memory. We achieve some significant performance improvements compared to a single-threaded CHR implementation. We obtain a further speed-up, in some cases nearly close to the optimum of 100%, when running programs under under a dual-core processor architecture. Our results show that CHR can be implemented efficiently on a multi-core architecture.
- S. Abdennadher. Operational semantics and confluence of constraint propagation rules. In Proc. of CP'97, LNCS, pages 252--266. Springer-Verlag, 1997.Google ScholarDigital Library
- Common CHR implementations, http://www.cs.kuleuven.ac.be/~dtai/projects/CHR.Google Scholar
- G. J. Duck, P. J. Stuckey, M. J. García de la Banda, and C. Holzbaur. The Refined Operational Semantics of Constraint Handling Rules. In Proc of ICLP'04, pages 90--104, 2004.Google Scholar
- G. J. Duck, P. J. Stuckey, and M. Sulzmann. Observable confluence for constraint handling rules. Technical Report CW 452, Katholieke Universteit Leuven, 2006. Proc. of CHR 2006, Third Workshop on Constraint Handling Rules.Google Scholar
- T. Frühwirth. Constraint handling rules. In Constraint Programming: Basics and Trends, LNCS. Springer-Verlag, 1995.Google Scholar
- T. Frühwirth. Parallelizing union-find in Constraint Handling Rules using confluence analysis. In Proc. of ICLP '05, volume 3668 of LNCS, pages 113--127. Springer-Verlag, 2005. Google ScholarDigital Library
- T. Frühwirth. Constraint handling rules: the story so far. In Proc. of PPDP '06, pages 13--14. ACM Press, 2006. Google ScholarDigital Library
- Glasgow haskell compiler home page, http://www.haskell.org/ghc/.Google Scholar
- T. Harris, S. Marlow, S. Peyton Jones, and M. Herlihy. Composable memory transactions. In Proc. of PPoPP '05, pages 48--60. ACM Press, 2005. Google ScholarDigital Library
- S. Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, 2003.Google Scholar
Index Terms
- A concurrent constraint handling rules implementation in Haskell with software transactional memory
Recommendations
Revisiting software transactional memory in Haskell
Haskell '16Software Transactional Memory (STM) has become very popular in Haskell. Currently, there are nearly 500 packages on Haskell’s package archive that directly use STM. Despite the widespread use in real world applications, Haskell’s STM implementation has ...
Revisiting software transactional memory in Haskell
Haskell 2016: Proceedings of the 9th International Symposium on HaskellSoftware Transactional Memory (STM) has become very popular in Haskell. Currently, there are nearly 500 packages on Haskell’s package archive that directly use STM. Despite the widespread use in real world applications, Haskell’s STM implementation has ...
An efficient lock-aware transactional memory implementation
ICOOOLPS '09: Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming SystemsTransactional memory (TM) is an emerging concurrency control mechanism that provides a simple and composable programming model. Unfortunately, transactions violate the semantics of mutual exclusion locks when they execute concurrently. Due to the ...
Comments