Skip to main content

TCLP: Overloading, Subtyping and Parametric Polymorphism Made Practical for CLP

  • Conference paper
  • First Online:
Logic Programming (ICLP 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2401))

Included in the following conference series:

Abstract

This communication is a continuation of our previous work on the TCLP type system for constraint logic programming [1]. Here we introduce overloading in TCLP and describe a new implementation of TCLP in the Constraint Handling Rules language CHR. Overloading, that is assigning several types to symbols, e.g. for integer and floating point arithmetic, makes it possible to avoid subtype relations like integer subtype of float, that are not faithful to the behavior of some predicates. We describe a new implementation of TCLP in Prolog and CHR where overloading is resolved by backtracking with the Andorra principle. Experimental results show that the new implementation of TCLP in CHR outperforms the previous implementation in CAML [2] w.r.t. both runtime efficiency, thanks to simplifications by unification of type variables in CHR, and w.r.t. the percentile of exact types inferred by the TCLP type inference algorithm, thanks to overloading. The following figure depicts the TCLP type structure we propose for ISO Prolog. Metaprogramming predicates in ISO prolog basically impose that every object can be decomposed as a term. This is treated in TCLP by subtyping with a type term at the top of the lattice of types.

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

References

  1. F. Fages and E. Coquery. Typing constraint logic programs. Theory and Practice of Logic Programming, 1, November 2001.

    Google Scholar 

  2. F. Pottier. Wallace: an efficient implementation of type inference with subtyping, February 2000. http://pauillac.inria.fr/~fpottier/wallace/ .

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Coquery, E., Fages, F. (2002). TCLP: Overloading, Subtyping and Parametric Polymorphism Made Practical for CLP. In: Stuckey, P.J. (eds) Logic Programming. ICLP 2002. Lecture Notes in Computer Science, vol 2401. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45619-8_42

Download citation

  • DOI: https://doi.org/10.1007/3-540-45619-8_42

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43930-1

  • Online ISBN: 978-3-540-45619-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics