Advertisement

Protocol Specialization

  • Matthias Neubauer
  • Peter Thiemann
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3302)

Abstract

In component-based programming, the programmer assembles applications from prefabricated components. The assembly process has two main steps: adapting a component by tweaking its configuration parameters, and connecting components by gluing output interfaces to input interfaces. While convenient, this approach may give rise to code bloat and inefficiency because prefabricated code is overly general, by necessity.

The present work addresses ways to remove unnecessary code during the deployment of a closed set of components by using program specialization. Our framework models components at the intermediate language level as systems of concurrent functional processes which communicate via channels. Each channel acts as a component connector with the interface determined by the channel’s protocol. We present an analysis that determines the minimum protocol required for each process and specify the specialization of a process with respect to a desired protocol, thereby removing unnecessary code.

The resulting specialization algorithm is unique in that it processes a concurrent base language, terminates always, and is guaranteed not to expand the program beyond its original size.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Bobeff, G., Noyé, J.: Molding components using program specialization techniques. In: WCOP 2003, Eighth International Workshop on Component-Oriented Programming, Darmstadt, Germany (July 2003)Google Scholar
  2. 2.
    Consel, C.: Program adaptation based on program transformation. ACM Computing Surveys 28(4es), 164 (1996)CrossRefGoogle Scholar
  3. 3.
    Consel, C. (ed.): Proceedings of the 1997 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, Amsterdam, The Netherlands, June 1997. ACM Press, New York (1997)Google Scholar
  4. 4.
    Czyperski, C.: Component Software, Beyond Object-Oriented Programming. Addison-Wesley, Reading (1998)Google Scholar
  5. 5.
    Danvy, O., Glück, R., Thiemann, P. (eds.): Dagstuhl Seminar on Partial Evaluation 1996. LNCS, vol. 1110. Springer, Heidelberg (1996)Google Scholar
  6. 6.
    Dussart, D., Bevers, E., De Vlaminck, K.: Polyvariant constructor specialization. In: Scherlis, W. (ed.) Proc. ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation PEPM 1995, La Jolla, CA, USA, June 1995, pp. 54–63. ACM Press, New York (1995)Google Scholar
  7. 7.
    Etalle, S., Gabbrieli, M.: Partial evaluation of concurrent constraint languages. ACM Comput. Surv. 30(3es), 11 (1998)CrossRefGoogle Scholar
  8. 8.
    Gapeyev, V., Levin, M.Y., Pierce, B.C.: Recursive subtying revealed. Journal of Functional Programming 12(6), 511–548 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Gay, S., Hole, M.: Types and subtypes for client-server interactions. In: Swierstra, S.D. (ed.) ESOP 1999 and ETAPS 1999. LNCS, vol. 1576, pp. 74–90. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  10. 10.
    Gay, S., Vasconcelos, V., Ravara, A.: Session types for inter-process communication. Technical Report TR-2003-133, Department of Computing Science, University of Glasgow (2003)Google Scholar
  11. 11.
    Gengler, M., Martel, M.: Self-applicable partial evaluation for the pi-calculus. In: Consel [3], pp. 36–46Google Scholar
  12. 12.
    Hatcliff, J., Mogensen, T.Æ., Thiemann, P. (eds.): DIKU 1998. LNCS, vol. 1706. Springer, Heidelberg (1999)Google Scholar
  13. 13.
    Hosoya, H., Kobayashi, N., Yonezawa, A.: Partial evaluation scheme for concurrent languages and its correctness. In: Fraigniaud, P., Mignotte, A., Bougé, L., Robert, Y. (eds.) Euro-Par 1996. LNCS, vol. 1123, pp. 625–632. Springer, Heidelberg (1996)CrossRefGoogle Scholar
  14. 14.
    Hughes, J.: Type specialisation for the λ-calculus; or, a new paradigm for partial evaluation based on type inference. In: Danvy, et al. (eds.) [5], pp. 183–215Google Scholar
  15. 15.
    Jones, N., Gomard, C., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)zbMATHGoogle Scholar
  16. 16.
    Kobayashi, N.: Useless code elimination and programm slicing for the pi-calculus. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 55–72. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  17. 17.
    Marinescu, M., Goldberg, B.: Partial-evaluation techniques for concurrent programs. In: Consel [3], pp. 47–62Google Scholar
  18. 18.
    Neubauer, M., Thiemann, P.: Protocol specialization. Technical Report 212. Institut f’́ur Informatik, University of Freiburg, Germany (August 2004)Google Scholar
  19. 19.
    Nierstrasz, O.: Regular types for active objects. In: Proceedings OOPSLA 1993, October 1993, pp. 1–15 (1993)Google Scholar
  20. 20.
    Pierce, B.C., Sangiorgi, D.: Typing and subtyping for mobile processes. In: Proc. of the 8th Annual IEEE Symposium on Logic in Computer Science, pp. 376–385. IEEE Computer Society Press, Los Alamitos (1993)Google Scholar
  21. 21.
    Reps, T., Turnidge, T.: Program specialization via program slicing. In: Danvy, et al. (eds.) [5], pp. 409–429Google Scholar
  22. 22.
    Schultz, U., Lawall, J., Consel, C., Muller, G.: Toward automatic specialization of Java programs. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, p. 367. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  23. 23.
    Schultz, U.P.: Black-box program specialization. In: WCOP 1999, Fourth International Workshop on Component-Oriented Programming, Lisbon, Portugal (June 1999)Google Scholar
  24. 24.
    Schultz, U.P., Lawall, J.L., Consel, C.: Automatic program specialization for java. ACM Transactions on Programming Languages and Systems (TOPLAS) 25(4), 452–499 (2003)CrossRefGoogle Scholar
  25. 25.
    Tip, F.: A survey of program slicing techniques. Journal of Programming Languages 3(3), 121–189 (1995)Google Scholar
  26. 26.
    Tip, F., Sweeney, P.F., Laffra, C., Eisma, A., Streeter, D.: Practical extraction techniques for Java. ACM Transactions on Programming Languages and Systems 24(6), 625–666 (2002)CrossRefGoogle Scholar
  27. 27.
    Walker, D., Crary, C., Morrisett, G.: Typed memory management via static capabilities. ACM Transactions on Programming Languages and Systems 22(4), 701–771 (2000)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Matthias Neubauer
    • 1
  • Peter Thiemann
    • 1
  1. 1.Institut für InformatikUniversität FreiburgFreiburgGermany

Personalised recommendations