Abstract Machines Flashcards
An abstract machine is usually:
a) ideal
b) physical
PHYSICAL
An abstract machine is able to do:
3 things
- Store programs
- Store data
- Execute programs on data
What is a native language in the context of abstract machines
A programming language that an abstract machine accepts.
The machine assigns meaning to programs written in the native language
What is the difference between high- and low-level machines
Low-level machines are physical or close to it. Fx an abstract machine whose native language is assembly
High-level machine are distant from physical machines
How do you implement an abstract machine?
3 choices
- Realize it in hardware directly
- more effort but gives efficient execution - Simulate it in software
- less effort but can lead to less efficient execution - Emulate in firmware
What is the definition of a partial function?
Given two sets X and Y, a partial function f from X to Y is an assignment of AT MOST ONE y (in) Y to every x (in) X
To express this we write f : X -> Y
Describe how programs are similar to partial functions
Machine M gives any program P (in language L) meaning as a partial function [P(in L)] : Data -> Data. Sending data to data
Describe an interpreter
An interpreter for L written in Lo, is a program I (in Lo) (for L) interpreted by Mo as a partial function. In other words for the program I (in Lo) (for L), programs in L are data. There is no generation of new code, it is the interpreter itself that is run.