Type inference in Prolog
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.
Key wordsProlog Type Type Inference
Unable to display preview. Download preview PDF.
- 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.Google Scholar
- Bruynooghe M., "Adding redundancy to obtain more reliable and more readable Prolog Programs", Proc. First Int. Logic Prog. Conf pp 129–133 1982.Google Scholar
- 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.Google Scholar
- Kanamori T. and Horiuchi K., "Type Inference in Prolog and its Applications", ICOT TR 95, December 1984.Google Scholar
- Kowalski R.A., "Logic for Problem Solving", Elsevier Science Publishing, 1979 North Holland.Google Scholar
- Mellish C.S., "An Automatic Generation of Mode Declaration for Prolog Programs", D.A.I. Research Paper No 163, University of Edinburgh 1981.Google Scholar
- Mishra P., "Towards a Theory of Types in Prolog", Proc 1984 Inter. Symp. on Logic Programmig, pp289–298.Google Scholar
- Mycroft A. and O'Keefe R.A., "A polymorphic Type System for Prolog", Logic Programming Workshop 1983.Google Scholar
- Nilsson J.F., "On the Compilation of a Domain-Based Prolog", Information Processing pp 293–298 1983.Google Scholar
- 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.Google Scholar
- Tamaki H. and Sato T., "Unfold/Fold Transformation of Logic Programs", Second International Logic Programming Conference, Uppsala 1984.Google Scholar