Skip to main content

Static type analysis of prolog procedures for ensuring correctness

  • Static Analysis
  • Conference paper
  • First Online:
Programming Language Implementation and Logic Programming (PLILP 1990)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 456))

Abstract

A method for deducing type properties at each execution point of a Prolog procedure is proposed. Such properties allow to detect at compile-time inconsistent calls, i.e. whose arguments don't respect some type preconditions.

Our method differs from most usual abstract interpretation frameworks, which are more code optimization-oriented. First, the procedure is analysed without the code of its subprocedures. Instead, formal specifications in form of pre-post conditions are associated to each subprocedures.

Another difference concerns the way types (collection of terms) are handled by our Analyser. There is no fixed type system. Any type can be freely defined by means of a fixed set of primitive operations. The main operations of the Analyser are completely defined upon these primitives.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

9. References

  1. A. Bansal, L. Sterling, An abstract interpretation scheme for logic programs based on type expression. In Proc. Int. Conf. on Fifth Generation Computer Systems, Tokyo 1988, pp. 422–429.

    Google Scholar 

  2. M. Bruynooghe, A framework for the Abstract Interpretation of Logic Programs. Technical Report CW62, Department of Computer Science, Katholieke Universiteit Leuven, October 1987.

    Google Scholar 

  3. M. Bruynooghe, Adding Redundancy to Obtain More Reliable and More Readable Prolog Programs. In Proc. 1st Int. Logic Programming Conf., Marseille, pp. 129–133.

    Google Scholar 

  4. M. Bruynooghe, A. Mulkers, K.Musumbu, Compile-time garbage collection for Prolog. Draft, Department of Computer Science, Katholieke Universiteit Leuven, April 1988.

    Google Scholar 

  5. S.K. Debray, D.S. Warren, Automatic mode inferencing for Prolog programs. Proc. 1986 Logic Programming Symposium, Salt Lake City, Sept. 86, IEEE Society Press, 1986, pp. 78–88.

    Google Scholar 

  6. P. De Boeck, Static Type Analysis of Prolog Procedures for Ensuring Correctness. Technical Report (first version), Institut d'Informatique, Namur, March 1990.

    Google Scholar 

  7. Y. Deville, Logic Programming: Systematic Program Development. Addison-Wesley, 1990.

    Google Scholar 

  8. G. Janssens, Deriving run time properties of logic programs by means of abstract interpretation. Ph.D. Thesis, Department of Computer Science, Katholieke Universiteit Leuven, March 1990.

    Google Scholar 

  9. N.D. Jones, H. Sondergaard, A Semantics Based Framework for the Abstract Interpretation of Prolog. In Abstract Interpretation of Declarative Languages, eds. S. Abramsky and C. Hankin, Ellis Horwood.

    Google Scholar 

  10. T. Kanomori, K. Horiuchi, Type inference in Prolog and its application. Proc. IJCAI 85, Aug. 85, pp. 704–707.

    Google Scholar 

  11. F. Kluzniak, Type Synthesis for Ground Prolog. In Proc. 4th Int. Conf. Logic Programming, Melbourne, may 1987.

    Google Scholar 

  12. C.S. Mellish, Abstract interpretation of Prolog programs. In Proc. Third Int. Conf. Logic Programming, London, July 86, LNCS 225, Springer Verlag 1986, pp. 463–474.

    Google Scholar 

  13. C.S. Mellish, Some global optimisations for a Prolog compiler. J. Logic Programming, Vol. 2(1), 1985, pp. 43–66.

    Google Scholar 

  14. P. Mishra, Towards a theory of types in Prolog. Proc. 1984 Symposium on Logic Programming, Atlanta City, IEEE Society Press 1984, pp. 289–298.

    Google Scholar 

  15. K. Musumbu, Interpretation Abstraite de Programmes Prolog. Ph.D. Thesis, Department of Computer Science, Institut d'Informatique, Namur, April 1990.

    Google Scholar 

  16. Z. Somogyi, A system of precise modes for logic programs. In Proc. 4th Int. Conf. on Logic Programming, Melbourne 1987.

    Google Scholar 

  17. K.L. Clark, Negation as failure. In Logic and Data Bases, eds. H. Gallaire and J. Minker, Plenum Press, N.Y. 1984.

    Google Scholar 

  18. A. Mycroft, R.A. O'Keefe, A polymorphic type system for Prolog. In Artificial Intelligence, Vol.23, 1984, pp. 295–307.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Pierre Deransart Jan Maluszyński

Rights and permissions

Reprints and permissions

Copyright information

© 1990 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

De Boeck, P., Charlier, B.L. (1990). Static type analysis of prolog procedures for ensuring correctness. In: Deransart, P., Maluszyński, J. (eds) Programming Language Implementation and Logic Programming. PLILP 1990. Lecture Notes in Computer Science, vol 456. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0024187

Download citation

  • DOI: https://doi.org/10.1007/BFb0024187

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-53010-7

  • Online ISBN: 978-3-540-46298-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics