Advanced Topics in Theoretical Computer Science
Part 2: Register machines (2) 20.11.2014 Viorica Sofronie-Stokkermans Universit¨ at Koblenz-Landau e-mail: sofronie@uni-koblenz.de Wintersemester 2014-2015
1
Advanced Topics in Theoretical Computer Science Part 2: Register - - PowerPoint PPT Presentation
Advanced Topics in Theoretical Computer Science Part 2: Register machines (2) 20.11.2014 Viorica Sofronie-Stokkermans Universit at Koblenz-Landau e-mail: sofronie@uni-koblenz.de Wintersemester 2014-2015 1 Contents Recapitulation:
1
2
3
4
5
6
7
8
9
10
11
12
13
0, s′ 1, . . . , s′ n with:
n
k, s′ k+1) for 0 ≤ k < n
14
15
16
17
18
19
20
21
22
23
24
25
Here xn, xn+1 are new registers (in which at the beginning 0 is stored; not used in P). 26
27
28
29
1, P′ 2
i ). Let P′ = P′ 1; P′ 2 (a WHILE program). ∆(P′)(s1, s2) iff there exists s with ∆(P′ 1)(s1, s) and ∆(P′ 2)(s, s2) iff there exists s with ∆(P1)(s1, s) and ∆(P2)(s, s2) iff ∆(P)(s1, s2) 30
1, P′ 2
i ). Let P′ = P′ 1; P′ 2 (a WHILE program). ∆(P′)(s1, s2) iff there exists s with ∆(P′ 1)(s1, s) and ∆(P′ 2)(s, s2) iff there exists s with ∆(P1)(s1, s) and ∆(P2)(s, s2) iff ∆(P)(s1, s2)
1 with ∆(P1) = ∆(P′ 1). Let P′ be the following WHILE program: P′ = while xi = 0 do xn := xn + 1; xn+1 := xn+1 + 1; xi := xi − 1 end; while xn+1 = 0 do xi := xi + 1; xn+1 := xn+1 − 1 end; while xn = 0 do P′ 1; xn := xn − 1 end.
31
32
33
34
35
36
37
38
39
40
0, . . . , s′ n
0 = s1
n = s2
41
0, . . . , s′ n
i+1(xi) = s′ i (xi) + 1
i+1(xj) = s′ i (xj) for j = i
42
0, . . . , s′ n
i+1(xi) =
i (xi) − 1
i (xi) > 0
i (xi) = 0
i+1(xj) = s′ i (xj) for j = i
43
0, . . . , s′ n
i+1 = s′ i
44
45
46
47
48
49
50
51
52
53
54
55
1, P′ 2
i ). We can assume w.l.o.g. that the indices used for labelling
1; P′ 2 (a GOTO program). We can show
56
1, P′ 2
i ). We can assume w.l.o.g. that the indices used for labelling
1; P′ 2 (a GOTO program). We can show
1 such that ∆(P1) = ∆(P′ 1). Let P′ be the following GOTO
57
58