An Experiment in Type Inference and Verification by Abstract Interpretation

  • Roberta Gori
  • Giorgio Levi
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2294)

Abstract

This paper describes an experiment in the definition of tools for type inference and type verification of ML-like functional languages, using abstract interpretation techniques.We first show that by extending the Damas-Milner type inference algorithm, with a (bounded) fixpoint computation (as suggested by the abstract interpretation view, i.e. by a slight variation of one of the type abstract semantics in [7]), we succeed in getting a better precision and solving some problems of the ML type inference algorithm without resorting to more complex type systems (e.g. polymorphic recursion). We then show how to transform the analyzer into a tool for type verification, using an existing verification method based on abstract interpretation. The resulting type verification method can be exploited to improve the ML type inference algorithm, when the intended type of functions is specified by the programmer.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    F. Bourdoncle. Abstract Debugging of Higher-Order Imperative Languages. In Programming Languages Design and Implementation’ 93, pages 46–55, 1993.Google Scholar
  2. 2.
    F. Bueno, P. Deransart, W. Drabent, G. Ferrand, M. Hermenegildo, J. Maluszynski, and G. Puebla. On the Role of Semantic Approximations in Validation and Diagnosis of Constraint Logic Programs. In M. Kamkar, editor, Proceedings of the AADEBUG’97, pages 155–169, 1997.Google Scholar
  3. 3.
    M. Comini, R. Gori, and G. Levi. How to Transform an Analyzer into a Verifier. In R. Nieuwenhuis and A. Voronkov, editors, Proceedings of the 8th International Conference on Logic for Programming, Artificial Intelligence and Reasoning, volume 2250 of Lecture Notes in Artificial Intelligence. Springer-Verlag, Berlin, 2001.Google Scholar
  4. 4.
    M. Comini, R. Gori, G. Levi, and P. Volpe. Abstract Interpretation based Verification of Logic Programs. In S. Etalle and J.-G. Smaus, editors, Proceedings of the Workshop on Verification of Logic Programs, volume 30 of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, 2000.Google Scholar
  5. 5.
    M. Comini, G. Levi, M. C. Meo, and G. Vitiello. Abstract Diagnosis. Journal of Logic Programming, 39(1–3):43–93, 1999.MATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    G. Cousineau and M. Mauny. The Functional Approach to Programming. Cambridge University Press, 1998.Google Scholar
  7. 7.
    P. Cousot. Types as abstract interpretations. In Conference Record of the 24th ACM Symp. on Principles of Programming Languages, pages 316–331. ACM Press, 1997.Google Scholar
  8. 8.
    P. Cousot and R. Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Proceedings of Fourth ACM Symp. Principles of Programming Languages, pages 238–252, 1977.Google Scholar
  9. 9.
    P. Cousot and R. Cousot. Systematic Design of Program Analysis Frameworks. In Proceedings of Sixth ACM Symp. Principles of Programming Languages, pages 269–282, 1979.Google Scholar
  10. 10.
    P. Cousot and R. Cousot. Abstract Interpretation Frameworks. Journal of Logic and Computation, 2(4):511–549, 1992.MATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    P. Cousot and R. Cousot. Comparing the Galois Connection and Widening/Narrowing Approaches to Abstract Interpretation. In M. Bruynooghe and M. Wirsing, editors, Proceedings of PLILP’92, volume 631 of Lecture Notes in Computer Science, pages 269–295. Springer-Verlag, 1992.Google Scholar
  12. 12.
    P. Cousot and R. Cousot. Inductive Definitions, Semantics and Abstract Interpretation. In Proceedings of Nineteenth Annual ACM Symp. on Principles of Programming Languages, pages 83–94. ACM Press, 1992.Google Scholar
  13. 13.
    L. Damas and R. Milner. Principal type-schemes for functional programs. In Proceedings of the Ninth Annual ACM Symposium on Principles of Programming Languages, pages 207–212. ACM Press, 1982.Google Scholar
  14. 14.
    G. Filè, R. Giacobazzi, and F. Ranzato. A Unifying View on Abstract Domain Design. ACM Computing Surveys, 28(2):333–336, 1996.CrossRefGoogle Scholar
  15. 15.
    J.R. Hindley. The principal type-scheme of an object in combinatory logic. Transaction American mathematical Society, 146:29–60, 1969.MATHCrossRefMathSciNetGoogle Scholar
  16. 16.
    G. Levi and P. Volpe. Derivation of Proof Methods by Abstract Interpretation. In C. Palamidessi, H. Glaser, and K. Meinke, editors, Principles of Declarative Programming. 10th International Symposium, PLILP’98, volume 1490 of Lecture Notes in Computer Science, pages 102–117. Springer-Verlag, 1998.Google Scholar
  17. 17.
    R. Milner. A theory of type polymorphism in programming. Journal of Computer and Systems Sciences, 17-3:348–375, 1978.MATHCrossRefMathSciNetGoogle Scholar
  18. 18.
    B. Monsuez. Polymorphic typing by abstract interpretation. In R. Shyamasundar, editor, Proceedings of Foundation of Software Technology and Theoretical Computer Science, volume 652 of Lecture Notes in Computer Science, pages 217–228. Springer-Verlag, 1992.Google Scholar
  19. 19.
    B. Monsuez. Polymorphic types and widening operators. In P. Cousot, M. Falaschi, G. File', and A. Rauzy, editors, Proceedings of Static Analysis, volume 724 of Lecture Notes in Computer Science, pages 224–281. Springer-Verlag, 1993.Google Scholar
  20. 20.
    A. Mycroft. Polymorphic type schemes and recursive definitions. In G. Goos and J. Hartmanis, editors, Proceedings of the International Symposium on Programming, volume 167 of Lecture Notes in Computer Science, pages 217–228. Springer-Verlag, 1984.Google Scholar
  21. 21.
    D. Park. Fixpoint Induction and Proofs of Program Properties. Machine Intelligence, 5:59–78, 1969.MATHGoogle Scholar
  22. 22.
    D. Rémy and J. Vouillon. Objective ML:An effective object-oriented extension to ML. Theory and Practice of Object-Systems, 4(1):27–50, 1998.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Roberta Gori
    • 1
  • Giorgio Levi
    • 1
  1. 1.Dipartimento di InformaticaUniversità di PisaPisaItaly

Personalised recommendations