1 Review of Static Program Analysis and Co/Contra-variance Ras Bodik, Thibaud Hottelier, James Ide UC Berkeley CS164: Introduction to Programming Languages.

Slides:



Advertisements
Similar presentations
Introduction to CS 491 / 2 Senior Design Project I / II Prof. Dr. H. Altay Güvenir.
Advertisements

CS1101: Programming Methodology
IT 240 Intro to Desktop Databases Introduction. About this course Design a database: Entity Relation (ER) modeling and normalization techniques Create.
Welcome to MAT 142. Basic Course Information Instructor Office Office Hours Beth Jones PSA 725 Tuesday 10:30 am – 12 noon Thursday 10:30 am – 12 noon.
5/2/2008Prof. P. N. Hilfinger CS164 Lecture 401 Pointer Analysis Lecture 40 (adapted from notes by R. Bodik)
CSE 305 Introduction to Programming Languages
CSSE221: Software Dev. Honors Day 25 Announcements: Announcements: Now returning programming mini-exam feedback, HW7, and some capsule quizzes. Now returning.
Lecture 34 CSE 331 Nov 19, HW 9 due today Q1 in one pile and Q 2+3 in another I will not take any HW after 1:15pm.
Welcome to MAT 142. Basic Course Information Instructor Office Office Hours Beth Jones PSA 725 Tuesday 10:30 am – 12 noon Thursday 10:30 am – 12 noon.
SLIDE 1IS 202 – FALL 2003 Lecture 26: Final Review Prof. Ray Larson & Prof. Marc Davis UC Berkeley SIMS Tuesday and Thursday 10:30 am - 12:00.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
COMP 14 – 02: Introduction to Programming Andrew Leaver-Fay August 31, 2005 Monday/Wednesday 3-4:15 pm Peabody 217 Friday 3-3:50pm Peabody 217.
University of Colorado - Dept of Aerospace Engineering Sciences - Introduction to FEM This is ASEN 5007: Introduction to Finite Element Methods.
CS 415: Programming Languages Course Introduction Aaron Bloomfield Fall 2005.
Computer Science 102 Data Structures and Algorithms V Fall 2009 Lecture 1: administrative details Professor: Evan Korth New York University 1.
TA Information Session College of Computing April 5, 2004.
1 Lecture 2 Unit Conversion Calculator Expressions, values, types. Their representation and interpretation. Ras Bodik Shaon Barman Thibaud Hottelier Hack.
Welcome to CompSci 100! As You Arrive… Make sure you grab a syllabus packet. Read through it. I will be covering the most essential points in my talk,
1 Lecture 12 Ideas for the Final Project DSLs in real world; language extensions Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction.
Study Tips for COP 4531 Ashok Srinivasan Computer Science, Florida State University Aim: To suggest learning techniques that will help you do well in this.
Introduction COMP104: Fundamentals and Methodology.
Introduction to Engineering Computing GEEN 1300 Lecture 7 15 June 2010 Review for midterm.
CS 458 Internet Engineering Instructor: Prof. Jörg Liebeherr University of Virginia.
COMP Introduction to Programming Yi Hong May 13, 2015.
EECE 310 Software Engineering Lecture 0: Course Orientation.
PHP Basics Course Introduction SoftUni Team Technical Trainers Software University
Chapter 1: Introduction to Project Management
Introduction to Computer Science A Professor Uday Reddy
1 Lecture 6 Logic Programming introduction to Prolog, facts, rules Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction to.
CSCI 51 Introduction to Computer Science Dr. Joshua Stough January 20, 2009.
T Seminar on Internetworking. Overview Paper finalization (deadline was 17.4.) –Proceedings has been send for printing Seminar day on
Introduction to Databases Computer Science 557 September 2007 Instructor: Joe Bockhorst University of Wisconsin - Milwaukee.
1 CS Programming Languages Class 15 October 17, 2000.
Introduction to Data Structures
University of Colorado - Intro to Aerospace Structures (ASEN 3112) - Fall 2015 HW 2-3 and Midterm Exam HW assignments posted on public web site and D2L.
Let’s do some introductions
CS 415 Daily Announcements. Friday, 26 August 2005 Readings: –Read Chapter 1 for next Monday –Read Algol 60 report for next Wednesday –Read some of chapter.
Programming In Perl CSCI-2230 Thursday, 2pm-3:50pm Paul Lalli - Instructor.
Introduction to CS Senior Design Project I / II Prof. Dr. H. Altay Güvenir.
CPSC 121: Models of Computation Unit 0 Introduction George Tsiknis Based on slides by Patrice Belleville and Steve Wolfman.
1 Lecture 19 Flow Analysis flow analysis in prolog; applications of flow analysis Ras Bodik Ali and Mangpo Hack Your Language! CS164: Introduction to Programming.
Ministry of Higher Education Sohar College of Applied Sciences IT department Comp Introduction to Programming Using C++ Fall, 2011.
CS Welcome to CS 5383, Topics in Software Assurance, Toward Zero-defect Programming Spring 2007.
1 CS161 Introduction to Computer Science Topic #17.
COMPILER CONSTRUCTION Lesson 1 – TDDD16 TDDB44 Compiler Construction 2010 Kristian Stavåker (Erik Hansson.
1 Implementing Prolog with Coroutines Ras Bodik, Thibaud Hottelier, James Ide UC Berkeley CS164: Introduction to Programming Languages and Compilers Fall.
Compiler Construction (CS-636)
Course Overview for Compilers J. H. Wang Sep. 14, 2015.
CS680: Announcements and Feedbacks Sung-Eui Yoon ( 윤성의 ) Course URL:
Course Overview for Compilers J. H. Wang Sep. 20, 2011.
Announcements Finish up Network Flow today Then Review for Final on Monday ◦ HW#5 is due on Monday, let me or the TA’s know if you have trouble starting.
1 Lecture 17 Flow Analysis flow analysis in prolog; applications of flow analysis Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction.
Data Structures and Algorithms in Java AlaaEddin 2012.
Computer Programming for Engineers CMPSC 201C Fall 2000.
Lecture 18 CSE 331 Oct 12, HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.
Course Information CSE 2031 Fall Instructor U. T. Nguyen /new-yen/ Office: CSEB Office hours:  Tuesday,
1 Lecture 14 Data Abstraction Objects, inheritance, prototypes Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction to Programming.
Principles of Imperative Computation Lecture 1 January 15 th, 2012.
Lecture 18 CSE 331 Oct 6, Group/Algo registration deadline BOTH DUE WED by 11:59pm!
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
1 Welcome Alireza Humber College Lecture 1 Game 540 Alireza
CS140 – Computer Programming 1 Course Overview First Semester – Fall /1438 – 2016/2017 CS140 - Computer Programming 11.
Programming COMP104: Fundamentals and Methodology Introduction.
Lecture 1 Concepts of Programming Languages
CS 336/536: Computer Network Security Fall 2014 Nitesh Saxena
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
Lecture 1 Concepts of Programming Languages
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
AME Spring Lecture 11 - Thrust and aircraft range
Presentation transcript:

1 Review of Static Program Analysis and Co/Contra-variance Ras Bodik, Thibaud Hottelier, James Ide UC Berkeley CS164: Introduction to Programming Languages and Compilers Fall 2010

Improve the course (we need your feedback) Office hours with Pizza this Wed, Nov 17, 5pm, in La Val’s HKN surveys: Next Monday, Nov 22 2

HW8: Static analysis (types and flow analysis) Three problems, one for each lecture L18-20 Preparation for the exam. Some reading Due in two weeks (Two days before exam) Today’s lecture and Thursday recitation will review the material 3

HW9: Final Project Design Document Main goal: Flesh out HW7. Include details for implementation and evaluation. What programs you want to write in your language? –if you are building a tool, answer “What programs do you want to analyze with your debugger / …?” –be specific, write down these programs What implementation steps will you follow? –finish your design before you submit the document –break down the implementation into ~6 steps –say what data structures and modules you’ll implement 4

Announcements Contest 1: Fastest 164 Parser workload: large files + many tiny files (onclick handlers) Contest 2: Most Impressive 164 Browser Demo goal: combine bQuery with Rx, potentially extending them simplicity: future 164 students must be able to build it Prizes: iPod nanos Deadline: a few days after the second midterm 5

Paid 164 Courseware Developer Job Do you want to improve 164? Some of the tasks where we need your help: Improve the browser, the language, the parser. Rewrite the handouts with creative technical writing. Develop homeworks that prepare for PAs (like HW4). Talk to Ras if interested. 6

Prolog program for Andersen algorithm new(o1,x). % x=new_1 Foo() new(o2,z). % z=new_2 Bar() assign(x,y). % y=x assign(x,w). % w=x pf(z,y,f). % y.f=z gf(w,v,f). % v=w.f flowsTo(O,X) :- new(O,X). flowsTo(O,X) :- assign(Y,X), flowsTo(O,Y). flowsTo(O,X) :- pf(Y,P,F), gf(R,X,F), aliasP,R), flowsTo(O,Y). alias(X,Y) :- flowsTo(O,X), flowsTo(O,Y). 7

Computing pointsTo and alias relations o2o2 y z new w v assign x o1o1 new assign pf[f]gf[f] 8

Handling of method calls Issue 1: Arguments and return values: –these are translated into assignments of the form p=r Example: Object foo(T x) { return x.f } r = new T; s = foo(r.g) is translated into foo_retval = foo_x.f r = new T; s = foo_retval; foo_x = r.g 9

Imprecision in modeling of function calls Example where our modeling leads to imprecision: def id(x) { return x } a = id(new Foo()) b = id(new Bar()) Let’s draw our inference graph: 10

Handling of method calls Issue 2: targets of virtual calls –call p.f() may call many possible methods –to do the translation shown on previous slide, must determine what these targets are Suggest two simple methods: – 11

Nominal type systems: co/contra-variance Assume: C extends B extends A. class B has method B foo(B). class C also has method foo. Assume you are designing the type system for this language. What types of C’s foo should you allow? B-->B, A-->A, C-->A, A-->C, … How do we decide? Want some statements to be type safe. What does type safety mean? 12