Higher-Order and Symbolic Computation

, Volume 25, Issue 1, pp 127–163 | Cite as

An approach to completing variable names for implicitly typed functional languages

Article

Abstract

This paper presents an approach to completing variable names when writing programs in an implicitly typed functional language. As a first step toward developing practical systems, we considered a simple case: up to the cursor position the program text is given completely. With this assumption we specify a variable completion problem for an implicitly typed core functional language with let-polymorphism, and show an algorithm for solving the problem. Based on the algorithm we have implemented a variable name completion system for the language as an Emacs-mode.

Keywords

Polymorphic language Type inference Emacs-mode Variable name completion 

References

  1. 1.
    Acar, U.A.: Self-adjusting computation (an overview). In: Proceedings of the 2009 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM ’09, Savannah, GA, USA, pp. 1–6. ACM Press, New York (2009) Google Scholar
  2. 2.
    Aditya, S., Nikhil, R.S.: Incremental polymorphism. In: Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture, Cambridge, USA, pp. 379–405 (1991) CrossRefGoogle Scholar
  3. 3.
  4. 4.
  5. 5.
    Di Cosmo, R.: Type isomorphisms in a type-assignment framework. In: Proceedings of the 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’92, Albuquerque, New Mexico, pp. 200–210. ACM Press, New York (1992) CrossRefGoogle Scholar
  6. 6.
  7. 7.
  8. 8.
  9. 9.
    Goto, T., Sasano, I.: An approach to completing variable names for implicitly typed functional languages. In: Proceedings of the ACM SIGPLAN 2012 Workshop on Partial Evaluation and Program Manipulation, PEPM ’12, Philadelphia, Pennsylvania, USA, pp. 131–140. ACM Press, New York (2012) CrossRefGoogle Scholar
  10. 10.
    Gvero, T., Kuncak, V., Piskac, R.: Code completion using quantitative type inhabitation. Technical Report EPFL-REPORT-170040, Ecole Polytechnique Federale de Lausanne (2011) Google Scholar
  11. 11.
    Haack, C., Wells, J.B.: Type error slicing in implicitly typed higher-order languages. Sci. Comput. Program. 50, 189–224 (2004) CrossRefMATHMathSciNetGoogle Scholar
  12. 12.
    Hashimoto, M.: First-class contexts in ML. In: Asian Computing Science Conference. Lecture Notes in Computer Science, vol. 1538, pp. 206–223. Springer, Berlin (1998) CrossRefGoogle Scholar
  13. 13.
    Java development environment for Emacs. http://jdee.sourceforge.net/
  14. 14.
    Katayama, S.: Systematic search for lambda expressions. In: Trends in Functional Programming, pp. 111–126 (2005) Google Scholar
  15. 15.
  16. 16.
    Lerner, B., Flower, M., Grossman, D., Chambers, C.: Searching for type-error messages. In: PLDI ’07: Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation, San Diego, California, USA. ACM Press, New York (2007) Google Scholar
  17. 17.
    Milner, R.: A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17(3), 348–375 (1978) CrossRefMATHMathSciNetGoogle Scholar
  18. 18.
    Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML (Revised). MIT Press, Cambridge (1997) Google Scholar
  19. 19.
    Mitchell, J.C.: Foundations for Programming Languages. MIT Press, Cambridge (1996) Google Scholar
  20. 20.
  21. 21.
    OCaml Development Tools. http://ocamldt.free.fr/
  22. 22.
  23. 23.
    Perelman, D., Gulwani, S., Ball, T., Grossman, D.: Type-directed completion of partial expressions. In: Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’12, Beijing, China, pp. 275–286. ACM Press, New York (2012) CrossRefGoogle Scholar
  24. 24.
    Pierce, B.C., Turner, D.N.: Local type inference. ACM Trans. Program. Lang. Syst. 22(1), 1–44 (2000) CrossRefGoogle Scholar
  25. 25.
    Rittri, M.: Using types as search keys in function libraries. In: Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture, FPCA ’89, Imperial College, London, United Kingdom, pp. 174–183. ACM Press, New York (1989) CrossRefGoogle Scholar
  26. 26.
    Robbes, R., Lanza, M.: How program history can improve code completion. In: Proceedings of the 2008 23rd IEEE/ACM International Conference on Automated Software Engineering, ASE ’08, Washington, DC, USA, pp. 317–326. IEEE Comput. Soc., Washington (2008) CrossRefGoogle Scholar
  27. 27.
    Robinson, J.A.: A machine-oriented logic based on the resolution principle. J. ACM 12(1), 23–41 (1965) CrossRefMATHGoogle Scholar
  28. 28.
    Runciman, C., Toyn, I.: Retrieving re-usable software components by polymorphic type. In: Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture, FPCA ’89, Imperial College, London, United Kingdom, pp. 166–173. ACM Press, New York (1989) CrossRefGoogle Scholar
  29. 29.
  30. 30.
  31. 31.
    Wright, A.: Simple imperative polymorphism. LISP Symb. Comput. 8, 343–355 (1995) CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2013

Authors and Affiliations

  1. 1.Department of Information Science and EngineeringShibaura Institute of TechnologyKoto-ku, TokyoJapan

Personalised recommendations