cpsc411 / cpsc411-book

The WIP book for CPSC 411
Other
59 stars 7 forks source link

allocate-frames violates earlier invariants about administrative languages #50

Open wilbowma opened 3 years ago

wilbowma commented 3 years ago

In allocate-frames, whose source and target are "administrative languages", we change the program.

The language definition doesn’t change but the change in the program does break an earlier invariant.

This is not inconsistent with our definition of administrative language: https://www.students.cs.ubc.ca/~cs-411/2020w2/chp2_book_top.html#%28tech._administrative._language%29

This only restricts the language definition, which still doesn't change throughout Asm-pred-lang/*.

We don't really change the semantics of the program, either. A return-point does allocate a frame of sufficient space to preserve all call-undead variables. We just make that explicit, rather than implicit, in allocate-frames.

However, it is different compared to earlier uses of administrative languages. I'll have to consider whether the difference is meaningful. I believe the challenge problem bury-dead is similar in this respect.

wilbowma commented 2 years ago

I should probably just remove the idea of an administrative languages. Only I merge #34 it becomes even less useful, since the whole loop has to use essentially the same language. Instead, be very clear about what invariants a language must satisfy, and keep those consistent.