Abstract
This paper presents a backward type analysis for logic programs. Given type signatures for a collection of selected predicates such as builtin or library predicates, the analysis infers type signatures for other predicates such that the execution of any query satisfying the inferred type signatures will not violate the type signatures for the selected predicates. Thus, the backward type analysis generalises type checking in which the programmer manually specifies type signatures for all predicates that are checked for consistency by a type checker.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
R. Barbuti and R. Giacobazzi. A bottom-up polymorphic type inference in logic programming. Science of Computer Programming, 19(3):133–181, 1992.
M. Codish and B. Demoen. Deriving polymorphic type dependencies for logic programs using multiple incarnations of Prop. In Proceedings of International Static Analysis Symposium, pages 281–297. Springer-Verlag, 1994.
M. Codish and V. Lagoon. Type dependencies for logic programs using ACI-unification. Theoretical Computer Science, 238:131–159, 2000.
A. Cortesi, B. Le Charlier, and P. Van Hentenryck. Type analysis of Prolog using type graphs. Journal of Logic Programming, 22(3):179–208, 1995.
A. Cortesi, G. Filé, and W. Winsborough. Optimal groundness analysis using propositional logic. Journal of Logic Programming, 27(2): 137–168, 1996.
P. Cousot and R. Cousot. Abstract interpretation: a unified framework for static analysis of programs by construction or approximation of fixpoints. In Proceedings of Principles of Programming Languages, pages 238–252. The ACM Press, 1977.
P.W. Dart and J. Zobel. A regular type language for logic programs. In F. Pfenning, editor, Types in Logic Programming, pages 157–189. The MIT Press, 1992.
J.P. Gallagher and D.A. de Waal. Fast and precise regular approximations of logic programs. In Proceedings of International Conference on Logic Programming, pages 599–613. The MIT Press, 1994.
N. Heintze and J. Jaffar. A finite presentation theorem for approximating logic programs. In Proceedings of Principles of Programming Languages, pages 197–209. The ACM Press, 1990.
N. Heintze and J. Jaffar. Semantic types for logic programs. In F. Pfenning, editor, Types in Logic Programming, pages 141–155. The MIT Press, 1992.
K. Horiuchi and T. Kanamori. Polymorphic type inference in Prolog by abstract interpretation. In Proceedings of Conference on Logic Programming, pages 195–214. Springer, 1988.
G. Janssens and M. Bruynooghe. Deriving descriptions of possible values of program variables by means of abstract interpretation. Journal of Logic Programming, 13(1–4):205–258, 1992.
T. Kanamori and K. Horiuchi. Type inference in Prolog and its application. In Proceedings of International Joint Conference on Artificial Intelligence, pages 704–707. Morgan Kaufmann, 1985.
T. Kanamori and T. Kawamura. Abstract interpretation based on OLDT resolution. Journal of Logic Programming, 15(1 & 2): 1–30, 1993.
A. King and L. Lu. A backward analysis for constraint logic programs. Theory and Practice of Logic Programming, 2(4&5):517–547, 2002.
J.W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1987.
L. Lu. A polymorphic type analysis in logic programs by abstract interpretation. Journal of Logic Programming, 36(1):1–54, 1998.
L. Lu. A precise type analysis of logic programs. In Proceedings of International Conference on Principles and Practice of Declarative Programming, pages 214–225. The ACM Press, 2000.
K. Marriott and H. Søndergaard. Precise and efficient groundness analysis for logic programs. ACM Letters on Programming Languages and Systems, 2(1–4): 181–196, 1993.
P. Mishra. Towards a theory of types in Prolog. In Proceedings of the IEEE International Symposium on Logic Programming, pages 289–298. The IEEE Computer Society Press, 1984.
D. Pedreschi and S. Ruggieri. Weakest preconditions for pure Prolog programs. Information Processing Letters, 67(3):145–150, 1998.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Lu, L., King, A. (2002). Backward Type Inference Generalises Type Checking. In: Hermenegildo, M.V., Puebla, G. (eds) Static Analysis. SAS 2002. Lecture Notes in Computer Science, vol 2477. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45789-5_9
Download citation
DOI: https://doi.org/10.1007/3-540-45789-5_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-44235-6
Online ISBN: 978-3-540-45789-3
eBook Packages: Springer Book Archive