imperative / any
Representation
Collected by Peter Donaldson — Own practice, Peter Donaldson and Quintin Cutts
The notional machine is not an entirely separate representation from the code but acts as a secondary notation to add invisible aspects of the code execution.
PL | NM |
---|---|
... | (all aspects from 1-Static Structure) |
instruction execution | add current step number to arrow leading in, then execute by adding to or looking up information in memory table, expression evaluator, or output areas |
expression evaluation | copy expression, substitute values, and evaluate it in expression evaluation area |
variable declaration | find first blank column in memory table and add name of variable in first row; value added underneath if initialised |
variable assignment | find variable in the memory table, strike through existing entry, and add entry to row below. |
conditionals and loops | evaluate control expression to 'True' or 'False', then follow relevant labelled control path to next instruction |
Dynamic view of control flow (actual execution); evaluation of expressions; declaration, initialisation, access and assignment of variables.
Developing understanding of how basic programming constructs work.
Code needs carefully selected and formatted to enable annotation.
Created by Peter Donaldson and Quintin Cutts / PLAN C project.
First, mark code with control flow paths and parts of the code containing expressions. Second, start at the top of the program and execute each line adding or looking up any necessary information from the memory table, expression evaluation or output areas.
Do you have feedback on this notional machine? Did you find a mistake, or do you have a request for improvement? You can create an Issue on GitHub, where the description is hosted. This way we can see your feedback and address it.
For this, you need a GitHub account. Then follow this link to see the source file of this page. In there, click the ... left of the highlighted line, then pick "Reference in a new issue".