28.10.2022 Views

Computability complexity and Languages- Fundamentals of Theoretical Computer Science

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4. Computable Functions 29

together with the equations V = 0 for each variable V in go other than

X 1 , ••• , Xm, Y. We will call this the initial state, and the snapshot (1, u ),

the initial snapshot.

Case 1. There is a computation s 1 , s 2 , ••• , s k of go beginning with the initial

snapshot. Then we write r/J~m>(r 1 ,r 2 , ••• ,rm) for the value of the

variable Y at the (terminal) snapshot sk.

Case 2. There is no such computation; i.e., there is an infinite sequence

s 1 ,s 2 ,s 3 , ••• beginning with the initial snapshot where each si+l

is the successor of s;. In this case r/J~m>(r 1 , ••• , r m) is undefined.

Let us reexamine the examples in Section 2 from the point of view of

this definition. We begin with the program of (b). For this program go, we

have

1/J~l)(x)

= x

for all x. For this one example, we give a detailed treatment. The following

list of snapshots is a computation of go:

(1,{X = r, Y= O,Z = 0}),

(4, {X= r, Y = 0, Z = 0}),

(5, {X= r- 1, Y = 0, Z = 0}),

(6, {X= r- 1, Y = 1, Z = 0}),

(7, {X= r- 1, Y = 1, Z = 1}),

(1, {X= r- 1, Y = 1, Z = 1}),

(1, {X= 0, Y = r, Z = r}),

(2, {X= 0, Y = r, Z = r}),

(3, {X= 0, Y = r, Z = r + 1}),

(8, {X= 0, Y = r, Z = r + 1}).

We have included a copy of go showing line numbers:

[A]

[B]

IF X =1= 0 GOTO B

z ~z + 1

IF Z =I= 0 GOTO E

x~x-1

Y~ Y+ 1

z ~z + 1

IF Z =/= 0 GOTO A

(1)

(2)

(3)

(4)

(5)

(6)

{7)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!