CSCE 330 (Fall 2023): Lecture Log

August 24 (Thu), 2023 Syllabus handout (also on the main course web site). Textbooks. Why study principles of PLs?

August 29 (Tue), 2023 dropbox. (As always, see "Grading per assignment" link on the main course website for a brief rubric; see the entry in the departmental dropbox for sumbission details.) Keep your work to a single page. More introduction and history, using the introductory slides on the course website.

August 31 (Thu), 2023 More introduction and history, using the introductory slides on the course website. The Von Neumann computer architecture. Other computer architectures. The three major language families. Euclid's algorithm in C, Scheme, OCaml, Haskell, and Prolog.

September 5 (Tue), 2023 Ch.1 [L] ("Thinking and Computation") almost completed.

September 7 (Thu), 2023 Quiz 1. Ch.2 [L] ("A Procedure for Thinking") almost completed. HW2 assigned. See dropbox for details.

September 12 (Tue), 2023 Quiz 2. HW2 must be submitted via the departmental dropbox (https://dropbox.cse.sc.edu). One .pl file musy be provided; it must include the Prolog program and commented examples of use; one example per part of the exercise. To save the examples of use, I recommend using protocol/1 and noprotocol/0. You may check the current working directory using working_directory(CWD,CWD) and change it with working_directory(_,NEWWD). Ch.2 [L] ("A Procedure for Thinking") completed. The instructor shows how to install SWI-Prolog in Windows (and installs the latest stable version, 9.0.4, on his laptop in class). Example of consulting, editing, and running a Prolog program: Euclid's GCD three-clause program. Ch.3 [L] ("The Prolog Language") started.

September 14 (Thu), 2023 Quiz 3. HW2 due date changed to 2023-09-19. Ch.3 [L] ("The Prolog Language") almost completed. Examples of editing, loading, running, modifying, and tracing Prolog programs.

September 19 (Tue), 2023 Ch.3 [L] ("The Prolog Language") completed. Examples of editing, loading, running, modifying, and tracing Prolog programs. Review of the HW2 requirements. The instructor shows how to access SWI-Prolog (swipl at the Linux prompt) on the departmental Linux machines. HW2 must be submitted via the departmental dropbox (https://dropbox.cse.sc.edu). One .pl file musy be provided; it must include the Prolog program and commented examples of use; one example per part of the exercise. To save the examples of use, I recommend using protocol/1 and noprotocol/0. You may check the current working directory using working_directory(CWD,CWD) and change it with working_directory(_,NEWWD). Alternatively, you can cut and paste from the SWI-Prolog interpreter to the file with your program. The instructor showed both options. Extra topic: negation as failure using the cut (!) and the fail predicate. Note to students: never use the cut in this course. Much Q&A.

September 21 (Thu), 2023 HW3 will consist of the exercise at the end of Ch.4 [L]. Details to follow. Review of the last section of Ch.3 [L] (Prolog back-chaining) with a detailed example of how unification builds a unifier as a set of substitutions, using Loveland's presentation with pointers to symbols. Examples of use of the back-chaining procedure of Figure 3.12 [L]. Much Q&A. Ch.4 [L] (Writing Prolog Programs) started.

September 26 (Tue), 2023 HW3 assigned. See departmental dropbox for details. Ch.4 [L] ("Writing Prolog Programs") completed: the blocks world example. Mathematical induction. Size of a predicate. Proof of partial correctness of above/2 and left/2. Correctness requires termination, which can be established by showing the diminishing size of a predicate. (Termination was only described very briefly.) Mathematical induction, with a detailed example of proof by induction. Recursive programs and induction. Induction can be used to prove that a recursive program is correct. Induction can also be used as a guide to writing Prolog programs. The base case is usually a clause. The induction step is usually a collection of one or more clauses, which are determined by case analysis. We will see that a similar technique can be used in Haskell for functional programs.

September 28 (Thu), 2023 Termination of recursive programs, by using a non-negative size measure for the recursive predicate. Discussion of the subway example (exercise at the end of ch.2 [L]) in detail with a Prolog implementation, done in class. All parts completed except the last one.

October 3 (Tue), 2023 Midterm exam date is confirmed (as in Syllabus): Thursday, October 12, 2023. Observations related to the subway problem in prolog: monotonicity of definite clause logic (the logic of facts and rules), impossibility of conflicts in definite clause logic KBs. Chapter 5 [L] ("Satisfying Constraints") through 5.3.1. HW4 assigned: exercises 2, 3, and 4 at the end of Ch.5[L], due on Tuesday, 2023-10-10.

October 5 (Thu), 2023 Midterm exam date is confirmed (as in Syllabus): Thursday, October 12, 2023. Different versions of factorial programs, both correct and incorrect. Tail-recursive vs. non-tail recursive programs, with factorial examples. Ch.5 [L] continued through the non-starred part of Section 5.5.

October 10 (Tue), 2023 Midterm exam date is confirmed (as in Syllabus): Thursday, October 12, 2023. Q4 and Q5. Ch.5 [L] completed. Review of HW4.

October 12 (Thu), 2023 Midterm (MT1). This exam was proctored by the TA, Qiaoyu Liang.

October 17 (Tue), 2023 HW5 assigned, due 2023-10-26: Exercise 6 Ch.7 [L]. Ch.6 [L] ("Case Study: Interpreting Visual Scenes:): Section 6.2 only. Ch.7 [L] ("Lists in Prolog") through Example 1 in section 7.2.1.

October 24 (Tue), 2023 Ch.7 [L] ("Lists in Prolog"), completed. Brief presentation of Ch.8 [L] ("Case Study: Understanding Natural Language"). Syntax started.

October 26 (Thu), 2023 HW6 assigned, due 2023-10-02. (Syntax. See dropbox for details.) Q6. Syntax continued, through the dangling else ambiguity.

October 31 (Tue), 2023 HW7 assigned, due 2023-11-09. (Ch.1 [H]. See dropbox for details.) Syntax completed.

November 2 (Thu), 2023 Midterm returned. Haskell started: Ch.1 [H] ("Introduction") with discussion of the assigned HW7.

November 7 (Tue), 2023 HW8 (Chs. 2 and 3 [H]; see dropbox for details) assigned, due on Tuesday, November 14. Q7. Ch.1 [H] completed. Ch.2 [H] ("First Steps") almost completed, with explanation of where ghci (the required Haskell interpreter) can be accessed and used on the departmental Linux machines and of how ghci can be installed on a personal Windows computer. Several examples of computation by function application.

November 9 (Thu), 2023 Important note about homework from [H]. Some of the exercises have solutions in Appendix A [H]. You are allowed to use them, but please try to do each exercise by yourself before using the author's solution. HW9 (Backus video; see dropbox for details) assigned, due on Thursday, November 16. Student presentations will be assigned soon. Please review the requirements in the Student Presentations section of the main course website (where dates will be updated lated). Ch.2 [H]: "First steps" completed. Ch.3 [H]: "Types and Classes" almost completed.

November 14 (Tue), 2023 HW10 (from ch.4 [H]; see dropbox for details) assigned, due on Tuesday, November 21 Ch.3 [H] completed. Ch.4 [H] ("Defining Functions") completed. Student presentations will be assigned soon. Please review the requirements in the Student Presentations section of the main course website (where dates will be updated lated) and try to find partners for a three-person presentation team.

November 16 (Thu), 2023 HW11 (from Ch.5 [H]; see dropbox for details) assigned, due on Tuesday, November 30. Some presentation teams are set up. Two more homework assignments will be assigned: HW12 will consist of exercises 4, 7, and 8 from Ch.6 [H]; HW13 will consist of exercises 7 and 8 from Ch.7 [H]. Discussion of HW9 including snippets of Backus's video on FP/FL. Ch.5 [L] ("List Comprehensions") completed (not including the Caesar Cypher example).

November 21 (Tue), 2023 HW12 assigned: exercises 4,7, and 8 Ch.6 [H]. HW13 assigned: exercises 5 and 9 Ch.7 [H]. More presentation teams are set up (13 in all; 1-14; 13 skipped), for all students in class. Ch.6 [H] ("Recursive Function") completed.

November 28 (Tue), 2023 There will be no penalty for late HW13 submissions (up to class on December 5). Presentation teams set up (16 in all; two students still do not have a team and should contact me to set up a team). Ch.7 [H] ("Higher-Order Functions") completed.

November 30 (Thu), 2023 Because of technical issues, the instructor could not show images from his laptop. We watched the "Countdown Problem" lecture video by Graham Hutton (the author of [H]). The material corresponds to Ch.9 [H] ("The Countdown Problem"). The instructor filled in some material from Ch.8 [H] ("Declaring Types and Classes") to explain the data and type declarations used in the lecture. The students are asked to complete the univeristy-provided course survey in Blackboard. The next two classes will be devoted to student presentations.

December 5 (Tue), 2023 Student presentations: Fortran (team 2), R (5), Arduino (7), Ruby (9), Sh (11), and Yacc (14).

December 7 (Thu), 2023 Student presentations: C# (team 3), Lua (4), Groovy (6), Perl (10), Mercury (12), Falcon (13), Erlang (15), Smalltalk (16). Students are reminded that the final exam will be in class at the standard time for classes meeting at 1315 TTh. The time is also written in the syllabus. The exam will be closed book and notes. Students are asked to submit a course evaluation using the form in Blackboard. End of course.