Abstract
In component-based software development, gluing of two software components is usually achieved by defining an interface specification, and creating wrappers on components to support the interface. We believe that interface specification provides useful information for specializing components. An interface may define constraints on a component's inputs, as well as on its outputs. In this paper, we propose a new approach to program specialization with respect to output constraints. We provide the form in which an efficient specialized program should be after such specialization, and consider a variant of partial evaluation to achieve it. In the process, we translate an output constraint into a characterization function for a component's input, and define a specializer that uses this characterization to guide the specialization process. We believe this work will broaden the scope of program specialization, and provide a framework for building more generic and versatile program adaptation techniques.
Similar content being viewed by others
References
Abramov, S.M. and Glück, R. The universal resolving algorithm: Inverse computation in a functional language. In Mathematics of Program Construction. Proceedings, R. Backhouse and J.N. Oliveira (Eds.), vol. 1837 of Lecture Notes in Computer Science, Springer-Verlag, 2000, pp. 187-212.
Bondorf, A. and Jørgensen, J. Efficient analyses for realistic off-line partial evaluation. Journal of Functional Programming, 3(3) (1993) 315-346.
Canfora, G., Cimitile, A., and De Lucia, A. Conditional program slicing. Information and Software Technology, Elsevier, 40 (1998) 595-607.
Chin, W.N. and Khoo, S.C. Calculating sized types. In 2000 ACM Workshop on Partial Evaluation and Semantics-Based Program Manipulation, Boston, Massachusetts, United States, 2000, pp. 62-72.
Chin, W.N. and Khoo, S.C. Calculating sized types. Higher-Order and Symbolic Computing (HOSC), 14(2/3) (2001).
Chin, W.N., Khoo, S.C., and Xu, D.X. Deriving pre-conditions for array bound check elimination. In Proceedings of the Second Symposium on Programs as Data Objects, PADO 2001, Aarhus, Denmark, 2001, pp. 2-24.
Chung, I.S., Lee, W.K., Yoon, G.S., and Kwon, Y.R. Program slicing based on specification. In Proceedings of 2001 ACM Symposium on Applied Computing, Las Vegas, Nevada, United States, 2001, pp. 605-609.
Comuzzi, J.J. and Hart, J.M. Program slicing using weakest preconditions. In FME '96: Industrial Benefit and Advances in Formal Methods, volume LNCS 1051, Springer-Verlag, Oxford, England, 1996 pp. 557-575.
Consel, C. A tour of Schism: A partial evaluation system for higher-order applicative languages. In ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, 1993, pp. 66-77.
Consel, C. Program adaptation based on program transformation. ACM Computing Survey, 28(4es) (1996) 164.
Dijkstra, E.W. A Discipline of Programming. Prentice Hall, Englewood Cliffs, NJ, 1976.
Enderton, H.B. A Mathematical Introduction to Logic. Academic Press, New York, 1972.
Flanagan, C. and Saxe, J.B. Avoiding exponential explosion: Generating compact verification conditions. In Symposium on Principles of Programming Languages, ACM Press, 2001.
Futamura, Y. Partial evaluation of computation process—An approach to a compiler-compiler. Systems, Computers, Controls, 2(5) (1971) 45-50.
Jones, N.D., Gomard, C.K., and Sestoft, P. Partial Evaluation and Automatic Program Generation. Prentice Hall International, June 1993, pp. xii + 415. ISBN 0-13-020249-5.
Khoo, S.C. and Shi, K. Output constraint specialization. In ACM SIGPLAN ASIA Symposium on Partial Evaluation and Semantics-Based Program Manipulation, Aizu, Japan, 12-14 Sept. 2002, pp. 106-116.
Lafave, L. and Gallagher, J.P. Constraint-based partial evaluation of rewriting-based functional logic programs. In Program Synthesis and Transformation. 7th International Workshop, LOPSTR'97, Leuven, Belgium, (LNCS 1463), July 1997, pp. 168-188.
Lafave, L. A constraint-based partial evaluator for functional logic programs and its application. PhD thesis, University of Bristol, 1998.
Lafave, L. and Gallagher, J.P. Extending the power of automatic constraint-based partial evaluators. ACM Computing Survey, 30(3es) (1998), pp. 1-4.
Nelson, G. A generalization of Dijkstra's calculus. ACM Transactions on Programming Languages and Systems, 11(4), (1989) pp. 517-561.
Pugh, W. The omega test: A fast practical integer programming algorithm for dependence analysis. Communications of ACM, 8 (1992) 102-114.
Reps, T. and Turnidge, T. Program specialization via program slicing. In Proceedings of the Dagstuhl Seminar on Partial Evaluation, O. Danvy, R. Glueck, and P. Thiemann (Eds.). Schloss Dagstuhl, Wadern, Germany, LNCS 1110, 1996, pp. 409-429.
Sørensen, M., Glück, R., and Jones, N.D. A positive supercompiler. Journal of Functional Programming, 6 (1996) 811-838
Secher, J.P. and Sørensen, M. From checking to inference via driving and dag grammars. In 2002 ACM Workshop on Partial Evaluation and Semantics-Based Program Manipulation, Peter Thiemann (Ed.). Jan. 2002, pp. 41-51
Suzuki, N. and Ishihata, K. Implementation of array bound checker. In ACM Principles of Programming Languages, 1977, pp. 132-143.
Takano, A. Generalized partial computation for a lazy functional language. In 1991 ACM Workshop on Partial Evaluation and Semantics-Based Program Manipulation, New Haven, Connecticut, United States, 1991, pp. 1-11.
Tip, F. A survey of program slicing techniques. Journal of Programming Languages, 3(3) Sept. (1995) 121-189.
Venkatesh, G.A. The semantic approach to program slicing. In ACM SIGPLAN Conf. on Programming Language Design and Implementation, vol. 26,no. 6, ACM Press, June 1991, pp. 107-119.
Xi, H. Dependent types in practical programming. Ph.D. thesis, Carnegie Mellon University, 1998.
Xu, Z., Miller, B.P., and Reps, T. Safety checking of machine code. In ACM SIGPLAN Conf. on Programming Language Design and Implementation, ACM Press, 2000, pp. 70-82.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Khoo, SC., Shi, K. Program Adaptation via Output-Constraint Specialization. Higher-Order and Symbolic Computation 17, 93–128 (2004). https://doi.org/10.1023/B:LISP.0000029449.57959.bd
Issue Date:
DOI: https://doi.org/10.1023/B:LISP.0000029449.57959.bd