Com S 342 --- Principles of Programming Languages EXERCISE 00: DESIGN OF SIMPLE (File $Date: 2004/01/21 21:13:38 $) The purpose of this exercise is for you to think some more about the design of "Simple", based on readings and our class discussion. As with all exercises, this is to be done individually. And it is due the day this topic is planned to be discussed in class, unless specified otherwise (see the syllabus at: http://www.cs.iastate.edu/~cs342/syllabus.shtml). As with all exercises, you have two choices for doing the work. You can either: - complete it as specified or - write down questions or problems that you had in trying to complete it. If you write down questions or problems you have, these should be detailed enough so that we can tell that you have read the materials and thought about them. (Don't just write: "I didn't understand how to do it". Instead, say what you tried and what you didn't understand.) During the class where this exercise is discussed, you should ask about these difficulties, and clear them up. Don't be shy; there will be other people with the same problem, and everyone can learn by discussing these issues. And you'll most likely see similar things on the homework, so it's best to understand them now. 1. [Simple's means of Combination] For the language Simple we are designing in class, the next step is to settle on the language's "means of combination". In this exercise you should briefly describe 6 ideas for means of combination in Simple. To do this briefly describe: (a) 3 primitive expressions or statements and (b) 3 compound expressions or statements for Simple. Give a brief example of the syntax of each of these. These primitive and compound expressions or statements you list should be independent of each other. That is don't list expressions or statements that one can easily simulate with some combination of the others. For example, one kind of compound statement is an if-then-else-statement and another would be an if-then statement. However, if you have both a "skip" (or empty) statement and an if-then-else statement, you can simulate the if-statement easily, so you would not list both kinds of statements. Also the primitives should not be operations of the basic types of data we have decided on in class. For example, "+" would be an operation on integers, and thus one of the means of computation, but not a means of combination. On the other hand, function calls (i.e., calls to user-defined functions) would be a compound expression that qualifies as a means of combination. WHAT TO HAND IN You should have at the beginning of class, written answers to the above questions (or written out questions and problems you encountered for each part). Make sure your name is on these. Attach the printouts, if any, requested above. ADDITIONAL READINGS If you have time, read pages 1-31 (up to the start of section 1.2) of the recommended textbook "Structure and Interpretation of Computer Programs", by Abelson and Sussman, which is on reserve and also on-line at the following URL. http://mitpress.mit.edu/sicp/