Skip to main content

Directional Type Inference for Logic Programs

  • Conference paper
  • First Online:
Static Analysis (SAS 1998)

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

Included in the following conference series:

Abstract

We follow the set-based approach to directional types proposed by Aiken and Lakshman [1]. Their type checking algorithm works via set constraint solving and is sound and complete for given discriminative types. We characterize directional types in model-theoretic terms. We present an algorithm for inferring directional types. The directional type that we derive from a logic program P is uniformly at least as precise as any discriminative directional type of P, i.e., any directional type out of the class for which the type checking algorithm of Aiken and Lakshman is sound and complete. We improve their algorithm as well as their lower bound and thereby settle the complexity (Dexptime-complete) of the corresponding problem.

On leave from University of Wrocław, Poland. Partially supported by Polish KBN grant 8T11C02913.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A. Aiken and T. K. Lakshman. Directional type checking of logic programs. In B. L. Charlier, editor, 1st International Symposium on Static Analysis, volume 864 of Lecture Notes in Computer Science, pages 43–60, Namur, Belgium, Sept. 1994. Springer Verlag.

    Google Scholar 

  2. K. R. Apt. Declarative programming in Prolog. In D. Miller, editor, Logic Programming-Proceedings of the 1993 International Symposium, pages 12–35, Vancouver, Canada, 1993. The MIT Press.

    Google Scholar 

  3. K. R. Apt. Program verification and Prolog. In E. Börger, editor, Specification and Validation methods for Programming languages and systems, pages 55–95. Oxford University Press, 1995.

    Google Scholar 

  4. K. R. Apt and S. Etalle. On the unification free Prolog programs. In A. M. Borzyszkowski and S. Sokolowski, editors, Mathematical Foundations of Computer Science 1993, 18th International Symposium, volume 711 of LNCS, pages 1–19, Gdansk, Poland, 30 Aug.–3 Sept. 1993. Springer.

    Google Scholar 

  5. J. Boye. Directional Types in Logic Programming. PhD thesis, Department of Computer and Information Science, Linköping University, 1996.

    Google Scholar 

  6. J. Boye and J. Maluszynski. Two aspects of directional types. In L. Sterling, editor, Proceedings of the 12th International Conference on Logic Programming, pages 747–764, Cambridge, June13–18 1995. MIT Press.

    Google Scholar 

  7. J. Boye and J. Maluszynski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179–220, Dec. 1997.

    Google Scholar 

  8. F. Bronsard, T. K. Lakshman, and U. S. Reddy. A framework of directionality for proving termination of logic programs. In K. Apt, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming, pages 321–335, Washington, USA, 1992. The MIT Press.

    Google Scholar 

  9. M. Bruynooghe, H. Vandecasteele, A. de Waal, and M. Denecker. Detecting unsolvable queries for definite logic programs. In Proceedings of the Symposium on Programming Language Implementation and Logic Programming (PLILP’98), LNCS. Springer-Verlag, 1998. to appear.

    Google Scholar 

  10. W. Charatonik, D. McAllester, D. Niwiński, A. Podelski, and I. Walukiewicz. The Horn mu-calculus. To appear in Vaughan Pratt, editor, Proceedings of the 13th IEEE Annual Symposium on Logic in Computer Science.

    Google Scholar 

  11. W. Charatonik, D. McAllester, and A. Podelski. Computing the least and the greatest model of the set-based abstraction of logic programs. Presented at the Dagstuhl Workshop on Tree Automata, October 1997.

    Google Scholar 

  12. W. Charatonik and L. Pacholski. Negative set constraints with equality. In Ninth Annual IEEE Symposium on Logic in Computer Science, pages 128–136, 1994.

    Google Scholar 

  13. W. Charatonik and A. Podelski. Set constraints for greatest models. Technical Report MPI-I-97-2-004, Max-Planck-Institut für Informatik, April 1997. www.mpi-sb.mpg.de/~podelski/papers/greatest.html.

  14. M. Codish and B. Demoen. Deriving polymorphic type dependencies for logic programs using multiple incarnations of prop. In B. L. Charlier, editor, Proceedings of the First International Static Analysis Symposium, Lecture Notes in Computer Science 864, pages 281–296. Springer Verlag, 1994.

    Google Scholar 

  15. M. Comini, G. Levi, M. C. Meo, and G. Vitiello. Proving properties of logic programs by abstract diagnosis. In M. Dam, editor, Analysis and Verification of Multiple-Agent Languages, volume 1192 of LNCS, pages 22–50. Springer-Verlag, June 1996.

    Google Scholar 

  16. P. Cousot and R. Cousot. Inductive definitions, semantics and abstract interpretation. In Proc. POPL’ 92, pages 83–94. ACM Press, 1992.

    Google Scholar 

  17. P. Cousot and R. Cousot. Formal language, grammar and set-constraint-based program analysis by abstract interpretation. In Record of FPCA’ 95-Conference on Functional Programming and Computer Architecture, pages 170–181, La Jolla, California, USA, 25–28 June 1995. SIGPLAN/SIGARCH/WG2.8, ACM Press, New York, USA.

    Chapter  Google Scholar 

  18. P. Devienne, J.-M. Talbot, and S. Tison. Set-based analysis for logic programming and tree automata. In Proceedings of the Static Analysis Symposium, SAS’97, volume 1302 of LNCS, pages 127–140. Springer-Verlag, 1997.

    Google Scholar 

  19. T. Frühwirth, E. Shapiro, M. Vardi, and E. Yardeni. Logic programs as types for logic programs. In Sixth Annual IEEE Symposium on Logic in Computer Science, pages 300–309, July 1991.

    Google Scholar 

  20. J. Gallagher and D. A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.

    Google Scholar 

  21. J. Gallagher and D. A. de Waal. Fast and precise regular approximations of logic programs. In P. V. Hentenryck, editor, Proceedings of the Eleventh International Conference on Logic Programming, pages 599–613, Santa Margherita Ligure, Italy, 1994. The MIT Press.

    Google Scholar 

  22. F. Gécseg and M. Steinby. Tree Automata. Akademiai Kiado, 1984.

    Google Scholar 

  23. N. Heintze. Practical aspects of set based analysis. In K. Apt, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming, pages 765–779, Washington, USA, 1992. The MIT Press.

    Google Scholar 

  24. N. Heintze and J. Jaffar. A finite presentation theorem for approximating logic programs. In Seventeenth Annual ACM Symposium on Principles of Programming Languages, pages 197–209, January 1990.

    Google Scholar 

  25. N. Heintze and J. Jaffar. Set constraints and set-based analysis. In Proceedings of the Workshop on Principles and Practice of Constraint Programming, LNCS 874, pages 281–298. Springer-Verlag, 1994.

    Google Scholar 

  26. G. Janssens and M. Bruynooghe. Deriving descriptions of possible values of program variables. Journal of Logic Programming, 13(2–3):205–258, 1992.

    Article  MATH  MathSciNet  Google Scholar 

  27. P. Mishra. Towards a theory of types in Prolog. In IEEE International Symposium on Logic Programming, pages 289–298, 1984.

    Google Scholar 

  28. Y. Rouzaud and L. Nguyen-Phuong. Integrating modes and subtypes into a Prolog type-checker. In K. Apt, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming, pages 85–97, Washington, USA, 1992. The MIT Press.

    Google Scholar 

  29. H. Seidl. Haskell overloading is DEXPTIME-complete. Information Processing Letters, 52:57–60, 1994.

    Article  MATH  MathSciNet  Google Scholar 

  30. C. Weidenbach. Spass version 0.49. Journal of Automated Reasoning, 18(2):247–252, 1997.

    Article  Google Scholar 

  31. E. Yardeni and E. Shapiro. A type system for logic programs. In E. Shapiro, editor, Concurrent Prolog, volume 2, chapter 28, pages 211–244. The MIT Press, 1987.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Charatonik, W., Podelski, A. (1998). Directional Type Inference for Logic Programs. In: Levi, G. (eds) Static Analysis. SAS 1998. Lecture Notes in Computer Science, vol 1503. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-49727-7_17

Download citation

  • DOI: https://doi.org/10.1007/3-540-49727-7_17

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-65014-0

  • Online ISBN: 978-3-540-49727-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics