Abstract
In this paper, we give an executable specification of a state-of-the-art polymorphic type checking system with subtypes in Prolog. We show that the implementation reduces to modifying simple well-known meta-interpreters into type meta-interpreters and applying the so-called generate-and-test approach to programming in Prolog. This study emphasizes that Prolog is suitable as a language for defining executable specifications and that Prolog can be augmented with a simple but powerful type system. The type language augmenting Prolog programs with type definitions and type declarations is a subset of Prolog itself. Therefore it is possible to use types explicitly in a program.
Research was partially supported by a grant from the Austrian Fulbright Commission and by a grant from the Austrian Bundeskammer der Gewerblichen Wirtschaft
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Bruynooghe M, Adding Redundancy to Obtain More Reliable and More Readable Prolog Programs, 1st Int Conference on Logic Programming, Marseille France, 1982
Cardelli L, Basic Polymorphic Type Checking, Draft, AT&T Bell Laboratories, Murray Hill New Jersey, ≥ 1984
Cardelli L, Structural Subtyping and the Notion of Power Type, 15th ACM Symposium on Principles of Programming Languages, San Diego California, ACM Press, January 1988
Chen W, Kifer M and Warren D, HiLog: A First-Order Semantics for Higher-Order Logic Programming Constructs, SUNY at Stony Brook, accepted at the North American Conference on Logic Programming, USA, 1989
Cheng M H M, van Emden M H and Strooper P A, Complete Sets of Frontiers in Logic-based Program Transformation, Meta 88 Workshop, Bristol England, July 1988
Dietrich R and Hagl F, A Polymorphic Type System with Subtypes for Prolog, 2nd European Symposium on Programming, Nancy France, 1988
Frühwirth Thom W, Type Inference by Program Transformation and Partial Evaluation, Meta-Programming in Logic Programming, Abramson H and Rogers M H (eds), MIT Press, Cambridge Massachusetts, 1989
Frühwirth Thom W, A Polymorphic Type Checking System for Prolog in HiLog, 6th Israel Conference on Artificial Intelligence and Computer Vision, Ramat Gan Israel, December 1989
Frühwirth Thom W, Types in Logic Programming, Ph.D. Thesis, Technical University Vienna, Computer Science Department E181B, Vienna Austria, March 1990
Hanus M, Horn Clause Programs with Polymorphic Types: Semantics and Resolution, TAPSOFT '89, Lecture Notes in Computer Science 351, Goos G and Hartmanis J (eds), Springer, New York New York, 1989
Jacobs D, A Type System for Algebraic Database Programming Languages, 2nd International Workshop on Database Programming Languages, Gleneden Beach Oregon, June 1989
Kanamori T and Horiuchi K, Polymorphic Type Inference in Prolog by Abstract Interpretation, Logic Programming '87 6th Conf., Lecture Notes in Computer Science 315, Goos G and Hartmanis J (eds), Springer, New York New York, 1987
Lloyd J W, Foundations of Logic Programming, Second, extended Edition, Springer Verlag, Berlin Germany, 1987
Milner R, A Theory of Type Polymorphism in Programming, Journal on Computer and System Sciences Vol 17 No 3, 1978, pp 348–375
Mycroft A and O'Keefe R A, A Polymorphic Type System for Prolog, Artificial Intelligence, Vol 23, No 3, August 1984, pp 295–307
Smolka G, Logic Programming with Polymorphically Order-Sorted Types, Lilog-Report 55, IBM Deutschland GmbH, Germany, October 1988
Sterling L and Shapiro E, The Art of Prolog, MIT Press, Cambridge Massachusetts, 1986
Takeuchi A and Furukawa K, Partial Evaluation of Prolog Programs and its Application to Meta Programming, Information Processing 86, 415–420, North Holland, 1986
van Emden M H, Conditonal Answers for Polymorphic Type Inference, in 5th Int Logic programming Conference and 5th Int Symposium on Logic programming, Kowalski R A and Bowen K A (eds), MIT Press, Cambridge Massachusetts, 1988
Venken R, A Prolog Meta-Interpreter for Partial Evaluation and its Application to Source to Source Transformation and Query-Optimization, in T. O'Shea (ed), Advances in Artificial Intelligence, ECCAI, Elsevier Science Publisher, Holland, 1985
Wegner P and Cardelli L, On Understanding Types, Data Abstraction, and Polymorphism, Computing Surveys, Vol 17, No 4, December 1985
Xu J and Warren D S, A Theory of Types and Type Inference in Logic Programming Languages, Ph.D. Thesis, State University of New York at Stony Brook, Department of Computer Science, Stony Brook New York, July 1989
Yardeni E and Shapiro E, A Type System for Logic Programs, in Concurrent Prolog: Collected papers, Shapiro E (ed), Vol 2, MIT Press, Cambridge Massachusetts, 1987, pp 211–244
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1990 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Frühwirth, T.W. (1990). Polymorphic type checking with subtypes in Prolog. In: Miola, A. (eds) Design and Implementation of Symbolic Computation Systems. DISCO 1990. Lecture Notes in Computer Science, vol 429. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-52531-9_131
Download citation
DOI: https://doi.org/10.1007/3-540-52531-9_131
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-52531-8
Online ISBN: 978-3-540-47014-4
eBook Packages: Springer Book Archive