Binding-Time Analysis for Both Static and Dynamic Expressions

  • Kenichi Asai
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1694)


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, we can statically access data structures while residualizing them at the same time. Previously, such data structures were treated as completely dynamic, which prevented us from accessing their components statically. The technique presented in this paper effectively allows us to lift data structures 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.


Partial Evaluation Dynamic Expression Typing Rule Program Text Static Abstraction 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Asai, K., H. Masuhara, and A. Yonezawa “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
  2. 2.
    Ashley, J. M., and C. Consel “Fixpoint Computation for Polyvariant Static Analyses of Higher-Order Applicative Programs,” ACM Transactions on Programming Languages and Systems, Vol. 16,No. 5, pp. 1431–1448 (September 1994).CrossRefGoogle Scholar
  3. 3.
    Bondorf, A., and O. Danvy “Automatic autoprojection of recursive equations with global variables and abstract data types,” Science of Computer Programming, Vol. 16, pp. 151–195, Elsevier (1991).zbMATHCrossRefGoogle Scholar
  4. 4.
    Bondorf, A., and J. Jørgensen “Efficient analyses for realistic off-line partial evaluation,” Journal of Functional Programming, Vol. 3,No 3, pp. 315–346, Cambridge University Press (July 1993).CrossRefGoogle Scholar
  5. 5.
    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
  6. 6.
    Danvy, O., and A. Filinski “Abstracting Control,” Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160 (June 1990).Google Scholar
  7. 7.
    Danvy, O., K. Malmkjær, and J. Palsberg “The essence of eta-expansion in partial evaluation,” Lisp and Symbolic Computation, Vol. 8,No. 3, pp. 209–227, Kluwer Academic Publishers (1995).CrossRefGoogle Scholar
  8. 8.
    Dean, J., C. Chambers, and D. Grove “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
  9. 9.
    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
  10. 10.
    Futamura, Y. “Partial evaluation of computation process–an approach to a compiler-compiler,” Systems, Computers, Controls, Vol. 2,No. 5, pp. 45–50, (1971).Google Scholar
  11. 11.
    Glück, R., and J. Jørgensen “An Automatic Program Generator for Multi-Level Specialization,” Lisp and Symbolic Computation, Vol. 10,No. 2, pp. 113–158, Kluwer Academic Publishers (July 1997).CrossRefGoogle Scholar
  12. 12.
    Henglein, F. “Efficient Type Inference for Higher-Order Binding-Time Analysis,” In J. Hughes, editor, Functional Programming Languages and Computer Architecture (LNCS 523), pp. 448–472 (August 1991).Google Scholar
  13. 13.
    Hornof, L., C. Consel, and J. Noyffe “Effective Specialization of Realistic Programs via Use Sensitivity,” In Van Hentenryck P., editor, Static Analysis (LNCS 1302), pp. 63–73 (1997).CrossRefGoogle Scholar
  14. 14.
    Jones, N. D., C. K. Gomard, and P. Sestoft Partial Evaluation and Automatic Program Generation, New York: Prentice-Hall (1993).zbMATHGoogle Scholar
  15. 15.
    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
  16. 16.
    Sperber, M. “Self-Applicable Online Partial Evaluation,” In O. Danvy, R. Glück, and P. Thiemann editors, Partial Evaluation (LNCS 1110), pp. 465–480 (February 1996).Google Scholar
  17. 17.
    Sperber, M., and P. Thiemann “Two for the price of one: composing partial evaluation and compilation,” Proceedings of the ACM SIGPLAN’ 97 Conference on Programming Language Design and Implementation (PLDI), SIGPLAN Notices, Vol. 32,No 5, pp. 215–225 (June 1997).CrossRefGoogle Scholar
  18. 18.
    Tarjan, R. Data Structures and Network Flow Algorithms, Volume CMBS 44 of Regional Conference Series in Applied Mathematics, SIAM (1983).Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1999

Authors and Affiliations

  • Kenichi Asai
    • 1
  1. 1.Department of Information Science, Faculty of ScienceUniversity of Tokyo “Information and Human Activity” PRESTO, JSTBunkyo-kuJapan

Personalised recommendations