# CS 135: Designing Functional Programs

## Winter 2019 Calendar

This page contains information on the rough timing of topics, assignment due dates, exam dates, and other important milestones. The selection and ordering of topics is correct except possibly at the very end, where somewhat more or less might be covered depending on timing. Due dates are also precise. The exact timing of lecture topics will almost certainly vary from this, and readings (all from the textbook, "How To Design Programs") are linked to the timing of lectures. DrRacket implements a series of language subsets, and the changes from one level to the next are noted under the heading "Language Level".

### Week 1 (Week of January 7 - 13)

Module 1: Prefix notation. Translating expressions. Defining functions and constants.

Readings: Preface, Sections 1, 2.

Language Level: Beginning Student.

### Week 2 (Week of January 14 - 20)

Module 2: The design recipe: contract, purpose, examples, definition, tests. Comparisons and predicates. Boolean functions and special forms. Short circuiting. Symbols and strings. Equality testing. Conditional expressions. Writing and testing conditional functions. Helper functions.

Readings: Sections 3-5.

Assignment 00: Due Tues. Jan. 15, 2019, 9:00PM

### Week 3 (Week of January 21 - 27)

Module 3: The semantics of Beginning Student. Stepping.

Module 4: Compound data. posns. Defining structures. Stepping with structures. Data definitions. Templates. Consuming and producing compound data.

Readings: Intermezzo 1, Sections 6, 7.

Assignment 01: Due Tues. Jan. 22, 2019, 9:00PM

### Week 4 (Week of January 28 - February 3)

Module 4: Mixed data and union types. Checked functions.

Module 5: Defining lists. Basic list constructs. Box-and-pointer visualization of lists. Extracting values from a list. Semantics of list functions. Functions on lists. Processing lists. Recursive data definitions. Recursive functions. Tracing recursive functions. Structural recursion. Templates and design recipes for recursive data definitions and recursive functions. Useful list functions. Producing lists. Nonempty lists. Strings and lists of characters.

Readings: Sections 9, 10.

Assignment 02: Due Tues. Jan. 29, 2019, 9:00PM

### Week 5 (Week of February 4 - 10)

Module 5: Lists of structures.

Module 6: Natural numbers and recursion. Subintervals of natural numbers. Recursion on integers. Insertion sort. List abbreviations. Quoting lists. Lists containing lists. Lists versus structures. Kinds of lists. Dictionaries. Association lists.

Readings: Sections 11, 12, Intermezzo 2.

Language Level: Beginning Student with List Abbreviations.

Assignment 03: Due Tues. Feb. 5, 2019, 9:00PM

### Week 6 (Week of February 11 - 17)

Module 6: Two-dimensional data. Processing two lists simultaneously. Merging sorted lists. Consuming a list and a number. List equality.

Module 7: The limits of structural recursion. Preview of accumulative and generative recursion.

Readings: Section 17.

Assignment 04: Due Tues. Feb. 12, 2019, 9:00PM

### Reading Week (Week of February 18 - 24)

No lectures or tutorials this week.
No Assignment due.
No consulting hours Mon. Feb. 18: Family Day Holiday
Tues. Feb. 19 . Fri. Feb. 22: Reading Week: watch for adjusted consulting hours.

### Week 7 (Week of February 25 - March 3)

Module 8: Binary arithmetic expressions. Trees. Tree terminology. Characteristics of trees. Mutual recursion. Binary search trees. General trees. General arithmetic expressions. Other uses of general trees. Nested lists as leaf-labelled trees. Flattening a nested list.

Readings: Sections 14-16.

Assignment 05: Due Thurs. Feb. 28, 2019, 9:00PM

### Week 8 (Week of March 4 - 10)

Midterm Exam: Mon. March 4

Module 9: Local definitions. Semantics of local. Naming common subexpressions. Using local for clarity. Encapsulation. Terminology associated with local.

Readings: Intermezzo 3.

Language Level: Intermediate Student.

No Assignment due.

### Week 9 (Week of March 11 - 17)

Module 10: Functional abstraction. Consuming functions. Producing functions. Putting functions in lists. Contracts and types. Simulating structures. Scope. Producing anonymous functions. lambda.

Readings: Sections 19, 20.

Language Level: Intermediate Student with lambda.

Assignment 06: Due Tues. March 12, 2019, 9:00PM

### Week 10 (Week of March 18 - 24)

Module 10: Syntax and semantics of Intermediate Student with Lambda. Contracts for abstract list functions. Parametric types. Built-in abstract list functions. Building an abstract list function. foldr. Higher-order functions.

Module 11: Generative recursion. Termination.

Readings: Sections 21-23, Intermezzo 4, 25-27.

Assignment 07: Due Tues. March 19, 2019, 9:00PM

### Week 11 (Week of March 25 - 31)

Module 11: Quicksort. Processing strings. More higher-order functions. foldl.

Module 12: Directed graphs. Backtracking algorithms. Graph terminology. Representing graphs. Structural recursion on graphs. Finding routes. Termination of find-route. Termination for DAGs. Backtracking in implicit graphs.

Readings: Section 28.

Assignment 08: Due Tues. March 26, 2019, 9:00PM

### Week 12 (Week of April 25 - 5)

Module 12: Making find-route efficient.

Module 13: History of topics covered in the course.

Readings: Sections 30, 31, 32.

Assignment 09: Due Tues. April 2, 2019, 9:00PM

Last day of UW classes for term: April 5

Last modified on Tuesday, 26 February 2019, at 10:14 hours.