Slide 9.4: Reduction rules of assignments (cont.) Slide 9.6: An assignment example Home |
<E|Env> ⇒ <E1|Env>
<I ':=' E | Env> ⇒ <I ':=' E1 | Env>
<S|Env> ⇒ Env1
<S ';' L | Env> ⇒ <L | Env1>
L ⇒ <L|Env0>
Env0 = undef
for all identifiers I
).
The reduction rules are not yet completed.
For example, the rules for reducing identifier expressions are skipped.
a := 2 + 3; b := a * 4; a := b – 5The first step is to set up the reductions:
a:=2+3; b:=a*4; a:=b-5 ⇒ <a ':=' '2' '+' '3'; b ':=' a '*' '4'; a ':=' b '-' '5' | Env0> (Rule 19)