Sections 501 and 900 (online)

Instructor: Jeremy Johnson

Format: online take home exam with fixed amount of time Final exam date: anytime starting Sat. June 8 (9am) and must be completed by Fri. June 14 (9am).

- Functional programming and scheme (Chapter 10 Sec. 1-5 of the text
and Lecture on scheme).
- evaluating S-expressions and the substitution model of evaluation. normal vs. applicative order.
- recursive functions in scheme
- data structures and list processing in scheme
- higher order functions (functions that are passed or return functions). E.G. map, filter, reduce, currying.

- Streams and delayed evaluation (Chapter 10 Sec. 4 of the text
and Chapter 3 Sec. 1 and 4 of SICP),
and Lecture on streams).
- stream processing with map, filter, reduction, etc.
- delay and force
- thunks and implementing delay and force.

- Lambda Calculus (10 Sec. 6 of the text
and Lecture on lambda calculus).
- Substitution model of computation (abstraction and application)
- free and bound variables
- alpha conversion and beta reduction and Church-Rosser
- universality of lambda calculus (arithmetic, boolean logic, conditionals, lists, and recursion).

- Environments and the scheme interpreter (Chapter 4 Sec. 1-2 of SICP).
and Lecture on scheme interpreter).
- why assignment can not be modeled with substitution
- environments - use and implementation
- scheme interpreter from SICP
- static vs. dynamic scope
- delayed evaluation

- Logic programming and prolog (chapter 11 of the text
and Chapter 4 Sec. 4 of SICP, and
Lecture on logic programming and the query language).
- Horn clauses
- Resolution and unification
- Prolog syntax and evaluation
- Prolog's search strategy (depth-first search and backtracking)
- Search order makes a difference - why?
- controling search with cut!

- Write a recursive scheme function and use and manipulate lists, including recursive data structures (e.g. trees).
- Write and use higher-order scheme functions
- Use substitution model of function application and lambda calculus.
- Use environment model of function application
- Trace through the execution of the scheme interpreter
- Understand the difference between static and dynamic scope and normal and applicative order.
- Write simple prolog rules to specify computation
- Reduce a horn clause using resolution and unification
- Trace through prolog evaluation (resolution, unification, and search with backtracking)
- Understand the consequences of cut on prolog search

There will be four questions (with multiple parts): 1) functional programming and scheme, 2) substitution model and lambda calculus, 3) scheme interpreter, environments, and delayed evaluation 4) Query language and logic programming and prolog