Skip to main content

Deletion of Redundant Unary Type Predicates from Logic Programs

  • Chapter

Part of the book series: Workshops in Computing ((WORKSHOPS COMP.))

Abstract

In this paper, program transformation is proposed as a way of handling type information efficiently. A typed program is translated to an untyped program, with regular unary predicates replacing the types, and then an attempt is made to eliminate as many of the unary type literals as possible. The method is as follows: first a query-answer transformation of the program with a given goal is made. This gives a specification of the calls to each literal in the program arising in the computation of the goal. The set of calls defines the context of the literal in the computation. Any literal can be eliminated if its answers are implied by its context. We define a procedure for eliminating literals defined by regular programs, a class which includes the type literals. A regular approximation of the query-answer program is made, and then decidable properties of regular programs are used to check for the elimination of the literal. The method can be compared with type-checking, since the elimination procedure also shows whether some type literal fails, indicating a “badly-typed” clause. Our aim however is not to construct a type system, but rather to show that simple types can be handled using a general framework of program analysis and transformation.

Work supported by ESPRIT Project PRINCE (P5246)

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A.V. Aho, J.E. Hoperoft, and J.D. Ullman. The Design and Analysis of Computer Algorithms. Addison-Wesley, 1974.

    Google Scholar 

  2. M. Codish. Abstract Interpretation of Sequential and Concurrent Logic Programs. PhD thesis, The Weizmann Institute of Science, 1991.

    Google Scholar 

  3. P.W. Dart and J. Zobel. Transforming typed logic programs into well-typed logic programs. Technical Report 88/11, University of Melbourne, May 1988.

    Google Scholar 

  4. S. Debray and R. Ramakrishnan. Canonical computations of logic programs. Technical Report, University of Arizona-Tucson, July 1990.

    Google Scholar 

  5. D.A. de Waal and J. Gallagher. Regular Approximations Applied to the Specialisation of a Proof Procedure. Technical Report CSTR-92-19, University of Bristol, May 1992.

    Google Scholar 

  6. H.B. Enderton. A Mathematical Introduction to Logic. Academic Press, New York, 1972.

    MATH  Google Scholar 

  7. T. Frühwirth. Type inference by program transformation and partial evaluation. In H. Abramson and M.H. Rogers, editors, Meta-Programming in Logic Programming, 1988.

    Google Scholar 

  8. J. Gallagher. A System for Specialising Logic programs. Technical Report TR-91-32, University of Bristol, November 1991.

    Google Scholar 

  9. J. Gallagher and D.A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, University of Bristol, March 1992.

    Google Scholar 

  10. P.M. Hill and J.W. Lloyd. The Gödel report. Technical Report TR-91-02, University of Bristol, March 1991. (preliminary version).

    Google Scholar 

  11. N. Jones. Flow analysis of lazy higher order functional programs. In S. Abramsky and C. Hankin, editors, Abstract Interpretation of Declarative Languages, Ellis-Horwood, 1987.

    Google Scholar 

  12. T. Kanamori. Abstract interpretation based on Alexander templates. Technical Report TR-549, ICOT, March 1990.

    Google Scholar 

  13. T. Kanamori and H. Seki. Verification of Prolog programs using an extension of execution. In E. Shapiro, editor, Lecture Note in Computer Science, 225, pages 475-489, Springer-Verlag, 1986.

    Google Scholar 

  14. J.W. Lloyd. Foundations of Logic Programming: 2nd Edition. Springer-Verlag, 1987.

    Google Scholar 

  15. J.W. Lloyd and J.C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11 (3and4): 217 - 242, 1991.

    MathSciNet  MATH  Google Scholar 

  16. C.S. Mellish. Using specialisation to reconstruct two mode inference systems. Technical Report, University of Edinburgh, March 1990.

    Google Scholar 

  17. P. Mishra. Towards a theory of types in prolog. In Proceedings of the IEEE International Symposium on Logic Programming, 1984.

    Google Scholar 

  18. A. Mycroft. A polymorphic type system. Artificial Intelligence, 23: 295307, 1984.

    Google Scholar 

  19. L. Naish. Types and the Intended Meaning of Logic Programs. Technical. Report, University of Melbourne, 1990.

    Google Scholar 

  20. D. Sahlin. An Automatic Partial Evaluator for Full Prolog. PhD thesis, The Royal Institute of Technology, 1991.

    Google Scholar 

  21. E. Yardeni and E. Shapiro. A type system for logic programs. Journal of Logic Programming, 10 (2): 348 - 375, 1991.

    Article  MathSciNet  Google Scholar 

  22. Zobel. Analysis of Logic Programs. PhD thesis, Technical Report 47, University of Melbourne, September 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1993 Springer-Verlag London

About this chapter

Cite this chapter

Gallagher, J., de Waal, D.A. (1993). Deletion of Redundant Unary Type Predicates from Logic Programs. In: Lau, KK., Clement, T.P. (eds) Logic Program Synthesis and Transformation. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3560-9_11

Download citation

  • DOI: https://doi.org/10.1007/978-1-4471-3560-9_11

  • Publisher Name: Springer, London

  • Print ISBN: 978-3-540-19806-2

  • Online ISBN: 978-1-4471-3560-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics