Advertisement

Type Systems for Useless-Variable Elimination

  • Adam Fischbach
  • John Hannan
Conference paper
  • 144 Downloads
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2053)

Abstract

We present a type-based specification for useless-variable elimination for a higher-order, call-by-value functional language. Utilizing a weak form of dependent types, we introduce a mechanism for eliminating at runtime useless code that is not detectable statically. We prove the specifications sound and safe with respect to an operational semantics, ensuring that eliminated expressions contributed no observable behavior to the original program. We define an algorithm that implements useless-variable elimination without dependent types, and we prove this algorithm correct with respect to the specification.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    Beradi, S., Coppo, M., Damiani, F., and Giannini, P. Type-based useless-code elimination for functional programs. In Semantics, Applications, and Implementation of Program Generation (September 2000), W. Taha, Ed., no. 1924 in Lecture Notes in Computer Science, Springer-Verlag.Google Scholar
  2. [2]
    Damiani, F. Conjunctive types and useless-code elimination. In ICALP Workshops (2000), vol. 8 of Proceedings in Informatics, Carleton-Scientific, pp. 271–285.Google Scholar
  3. [3]
    Damiani, F., and Giannini, P. Automatic useless-code elimination for HOT functional languages. Journal of Functional Programming (2000). (to appear).Google Scholar
  4. [4]
    Fischbach, A., and Hannan, J. Type systems for useless-variable elimination. Tech. Rept. CSE-01-002. Penn State University.Google Scholar
  5. [5]
    Hannan, J., and Hicks, P. Higher-order arity raising. In Proceedings of the Third International Conference on Functional Programming (September 1998), P. Hudak and C. Queinnec, Eds., ACM SIGPLAN, pp. 27–38.Google Scholar
  6. [6]
    Hannan, J., and Hicks, P. Higher-order unCurrying. In Proceedings of the 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (January 1998), pp. 1–11.Google Scholar
  7. [7]
    Kobayashi, N. Type-based useless-variable elimination. In Proceedings of the 2000 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (2000), pp. 84–93.Google Scholar
  8. [8]
    Shivers, O. Control-Flow Analysis of Higher-Order Languages. PhD thesis, Carnegie-Mellon University, May 1991.Google Scholar
  9. [9]
    Wand, M., and Siveroni, I. Constraint systems for useless variable elimination. In Conf. Rec. 26th ACM Symposium on Principles of Programming Languages (1999).Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Adam Fischbach
    • 1
  • John Hannan
    • 1
  1. 1.Department of Computer Science and EngineeringThe Pennsylvania State UniversityUniversity ParkUSA

Personalised recommendations