User:JanPielesiak/Maszyna Pawlaka

Pawlak’s machine – an abstract machine designed by Zdzisław Pawlak capable of computing linear calculations.

Physical description
Machine consists of:


 * A tape F divided into cells, each of which contains a symbol; either data, an indicator that data is to be read from memory or operation symbol.


 * A head A and S that is moving above the tape, reading three cells from it at the time.


 * data memory D (stores initial arguments)


 * memory of partial results W

Simplified language
Simplified language symbolizes what operations are supposed to be done in given order, without supplying any actual data to be calculated.

Δ - initial arguments; * - partial result; from calculations that were already completed +,-,•,/  - what sort of mathematical operations should be done by the machine.

Order of calculations
Zdzisław Pawlak used to record calculations in form of a tree; nodes represent what operations should be done and branches are data and partial results. Pawlak proposes two methods of going through the tree, called by him W and P.

W order  (along-order, pol. “wzdłużny”)
We follow branches up, starting from the furthest right one until reaching a point where we do not have the partial results necessary to continue. When such situation occurs we move to the next branch on the left. We proceed until the final result is computed.

P order (transverse order, pol. “poprzeczny”)
We follow levels of the tree  starting from the bottom-left node and moving right. When entire level is calculated we move to the higher level of the tree.

Machine's operation
The machine is compatible with both orders, yet for each one of them there is a different method of partial results management.

Action order for the P order
First mathematical operation symbol and two of the arguments (first 3 cells) of the tape are examined. Next arguments are read from data memory D or partial results memory W, depending on what symbol is in the argument’s cell. After that the calculation is performed and the result is saved at the end of the partial results memory W. Last result is the final result (the top of the tree).

Action order for the W order
The difference between P and W order is only that if both arguments are initial arguments, they are read from D memory, and the result is saved on the first free cell of W memory. If one of the arguments is an initial argument and the other is a partial result, then the initial data is read from D and last saved partial result from W is read as the second argument. Partial results read from W is always deleted afterwards, so the result is saved on its place. If both arguments are read from W, two numbers are read and the result is saved where the penultimate of partial results was.

P order example
10 - 3 = 7

2 • 3 = 6

7 + 7 = 14

1 • 2 = 2

9 - 6 = 3

4 • 8 = 32

14 / 2 = 7

3 + 32 = 35

7 + 35 = 42

If we write the symbol of the mathematical operation after the arguments, we can then present the calculations linearly:

10,3,-,2,3,•,7,7,+,1,2,•,9,6,-,4,8,•,14,2/,3,32,+,7,35,+,42

Simplified language:

ΔΔ-ΔΔ•*Δ+ΔΔ•Δ*-ΔΔ•**/**+**+*

W order example
4 • 8 = 32

2 • 3 = 6

9 - 6 = 3

3 + 32 = 35

1 •2 = 2

10 - 3 = 7

7 + 7 = 14

14 / 2 = 7

7 + 35 = 42

If we write the symbol of the mathematical operation after the arguments, we can then present the calculations linearly:

4,8,•,2,3,•,9,6,-,3,32,+,1,2,•,10,3,-,7,7,+,14,2,/,7,35,+,42

Simplified language:

ΔΔ•ΔΔ•Δ*-**+ΔΔ•ΔΔ-*Δ+**/**+*