New Generation Computing

, Volume 20, Issue 1, pp 27–51 | Cite as

Binding-time analysis for both static and dynamic expressions

  • Kenichi Asai
Special Feature

Abstract

This paper presents a specializer and a binding-time analyzer for a functional language where expressions are allowed to be used as both static and dynamic. With both static and dynamic expressions, data structures can be statically accessed while they are residualized at the same time. Previously, such data structures were treated as completely dynamic, which prevented their components from being accessed statically. The technique presented in this paper effectively allows data structures to be lifted which was prohibited in the conventional partial evaluators. The binding-time analysis is formalized as a type system and the solution is obtained by solving constraints generated by the type system. We prove the correctness of the constraint solving algorithm and show that the algorithm runs efficiently in almost linear time.

Keywords

Partial Evaluation Offline Specialization Binding-Time Analysis Type System Functional Languages 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1).
    Asai, K., “Binding-Time Analysis for Both Static and Dynamic Expressions,” inStatic Analysis (LNCS 1694) (Cortesi, A. and Filé, G., eds.), pp. 117–133 (September 1999).CrossRefGoogle Scholar
  2. 2).
    Asai, K., Masuhara, H. and Yonezawa, A., “Partial Evaluation of Call-by-value λ-calculus with Side-effects,”ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM ’97), pp. 12–21, June 1997.Google Scholar
  3. 3).
    Ashley, J. M. and Consel, C., “Fixpoint Computation for Polyvariant Static Analyses of Higher-Order Applicative Programs,”ACM Transactions on Programming Languages and Systems, 16, 5, pp. 1431–1448, September 1994.CrossRefGoogle Scholar
  4. 4).
    Bondorf, A. and Danvy, O., “Automatic Autoprojection of Recursive Equations with Global Variables and Abstract Data Types,”Science of Computer Programming, 16, pp. 151–195, Elsevier, 1991.CrossRefGoogle Scholar
  5. 5).
    Bondorf, A., and Jørgensen, J., “Efficient Analyses for Realistic Off-line Partial Evaluation,”Journal of Functional Programming, 3, 3, pp. 315–346, Cambridge University Press, July 1993.CrossRefGoogle Scholar
  6. 6).
    Danvy, O., “Type-Directed Partial Evaluation,”Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages, pp. 242–257, January 1996.Google Scholar
  7. 7).
    Danvy, O. and Filinski, A., “Abstracting Control,” inProc. of the 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160, June 1990.Google Scholar
  8. 8).
    Danvy, O., Malmkjær, K. and Palsberg, J., “The Essence of Eta-expansion in Partial Evaluation,”Lisp and Symbolic Computation, 8, 3, pp. 209–227, Kluwer Academic Publishers, 1995.CrossRefGoogle Scholar
  9. 9).
    Dean, J., Chambers, C. and Grove, D., “Identifying Profitable Specialization in Object-Oriented Languages,”ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM ’94), pp. 85–96, June 1994.Google Scholar
  10. 10).
    Fujinami, N., “Determination of Dynamic Method Dispatches Using Run-time Code Generation,”Proceedings of the Second International Workshop on Types in Compilation (TIC 1998), pp. 135–151, March 1998.Google Scholar
  11. 11).
    Futamura, Y., “Partial Evaluation of Computation Process — an Approach to a Compiler-compiler,”Systems, Computers, Controls, 2, 5, pp. 45–50, 1971, reprinted asHigher-Order and Symbolic Computation, 12, 4, pp. 381–391, Kluwer Academic Publishers, December 1999.Google Scholar
  12. 12).
    Glück, R. and Jørgensen, J., “An Automatic Program Generator for Multi-Level Specialization,”Lisp and Symbolic Computation, 10, 2, pp. 113–158, Kluwer Academic Publishers, July 1997.CrossRefGoogle Scholar
  13. 13).
    Hatcliff, J., “An Introduction to Online and Offline Partial Evaluation Using a Simple Flowchart Language,” inPartial Evaluation, Practice and Theory (LNCS 1706) (J. Hatcliff, T. Æ. Mogensen, and P. Thiemann eds.), pp. 20–82, 1999.Google Scholar
  14. 14).
    Henglein, F., “Efficient Type Inference for Higher-Order Binding-Time Analysis,” inFunctional Programming Languages and Computer Architecture (LNCS 523) (J. Hughes, ed.), pp. 448–472, August 1991.CrossRefGoogle Scholar
  15. 15).
    Hornof, L., Consel, C. and Noyé, J., “Effective Specialization of Realistic Programs via Use Sensitivity,” inStatic Analysis (LNCS 1302) (van Hentenryck P., ed.), pp. 63–73, 1997.CrossRefGoogle Scholar
  16. 16).
    Jones, N. D., Gomard, C. K. and Sestoft, P.,Partial Evaluation and Automatic Program Generation, Prentice-Hall, New York, 1993.MATHGoogle Scholar
  17. 17).
    Ruf, E.,Topics in Online Partial Evaluation, Ph.D. thesis, Stanford University, March 1993. Also published as Stanford Computer Systems Laboratory technical report CSL-TR-93-563.Google Scholar
  18. 18).
    Sperber, M., “Self-applicable Online Partial Evaluation,” inPartial Evaluation (LNCS 1110) (O. Danvy, R. Glück, and P. Thiemann eds.), pp. 465–480, February 1996.CrossRefGoogle Scholar
  19. 19).
    Sperber, M. and Thiemann, P., “TwO For The Price of One: Composing Partial Evaluation and Compilation,” inProc. of the ACM SIGPLAN ’97 Conference on Programming Language Design and Implementation (PLDI), SIGPLAN Notices,32, 5, pp. 215–225, June 1997.CrossRefGoogle Scholar
  20. 20).
    Tarjan, R.,Data Structures and Network Flow Algorithms, VolumeCMBS 44 ofRegional Conference Series in Applied Mathematics, SIAM, 1983.Google Scholar

Copyright information

© Ohmsha, Ltd. and Springer 2002

Authors and Affiliations

  • Kenichi Asai
    • 1
    • 2
  1. 1.Department of Information Science, Faculty of ScienceThe University of TokyoJapan
  2. 2.Information and Human ActivityPRESTO, JSTJapan

Personalised recommendations