Schedule

See the diary for a list of what has been covered so far, when some homework is due, and what is planned next, if you want to read ahead.

There are code samples in these directories that may not be web accessible, but that you can read and copy from your CS account.

Declarative programming

Reading: slides (4up)

Goal: understanding the difference between imperative and declarative programming. Detecting the elements of a problem and stating the relationships between them.

Homework: due in class on paper at the beginning of the next lecture, estimated total effort less than an hour.

  1. Code problem E in a common imperative/OO language (recommended Python and Java). Include unit testing and trace of execution.
  2. Consider a small (but not too small) problem of your choice. Describe the problem in English. Define the elements of the problem. State some interesting/relevant relationships between them.

An introduction to Curry

Reading:
  1. Slides (4up)
  2. Tutorial up to Sect. 3
  3. Consult the Pakcs Manual as needed to execute and test programs.
Goal: Ability to encode simple problems into Curry programs and to execute and test them.

Homework: due on paper in class at the beginning of the Tuesday lecture following the completion of this unit. See the diary for the exact date.

Fill in the missing portions of code which are identified by "...". The amount of code is quite small. The focus is on reasoning about the code and understanding why is (or is not) correct.

  1. Problem 1
  2. Problem 2
  3. Problem 3

Rewriting

Reading:
  1. Slides (4up)
  2. Quick Introduction to Term Rewriting.
  3. Only for consultation Terese Lite
Goal: Understanding rewriting as a model for functional logic computations

Homework: Exercises number 3, 5, 6 and 9b found in the slides. As usual, due on paper in class at the beginning of the Tuesday lecture following the completion of this unit. See the diary for the exact date. If you cannot complete the exercises because of the functional logic paradigm, code the problems in your preferred imperative or object-oriented language and point out what you are not able to do in Curry.

Narrowing

Reading:
  1. Slides (4up)
  2. Programming with Narrowing: a Tutorial.
Goal: Understanding narrowing and using it for programming

Homework: Exercises number 5, 8, 9, and 10a found in the slides. Submit according to the usual conventions (format, medium, schedule, etc.)

Strategies

Reading:
  1. Slides (4up)
Goal: Understanding the evaluation strategy of narrowing (functional logic) computation

Homework: Exercises number 6 and 8 in the slides. Code a Curry program for this problem. Submit according to the usual conventions (format, medium, schedule, etc.)

Compiling

Reading:
  1. Slides (4up)
  2. Paper: Needed Computations Shortcutting Needed Steps
Goal: Learning an abstract compilation scheme for a functional logic language

Homework: Exercises number 6A, 6B and 9 in the slides. Code a Curry program for the U2 problem at http://okmij.org/ftp/kakuritu/StrangeLoop.pdf. Submit according to the usual conventions.

Code Examples:

  1. Compilation in Python of the append function
  2. Unit testing of the program above

Design Patterns

Reading:
  1. Papers: Functional Logic Design Patterns and New Functional Logic Design Patterns
  2. Pattern Website
Goal: Understanding patterns and ability to apply some simple pattern to a problem

Homework: Code a program to compute the combinations of k elements out of a set of n elements, and similarly the combinations with repetitions. Hint: take advantage of non-determinism.

Homework: Complete the assignment about Jumping Numbers.

IO

Reading:
  1. Slides (4up)
Goal: Understanding declarative input/output

Homework: Complete the following assignment blocks worls prettyprint. Hint: abstracting the output simplifies the problem.

Contact: antoy@cs.pdx.edu
Last update Tue 22 Oct 2019 01:48:25 PM PDT