Abstract
This paper presents a type inference system for Prolog. The idea is to describe sets of terms for which the predicates may succeed. We calculate ordered sets of terms containing some variables called "type variables" (corresponding to variables appearing in simultaneously heads and bodies of clauses), and we generate inequations (from the bodies of clauses) on these type variables. The inequations are then solved in order to instanciate type variables by their domains, obtained from this resolution. The resolution of inequations is done by unification and strategy resolution simulation, with a particular treatment of recursive calls.
This work was supported by a CNET contract
Preview
Unable to display preview. Download preview PDF.
Bibiography
Apt, K.R. and Van Emden M.H., "Contributions to the Theory of Logic Programming", Journal of ACM, Vol 29 No 3 pp 841–862 1982.
Bruynooghe M., "Abstract Interpretation: Towards the Global Optimization of Prolog Programs", Proceedings 1987 Symposium on Logic Programming August 31–September 1987 San Francisco IEEE Society Press pp 192–204.
Bruynooghe M., "Adding redundancy to obtain more reliable and more readable Prolog Programs", Proc. First Int. Logic Prog. Conf pp 129–133 1982.
Gordon, M.J.C.,Milner,A.J.R.G., Morris,L.,Newey,M.and Wadsworth,C., "A Metalanguage for interactive proof in LCF", in Proc. 5 th ACM Symposium Principles of Programming Language, Tucson AZ, 1978.
Kanamori T. and Horiuchi K., "Type Inference in Prolog and its Applications", ICOT TR 95, December 1984.
Kowalski R.A., "Logic for Problem Solving", Elsevier Science Publishing, 1979 North Holland.
Mellish C.S., "An Automatic Generation of Mode Declaration for Prolog Programs", D.A.I. Research Paper No 163, University of Edinburgh 1981.
Mishra P., "Towards a Theory of Types in Prolog", Proc 1984 Inter. Symp. on Logic Programmig, pp289–298.
Mycroft A. and O'Keefe R.A., "A polymorphic Type System for Prolog", Logic Programming Workshop 1983.
Nilsson J.F., "On the Compilation of a Domain-Based Prolog", Information Processing pp 293–298 1983.
Pereira L.M., Pereira F.C.N. and Warren D.H.D., "User's Guide to DEC system-10 Prolog", Occasional Paper 15, Dept of Artificial Intelligence, Edinburgh 1979.
Tamaki H. and Sato T., "Unfold/Fold Transformation of Logic Programs", Second International Logic Programming Conference, Uppsala 1984.
Van Emden, M.H. and Kowalski, R.A., "The Semantics of Predicate Logic as Programming", Journal of ACM Vol 23 No 4, pp733–742 1976.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1988 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Azzoune, H. (1988). Type inference in Prolog. In: Lusk, E., Overbeek, R. (eds) 9th International Conference on Automated Deduction. CADE 1988. Lecture Notes in Computer Science, vol 310. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0012836
Download citation
DOI: https://doi.org/10.1007/BFb0012836
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-19343-2
Online ISBN: 978-3-540-39216-3
eBook Packages: Springer Book Archive