CSE 3401A Functional and Logic Programming
Summer 2008
Department of Computer Science and 
Engineering,
York University
What's new:
- August 15: Unofficial final grades are out. Use courseInfo to check your marks. These grades are unofficial until approved by the 
Senate. 
- August 3: Solution to assignment 2 posted (see week 13 in ``readings and lecture transparencies" below)
- July 31: Final exam schedule: Tue, 5 Aug 2008, 
 19:00 ~ 22:00 @ SLH B
- July 31: Sample Prolog questions posted 
(see ``Sample Test 
Questions" below)
- July 30: All remaining office hours cancelled (except for one: 
July 31st from 2:30-4:00PM)
- July 23: Test 2 solution posted (see "Readings and Lecture 
Transparencies" below)
- July 22:  Assignment 2 due date extended 
(again)! Due on July 30th 
- July 16: Today's office hours are cancelled
- July 9: Assignment/Report 2 extended : due on 
July 23rd
- July 6: Extra office hour for the test: Monday July 7 from 
2:30-4:00PM 
- July 4: Many have asked me about the syllabus of class test 2: 
everything that has been covered up to and including week 8 is included in 
the exam (i.e. slide 33 of lecture7.pdf).
- July 3: Report/Assignment 2 is out. Due on July 16th
- July 2: *** Today's class is 
cancelled ***
- June 25: Course evaluation strategy changed: I'll take the 
highest of the 2 class tests and make it worth 40%!
- June 25: Drop date (last day to drop the course) is approaching: If 
you need to drop the course, do it on or before July 
2nd 
- June 25: Class Test-2 on July 9th (Wednesday)
from 7:00 PM ~ 8:30 PM  
- June 20: Today's office hours are cancelled
- June 20: Test 1 marks are out; use courseInfo 
3401 from prism to check your marks. Papers were given back in 
class on June 17th
- June 17: Test 1 solution posted (see ``Readings and Lecture 
Transparencies" -- week 6)
- June 8: Additional office hours for this week: Monday June 9, 
2:30-4:00 PM.
- June 6: Sample LISP questions posted  
(see ``Sample Test Questions" below)
- June 6: Today's office hours extended: 2:00-5:00 PM.
- June 4: Partial solution to report-1 posted (see ``readings and 
lecture transparencies" below)
- May 22: Class Test-1 on June 11th (Wednesday) 
from 7:00 PM ~ 8:30 PM  
- May 20: Assignment-1/Report-1 is out; due on 
June 4th (see ``on-reports'' below)
- May 14: Posted my office hours
-  May 7: Welcome to 3401
Course Description
The course introduces and explores programming concepts used in functional 
and knowledge-based computing. It is intended to give the student a 
programming background which will be useful for further work in logic 
programming, expert systems, and artificial intelligence.
The programming languages Lisp and Prolog will be considered in detail. 
Lisp is a functional programming language based on the list structure. It 
is widely used in artificial intelligence applications. Prolog is a 
declarative programming language based on the concept of a logical 
assertion. It is widely used for constructing knowledge-based and expert 
systems. 
Instructor
Shakil M. Khan
Office: CSEB 2017
Email: skhan "at" cse.yorku.ca
Lectures
Wednesday from 19:00 to 22:00 in CB 115.
Instructor Office Hours
- Regular office hours:
	
	- Wednesday 3:00 PM - 4:30 PM
- Friday    2:00 PM - 3:30 PM
 
- Additional office hours:
	
	- July 7 (Monday): 2:30-4:00 PM
- June 9 (Monday): 2:30-4:00 PM
- June 6 (Friday): 3:30-5:00 PM
- July 31 (Thursday): 2:30-4:00 PM
 
TA
George Spanogiannopoulos
Textbooks
- 
Robert Wilensky, Common LISPcraft, W.W.Norton & Company, 1986. ISBN 0-393-95544-3
- 
W.F. Clocksin, C.S. Melish, Programming in Prolog, Springer-Verlag, 5'th edition, 2004. ISBN 0-387-00678-8
The textbooks are required; they are available at the York University Bookstore.Prerequisites
AK/AS/SC/MATH 1090 3.0.
Evaluation
| Assignements (10%+10%) | 20% | 
| Midterm tests (2 @ 20% 
each) | 40% | 
| Final exam | 40% | 
| Total | 100% | 
 
Tentative Schedule
- Week 1  (May 7)  Course overview. Using lisp interpreter, 
s-expressions, lists, atoms. Functions and scope of variables 
- Week 2  (May 14)  Conditional expressions, recursion,  property lists. Functional Programming, using functions to 
write functions, applying functions 
- Week 3  (May 21) Functional programming 
- Week 4  (May 28) Functional programming, Lambda calculus 
-  Report 1 due                                      
- Week 5  (June 4) Lambda calculus. Flexible functions 
-  Test 1
- Week 6  (June 11)  Macros. Multiple value functions 
- Week 7  (June 18) Pattern matching & Database application 
- Week 8  (June 25) Database. Start Prolog 
- Week 9  (July 2)  Prolog programming - utility programs and accumulators 
-  Report 2 due
- Week 10 (July 9) Accumulators, Cut & not, Grammars 
-  Test 2                                      
- Week 11 (July 16) Grammars, Defining operators 
- Week 12 (July 23) Resolution 
- Week 13 (July 30)  Example programs and review 
-  Report 3 due   
-  Final Exam                                      
Readings and Lecture Transparencies
- Week 1  (May 7)  Course overview. Using lisp interpreter, 
s-expressions, lists, atoms. Functions 
 Required Readings: Wilensky ch. 1, 2, 15, 3
 Lecture transparencies
- Week 2  (May 14)  Conditional expressions, recursion, scope of 
variables, property lists. 
 Functional Programming, using functions to 
write functions, applying functions
 Required Readings: Wilensky ch. 4, 6, 7, 8; 
Notes on symbols and property lists;
 Lecture transparencies
- Week 3  (May 21) Lambda calculus, Functional programming 
 Required Readings: Wilensky ch. 9; 
Notes on Lambda calculus;
Notes on functionals
 functionals.lsp; 
functionasl-base.lsp
 Lecture transparencies
- Week 4  (May 28) Flexible functions, Macros 
 Required Readings: Wilensky ch. 12, 13, 14.5
 Lecture transparencies
- Week 5  (June 4)  Multiple value functions. Pattern matching  
 Assignment/Report 1 due
 Required Readings: Wilensky ch. 16.4, 21
 Partial solution to assignment-1
 Lecture transparencies
- Week 6  (June 11)  
Class Test 1
 Test 1 solution
 
- Week 7  (June 18)  Associative database management 
 Required Readings: Wilensky ch. 22
 Lecture transparencies
- Week 8  (June 25)  Prolog introduction, utility and example programs  
 Required Readings: Clocksin & Melish ch. 1, 2, 3
 ring.pro
 utilities.pro
 Lecture transparencies
 (also see the Prolog part from last week)
- Week 9  (July 2) No class today!
- Week 10  (July 9)
Class Test 2
 Test 2 Solution
 
- Week 11  (July 16)
 Accumulators, Cut & not
 Required Readings: Clocksin & Melish ch. 3, 4
 Lecture transparencies
 
- Week 12  (July 23)
Prolog and Resolution
 Required Readings: Clocksin & Melish ch. 10
 Notes on resolution
 Lecture transparencies
 
- Week 13  (July 30)
Defining operators
 Assignment/Report 2 due
 Required Readings: Clocksin & Melish ch. 5
 Lecture transparencies
 Solution to assignment 2
Sample Test Questions
Miscellaneous important dates
First day of classes (summer term) : May 5 - Monday
Last day to enrol in the course    : May 9 - Friday
Victoria Day (univ. closed)	     : May 19 - Monday
Canada Day (univ. closed)	     : July 1 - Tuesday
Last day to drop the course        : July 2 - Wednesday
Last day of classes (summer term)  : August 1 - Friday
Civic Holiday (univ. closed)	     : August 4 - Monday
Additional References
The following are on two hour reserve in Steacie Library.
- Patrick Harrison, Common Lisp and Artificial Intelligence
QA 76.73 C28 H36 1990
- Robert Wilensky, Common LISPcraft
QA 76.73 C28 W55 1986
- W.F. Clocksin, C.S. Mellish, Programming in Prolog
QA 76.73 P76 C57 1987
- Robert Mueller, Symbolic Computing with Lisp and Prolog
QA 76.73 L23 M84 1988
|  | Clisp Common LispTo use Lisp on Prism | 
- To run Lisp execute the command clisp.  To exit execute(bye)at the prompt.
- Try this for a 
more efficient use of clisp and emacs on Prism.
- Parameters for clisp are available on Prism as a man page; use the command man clisp.
- Documentation is avaliable on Prism at /cs/local/doc/clisp.
About Common Lisp
-  
An introduction and Tutorial for
Common Lisp.  Lots of links to other Lisp pages.
- Common Lisp: The Language (2nd Edition, HTML version). This was the official language
definition prior to the release of the ANSI Specification, and is still a useful reference.
Getting Common Lisp
|  | SWI-PrologRunning SWI-Prolog in the Prism Lab | 
- 
To run Prolog execute the command pl. To exit enter
<CTRL>-D
at the prompt.
- 
Documentation is 
available
on the web.
Getting Prolog
About Prolog