CSCI-291: Programming Language Paradigms

Spring 2024

Contact Info

Instructor: Brad Richards
Lectures: MWF 1:00-1:50, TH399
Phone: x3579
Email: brichards@pugetsound.edu
Office: Thompson 401
Office Hours: MWF 10:10-10:50, Th 12-12:50 (via Zoom)
Tutor Schedule: See bottom of the schedule page
CWL Tutors: subject tutors
Course Comments: anonymous comment form
Department Comments: anonymous comment form

Covid:

As you're no doubt aware, variants of the Covid virus are still present in the surrounding area. It's highly transmissible, can be passed to (and by) those of us who are vaccinated, and can result in significant long-term illness even if you're vaccinated. Please take all possible precautions to avoid spreading Covid. Do not come to class if you're feeling sick or have had close contact with someone who is. Consider wearing a mask in class. All of my office hours will be held via Zoom, at least initially. (Our Zoom meeting room is 988 439 5089. Password and direct link are available on Canvas.)

Contents

Resources:

Our Zoom is 988 439 5089. Password (and direct link) available on Canvas.

Code and transcripts from class.

Other miscellaneous documents from class.

Haskell:

Logic Programming:

Schedule:

Week Topic Reading  
1/15 Intro to Haskell: Expressions, fn definitions, lists.
No class Monday
Chapters 1, 2 Research Paul Graham. Read this, and then this. This article is worth reading too.
Assignment 1 (solns)
1/22 More on defining functions, lists; Types Chapters 3, 4  
1/29 More on types and typeclasses, Recursion, Functions as values. Chapters 5, 6 Assignment 2 (solns)
2/5 Applicative programming, Returning functions Chapter 6 Assignment 3 (solns)
2/12 More on returning functions, Defining types Chapter 8 Assignment 4 (solns)
2/19 More types, Larger examples Chapter 8 Assignment 5 (solns)
2/26 Lazy Evaluation Lazy, Example Assignment 6 (solns)
3/4 Cyclic Programming, Managing state (monads) Chapter 12, other  
3/11 Spring Break
3/18 More on managing state
Exam Wednesday in TH409
Chapter 12, other Study Guide, Old Exam, Old solns, New solns
3/25 Prolog intro, Facts, Rules, and Queries Section 1 Assignment 7
4/1 Matching & binding, Proof Search
No class Monday
Section 2  
4/8 Recursion, Lists, Arithmetic Section 3, 4, 5  
4/15 Terms, Cuts and Negation Section 9, 10  
4/24 Collecting solutions
No class Friday
Section 11  

Background:

Declarative programming languages are an important alternative to languages (such as C, C++, and Java) that use the more familiar imperative programming paradigm. This course introduces the functional, dataflow, and logic programming paradigms in depth through assignments in the programming languages Haskell and Prolog. These languages are based on models of computation that are fundamentally different from the von Neumann model underlying imperative programming languages, and exposure to these new paradigms provides valuable perspective on programming and problem solving in general.

This course builds progressively on previously covered material. Therefore, it is essential to attend all classes and keep up with the reading and the assignments. Students are expected to attend all lectures, with exceptions permitted in case of illness and family emergencies, and should do the assigned readings before each class.

Learning Objectives:

By the end of the semester, successful students should:

Grading:

Homework for this class will be submitted electronically, and must be turned in by class time on the due date for full credit (unless the assignment explicitly states otherwise). Late homework will be penalized 5% per day, and will not be accepted more than one week late. The following grade cutoffs are upper bounds — they might come down, but will not be set higher: A = 95, A- = 90, B+ = 88, B = 83, B- = 80, C+ = 77, C = 73, C- = 70, D+ = 67, D = 64, D- = 60, F = <60. Your overall grade is composed as follows:

Community Statement:

The course will work best if we respect and welcome each other no matter what level of "readiness" we are at, and we all support one another in learning. I will not tolerate behaviors that could negatively affect another student's classroom experience. Such behaviors might include: making rude or condescending comments, snickering at others' questions or comments, talking over other individuals, and so on. I reserve the right to withdraw a student from this class who is repeatedly exhibiting such behavior.

The goals of this course can only be accomplished in a setting of mutual respect, where ideas, questions, and misconceptions can be discussed with civility. As your instructor, I am committed to creating a classroom environment that welcomes all students, regardless of their identities (e.g., race, class, gender, sexual orientation, religious beliefs). I firmly believe that everyone in the class is fully capable of engaging and grasping the material, and that the world of computing is stronger when it includes the broadest possible set of perspectives. We all have unconscious biases, and I will try to continually examine my judgments, words, and actions to keep my biases in check and treat everyone fairly. I hope that you will do the same. If you feel comfortable, please let me know if there is anything I can do to make sure everyone is encouraged to succeed in this class.

Academic Integrity

The assignments form a crucial part of the course and, unless stated otherwise, students are required to work on them individually. Please ensure that any work you take credit for is your own. Inappropriate collaboration with other students is not permitted and will be subject to severe penalties. In particular, sharing your work in any way with other students (e.g. code inspection, sharing code electronically via email or photos, etc) is inappropriate, as is copying part or all of someone else's work. Code or other hints found online must be attributed, and should not compromise your ownership of the work. Please review the university's Academic Integrity policy and ask me if you have any questions regarding its application to this course.

University, Academic, and Administrative Policies

There are many university policies and resources that offer guidance on how to be safe and make the most of your college education. Here are a few that you should take a moment to review: