1 / 19

Macho: Programming With Man Pages

Macho: Programming With Man Pages. Anthony Cozzie , Murph Finnicum , Sam King University of Illinois at Urbana-Champaign. Programming is hard!. Extreme Detail Extreme Precision. Lots of Automated Tools. Static Analysis Coverity Code Snippet search engines

neil
Download Presentation

Macho: Programming With Man Pages

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. Macho: Programming With Man Pages Anthony Cozzie, MurphFinnicum, Sam King University of Illinois at Urbana-Champaign

  2. Programming is hard! • Extreme Detail • Extreme Precision

  3. Lots of Automated Tools • Static Analysis • Coverity • Code Snippet search engines • Prospector, SNIFF, Xsnippet, even Google • Automated Debuggers • Genetic programming, Delta debugging

  4. Automating Programming • Computer makes decisions • But it will make mistakestoo! • Programmer must go back and check the tool – not easy • So, how can we do this efficiently?

  5. Macho Architecture Raw Text Requested Computation Candidate Programs Solutions Code Snippets NL parsing Database Stitching Debugger Runtime Feedback

  6. The Trick NL parsing Database Stitching Debugger

  7. Examples! • Example is end-to-end: covers many decisions • Easy to understand compared to code

  8. The Example (LS) Print the names of files in a directory. Sort the names.

  9. Extract Implied Computation directory -> files files -> names print(names) sort(names) Print the names of files in a directory. Sort names.

  10. Use Programmer’s Labels public static void main(String[] args) { .... //first (original) database files = directory.listFiles(); .... }

  11. Input to Synthesis: LS1 public static void Ls1(java.lang.Stringp_directory) { java.io.Filetmp = new File(p_directory); java.io.File[] files = tmp.listFiles(); int tmp_0 = files.length; java.lang.String[] tmp_1 = new java.lang.String[tmp_0]; for(int tmp_3 = 0; tmp_3 < files.length; ++tmp_3) { java.io.File tmp_2 = files[tmp_3]; java.lang.String names = tmp_2.getName(); tmp_1[tmp_3] = names; } Arrays.sort(tmp_1); for(int tmp_5 = 0; tmp_5 < tmp_1.length; ++tmp_5) { java.lang.String tmp_4 = tmp_1[tmp_5]; System.out.println(tmp_4); } }

  12. Bugs! • Prints hidden files • Crashes if the input is not a directory

  13. Synthesized Version of LS public static void Ls3(String p_dir) { java.io.Filetmp = new File(p_dir); java.io.File[] files = tmp.listFiles(); booleantmp_3 = tmp.isDirectory(); if(tmp_3) { Arrays.sort(files); for(inttmp_1 = 0; tmp_1 < files.length; ++tmp_1) { java.io.File tmp_0 = files[tmp_1]; java.lang.String names = tmp_0.getName(); boolean tmp_2 = tmp_0.isHidden(); if(!tmp_2) System.out.println(names); } } else System.out.println(tmp+ ""); }

  14. Pure NL Spec Take the path "/home/zerocool/" If the path is a file, print it. Otherwise get the list of files in the directory. Sort the result alphabetically. Go over the result from the beginning to the end: If the current element's filename does not begin with ".", print it.

  15. Macho Print the names of files in a directory. Sort the names. + simple example

  16. Input Synergy • NL: moderate information over a large part of the state space • Examples: very precise information over a tiny part of the state space • Together: win

More Related