Advertisement

Backward Type Inference Generalises Type Checking

  • Lunjin Lu
  • Andy King
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2477)

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    R. Barbuti and R. Giacobazzi. A bottom-up polymorphic type inference in logic programming. Science of Computer Programming, 19(3):133–181, 1992.CrossRefMathSciNetGoogle Scholar
  2. 2.
    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.Google Scholar
  3. 3.
    M. Codish and V. Lagoon. Type dependencies for logic programs using ACI-unification. Theoretical Computer Science, 238:131–159, 2000.zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    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.zbMATHCrossRefGoogle Scholar
  5. 5.
    A. Cortesi, G. Filé, and W. Winsborough. Optimal groundness analysis using propositional logic. Journal of Logic Programming, 27(2): 137–168, 1996.zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    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.Google Scholar
  7. 7.
    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.Google Scholar
  8. 8.
    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.Google Scholar
  9. 9.
    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.Google Scholar
  10. 10.
    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.Google Scholar
  11. 11.
    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.Google Scholar
  12. 12.
    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.zbMATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    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.Google Scholar
  14. 14.
    T. Kanamori and T. Kawamura. Abstract interpretation based on OLDT resolution. Journal of Logic Programming, 15(1 & 2): 1–30, 1993.zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    A. King and L. Lu. A backward analysis for constraint logic programs. Theory and Practice of Logic Programming, 2(4&5):517–547, 2002.zbMATHCrossRefMathSciNetGoogle Scholar
  16. 16.
    J.W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1987.Google Scholar
  17. 17.
    L. Lu. A polymorphic type analysis in logic programs by abstract interpretation. Journal of Logic Programming, 36(1):1–54, 1998.zbMATHCrossRefMathSciNetGoogle Scholar
  18. 18.
    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.Google Scholar
  19. 19.
    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.CrossRefGoogle Scholar
  20. 20.
    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.Google Scholar
  21. 21.
    D. Pedreschi and S. Ruggieri. Weakest preconditions for pure Prolog programs. Information Processing Letters, 67(3):145–150, 1998.CrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Lunjin Lu
    • 1
  • Andy King
    • 2
  1. 1.Oakland UniversityUSA
  2. 2.University of Kent at CanterburyUK

Personalised recommendations