CSE 130: Principles of Programming Languages
- Please hand in homework in paper hardcopy form; do not email me or the TA
an attachment! Computer printed paper is much preferred; if your handwriting
is too hard to read, you will lose points. You may also lose points if your
solution is too difficult to understand, whether due to English or technical
- Please give the assignment set number and problem number for each
question; also be sure to include your name, and the due date. If there are
multiple pages, you should staple them; since there are many students, loose
pages are likely to be lost, and you will not get credit.
- For problems that require use of a computer, always hand in both your
input and your output as part of your solution.
- Please do not ask the TAs or professor for help doing your homework; this
is not fair to other students. Especially, please do not do so in a sneaky
way; we have all been deluged with such questions by email, and from now on we
will take off points if you ask them. Of course, it is acceptable to ask
questions about the content of the course - indeed, it is encouraged! And you
can also ask about bugs in the homework questions (if there are any).
- Assignments will normally be posted by Friday, due on Tuesday of the
following week. Homework due more than 5 days away is subject to change.
- Every problem you hand in will be checked, but only a random subset
(chosen to be maximally helpful to you, subject to our resource limitations)
will be graded; you will get up to 3 points for a problem that is handed in
and checked, and up to 10 points for one that is graded; of course, the total
for homework will be weighted appropriately when combined with the midterm and
- Be sure to reload pages frequently, because sometimes they may be updated
frequently (i hope this is unnecessary since I have put meta tags on pages,
but it is not guaranteed).
- Due 13 January:
- Briefly compare Java with at least three other languages, such as
FORTRAN, COBOL, BASIC, Algol, C, Lisp, ML, Ada, C++, etc; the languages that
you choose for comparison should be very different from each other; write one
paragraph for each comparison; please try to hit the main points and avoid
the trivial points.
- Say what is your own favorite programming language, and explain why you
like it, without falling into merely subjective considerations; i.e., you
should base your argument on real historical, cultural, and pragmatic
considerations, such as those described in the Essay on Comparative Programming
- Exercise 1.10 of Sethi (p. 22).
- Due 20 January:
- Give a BNF definition (do not use extended BNF) of a language of
balanced parentheses, in which the only two tokens are ( and
). For example, ()() and ((()))()((()())) are in
the language, but ((() is not.
- Exercise 2.7 of Sethi (p. 49).
- Exercise 2.8 of Sethi (p. 49).
- Due 27 January:
- Exercise 3.2 of Sethi (p. 95).
- Exercise 3.10 of Sethi (p. 97).
- Write pseudo-code for the computation of leap year in Example 3.1 (page
66) using a case statement based on the remainder of year divided by 400;
you may use a nested case statement, but do not use any conditionals.
- Due 3 February:
- Exercise 4.3 of Sethi (p. 143).
- Exercise 4.7 of Sethi (p. 145).
- Exercise 4.8 of Sethi (p. 145).
- Due 10 February:
- Exercise 5.2 of Sethi (p. 198-99).
- Exercise 5.8 of Sethi (p. 201).
- Exercise 5.9 of Sethi (p. 201).
- Due 19 February:
- Exercise 6.1 of Sethi (p. 248).
- Exercise 6.2 of Sethi (p. 248); hand in source code and output showing
that the compiled code executes correctly on some not totally trivial
examples. You may use Java instead of C++ if you prefer.
- Exercise 6.4 of Sethi (p. 248).
- Due 26 February:
- Exercise 8.2 of Sethi (p. 336-7).
- Exercise 8.3 of Sethi (p. 337).
- Exercise 8.12 of Sethi (p. 338).
- Due 4 March: Your code should be executable and you should hand in output
for two test cases for each part of each question.
Note: You may use a different Prolog than BinProlog if you prefer.
- Exercise 11.2 of Sethi (p. 470).
- Exercise 11.4 of Sethi (p. 471).
- Exercise 11.5 of Sethi (p. 471).
- Due 11 March: You should run your code and hand in the output for two test
cases for each part of each question where applicable.
- Exercise 9.3 of Sethi (p. 380).
- Exercise 9.5 of Sethi ( p. 380).
- Exercise 9.8 of Sethi ( p. 381).
Standard ML of New Jersey, version 110.0.6 is available on all CSE unix
/net/cs/class/development/elkan/cse230/sml-110/bin/sml, which you
can either define as an alias for
sml, or else you can add the
path for its directory to the
PATH variable of your environment.
You should actually run your ML code for all of the ML programming problems,
and turn in your code along with its output.
Binary for BinProlog 4.00 for Solaris machines (such as the CSE
instructional machines beowulf, bintijua, kongo, or the machines in the APE
lab) can be found at /net/cs/class/wi99/cse230/prolog/bp, and also as a
backup, at /net/cat/disk1/prolog/bp; the latter directory also contains
some other files, including some relevant to exercises, so that you don't have
to do all the typing yourself. Some basic notes on using BinProlog 4.00 are
To CSE 130 homepage
Maintained by Joseph Goguen
© 2000 - 2004 Joseph Goguen
Last modified: Sat Mar 13 19:50:58 PST 2004