Macho: Programming With Man Pages Anthony Cozzie, Murph Finnicum, Sam King University of Illinois at Urbana-Champaign.

Slides:



Advertisements
Similar presentations
PLDI’2005Page 1June 2005 Example (C code) int double(int x) { return 2 * x; } void test_me(int x, int y) { int z = double(x); if (z==y) { if (y == x+10)
Advertisements

Telecooperation/RBG Technische Universität Darmstadt Copyrighted material; for TUD student use only Introduction to Computer Science I Topic 16: Exception.
Session 3 Algorithm. Algorithm Algorithm is a set of steps that are performed to solve a problem. The example below describes an algorithm Example Check.
CS 177 Recitation Week 8 – Methods. Questions? Announcements  Project 3 milestone due next Thursday 10/22 9pm  Turn in with: turnin –c cs177=xxxx –p.
JAVA PROGRAMING LANGUAGE. Content of Java 2 SDK  Development Tools (In the bin subdirectory.) Tools and utilities that will help you develop, execute,
Writing algorithms using the while-statement. Previously discussed Syntax of while-statement:
Linux/Bash Commands Damian Gordon. ls List all the visible files in the current folder.
Introduction to Linux and Shell Scripting Jacob Chan.
Classes, Objects, Arrays, Collections and Autoboxing Dr. Andrew Wallace PhD BEng(hons) EurIng
University of Maryland Bug Driven Bug Finding Chadd Williams.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 2: Working with Visual.
Winrunner Usage - Best Practices S.A.Christopher.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Enabling Refinement with Synthesis Armando Solar-Lezama with work by Zhilei Xu and many others*
Lecture 2: Classes and Objects, using Scanner and String.
Chapter 9 1 Chapter 9 – Part 1 l Overview of Streams and File I/O l Text File I/O l Binary File I/O l File Objects and File Names Streams and File I/O.
Week 91 Introduction to Programming Ms. Knudtzon C Period Quarter 2 – Lecture 20 Monday, November 1 st.
1 Debugging. 2 A Lot of Time is Spent Debugging Programs Debugging. Cyclic process of editing, compiling, and fixing errors. n Always a logical explanation.
The Daikon system for dynamic detection of likely invariants MIT Computer Science and Artificial Intelligence Lab. 16 January 2007 Presented by Chervet.
Problem of the Day  Why are manhole covers round?
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
Problem of the Day  Why are manhole covers round?
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Lecture 3 Decisions (Conditionals). One of the essential features of computer programs is their ability to make decisions. Like a train that changes tracks.
Introduction to Perl Yupu Liang cbio at MSKCC
Liang, Introduction to Java Programming, Tenth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 18 Recursion Lecture 6 Dr. Musab.
Review, Pseudocode, Flow Charting, and Storyboarding.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 15 * Recursive Algorithms.
CPS 100, Spring Tools: Solve Computational Problems l Algorithmic techniques  Brute-force/exhaustive, greedy algorithms, dynamic programming,
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
CS101: Introduction to Computer Science Slides adapted from Sedgewick and Wayne Copyright © Your First Java.
1 CS November Testing/Debugging. And Applications Read chapter 14, pp. 385–401 Prelim 2 Max 100 Median 82 Mean 78.3 Min * ***************************
Page 1 – Autumn 2009Steffen Vissing Andersen SDJ I1, Autumn 2009 Agenda: Java API Documentation Code Documenting (in javadoc format) Debugging.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
Introduction to array: why use arrays ?. Motivational example Problem: Write a program that reads in and stores away 5 double numbers After reading in.
Computer Science Reaching Wider Summer School 2012.
Open project in Microsoft Visual Studio → build program in “Release” mode.
Contest Algorithms January 2016 Pseudo-code for backtracking search, and three examples (all subsets, permutations, and 8- queens). 4. Backtracking 1Contest.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
ITP 109 Week 2 Trina Gregory Introduction to Java.
Programming for Interactivity Professor Bill Tomlinson Tuesday & Wednesday 6:00-7:50pm Fall 2005.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Programming by Sketching Ras Bodik. 2 The Problem Problem: k-line algorithm translates to k lines of code. 30-year-old idea: Can we synthesize the.
2.4 A Case Study: Percolation Introduction to Programming in Java: An Interdisciplinary Approach · Robert Sedgewick and Kevin Wayne · Copyright © 2008.
Midterm 2 Review Notes on the CS 5 midterm Take-home exam due by 5:00 pm Sunday evening (11/14) Hand in your solutions under the door of my office, Olin.
Testing and Debugging UCT Department of Computer Science Computer Science 1015F Hussein Suleman March 2009.
CSC 241: Introduction to Computer Science I
Testing and Debugging PPT By :Dr. R. Mall.
Chapter No. : 1 Introduction to Java.
Chapter 5 Ordered List.
CS1101X Programming Methodology
What’s cheating and what is not?
Computer Programming Methodology Input and While Loop
Cracking the Coding Interview
Java Intro III.1 (Fr Feb 23).
Optimizing Malloc and Free
Decision statements. - They can use logic to arrive at desired results
Chapter 5 Ordered List.
Computing Adjusted Quiz Total Score
Recitation 2 September 2, 2011 Ben Newton.
Chapter 6 Queue.
class PrintOnetoTen { public static void main(String args[]) {
Building Java Programs
Chapter 7 Searching Your Products
LCC 6310 Computation as an Expressive Medium
Information Retrieval and Web Design
CSC 241: Introduction to Computer Science I
Presentation transcript:

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 – Prospector, SNIFF, Xsnippet, even Google Automated Debuggers – Genetic programming, Delta debugging

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

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

The Trick NL parsing Database Stitching Debugger

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

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

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

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

Input to Synthesis: LS1 public static void Ls1(java.lang.String p_directory) { java.io.File tmp = 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); }

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

Synthesized Version of LS public static void Ls3(String p_dir) { java.io.File tmp = new File(p_dir); java.io.File[] files = tmp.listFiles(); boolean tmp_3 = tmp.isDirectory(); if(tmp_3) { Arrays.sort(files); for(int tmp_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 + ""); }

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.

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

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