There are code samples in these directories that may not be web accessible, but that you can read and copy from your CS account.
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.
- Code problem E in a common imperative/OO language (recommended Python and Java). Include unit testing and trace of execution.
- 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.
Reading:Goal: Ability to encode simple problems into Curry programs and to execute and test them.
- Slides (4up)
- Tutorial up to Sect. 3
- Consult the Pakcs Manual as needed to execute and test programs.
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.
Reading:Goal: Understanding rewriting as a model for functional logic computations
- Slides (4up)
- Quick Introduction to Term Rewriting.
- Only for consultation Terese Lite
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.
Reading: Goal: Understanding narrowing and using it for programmingHomework: Exercises number 5, 8, 9, and 10a found in the slides. Submit according to the usual conventions (format, medium, schedule, etc.)
Reading: Goal: Understanding the evaluation strategy of narrowing (functional logic) computationHomework: 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.)
Reading: Goal: Learning an abstract compilation scheme for a functional logic languageHomework: 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:
Reading: Goal: Understanding patterns and ability to apply some simple pattern to a problemHomework: 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.
Reading: Goal: Understanding declarative input/outputHomework: 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