Title: CS 6371: Advanced Programming Languages
Course Registration Number: 22049
Times: TR 1:002:15
Location: CB2 1.204
Instructor: Dr. Kevin Hamlen (hamlen AT utdallas)
Instructor's Office Hours: TR 2:153:15 in ECSS 3.704
This course will cover functional and logic programming, concepts of programming language design, and formal reasoning about programs and programming languages. The following are the course learning objectives:
Through taking this course, students will learn the tradeoffs of imperative vs. nonimperative programming languages, issues involved in designing a programming language, the role of formal semantics and typesystems in reasoning about programs and languages, and proof techniques related to programming language design.
The course is open to Ph.D. students and Masters students. Interested undergraduates should see the instructor for permission to take the course.
Prerequisites: Discrete Structures (CS 3305/5333 or equivalent), Algorithm Analysis and Data Structures (CS 3345/5343 or equivalent), Automata Theory (CS 4384/5349 or equivalent). A solid background in all three of these areas will be heavily assumed throughout the course!
STUDENTS MUST ATTEND AT LEAST TWO OF THE FIRST THREE CLASSES. IF YOU MISS MORE THAN ONE OF THE FIRST THREE CLASSES (other than for excused absences—see below) THEN YOU WILL NOT BE PERMITTED TO TAKE THE COURSE. The first three classes will cover functional programming in the OCaml programming language, which will be the basis for most of the rest of the course. Documented absences approved by university policy are exempted from this attendance requirement. These include illness with an accompanying doctor's note, and observance of religious holy days.
To better understand the inclass OCaml demos, you should do the following as preparation:
If you can't get OCaml to work on your personal machine, you can use OCaml on the UTD CS Department Linux servers. To do so:
You can install your own local version of SWI Prolog or you can access the version installed on the UTD linux servers as follows:
Homework (25%): Homeworks will be assigned approximately once per 1.5 weeks, and will consist of a mix of programming assignments and written assignments. Programming assignments will be done in OCaml, Prolog, or possibly Coq. Written assignments will typically involve discrete math proofs. Homeworks must be turned in at the start of class (i.e., by 1:05pm) on the due date. No late homeworks will be accepted.
Quizzes (15%): On indicated assignment due dates (see the course schedule below), students will solve one or two problems individually at the start of class as a quiz. The quiz problems are essentially extra homework problems solved individually in class without the help of the internet or collaboration with other students. The quizzes will be closedbook and closednotes.
Midterm (25%): There will be an inclass midterm exam in class on Thursday, March 3rd. The exam will cover functional programming, operational semantics, denotational semantics, and fixpoints.
Final (35%): The final exam for the course is scheduled by the university registrar for Thursday May 5 from 2:00–4:45pm. The exam will be cumulative, covering all material in the course. Students will have 2 hours and 45 minutes to complete it.
Students may work individually or together with other students presently enrolled in the class to complete the assignments, but they must CITE ALL COLLABORATORS AND ANY OTHER SOURCES OF MATERIAL that they consulted, even if those sources weren't copied wordforword. Copying or paraphrasing someone else's work without citing it is plagiarism, and may result in severe penalties such as an immediate failing grade for the course and/or expulsion from the computer science program. Therefore, please cite all sources!
Students may NOT consult solution sets from previous semesters of this course, or collaborate with students who have such solutions. These sources are offlimits because such "collaborations" tend to involve simply copying someone else's answer to a similar homework problem, which does not prepare you for the quizzes and exams.
The course has no required textbook, but we will make use of several online references:
Date  Topic  Assignments  
Functional Programming  
Lecture 1: Tue 1/12 
Course Introduction: Functional vs. Imperative programming, typesafe languages, intro to OCaml Lecture Slides OCaml Transcript 
Assignment 1 due 1/21 (OCaml Intro) 

Lecture 2: Thu 1/14 
OCaml: Parametric polymorphism OCaml Transcript 

Lecture 3: Tue 1/19 
OCaml: List folding, tail recursion Lecture Slides OCaml Transcript 

Operational Semantics  
Lecture 4: Thu 1/21 
Largestep Semantics: Intro See Section 6 of Assignment 2 for lecture notes. 
Assignment 2 due 1/28 (SIMPL Interpreter) 

Lecture 5: Tue 1/26 
Largestep Semantics: Proof techniques Lecture Notes 

Lecture 6: Thu 1/28 
Smallstep Semantics Quiz #1: OCaml Programming Lecture Notes 
Assignment 3 due 2/9 (Operational Semantics) 

Denotational Semantics  
Lecture 7: Tue 2/2 
Denotational Semantics: Semantic domains and valuation functions Lecture Notes 

Lecture 8: Thu 2/4 
Denotational Semantics: Fixed points Lecture Notes 

Lecture 9: Tue 2/9 
Fixedpoint Induction Quiz #2: Operational Semantics Lecture Notes 
Assignment 4 due 2/18 (Fixpoints) 

Lecture 10: Thu 2/11 
Semantic Equivalence Lecture Notes Fixed Point Induction Examples 

Lecture 11: Tue 2/16 
Formal methods: Programproof codevelopment Coq Transcript 

Type Theory  
Lecture 12: Thu 2/18 
Type Theory: Introduction Quiz #3: Fixpoints See Assignment 5 reference section for lecture notes. 
Assignment 5 due 3/8 (SIMPL Typechecker) 

Lecture 13: Tue 2/23 
Type Theory: Typesoundness, Progress and Preservation Lecture Notes 

Lecture 14: Thu 2/25 
Type Theory: Typebased Information Flow Security Lecture Slides 

Lecture 15: Tue 3/1 
Midterm Review Sample Midterm Exam with Solutions Lecture Slides 

Midterm: Thu 3/3 
Midterm Exam  
Untyped Lambda Calculus  
Lecture 16: Tue 3/8 
Untyped Lambda Calculus: Introduction See Assignment 6 reference section for lecture notes. 
Assignment 6 due 3/24 (Lambda calculus) 

Lecture 17: Thu 3/10 
Untyped Lambda Calculus: Encodings and reductions Quiz #4: Static Semantics See Assignment 6 reference section for lecture notes. 

No Class: Tue 3/15 
No Class: Spring break  
No Class: Thu 3/17 
No Class: Spring break  
Typed Lambda Calculus  
Lecture 18: Tue 3/22 
Simplytyped Lambda Calculus System F: Typeinhabitation, CurryHoward Isomorphism Lecture Notes 

Lecture 19: Thu 3/24 
System F: HindleyMilner typeinference Lecture Notes 
Assignment 7 due 4/7 (Functional SIMPL) 

Lecture 20: Tue 3/29 
Summary/Comparison of Modern Language Features: Weak vs. strong typing, typesafety, function evaluation strategies, type polymorphism  
Logic Programming  
Lecture 21: Thu 3/31 
Logic Programming: Intro Lecture Slides 

Lecture 22: Tue 4/5 
Logic Programming: Lists, Logical Arithmetic Lecture Slides 

Lecture 23: Thu 4/7 
Logic Programming: Negation, Order Sensitivity Lecture Slides Quiz #5: Lambda Calculus 
Assignment 8 due 4/19 (Prolog) 

Formal Verification  
Lecture 24: Tue 4/12 
Axiomatic Semantics: Hoare Logic Lecture Slides


Lecture 25: Thu 4/14 
Axiomatic Semantics: Loop invariants Lecture Notes 

No Lecture: Tue 4/19 
Quiz #6: Prolog  Assignment 9 due 4/28 (Hoare Logic) 

Lecture 26: Thu 4/21 
Axiomatic Semantics: Weakest precondition, strongest postcondition  
Lecture 27: Tue 4/26 
Final Review Sample Final Exam with Solutions 

Lecture 28: Thu 4/28 
Final Review Quiz #7: Axiomatic Semantics 

Thu 5/5 2:00–4:45pm 
Final Exam in CB2 1.204 (regular classroom) 