TCLP is a type checker for Prolog/CLP(X). TCLP thus aims to introduce
a typing discipline to contraint logic programming. That is, given a
description of the types' universe, and the set of the types of used
function symbols, TCLP will check the coherence of the use of these
function symbols. TCLP take the program plus any type definitions as
input and will output the type of infered predicates plus any errors
w.r.t. the type checking.
Currently TCLP comes with definitions for three
Prolog/CLP(X) dialects: ISO-Prolog, GNU-Prolog (with CLP(FD)
extension) and SICStus Prolog with its libraries (including the
constraint programming libraries CLP(B), CLP(FD), CLP(QR), CHR).
TCLP has been written in SICStus Prolog and comes in three forms: an
online demo (Section 2), a SICStus Prolog
library (Section 4) and a
command line tool (Section 3).
-
Uses three kinds of polymorphism:
-
parametric polymorphism (e.g. list(a))
- subtyping (e.g. list(a) < term)
- overloading (i.e. ad hoc polymorphism,
like - : int × int -> int and - :
a×b -> pair(a,b)
- Is able to infer a heuristic type for predicates
- Default type term or atom for undeclared function symbols
- Possibility to define your own clause syntax (ex :+ instead
of :- in CLP(FD) constraint definitions)