[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Assignments] [Labs]

Back to An Expression Grammar. On to Ambiguous Grammars, Concluded.

**Held** Monday, April 12

**Summary**

- Exam 2 returned.
- Assignment 5 (Prolog) distributed.

**Contents**

**Notes**

- I've graded exam 2. We'll
spend much of today's class discussing the exam.
- I'm going to give you some in-class makeup problems.
- I'll let you folks work at the board and comment on each other's work.
- I'll give extra credit for volunteers who go up to the front.
- An answer key will be available later this week.

- Assignment 5 is now ready.
- Read Louden, chapter 6, for next class.
- I'm guest-teaching a class this week, and so won't be available afternoons.
- I should have guidelines for presentations available on Wednesday. Start thinking about topics and groups (3-4 people).

- Some basic facts:
- The median grade was 80. The average grade was also 80.
- There were two grades in the 90's.

- Some good parts:
- Most of you got the FP problems right.

- Some bad parts:
- Many of you got the SIMPLE semantics question wrong, even though it was quite similar to a problem on HW3.
- Many of you couldn't figure out what
*valueslist*does.

- We're going to walk through this. I'll use four volunteers.
(You can only volunteer if (a) you got less than fifteen on this
problem or (b) you didn't do the exam.)
- One volunteer will lead us through changes to the type of
`meaningExp`

as well as some other basics. - One volunteer will lead us through a definition of
`meaningExp [[read()]]`

- One volunteer will lead us through definitions of some of the
other equations that define
`meaningExp`

. - One volunteer will lead us through definitions of some of the
other equations that use
`meaningExp`

- One volunteer will lead us through changes to the type of

A quiz (which you may discuss as a class or in small groups; each group should turn in one set of solutions). You may want to use the Scheme semantics for this and the next quiz.

Consider the following two functions (`@`

is the simple I've
used for down-arrow; `S@n`

means ``select the nth element of
S''; `:`

is used for concatenation.)

foo :: E -> T foo = \ exp . if (exp in E_{p}) then foo ((exp|E_{p}) @ 2) else if (exp =null) thentrueelsefalsebar :: E -> (E union {bozo})* \ exp . if (exp in E_{p}) then <(exp|E_{p}) @ 1>:(bar ((exp|E_{p}) @ 2)) else if (exp =null) then <> elsebozo

a. What does `foo`

do?

b. What does `bar`

do?

c. What does this say about *valueslist*?

A quiz (which you may discuss as a class or in small groups; each group should turn in one set of solutions). You may want to use the Scheme semantics for this quiz.

**Do not execute the following code!**

What is the value of `(eqv? (cons 'a 'b) (cons 'a 'b))`

?
Why? (You'll probably want to refer to the descriptions of
*cons* and *eqv*.)

**History**

- Created Tuesday, January 19, 1999 as a blank outline.
- Filled in the details on Monday, April 12, 1999.
- On Wednesday, April 14, 1999, I moved uncovered topics (associativity) to the next outline.

Back to An Expression Grammar. On to Ambiguous Grammars, Concluded.

[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Assignments] [Labs]

**Disclaimer** Often, these pages were created ``on the fly'' with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.

This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS302/99S/Outlines/outline.28.html

Source text last modified Thu Apr 15 09:12:40 1999.

This page generated on Thu Apr 15 10:09:58 1999 by SiteWeaver. Validate this page's HTML.

Contact our webmaster at rebelsky@math.grin.edu