Abstract
We propose a generic type system for the Constraint Handling Rules (CHR), a rewriting rule language for implementing constraint solvers. CHR being a high-level extension of a host language, such as Prolog or Java, this type system is parameterized by the type system of the host language. We show the consistency of the type system for CHR w.r.t. its operational semantics. We also study the case when the host language is a constraint logic programming language, typed with the prescriptive type system we developed in previous work. In particular, we show the consistency of the resulting type system w.r.t. the extended execution model CLP+CHR. This system is implemented through an extension of our type checker TCLP for constraint logic languages. We report on experimental results about the type-checking of twelve CHR solvers and programs, including TCLP itself.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Frühwirth, T.: Theory and practice of constraint handling rules. Journal of Logic Programming, Special Issue on Constraint Logic Programming 37, 95–138 (1998)
Holzbaur, C., Frühwirth, T.: A Prolog Constraint Handling Rules compiler and runtime system. Special Issue Journal of Applied Artificial Intelligence on Constraint Handling Rules 14 (2000)
Abdennadher, S., Krämer, E., Saft, M., Schmauss, M.: JACK: A Java Constraint Kit. In: Electronic Notes in Theoretical Computer Science, vol. 64, Elsevier, Amsterdam (2000)
Chin, W.N., Sulzmann, M., Wang, M.: A type-safe embedding of constraint handling rules into Haskell. Technical report, National University of Singapore (2003), http://www.comp.nus.edu.sg/~sulzmann/chr/hchr/hchr-tr.ps
Coquery, E., Fages, F.: Subtyping constraints in quasi-lattices. In: Pandya, P.K., Radhakrishnan, J. (eds.) FSTTCS 2003. LNCS, vol. 2914, pp. 136–148. Springer, Heidelberg (2003)
Coquery, E.: Typage et programmation en logique avec contraintes. PhD thesis, Université Paris 6 - Pierre et Marie Curie (2004)
Stuckey, P.J., Sulzmann, M.: A theory of overloading. In: Peyton-Jones, S. (ed.) Proceedings of the International Conference on Functional Programming, pp. 167–178. ACM Press, New York (2002)
Coquery, E., Fages, F.: Tclp: overloading, subtyping and parametric polymorphism made practical for constraint logic programming. Technical Report RR-4926, INRIA Rocquencourt (2002)
Fages, F., Coquery, E.: Typing constraint logic programs. Journal of Theory and Practice of Logic Programming 1, 751–777 (2001)
Coquery, E.: TCLP (2003), http://contraintes.inria.fr/~coquery/tclp/
Abdennadher, S.: Operational semantics and confluence of constraint propagation rules. In: Smolka, G. (ed.) CP 1997. LNCS, vol. 1330, pp. 252–266. Springer, Heidelberg (1997)
Jaffar, J., Lassez, J.L.: Constraint logic programming. In: Proceedings of the 14th ACM Symposium on Principles of Programming Languages, Munich, Germany, pp. 111–119. ACM Press, New York (1987)
Mycroft, A., O’Keefe, R.: A polymorphic type system for Prolog. Artificial Intelligence 23, 295–307 (1984)
Lakshman, T., Reddy, U.: Typed Prolog: A semantic reconstruction of the Mycroft-O’Keefe type system. In: Saraswat, V., Ueda, K. (eds.) Proceedings of the 1991 International Symposium on Logic Programming, pp. 202–217. MIT Press, Cambridge (1991)
Smaus, J.-G., Fages, F., Deransart, P.: Using modes to ensure subject reduction for typed logic programs with subtyping. In: Kapoor, S., Prasad, S. (eds.) FST TCS 2000. LNCS, vol. 1974, pp. 214–226. Springer, Heidelberg (2000)
Pottier, F.: A versatile constraint-based type inference system. Nordic Journal of Computing 7, 312–347 (2000)
Frühwirth, T., Schrijvers, T. (CHR web page), http://www.cs.kuleuven.ac.be/~dtai/projects/CHR/
Haemmerlé, R., Fages, F.: Closures are needed for closed module systems. Technical Report RR-5575, INRIA (2005)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Coquery, E., Fages, F. (2006). A Type System for CHR. In: Hnich, B., Carlsson, M., Fages, F., Rossi, F. (eds) Recent Advances in Constraints. CSCLP 2005. Lecture Notes in Computer Science(), vol 3978. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11754602_8
Download citation
DOI: https://doi.org/10.1007/11754602_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-34215-1
Online ISBN: 978-3-540-34216-8
eBook Packages: Computer ScienceComputer Science (R0)