Hey everyone,
I am a little confused about Exercise 12.6 from Semantics Engineering with PLT-Redex. The exercise is as follows:
"Formulate a general reduction relation for ISWIM using a with clause. Use traces to demonstrate that programs may be reduced to values along several different paths in a reduction graph. "
The problem I'm having with this is that to accomplish this goal, I needed to make a change to the ISWIM language definition on page 217 at the beginning of this chapter, particularly in the contexts section, and I made absolutely no change to the reduction relation given on page 225 directly above this exercise.
So for me, that language definition from 217, along with the reduction relation on 225, as well as the definitions for the meta functions in this chapter, I get the standard reduction, which permits only one reduction path for, say, an expression like (+ (1 1) (+ 1 1)). The left-most (+ 1 1) reduces to 2 first.
When I make the change to the contexts in the language definition, and change it from
(E hole (V E) (E M) (o V ... E M ...))
to
(E hole (M E) (E M) (o M ... E M ...))
My traces for the above expression gives what I think the exercise is expecting. I have a diamond shaped in my reduction DAG.
The problem I have with this is that I haven't done anything to the reduction relation to do this. The exercise seems pretty explicit to create a reduction relation using a with clause. so it seems like the purpose of the exercise is to get you to understand the with clause by developing something new using it. Now granted my reduction relation does use a with clause, because it's the one I copied out of the book. But I didn't write that one and use the with clause in my own new way.
So is there a different way to get the reduction relation to support the general reduction that requires one to change the reduction relation and not the grammar?
Thanks for the help,
-mike