A Type System for CHR
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.
Keywords
Type System Operational Semantic Type Scheme Type Inference Typing EnvironmentPreview
Unable to display preview. Download preview PDF.
References
- 1.Frühwirth, T.: Theory and practice of constraint handling rules. Journal of Logic Programming, Special Issue on Constraint Logic Programming 37, 95–138 (1998)zbMATHGoogle Scholar
- 2.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)Google Scholar
- 3.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)Google Scholar
- 4.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
- 5.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)CrossRefGoogle Scholar
- 6.Coquery, E.: Typage et programmation en logique avec contraintes. PhD thesis, Université Paris 6 - Pierre et Marie Curie (2004)Google Scholar
- 7.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)Google Scholar
- 8.Coquery, E., Fages, F.: Tclp: overloading, subtyping and parametric polymorphism made practical for constraint logic programming. Technical Report RR-4926, INRIA Rocquencourt (2002)Google Scholar
- 9.Fages, F., Coquery, E.: Typing constraint logic programs. Journal of Theory and Practice of Logic Programming 1, 751–777 (2001)CrossRefzbMATHGoogle Scholar
- 10.Coquery, E.: TCLP (2003), http://contraintes.inria.fr/~coquery/tclp/
- 11.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)CrossRefGoogle Scholar
- 12.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)Google Scholar
- 13.Mycroft, A., O’Keefe, R.: A polymorphic type system for Prolog. Artificial Intelligence 23, 295–307 (1984)CrossRefzbMATHGoogle Scholar
- 14.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)Google Scholar
- 15.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)CrossRefGoogle Scholar
- 16.Pottier, F.: A versatile constraint-based type inference system. Nordic Journal of Computing 7, 312–347 (2000)zbMATHGoogle Scholar
- 17.Frühwirth, T., Schrijvers, T. (CHR web page), http://www.cs.kuleuven.ac.be/~dtai/projects/CHR/
- 18.Haemmerlé, R., Fages, F.: Closures are needed for closed module systems. Technical Report RR-5575, INRIA (2005)Google Scholar