Skip to main content
Log in

A Polymorphic Type Dependency Analysis for Logic Programs

  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

An analysis is presented that infers polymorphic type dependencies in logic programs. Using set union as a type constructor and non-deterministic type definitions, the analysis infers more precise information than previous type dependency inference analyses. The analysis is an abstract interpretation based on the S-semantics and derives success patterns for each predicate in the program.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Aiken, A. and Lakshman, T. K., “Directional type checking of logic programs”. in Proc. of the First International Static Analysis Symposium (Le Charlier, B. ed.), Springer-Verlag, pp. 43–60, 1994.

  2. Amato G., Scozzari F.: “On the interaction between sharing and linearity”. Theory and Practice of Logic Programming 10(1), 49–112 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  3. Barbuti R., Giacobazzi R., “A bottom-up polymorphic type inference in logic programming”. Science of Computer Programming, 19(3), 133–181 (1992)

    Article  MathSciNet  Google Scholar 

  4. Bossi, A., Gabbrielli, M., Levi, G. and Martelli, M., “The s-semantics approach: Theory and applications”. Journal of Logic Programming, 19-20, pp. 149–197, 1994.

  5. Boye, J. and Maluszynski, J., “Two aspects of directional types”. in Proc. of the Twelfth International Conference on Logic Programming, The MIT Press, pp. 747–761, 1996.

  6. Bronsard, F., Lakshman, T. K. and Reddy, U. S., “A framework of directionality for proving termination of logic programs”. in Proc. of the Joint International Conference and Symposium on Logic Programming (JICSLP-92) (Apt, K. ed.), The MIT Press, pp. 321–335, 1992.

  7. Bruynooghe, M., Gallagher, J. and Van Humbeeck, W., “Inference of Well-Typings for Logic Programs with Application to Termination Analysis”. in Proc. of the Twelfth International Symposium on Static Analysis, LNCS 3672, Springer, pp. 35–51, 2005.

  8. Charatonik, W. and Podelski, A., “Directional type inference for logic programs”. in Proc. of the Fifth International Symposium on Static Analysis (Levi, G. ed.), LNCS 1503, Springer, pp. 278–294, 1998.

  9. Codish, M. and Demoen, B., “Deriving polymorphic type dependencies for logic programs using multiple incarnations of Prop”. in Proc. of the First International Static Analysis Symposium (Le Charlier, B. ed.), LNCS 864, Springer, pp. 281–297, 1994.

  10. Codish M., Lagoon V.: “Type dependencies for logic programs using ACI-unification”. Theoretical Computer Science 238, 131–159 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  11. Comon, H., Dauchet, M., Gilleron, R., Löding, C., Jacquemard, F., Lugiez, D., Tison, S. and Tommasi, M., “Tree automata techniques and applications”. Available on: http://www.grappa.univ-lille3.fr/tata, 2007.

  12. Cousot, P. and Cousot, R., “Abstract interpretation: a unified framework for static analysis of programs by construction or approximation of fixpoints”. in Principles of Programming Languages, The ACM Press, pp. 238–252, 1977.

  13. Cousot P., Cousot R.: “Abstract interpretation and application to logic programs”. Journal of Logic Programming 13(1, 2, 3 and 4), 103–179 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  14. Dart, P. W. and Zobel, J., “A regular type language for logic programs”. Types in Logic Programming (Pfenning, F. ed.), The MIT Press, pp. 157–189, 1992.

  15. Gallagher, J. P. and Puebla, G., “Abstract interpretation over nondeterministic finite tree automata for set-based analysis of logic programs”. in Proc. of the Fourth International Symposium on Practical Aspects of Declarative Languages, LNCS 2257, Springer, pp. 243–261, 2002.

  16. Gallagher, J. P. and De Waal, D. A., “Fast and precise regular approximations of logic programs”. in Proc. of the Eleventh International Conference on Logic Programming, (Bruynooghe, M. ed.), The MIT Press, pp. 599–613, 1994.

  17. Hermenegildo M., Warren R., Debray S. K.: “Global flow analysis as a practical compilation tool”. Journal of Logic Programming 13(1, 2, 3 and 4), 349–366 (1992)

    Article  Google Scholar 

  18. Hermenegildo, M. V., Bueno, F., Puebla, G. and López, P., “Program analysis, debugging, and optimization using the Ciao system preprocessor”. in Proc. of the 1999 International Conference on Logic Programming, The MIT Press, pp. 52–65, 1999.

  19. Hill P. M., Spoto F.: “Generalising Def and Pos to Type Analysis”. Journal of Logic and Computation 12(3), 497–542 (2002)

    Article  MathSciNet  Google Scholar 

  20. Horiuchi, K. and Kanamori, T., “Polymorphic type inference in Prolog by abstract interpretation”. in Proc. of the Sixth Conference on Logic Programming (Furukawa, K., Tanaka, H. and Fujisaki, T. eds.), LNCS 315, Springer, pp. 195–214, 1988.

  21. Kanamori, T. and Horiuchi, K., “Type inference in Prolog and its application”. in Proc. of the Ninth International Joint Conference on Artificial Intelligence (Joshi, A. K. ed.), Morgan Kaufmann, pp. 704–707, 1985.

  22. Kanamori T., Kawamura T.: “Abstract interpretation based on OLDT resolution”. . Journal of Logic Programming 15(1 & 2), 1–30 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  23. Lloyd, J. W., Foundations of Logic Programming, Springer-Verlag, 1987.

  24. Lu, L., “Type analysis of logic programs in the presence of type definitions”. in Proc. of the 1995 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based program manipulation, The ACM Press, pp. 241–252, 1995.

  25. Lu L.: “A polymorphic type analysis in logic programs by abstract interpretation”. Journal of Logic Programming. 36(1), 1–54 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  26. Lu L.: “Improving precision of type analysis using non-discriminative union Theory and Practice of Logic Programming 8(1), 33–79 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  27. Lu, L. and Greenfield, P., “Logic program testing based on abstract interpretation”. in Formal Methods in Programming and Their Applications, International Conference (Bjørner, D., Broy, M. and Pottosin, I. V. eds.), LNCS 735, Springer-Verlag, pp. 170–180, 1993.

  28. Lu L.: “Checking emptiness of non-deterministic regular types with set operators”. Electr. Notes Theor. Comput. Sci. 212, 191–206 (2008)

    Article  Google Scholar 

  29. Pietrzak P. S., Fernández J. C., Puebla G., Hermenegildo M. V.: “A practical type analysis for verification of modular prolog programs”. in PEPM ’08: Proc. of the 2008 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, pp. 61–70. ACM, New York, NY, USA (2008)

  30. Rychlikowski, P. and Truderung, T., “Polymorphic directional types for logic programming”. in Proc. of the 3rd ACM SIGPLAN international conference on Principles and practice of declarative programming, ACM Press, pp. 61–72, 2001.

  31. Saglam, H. and Gallagher, J., “Approximating constraint logic programs using polymorphic types and regular descriptions”. Technical report cstr 95-017, Department of Computer Science, University of Bristol, 1995.

  32. Yardeni E., Shapiro E.: “A type system for logic programs, ” Journal of Logic Programming. 10(2), 125–153 (1991)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lunjin Lu.

About this article

Cite this article

Lu, L. A Polymorphic Type Dependency Analysis for Logic Programs. New Gener. Comput. 29, 409–444 (2011). https://doi.org/10.1007/s00354-009-0117-5

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00354-009-0117-5

Keywords

Navigation