Programming Assignment 3 (due midnight 08/19/15)
Penalty for late submission: 10% less credit/day.
Problem I (30 points). Mark’s website contains programs with timing experiments done on textbook’s Scheme, ML, Haskell and Prolog implementations of merge-sort.
1. Extend the timing experiments of problem II of PA 2 to include Prolog as well. Report the timing results in the form of a table or a graph, draw your conclusions, and write them down.
2. Provide a detailed analysis of structural similarities and differences between the Prolog implementation of merge-sort and the functional languages implementations of it done in Scheme, ML, and Haskell.
Problem II (40 points). Implement
in C++ the recursive-descent parser for the language of balanced parentheses of
section 11.6 of FCS (C code:
http://infolab.stanford.edu/~ullman/fcsc-figures.html). Prepare a framework of
tests demonstrating that the code you submit works properly. You are allowed to
use directly the FCS C code provided on the FCS website and modify it with
minimal necessary changes. The code you submit should include your tests.
Problem III (30 points). Work out solutions of the following SICP
programming problems: 4.4, 4.9 of section 4.1.2 and 4.11 of section 4.1.3.
Submit your solutions together with the data demonstrating that your code works
properly.
You will need to submit your code and reports following the submission rules that will be provided at a later date.