Skip to main content

A Type System for CHR

  • Conference paper
Recent Advances in Constraints (CSCLP 2005)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 3978))

  • 244 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

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)

    MATH  Google 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)

    Chapter  Google 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)

    Article  MATH  Google 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)

    Chapter  Google 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)

    Article  MATH  Google 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)

    Chapter  Google Scholar 

  16. Pottier, F.: A versatile constraint-based type inference system. Nordic Journal of Computing 7, 312–347 (2000)

    MATH  Google 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 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics