1 / 80

Keyword Programming in Java

Keyword Programming in Java. Greg Little and Robert C. Miller MIT CSAIL This work was supported in part by the National Science Foundation under award number IIS-0447800, and by Quanta Computer as part of the TParty project. Keyword Programming. Problem. src. array. cursor.

ivor-tyson
Download Presentation

Keyword Programming in Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Keyword Programming in Java Greg Little and Robert C. Miller MIT CSAIL This work was supported in part by the National Science Foundation under award number IIS-0447800, and by Quanta Computer as part of the TParty project.

  2. Keyword Programming

  3. Problem src array cursor read a line from src, and add it to array

  4. AutoComplete read a line from src, and add it to array

  5. AutoComplete read a line from src, and add it to array

  6. AutoComplete read a line from src, and add it to array

  7. AutoComplete read a line from src, and add it to array

  8. AutoComplete read a line from src, and add it to array

  9. AutoComplete read a line from src, and add it to array

  10. AutoComplete read a line from src, and add it to array

  11. AutoComplete read a line from src, and add it to array

  12. Keyword Programming read a line from src, and add it to array

  13. Keyword Programming read a line from src, and add it to array

  14. Keyword Programming read a line from src, and add it to array

  15. Keyword Programming read a line from src, and add it to array

  16. Keyword Programming read a line from src, and add it to array

  17. Related Work • AutoComplete • syntactically valid prefix • Jungloids[Mandelin et al PLDI ’05] • XSnippet[Sahavechaphan et al OOPSLA ’06] • input and output types • Keyword Programming • keywords from expression

  18. Motivation

  19. Overview • Algorithm • Evaluation

  20. Algorithm array.add(src.readLine());

  21. Algorithm array.add(src.readLine); array readLine src

  22. Algorithm array.add(src.readLine); array readLine src List<String> String BufferedReader

  23. Algorithm boolean add List<String>, String List<String> array String readLine BufferedReader BufferedReader src

  24. Algorithm boolean add List<String>, String List<String> array Function String readLine BufferedReader BufferedReader src

  25. Algorithm Function Database Dynamic Program Extract Tree

  26. Function Database List<String> array

  27. Function Database boolean add List<String>, String List<String> array

  28. Function Database boolean add List<String>, String List<String> array BufferedReader src

  29. List Functions boolean add List<String>, String List<String> array String readLine BufferedReader BufferedReader src

  30. Function Database boolean add List<String>, String List<String> array String String readLine new String BufferedReader BufferedReader src

  31. Score Functions boolean add List<String>, String List<String> array String String new String readLine BufferedReader BufferedReader src

  32. Score Functions boolean add List<String>, String List<String> array String String new String readLine BufferedReader add line BufferedReader src

  33. Score Functions boolean add List<String>, String List<String> array 1 String String new String readLine BufferedReader add line BufferedReader src

  34. Score Functions boolean add List<String>, String List<String> array 1 1 String String readLine new String BufferedReader add line BufferedReader src

  35. Dynamic Program boolean add List<String>, String List<String> array List<String> boolean BufferedReader String array add src readLine 1 2 1 1 1 1 1 1 1 1 1 1 String String List<String>, String BufferedReader new String readLine BufferedReader List<String> boolean BufferedReader String array add src readLine List<String>, String BufferedReader BufferedReader List<String> boolean BufferedReader String src array ? add src new String List<String>, String

  36. Extract Tree List<String> boolean BufferedReader String array add src readLine 2 1 List<String>, String BufferedReader List<String> boolean BufferedReader String array add src readLine List<String>, String BufferedReader List<String> BufferedReader String array src new String

  37. Extract Tree List<String> boolean BufferedReader String array add src readLine 2 1 List<String>, String BufferedReader List<String> boolean BufferedReader String array add src readLine List<String>, String BufferedReader List<String> BufferedReader String array src new String

  38. Extract Tree List<String> boolean BufferedReader String array add src readLine 2 1 List<String>, String BufferedReader List<String> boolean BufferedReader String array add src readLine BufferedReader List<String>, String List<String> BufferedReader String array src new String

  39. Extract Tree List<String> boolean BufferedReader String array add src readLine 2 1 List<String>, String BufferedReader List<String> boolean BufferedReader String array add src readLine BufferedReader List<String>, String List<String> BufferedReader String array src new String

  40. Extract Tree boolean add List<String>, String List<String> String array readLine BufferedReader BufferedReader src

  41. Render as Java array.add(src.readLine()) boolean add List<String>, String List<String> String array readLine BufferedReader BufferedReader src

  42. More Complex .Math.max(x, y).......... Keep best n functions per box 3 .Math.max(x, x).......... max x y . Discourage double counting

  43. Evaluation Artificial Corpus sense of speed in real projects sense of accuracy in wide variety of contexts User Study sense of accuracy on real inputs sense for how real inputs look

  44. Artificial Corpus multiple open source repositories Popular Could Compile

  45. Artificial Corpus

  46. Artificial Corpus RubySymbol.newSymbol(getRuntime(), name)

  47. Artificial Corpus RubySymbol.newSymbol(getRuntime(), name) RubySymbol newSymbol getRuntime name

  48. Artificial Corpus RubySymbol.newSymbol(getRuntime(), name) RubySymbolnewSymbolgetRuntime name Ruby Symbol new Symbol get Runtime name

  49. Artificial Corpus RubySymbol.newSymbol(getRuntime(), name) RubySymbolnewSymbolgetRuntime name Ruby Symbol new Symbol get Runtime name ruby symbol new symbol get runtime name

  50. Artificial Corpus RubySymbol.newSymbol(getRuntime(), name) RubySymbolnewSymbolgetRuntime name Ruby Symbol new Symbol get Runtime name ruby symbol new symbol get runtime name name runtime get symbol symbol ruby new

More Related