Abstract
Typed Prolog and λProlog are logic programming languages with a strict typing discipline which is based on simple types with variables. Experiments show that this discipline does not handle properly common logic programming practices used in Prolog. For instance, the usual transformation for computing the Clark completion of a Prolog program does not work well with some typed programs. We observe that the so-called head-condition is at the heart of these problems, and conclude that it should be enforced. We propose a second-order scheme which is compatible with usual practices. It allows quantifying types and terms, passing type and term parameters to goals and terms, and to express type guards for selecting goals. We give its syntax and deduction rules, and propose a solution to keep the concrete notation of programs close to the usual one.
Preview
Unable to display preview. Download preview PDF.
References
H. Barendregt and K. Hemerik. Types in lambda calculi and programming languages. In N. Jones, editor, European Symp. on Programming, LNCS 432, pages 1–35, Springer-Verlag, 1990.
P. Brisset and O. Ridoux. The architecture of an implementation of AProlog: Prolog/Mali. In Workshop on λProlog, Philadelphia, PA, USA, 1992. ftp://ftp.irisa.fr/local/lande.
K.L. Clark. Negation as failure. In H. Gallaire and J. Minker, editors, Logic and Data Bases, pages 293–322, Plenum Press, New-York, USA, 1978.
C.M. Elliott. Higher-order unification with dependent function types. In N. Derschowitz, editor, 3rd Int. Conf. Rewriting Techniques and Applications, LNCS 355, pages 121–136, Springer-Verlag, 1989.
C.M. Elliott and F. Pfenning. A semi-functional implementation of a higher-order logic programming language. In P. Lee, editor, Topics in Advanced Language Implementation, pages 289–325, MIT Press, 1991.
J.-Y. Girard. Interprétation fonctionelle et élimination des coupures dans l'arithmétique d'ordre supérieur. Thèse de doctorat d'état, Université de Paris VII, 1972.
M. Hanus. Horn clause programs with polymorphic types: semantics and resolution. In TAPSOFT'89, LNCS 352, pages 225–240, Springer-Verlag, 1989.
M. Hanus. Polymorphic higher-order programming in Prolog. In G. Levi and M. Martelli, editors, 6th Int. Conf. Logic Programming, pages 382–397, MIT Press, 1989.
P.M. Hill and J.W. Lloyd. The Gödel Programming Language. MIT Press, 1994.
P.M. Hill and R.W. Topor. A semantics for typed logic programs. In F. Pfenning, editor, Types in Logic Programming, pages 1–62, MIT Press, 1992.
J. Reynolds. Towards a theory of type structure. In Colloque sur la Programmation, LNCS 19, pages 408–425, Springer-Verlag, 1974.
T.K. Lakshman and U.S. Reddy. Typed Prolog: a semantic reconstruction of the Mycroft-O'Keefe type system. In Int. Logic Programming Symp., pages 202–217, 1991.
D.A. Miller. A logical analysis of modules in logic programming. J. Logic Programming, 6(1–2):79–108, 1989.
D.A. Miller and G. Nadathur. Higher-order logic programming. In E. Shapiro, editor, 3rd Int. Conf. Logic Programming, LNCS 225, pages 448–462, Springer-Verlag, 1986.
D.A. Miller, G. Nadathur, F. Pfenning, and A. Scedrov. Uniform proofs as a foundation for logic programming. Annals of Pure and Applied Logic, 51:125–157, 1991.
R. Milner. A theory of type polymorphism in programming. J. Computer and System Sciences, 17:348–375, 1978.
A. Mycroft and R.A. O'Keefe. A polymorphic type system for Prolog. Artificial Intelligence, 23:295–307, 1984.
G. Nadathur. A Higher-Order Logic as the Basis for Logic Programming. Ph.D. Thesis, University of Pennsylvania, 1987.
G. Nadathur and F. Pfenning. The type system of a higher-order logic programming language. In F. Pfenning, editor, Types in Logic Programming, pages 245–283, MIT Press, 1992.
F. Pfenning. Partial polymorphic type inference and higher-order unification. In ACM Conf. LISP and Functional Programming, pages 153–163, ACM Press, 1988.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Louvet, P., Ridoux, O. (1996). Parametric polymorphism for typed Prolog and λProlog. In: Kuchen, H., Doaitse Swierstra, S. (eds) Programming Languages: Implementations, Logics, and Programs. PLILP 1996. Lecture Notes in Computer Science, vol 1140. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61756-6_76
Download citation
DOI: https://doi.org/10.1007/3-540-61756-6_76
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61756-3
Online ISBN: 978-3-540-70654-0
eBook Packages: Springer Book Archive