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.
Similar content being viewed by others
References
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).
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.
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.
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.
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.
Danvy, O., “Type-Directed Partial Evaluation,”Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages, pp. 242–257, January 1996.
Danvy, O. and Filinski, A., “Abstracting Control,” inProc. of the 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160, June 1990.
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.
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.
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.
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.
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.
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.
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.
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.
Jones, N. D., Gomard, C. K. and Sestoft, P.,Partial Evaluation and Automatic Program Generation, Prentice-Hall, New York, 1993.
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.
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.
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.
Tarjan, R.,Data Structures and Network Flow Algorithms, VolumeCMBS 44 ofRegional Conference Series in Applied Mathematics, SIAM, 1983.
Author information
Authors and Affiliations
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
Received:
Revised:
Published:
Issue Date:
DOI: https://doi.org/10.1007/BF03037258