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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
F. Fages and E. Coquery. Typing constraint logic programs. Theory and Practice of Logic Programming, 1, November 2001.
F. Pottier. Wallace: an efficient implementation of type inference with subtyping, February 2000. http://pauillac.inria.fr/~fpottier/wallace/ .
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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