Assignment 7

CS 550 Programming Languages
Instructor: Jeremy Johnson 
Due date: Thurday June 6 at 9am

Query Language and Logic Programming (100 points)

This assignment explores logic programming and prolog, the simple query language and interpreter from SICP discussed in Lecture on logic programming and the query language.

Background Information

Background information is obtained in lecture 1 (scheme and functional programming), lecture 2 (material on streams), lecture 3 (material on the scheme interpreter), and lecture 4 (material on logic programming, the query language interpreter, and prolog). As always refer to the documentation for MIT/GNU Scheme and GNU prolog as needed.

What to do

  1. Question 4.59 of SICP.
  2. Question 4.65 of SICP.
  3. Question 4.68 of SICP (do this in the query language and prolog).
  4. Question 4.75 of SICP.
  5. Complete the prolog interpreter of the mini language from lecture on the mini language for the implementation of arithmetic expressions and assignment. You will need to add rules for if, while, and statement sequences.

How to submit

Students should submit their solution electronically using BbVista. This assignment must be done individually. Submit a gzipped tar file, called A7.tar.gz (the tar file should contain a directory called A7 which contains the files). The tar file should contain source code, instructions how to run your programs, sample input and output files, and a README file. The README file should describe all files that are included, contain instructions how to build and use the code, and outline how the code works. You should also indicate how you tested your code. If your program is not working, you should clearly state this in the README file. All scheme functions should be written in scheme and must work with MIT-Scheme, and all prolog questions should work in GNU prolog. Code should be documented (clear specifications and comments for any tricky parts of the code). Those questions that involve hand computations or proofs should be submitted as pdf or text files whose name indicates the question.