Description

CS50200 - Compiling and Programming Systems
Fall 2014
Days: Tuesday Thursday 3:00-4:15 pm
Credit Hours: 3

Instructor: Zhiyuan Li (LWSN 3154H) 765-494-7822
zhiyuanli@purdue.edu

TA(s): Praveen Kumar Gurumurthy
Office Hours : M - 10-11am ; Th - 1.15-2.15pm
HAAS 266 #8
praveen@purdue.edu

Nithya Raghavan
nraghava@purdue.edu

Office hours: See staff info on Piazza
Instructor contact hours for on-line students: TuTh 4:15-5:15 on Skype
(additional skype hours by appointment)

Textbook :
Compilers: Principles, Techniques, and Tools (Second Edition) A Aho & M. Lam & Sethi & Ullman Addison-Wesley 978-032-148681-3

Course Work:
Homework Assignments (20%)
Midterm (20%)
Final exam (30%)
Projects (30%)

Midterm date/time/place:
October 16th (Thursday), 3:00-4:15pm in the class room.
(Off-campus students follow the instruction from the distance-learning staff.)
NOTE: No make-up exam will be given, except for extreme difficulty such as illness certified by Purdue's medical facility.

Final Exam date/place:
(Please confirm with Purdue's schedule)

Projects:
There will be two projects based on the GNU GCC compiler framework:

Project 1 -- Regenerate C program from the internal representation (AST). This is a warm up project to get familiar with the GCC internal representation.

Project 2 -- Data flow analysis and optimization.

Learning Objective:
This course presents an overview of the principles and techniques in modern compilers, which gives students a deeper understanding of the syntactic rules and the functionality of modern programming languages, as well as the use of the compiler for enhancing program quality. The course also gives the students the opportunity to practice the implementation of certain key components in the compiler front-end and back-end.

Course Contents:
The course introduces the theoretical foundation for both the front end and the
backend of the compiler. For front end, finite automata, regular expression,
context free grammars and parsing state computation form the theoretical base.

For the back end, the most important theories concern the analysis of
program's control and data flow, control and data dependences, and the
concept of parallelism and locality analysis. The course also has a heavy
emphasis on experimentation, using a state of the art compiler environment to
implement both front-end and back-end techniques.

Topics Covered:

The first part of the course will be an overview of the "front end" of the compiler
and basic mechanism for code generation , including the following components:
Lexical analysis, examples of context free grammars, top-down parsing,
bottom-up parsing, abstract syntax tree, basic type checking, symbol
tables,intermediate code format and generation, machine code generation,
garbage collection, code generation for programs written in object-oriented
languages. The second part of the course gives more in depth coverage of the
fundamental program analysis techniques commonly used by compilers and
software engineering tools, which include, but not limited to, the following: Control flow and control dependence, data flow and data dependence analysis,
interprocedural analysis, pointer analysis, how such analyses are applied to
program transformations for better performance and to enhancement of software reliability.

Prerequisites:
A bachelor degree in computer science or an equivalent field. Solid
understanding of syntax and semantics of high level programming languages,
computer organization, data structures and combinatorial algorithms. Strong skill in C programming, especially in dealing with dynamic data structures such as lists and graphs. Familiarity with instruction-level processor architecture.

Grades Posting:
To meet Purdue's student privacy regulation requirement, all grades are stored on

http://www.itap.purdue.edu/learning/tools/blackboard/index.cfm

Academic Integrity Policy

Unless specified otherwise explicitly in the specific assignment/project handout, all assignments and projects must be completed by each student independently. Copying, either electronically or manually, from others' work (from Purdue students or external sources such as the internet) is a violation of the policy. Letting a student copy one's work is also a violation. Depending on the degree of severity of the violation, the first offense will receive a penalty of either a zero point given to the specific assignment or an automatic down-grade of the final letter grade. The second offense will result in a failing letter grade for the course and a report to the university.

Late Work Policy:

Each student is given four "late days" through the entire semester for possible late turn-in of a project. Each use will be whole days, not a fraction such as 1/2 day. The TA will keep a record on the grade book on how many "late days" a student has used.
No other late turn-in of projects will be accepted. Late work for written home works is not accepted. Therefore if a student has a travel scheduled, the homework should be turned in before the travel

Makeup Exam Policy

A makeup exam is given only under the most unusual circumstances with clear supporting document, such as hospital excuses. (We cannot accept a note from a hospital/clinic simply saying "so and so came to visit the clinic".) Things should have been scheduled to avoid conflict, e.g. job interviews, cannot be used as excuses for missing an exam.


Grades Dispute

If anyone finds the grading of a piece of course work to be questionable,
the issue must be brought to the attention of the TAs as soon as
possible
through email, i.e. within the first week from the day the graded
work
is returned to the student. This will ensure that the graders still have
clear memory of the entire context in which the grade was assigned.

Final Exam and PhD Qualifying Exam

The final exam will be comprehensive and will be a part of the qualifying exam.
The qualifying exam may have a second part that includes additional questions.

Since the final exam constitutes only a part of the course work,
it is possible that a student may get a A grade for the course
but fails the qualifying exam or, reversely, may pass the qualifying exam
but receives a below-A grade for the course.

General Information

No information, yet. Stay tuned!

Announcements

Final exam and hw5 grades posted
12/20/14 6:24 PM
Both final exam and homework 5 grades have been posted on Blackboard. We will arrange to have exam papers available for anyone to take a look, as soon as the qualifying results have been determined by the qual committee. (As in previous semesters, the final papers will be kept by the instructor for one year in case any questions arise in the future.) HW5 papers will be returned to students Monday in a box kept at the front desk in the undergrad adviser suite.

Students will receive the letter grade as the school release it. I have submitted the grades.

It has been mostly a good experience for me this semester. Hope you have a good holiday.
Request/reminder: please do not post your project/programming solutions on-line
12/16/14 8:52 PM
Hello everyone,

We know many of you are proud of what you have accomplished with the compiler projects and programming assignments. Some of you may also be thinking of storing away your codes in a public code repository as a way of backing up. However, we would like to urge you not to put codes developed for our CS502 projects and programming assignments anywhere that others can download. This is because the same projects/assignments or something very similar may be reused in the future. We do not want to have temptations out there to get some students (however few there may be) into submitting other people's work as their own. We explicitly prohibit reuse of codes obtained elsewhere either at Purdue or outside as you can recall from the policy we posted the first day of the semester.

Thank you for your cooperation!

Thank you.
Reminder: final exam
12/15/14 10:16 PM
According to MyPurdue, the place and time for our final exam (evening) will be

Wed 12/17 7:00p - 9:00p EE 117

Please verify with MyPurdue again on Wednesday in case of any (however unlikely) changes.
Distance learning students, follow instructions from the distance-learning office.

This exam, like the midterm, will be close-book, close-notes, no discussion, no electronic device, taking alternate seats when possible. Wish you a smooth exam.
How to turn in homework 5
12/11/14 11:42 AM
In order to best accommodate everyone's schedule next Monday, we will put a box in the undergraduate adviser office (the front desk in the suite right across the Port cafe in LWSN building). Tell the secretary or receptionist that the homework is for CS502.

The deadline for on campus students will be 5pm Monday. No late homework will be accepted, because we will post a sample solution on Tuesday.

Distance learning students use the Blackboard to turn in homework 5 by Midnight Monday. Again, no late work will be accepted.
How to Prepare for the Final Exam (which is also the qual exam)
12/10/14 4:14 PM
The final exam and the qual exam will have the same set of problems. It will be a two-hour exam. There are 120 points in total, but a student receiving more than 100 points will have 100 points entered as the final exam result.

The exam has five problems, roughly, two of which cover the
front-end and three of which cover the back-end.

The front-end part will mainly concern the following materials:

(i) writing of LL(1) grammars and SLR grammars for a specified language
(ii) drawing LL(1) parsing tables and SLR parsing tables after determining information such as state diagrams, FIRST sets and FOLLOW sets.
(iii) the basic concepts of semantic actions, type checking and symbol table
operations.

The back-end part will mainly concern the following:

(iv) control flow analysis and the control dependence graph
(v) data flow analysis algorithms
(vi) using data flow analysis to discover properties of a program and to
transform the program for certain optimization goals.

To prepare for the exam, the students should review all relevant lecture
notes, textbook sections, homework problems (including programming assignments and projects), and the midterm exam.

Since this exam also serves as the qual exam, some problems may require the students to find relationship between different concepts studied in the lectures and to find ways to use and possibly combine the studied techniques.
Act Immediately : Clean up your Scratch disks
11/30/14 4:15 PM

Hello Folks,

Unfortunately the scratch disks seems to be full and all of you are going to encounter this error soon. Refer (https://piazza.com/class/hy7enxf648g7me?cid=324).

Kindly request you all the make clean asap on all the project folders you have.

Required Action:

1) If you have separate copies for Project 1 and 2 and you are not using proj1 anymore. Do a make clean for proj1 and remove all the executables. 

2) If you are not currently working on Proj 2, do a make clean so that others can use the disk space (Kindly Be considerate to you fellow students). Every copy of cc1 is around 400 MB, so please remove all of them unless you are working on in RIGHT NOW. 

Failing to do these might require us to approach the CS staff and they would be cleaning the scratch directories which means that anything and everything you have can be wiped out including your projects without prior notice.

Thank you,

Praveen

Project 1 Grading Info
11/26/14 2:18 AM

The grades for the Project 1 have been released. We have also posted comments in Blackboard regarding which test cases have failed. 

Points for each case (ordered by no.): 
1) Test Case 1 - As released earlier with the question (10 points) 
2) Test Case 2 - As released earlier with the question (10 points) 
3) Test Case 3 - As released earlier with the question (10 points) 
4) Test Case 4 - (10 points) 
5) Test Case 5 - (10 points) 
6) Test Case 6 - (10 points) 
7) Test Case 7 - (10 points)

The testcase files themselves have a comment stating what the program is testing for.


The remaining 30 points are for your Report/Documentation and Readability of Code. 

If you have got 30 or less, it means that either we were unable to run your program or your program threw errors for all the test cases. In either case, we have decided to give you a chance to show that your program works. We request you to meet us during office hours and show us how to run your program or show where the errors are so that we can award points accordingly. Try to come within this week.

If you have got more than 100 points, you deserved it :) 


If you believe you deserve more points (Specifically pertaining to two test cases failing because of the same error), please feel free to stop by during office hours and we can discuss and re-evaluate when applicable. 


Distance learning students, send us detailed E-Mails explaining what the problem might be.

We will be re-using these test cases while grading project 2 in addition to newer test case, so it might be your best interest to fix the bugs :)

Have fun during the Thanksgiving break (err... you should be working on project 2 :P, kidding!),


Thanks,
Nithya and Praveen!

HW4.pdf has been added to class homepage under Resources
11/18/14 11:56 PM

The teaching staff has posted a new homework resource.

Title: HW4.pdf
http://www.piazza.com/class_profile/get_resource/hy7enxf648g7me/i2o7uao6nff4wh

Due date: Nov 25, 2014

You can view it on the course page: https://piazza.com/purdue/fall2014/cs502/resources

A docx file of the hw4 assignment can also be found on the same page.

Staff Office Hours
NameOffice Hours
Zhiyuan Li
When?
Where?
Praveen Kumar Gurumurthy
When?
Where?
Nithya Raghavan
When?
Where?

Homework

Homework
Due Date
Dec 15, 2014
Nov 25, 2014
Nov 25, 2014
Sep 9, 2014
Sep 2, 2014
Sep 2, 2014

Lecture Notes

Lecture Notes
Lecture Date
Dec 11, 2014
Dec 4, 2014
Dec 4, 2014
Dec 2, 2014
Nov 18, 2014
Oct 30, 2014
Oct 28, 2014
Oct 23, 2014
Oct 23, 2014
Oct 23, 2014
Oct 9, 2014
Oct 7, 2014
Oct 2, 2014
Oct 2, 2014
Sep 25, 2014
Sep 25, 2014
Sep 23, 2014
Sep 23, 2014
Sep 18, 2014
Sep 16, 2014
Sep 9, 2014
Sep 9, 2014
Sep 4, 2014
Aug 26, 2014

General Resources

General Resources