Skip to main content
Log in

Binding-time analysis for both static and dynamic expressions

  • Special Feature
  • Published:
New Generation Computing Aims and scope Submit manuscript

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.

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.

Institutional subscriptions

Similar content being viewed by others

References

  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).

    Chapter  Google Scholar 

  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.

  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.

    Article  Google Scholar 

  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.

    Article  Google Scholar 

  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.

    Article  Google Scholar 

  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.

  7. Danvy, O. and Filinski, A., “Abstracting Control,” inProc. of the 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160, June 1990.

  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.

    Article  Google Scholar 

  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.

  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. 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. 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.

    Article  Google Scholar 

  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.

  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.

    Chapter  Google Scholar 

  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.

    Chapter  Google Scholar 

  16. Jones, N. D., Gomard, C. K. and Sestoft, P.,Partial Evaluation and Automatic Program Generation, Prentice-Hall, New York, 1993.

    MATH  Google Scholar 

  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.

  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.

    Chapter  Google Scholar 

  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.

    Article  Google Scholar 

  20. Tarjan, R.,Data Structures and Network Flow Algorithms, VolumeCMBS 44 ofRegional Conference Series in Applied Mathematics, SIAM, 1983.

Download references

Author information

Authors and Affiliations

Authors

Additional information

Kenichi Asai, Ph.D.: He is a research associate at the Department of Computer Science, Faculty of Science, the University of Tokyo. He obtained his bachelors degree, masters degree, and doctor of Science from the University of Tokyo in 1990, 1992, and 1997, respectively. His research interests are in Programming Languages in general, in Partial Evaluation and Reflection in particular. He is a member of ACM, IPSJ, and JSSST.

About this article

Cite this article

Asai, K. Binding-time analysis for both static and dynamic expressions. NGCO 20, 27–51 (2002). https://doi.org/10.1007/BF03037258

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF03037258

Keywords

Navigation