Notional Machines

We collected the following notional machines:

imperative / assembly Paradigm/Language:

Conceptual Advantage

Provides tangible focus for discussing addresses, offsets, and even byte ordering and segments.

Draws Attention To

Relationships between items in memory, whether they are elements of an array, bytes in a single value, or different methods for allocating space.
PLNM
memory cell seat
value student or number given to student
address established by counting off
offset number of seats between two targets
segment front, middle, or back of the room
Collected by andrew
Control Flow as Graph (1 - Sequence)
Handmade representation
imperative / Java Paradigm/Language:

Conceptual Advantage

See a method as a sequence of statements to execute, and make clear that that sequence starts when the method is called and ends when the method returns.

Draws Attention To

The idea of a 'sequence' in structured programming, where a sequence consists of statements to execute.
PLNM
statement rectangular node
control-flow between statements arrow from node to node
method entry round 'e' node at top
method exit round 'x' node at bottom
Collected by matthias
Control Flow as Graph (2 - Selection)
Handmade representation
imperative / Java Paradigm/Language:

Conceptual Advantage

Understand concept of selection from structured programming (conditional statements like if, if-else), and make clear that a statement may or may not execute, based on a decision taken earlier in the control flow.

Draws Attention To

The idea of a 'selection' in structured programming, where a data (the condition's value) is turned into control flow (the next statement to execute).
PLNM
... ...
if condition diamond-shaped node
condition outcome label on an arrow coming out of a condition (e.g., true, false)
Collected by matthias
imperative / Java Paradigm/Language:

Conceptual Advantage

Understand concept of a multi-way selection (a conditional statement where the condition is not just a Boolean value, e.g., a switch-statement).

Draws Attention To

The idea of a multi-way 'selection' in structured programming, where a data (the condition's value) is turned into control flow (the next statement to execute).
PLNM
... ...
switch condition diamond-shaped node with multiple arrows leaving
switch cases label on arrows coming out of a switch (including 'default')
Collected by matthias
imperative / Java Paradigm/Language:

Conceptual Advantage

Understand concept of short-circuit Boolean operators (|| and &&), and see how they only evaluate their right operand if needed.

Draws Attention To

The idea that for short-circuit Boolean operators, the second operand may never be evaluated (allowing common constructs like if (o!=null && o.length>0) ...
PLNM
... ...
|| in condition 'false' arrow to extra diamond node
&& in condition 'true' arrow to extra diamond node
Collected by matthias
Control Flow as Graph (5 - Repetition)
Handmade representation
imperative / Java Paradigm/Language:

Conceptual Advantage

Understand concept of repetition from structured programming (loops like while, do-while, or for), where a given statement can be executed multiple times, by simply following the arrows through the cycle.

Draws Attention To

The idea of a 'repetition' in structured programming, where control-flow leads to statements getting executed multiple times
PLNM
... ...
back edge arrow pointing to a node that came prior in the flow (introducing a cycle)
while-, do-while-, for-loop cycle in the graph
Collected by matthias
imperative / Java Paradigm/Language:

Conceptual Advantage

Explains need for hashCode() and equals() methods when using HashSet

Draws Attention To

Need for .hashCode() and .equals(Object o) methods
PLNM
HashSet Box of hanging folders
bucket Single file folder
key Piece of paper in a file folder
value N/A (HashSet, not HashMap)
add(key) method Find correct folder, check if the folder already contains the key by comparing the key to all contents of the folder
Collected by colleen
imperative / any Paradigm/Language:

Conceptual Advantage

Emphasises that only the head of list (top box) or the whole list (the stack on the pallet) is directly accessible, and that new items can be added on top of a list but not into the middle of it.

Draws Attention To

?
PLNM
list stack of boxes on a pallet
list element box on the stack
[ top of the stack
] pallet
Collected by ben
imperative / Java / C# / any Paradigm/Language:

Conceptual Advantage

To illustrate method calls, the teacher dances to another location, performs some actions there (changing the memory), and then returns to the previous location through the return address, where he continues with performing actions

Draws Attention To

It illustrates that you `go elsewhere in the memory' when you call a method, and that you need to remember where you came from (return address) when you go elsewhere. A dancing teacher helps students to remember the concept.
PLNM
method call dance to another location
return address dance back to the previous location
Collected by johan
imperative / Java Paradigm/Language:

Conceptual Advantage

Helps students plan and debug code

Draws Attention To

The fact that each reference can only point to a single thing
PLNM
Object Type written and underlined in a rectangle
variable variable name followed by a small box
int number written in a small box
reference arrow originating from a small box
X written in a small box local variable
free floating instance variable
Collected by colleen
Procedure as Worker
Representation (hand-made)
imperative / any Paradigm/Language:

Conceptual Advantage

Provides a way to visualise input and action, and later the difference between action and output. The same visualisation extended to cover user defined procedures, parameters and later to explain sub-procedure calls including recursion.

Draws Attention To

?
PLNM
procedure worker who knows how to do a particular job
procedure call calling the name of the worker, so that he starts doing his particular job
procedure input giving information to the worker (telling them in their right ear)
procedure implementation instructions for the worker on how to do their job
procedure effect how the worker affects the world
procedure result what the worker speaks to the worker on their left
Collected by ben
Python Computer (Stage 1)
Representation (hand-made)
imperative / Python Paradigm/Language:

Conceptual Advantage

Expandable 'offline' model of program execution. In its beginning stage, it only covers control flow and variables (without references) of Python scripts.

Draws Attention To

Semantics of control flow in Python. Visible effects of each line on the 'state' of the Python computer.
PLNM
Memory A table of identifer and value.
Instruction Update of state according to defined rules.
Variable Entry in the table.
Conditional Conditional evaluator (flag) that affects the 'program counter'.
Control flow Program counter that identifies next line to get executed and is updated according to a set of rules.
Collected by andreas
Recursion Demo with Python Tutor
Machine-generated representation
imperative / Python Paradigm/Language:

Conceptual Advantage

Demonstrates what happens to variable values when they are passed to a function. Distinguishes frame elements among each recursive call. Shows separate stack frames, each with own parameters and variables, for each recursive call.

Draws Attention To

Addition of each stack frame as each recursive call is made. Collapse of stack frame as function completes and returns value.
PLNM
frame group of elements with function name
parameter labeled box inside frame
local variable labeled box inside frame
Collected by craig
Variable as Box
Analogy
imperative / any Paradigm/Language:

Conceptual Advantage

Makes variable tangible, embodied activity

Draws Attention To

Variables, access, initialization
PLNM
Variable Box
access opening box, accessing topmost post-it
rename variable new name on box
assign (list) new name also on box
assign simple value second box with same post-it
Collected by felienne
imperative / staticaly-typed Paradigm/Language:

Conceptual Advantage

Helps understanding of why types matter both in parking spaces and in statically-typed languages

Draws Attention To

The idea of a statement, a condition, and how they are used to build sequence, selection, and repetition constructs of structured programming
PLNM
variable parking space
value vehicle
type of variable vehicle size/shape/constraint on parking space
type of value type of vehicle
Collected by jan