CS603 Organization of Programming Languages
Due 31 March 2003

University of Alabama
Department of Computer Science
Spring 2003


The purpose of this assignment is to do some ML programming.

Problem Description

Write the following functions based upon the code from the lecture on March 19th. The code will be available on the class web page. 1. Write an ML function superior person1 person2 that returns true if person1 has a higher rank than person2, where the relationship is King $>$ Peer $>$ Knight $>$ Peasant. The type of superior should be person * person -> bool. 2. Write an ML function rank person that maps persons to integers, mapping Kings to 4, Peers to 3, Knights to 2, and Peasants to 1. Use this function to reimplement superior. The new function should be
nsuperior person1 person2. 3. Modify type person to add the constructor Esquire, whose arguments are a name and a village (both represented by strings). Modify function title to generate, for instance, "John Smith, Esq., of Bottisham". Modify superior to rank Esquire above Peasant and below Knight.

How to Turn in Your Program

Email the three program files, superior, nsuperior, and esquire. to with a subject line of CS603MP3. If it all possible, try to send this from the email account you placed on the index card. In any case, be sure that your name is included in both program source files and in the body of your email message.

About this document ...

CS603 Organization of Programming Languages
Due 31 March 2003

This document was generated using the LaTeX2HTML translator Version 2K.1beta (1.61)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split 0 -nonavigation MP3.tex

The translation was initiated by on 2003-03-19