Abstract Machines Flashcards

1
Q

An abstract machine is usually:

a) ideal
b) physical

A

PHYSICAL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

An abstract machine is able to do:

3 things

A
  1. Store programs
  2. Store data
  3. Execute programs on data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a native language in the context of abstract machines

A

A programming language that an abstract machine accepts.

The machine assigns meaning to programs written in the native language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between high- and low-level machines

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you implement an abstract machine?

3 choices

A
  1. Realize it in hardware directly
    - more effort but gives efficient execution
  2. Simulate it in software
    - less effort but can lead to less efficient execution
  3. Emulate in firmware
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the definition of a partial function?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe how programs are similar to partial functions

A

Machine M gives any program P (in language L) meaning as a partial function [P(in L)] : Data -> Data. Sending data to data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe an interpreter

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly