CSCE 330: Programming Language Structures (Fall 2016)

Prerequisites: CSCE 240 and either MATH 374 or MATH 174

Section 1: TTh 1315--1430 SWGN 2A31

Section 2: MW 1640--1755 SWGN 2A27

Instructor (Section 1): Marco Valtorta
Office: Swearingen 3A55, 777-4641
Office Hours: MF 1030-1200 and by appointment
Teaching Assistant: Mohammad Ali Javidian
Office Hours: M 1000-1130 and Th 930-1100, Swearingen 3A42

Instructor (Section 2): Aaron Hein
Office Hours: W 1300-1600, Swearingen 3A42

Any student with a documented disability should contact the Office of Student Disability Services at (803)777-6142 to make arrangements for proper accommodations.


Grading Policy

Reference materials:

  • Hector J. Levesque. Thinking as Computation. The MIT Press, 2012 (required text, referred to as [L]). Supplementary materials from the author are available.
  • Graham Hutton. Programming in Haskell. Cambridge University Press, 2007 (required text, referred to as [U]). Supplementary materials from the author, including an errata list, are available. Here is the direct link for Chapter 11 ("The Countdown Problem") lecture. Here is the direct link for the countdown program code, in literate Haskell format.
  • The current departmental syllabus lists the following outcomes of instruction for this course: Specific objectives of this course are: If time allows, we will also study the run-time behavior of block-oriented, statically-typed imperative languages.

    Lecture Log

    Lecture Notes

    Homework, Tests, and Programs
    Study guide for the final exam, fall 2016
    Final exam from 2013
    Some notes and examples for the fall 2015 midterm, courtesy of James O'Reilly
    Programs and related notes follow.

    1. Predicates describing a solar system; similar in difficulty to predicates for HW3 (family predicates from ch.4[L])
    2. Description of the brainbasher puzzle
    3. Prolog code for the brainbasher puzzle, solved using the generate and test approach described in ch.5[L] and applied in HW4 from ch.5[L].
    4. Some examples of list predicates (cf. ch.7[L])
    5. A program that applies list predicates
    6. List reversal using an accumulator
    7. Description of the list reversal program using an accumulator
    Miscellaneous programs (naive and tail-recursive versions for most):
    1. Factorial
    2. Fibonacci numbers
    3. Length of a list
    4. Sum of a list of numbers
    5. Inner product of two vectors represented as lists

    See the lecture log for assignments not listed below.
  • Grading policy per assignment
    Please include examples of use for Prolog assignments. The examples of use should address all types of queries or predicates that you are asked to write. You may create a log of an SWI-Prolog session using protocol/1 and noprotocol/0. See
    Please include examples of use for Haskell assignments. Please copy and paste from the WinGHCi or GHCi editor window; to save space, do not insert windows directly.
    Solutions for the exercises from Hutton's book are easily available. Please, on your honor, do not consult them.
  • Midterm from 2012 edition of the course (with some changes) (MS-Word format).
  • HW6, based on a video lecture by John Backus,

    Prolog Information

    Haskell Information

    Student Presentation

    Quizzes (In-Class Exercises)
    Quiz 1 of 16-08-23 (in pdf format, with answer)
    Quiz 2 of 16-09-03 (in pdf format, with answer)
    Quiz 3 of 16-09-17 (in pdf format, with answer)
    Quiz 4 of 16-09-22 (in pdf format, with answer)
    Quiz 6 of 16-11-01 (in pdf format, with answer). Note: Q5 will be given later.
    Quiz 5 of 16-11-10 (in docx format, with answer).
    Quiz 7 of 16-11-15 (in docx format, with answer).
    Quiz 8 of 16-11-18 (in docx format, with answer).
    Quiz 9 of 16-11-29 (in docx format, with answer).

    Some useful links:
    In this class, we write dates according to ISO Standard 8601.
    Brian Hayes. "The Semicolon Wars." _American Scientist_, July-August 2006, pp.299-303. Local copy, pdf.
    Philip Wadler, "Monads for Functional Programming" (pdf, local copy; bibliographical details at the bottom of the first page). Chapter 5 (especially starting with section 5.2) mirrors the presentation in Chapter 8 [H]. The beginning of Section 5.4 specifies the unit and * operations needed to define a monad. The discussion at the beginning of Section 5.12 explains that these operations have the monad properties, and therefore the parsers of Chapter 8 [H] are monads: "The empty parser and sequencing correspond directly to unit and *, and the monads laws reflect that sequencing is associative and has the empty parser as a unit. The failing parser and alternation correspond to zero and (XOR), which satisfy laws reflecting that alternation is associative and has the failing parser as a unit, and that sequencing distributes through alternation."
    Philip Wadler, "Propositions as Types" (video, September 25-26, 2015). Related paper: Philip Wadler. "Propositions as Types." Communications of the ACM, 58, 12, 75-84 (December 2015). ( Long version from author's website (pdf))
    Functional Programming in the Real World.
    Repository of Code for: Cristina Videira Lopez. Exercises in Programmign Style. CRC Press, 2014.
    Parnas D.L. (December 1972). "On the Criteria To Be Used in Decomposing Systems into Modules" (PDF). Comm ACM 15 (12): 1053-1058 (local copy).
    Derek Partridge and Yorick Wilks. "Does AI Have a Methodology Different from Software Engineering?" Technical Report MCCS-86-53 (1986), Computing Research Laboratory, University of New Mexico (local copy).
    Computer Language History web site by Eric Levenez
    The Ariane 5 launch disaster.
    Local copy of: Adrion, W.A., M.A. Branstad, and J.C. Cherniavsky. "Validation, Verification and Testing of Computer Software." ACM Computing Surveys, 14, 2 (June 1982), pp.159--192.
    Local copy of: Rajlich, V., N. Wilde, M. Buckellew. and H. Page. ``Software Cultures and Evolution.'' _Computer_, 34, 9 (September 2001), pp.24--28.
    C.A.R. Hoare. "Retrospective: An Axiomatic Basis for Computer Programming." _Communications of the ACM_, 52, 10 (October 2009), pp.30-32.
    C.A.R. Hoare. "An Axiomatic Basis for Computer Programming. _Communications of the ACM_, 12, 10 (October 1969), 576-580.
    John McCarthy. "A Micromanual for LISP---Not The Whole Truth." ACM SIGPLAN Notices, Vol. 13, Issue 8 (August 1978), Pages 215-216 (local copy)
    The Simplesem interpreter
    : unzip, and follow the instructions in readme.txt. This is a Java implementation that seems robust and will run in Windows.
    Carter Bays's FP interpreter
    John Backus. "Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs." Communications of the ACM, 21, 8 (August 1978), 613-641
    John Backus: Function Level Programming and the FL Language: a 1987 lecture on FP by John Backus.
    Boyko Bantchev's List of Interviews with Programming Language Creators from Computerworld's series "The A-Z of Programming Languages (pdf)
    A to Z of Programming Languages Index
    J.W. Backus. "The 701 Speedcoding System." Journal of the ACM, 1, 1, pp.4-6, 1954 (local copy).
    A site with a short program written in many languages, not including FP.
    A site with another short program written in several languages..
    Examples of APL code
    John McCarthy, developer of LISP, wins the Franklin Medal
    John McCarthy's Obituary from the _New York Times_, 2011-10-25 (local copy).
    Dennis Ritchie's Obituary from the _New York Times_, 2011-10-13 (local copy).
    Joe Armstrong. "Erlang." Communications of the ACM, Vol. 53 No. 9 (September 2010), Pages 68-75.. This article describes the notion of dynamic code upgrade.
    Pascal Rigaux's Diagrams of Programming Language History.
    Eric Levenez's Genealogy of Programming Languages.