CPSC 349: Programming Paradigms — Winter 2006
Course Info
Name: CPSC 349: Programming Paradigms.
Description: Examination of the basic principles of the major programming language paradigms.
Focus on declarative paradigms as functional and logic programming. Data types, control expressions, loops,
types of references, lazy evaluation, different interpretation principles, information hiding.
Prerequisites: CPSC 331, (PHIL 279 or PHIL 377 (waived for engineers)).
| Class timings:
| |
L02: Tue/Thur @ 9:30 - 10:45 (ICT 121)
T05: Tue/Thur @ 11:00 - 11:50 (ST 63)
T06: Tue/Thur @ 13:00 - 13:50 (ES 653)
T07: Fri @ 14:00 - 15:50 (MS 205)
T08: Fri @ 14:00 - 15:50 (ENC 33)
|
| Grading:
| |
Assignments — 5 x 6% = | | 30% (note: best 5 marks of 6 will be taken)
|
| Midterm — | | 30%
|
| Final — | | 40%
|
Midterm: Thursday Mar. 2 (in class) — 50 mins.
Final: Tuesday Apr. 25 @ 08:00 - 10:00 (Gold Gym) — 120 mins.
Further info: documents in ~loose/349/*
Contact Info
- Instructor: Ken Loose
- Room: ICT 736
Email: loose@cpsc.ucalgary.ca
Office hours: Tue. 11:00 - 12:00, Wed. 13:00 - 14:00
- TA: Sean Nichols (T05 / T07)
- Room: ICT 618A
Email: nicholss@cpsc.ucalgary.ca
Phone: 210-9420
Office hours: Tue @ 12:00 - 13:00, Fri @ 16:00 - 17:00
Course website: http://pages.cpsc.ucalgary.ca/~nicholss/ta/w06_349/
- TA: Rylan Cottrell (T06 / T08)
- Email: cottrell@cpsc.ucalgary.ca
News & Announcements
- Monday Apr. 24
- Solution to the mock final is here. Good luck on your
exam!
- Thursday Apr. 20
- Final review will be on Monday April 24 @ 10:00 - 12:00 in ICT
116.
Apologies to those who cannot make it at this time. Again — If you have questions, I may
be in my office on Sunday Apr. 23, and will definitely be in my office (almost) all day Monday Apr.
24.
Assignment 3 marks (for those who do not yet have them) will be available at or before this
time.
- Sunday Apr. 16
- INFORMATION ABOUT THE FINAL REVIEW
I have posted up a mock final to the site. Hopefully this will help you
prepare for the final exam. I will be going over the solutions to the questions on this paper in a
final review, and will also be answering any questions at this time. Please visit the
poll to indicate what time is best for you. I will be collecting responses to
the poll, and will post the time for the final review sometime in the early AM of Wednesday Apr.
19.
- Tuesday Apr. 11
- T05: no tutorial on Thursday Apr. 13 (BSD).
T07: no tutorial on Friday Apr. 14 (Good Friday).
Re: Assignment 3 If you are considering dropping this course before the drop deadline
(Thursday Apr. 13 @ 17:00), and you want to see your assignment 3 mark before then to help you make the
decision, please let me know before Wednesday Apr. 12 @ 10:00 AM
so that I can prioritize my marking and ensure you get your grade on time! You can either email me or tell
me in person. If you do not let me know by this time, you will receive your mark before the final exam,
hopefully sometime next week.
New example posted... this covers converting control structures (for loops, if-then
conditionals and switch/case conditionals) between imperative, Haskell and Prolog code. May be useful for
your final exam. T07: I will not have a chance to present this, so make sure you go over it!
There will be a final review sometime in the Apr. 20 - Apr. 24 timeframe. Exact time and place to be
determined, and will be posted here.
- Monday Apr. 03
- No new material this week. Tutorials (Apr. 04 / 06 / 07) reserved for Q&A regarding assignment 3 (due
next Monday).
- Saturday Apr. 01
- Added the marks breakdown for Assignment 2.
- Friday Mar. 31
- Added a solution for Exercise 5.
- Tuesday Mar. 28
- Added a page to the links section containing 99 really good Prolog exercises
(with solutions).
- Monday Mar. 27
- Assignment 2 marks and comments are now up on blackboard for
all sections.
- Saturday Mar. 25
- The last Prolog IO example I posted had a bug in it (oops!). I've fixed it now, so if you
downloaded it and keep getting errors when you try to compile it, try downloading it again. (Thanks Tim for
alerting me to the problem!)
- Friday Mar. 24
- Posted a fifth set of exercises supplied by Dr. Loose.
Also added a solution for Exercise 4.
- Tuesday Mar. 21
- Added some code (again, different from Dr. Loose's) for doing I/O in Prolog to the
Examples section... should be useful for assignment 3.
- Monday Mar. 20
- Added a link to a quick Prolog graphing tutorial to the links section.
- Friday Mar. 10
- I've been asked a lot of questions about creating a "show" function for your user-defined data types, so I've posted up
a page that tries to answer them.
- Tuesday Mar. 07
- Posted a fourth set of exercises supplied by Dr. Loose.
- Tuesday Mar. 07
- All tutorials this week (Mar. 07 / 09 / 10) will be reserved for Q&A regarding assignment 2 (due next Monday). I will not be
presenting any new material in these tutorials.
- Tuesday Feb. 28
- Added a solution for Exercise 3.
- Friday Feb. 25
- Added a utility for you to check the output of your programs to make sure they follow the right
format. Please use this before submitting, especially if I commented on your assignment 1 that you did not follow the correct
format (this time around, you will lose marks for this).
- Wednesday Feb. 22
- Added a breakdown of the correct solutions submitted for the various test cases in assignment 1.
Please note: these are the same test cases I will use to test your next two assignments!
- Tuesday Feb. 14
- Posted a third set of exercises from Dr. Loose. These exercises have come from previous
exams, and will be good practice for your upcoming midterm on March 2!! T05: I will go over the
solution on Tuesday Feb. 28. T07: I will go over the solution this Friday Feb. 17 (sorry for the
lack of notice).
Sorry I don't have your marks posted yet. They are done, but we are having some issues with Blackboard (if you log
on, you won't see CPSC 349 listed as one of your courses). Please hang on; we will have your marks available
ASAP.
Finally, I've added some code (different from Dr. Loose's) for doing I/O in Haskell to the
Examples section... should be useful for assignment 2.
- Friday Feb. 10
- Added a set of solutions to Exercise 2.
- Thursday Feb. 09
- Posted the example from class: depth-first searching on trees and graphs.
- Friday Feb. 03
- Added a set of solutions to Exercise 1.
- Tuesday Jan. 31
- The next tutorial 05 (on Thursday Feb. 02) will be reserved for Q&A regarding assignment 1 (due next Monday). I will not be
presenting any new material in this tutorial.
- Monday Jan. 30
- Posted a second set of exercises supplied by Dr. Loose.
- Tuesday Jan. 24
- Tutorial 05 on Thursday Jan. 26 and Tutorial 07 on Friday Feb. 03 will be held in
MS 217 (the computer lab on 2nd floor,
Math Sciences building).
- Monday Jan. 23
- Added a page containing I/O specifications for the assignment, along with a few examples.
Posted a set of exercises supplied by Dr. Loose.
- Tuesday Jan. 19
- Added some algorithms to the links section of the webpage.
Assignments
Each assignment is essentially the same; the only difference is the language in which it must be implemented.
Assignment 1 must be written in an imperative language of your choice. C, C++ and Java are all
acceptable. Other languages (e.g.: Perl, Python, Pascal) may be ok; please check in with your TA (Rylan or
myself) to confirm; your assignment may not be graded if you choose a language other than C, C++ or Java without
checking with your TA. Assignment 2 must be written in Haskell. There are no exceptions.
Assignment 3 must be written in Prolog. There are no exceptions.
All assignments consist of the same two parts: Part A is a program to find the shortest path
between two cities in a specified graph. Part A of every assignment must be attempted to receive a passing
grade in this course. Any algorithm of your choice may be used to find this path. Part B
is a program to find a minimum spanning tree of the same graphs. You must use one of the two algorithms provided
(either Kruskal's Algorithm or
Prim's Algorithm). A quick note: Kruskal's is
probably easier to understand; Prim's may be easier to program...
For more details on the assignments, and the algorithms allowed for Part B, please see the files in
~loose/349/assignments/*.
I/O specifications for the assignments are here.
Neither Rylan nor I have the ability to give extensions to the deadlines below. If you feel you need an
extension, you must confer with Dr. Loose.
- Assignment 1: imperative language of your choice
- Due date: Monday Feb. 06, 2006 @ midnight (i.e.: 12:00 AM Feb. 07)
Marks / Test Cases (These are the same tast cases I will use for the
next two assignments!)
- Assignment 2: Haskell (functional)
- Due date: Monday Mar. 13, 2006 @ midnight (i.e.: 12:00 AM Mar. 14)
Marks / Test Cases
- Assignment 3: Prolog (logic)
- Due date: Monday Apr. 10, 2006 @ midnight (i.e.: 12:00 AM Apr. 11)
Exercises & Examples
The exercises posted below are not mandatory and will not be graded, but it is strongly suggested that you
work through them to ensure your understanding of the course material is complete. Any code examples I go over in
class will be posted here.
- Exercise 1 (Solution)
-
Section T05: I will be going through this in class on Tuesday Jan. 31.
Section T07: I will be going through this in class on Friday Feb. 03.
- Week 2 Examples
-
I will be going over these examples during week 2 (Jan. 24 / 26 / 27).
- Exercise 2 (Solution)
-
Section T05: I will be going through this in class on Tuesday Feb. 07.
Section T07: I will be going through this in class on Friday Feb. 10.
- Week 4 Examples: tree search, graph search
-
I will be going over these examples during week 4 (Feb. 07 / 09 / 10). The graph search code in particular may be
useful when you work on assignment 2...
- Week 5 Examples: IO in Haskell
-
I will be going over these examples during week 5 (Feb. 14 / 16 / 17). May be useful for assignment 2.
- Exercise 3 (Solution)
-
Section T05: I will be going through this in class on Tuesday Feb. 28.
Section T07: I will be going through this in class on Friday Feb. 17.
- Week 7 Examples
-
I will be going over these examples during week 7 (Feb. 28 / Mar. 2 / 3).
- Week 8 Examples: show functions for user-defined types
-
Answers the question I've been asked in labs and on email: "How do I create a "show" function for my data types?"
- Exercise 4 (Solution)
-
Section T05: I will be going through this in class on Tuesday Mar. 21.
Section T07: I will be going through this in class on Friday Mar. 24.
- Week 9 Examples, "Hello, World" standalone
-
I will be going over these examples during week 9 (Mar. 14 / 16 / 17).
- Week 10 Examples: IO in Prolog
-
I will be going over these examples during week 10 (Mar. 21 / 23 / 24). May be useful for assignment 3
(was broken, now fixed).
- Exercise 5 (Solution)
-
Section T05: I will be going through this in class on Thursday Mar. 30.
Section T07: I will be going through this in class on Friday Mar. 31.
- Week 11 Examples
-
I will be going over these examples during week 11 (Mar. 28 / 30 / 31).
- Week 13 Examples: converting control structures between C /
Haskell / Prolog
-
I will be going over these examples during week 13 (Apr. 11). If you are in the section T07 (Friday), please look
over these examples! We will not have a tutorial where I can present them, and they may be useful for your final!
These examples cover converting for loops, if-then conditionals and switch/case conditionals
between the different paradigms. Make sure you understand how they work for the final.
Useful Links
|