Start of Interpreter for program ext3.tri at Sun Dec 12 23:12:43 2010

Program

# alen:=5
ARRAY a[alen]
a[0]:=23
a[1]:=85
a[2]:=10
a[3]:=47
a[4]:=62
i:=0
FORi: j:=(i+1)
FORj: IF (a[i]<=a[j]) THEN GOTO NOSWAP
t:=a[i]
a[i]:=a[j]
a[j]:=t
NOSWAP: j:=(j+1)
IF (ji:=(i+1)
IF (i<(alen-1)) THEN GOTO FORi#

Parsing tree

root
:=
alen5
ARRAY
aalen
[]:=
a023
[]:=
a185
[]:=
a210
[]:=
a347
[]:=
a462
:=
i0
label
FORi
:=
j+
i1
label
FORj
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
label
NOSWAP
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Table of constants

c1=5c2=0c3=23c4=1c5=85c6=2c7=10c8=3c9=47c10=4c11=62

Table of identifiers

i1=aleni2=ai3=ii4=FORii5=ji6=FORji7=NOSWAPi8=t

label 'FORi' is address of the operator {omistamine} (00611468)
label 'FORj' is address of the operator {tingimus} (006114C8)
label 'NOSWAP' is address of the operator {omistamine} (00619E18)

Modified tree

root
:=
alen5
ARRAY
aalen
[]:=
a023
[]:=
a185
[]:=
a210
[]:=
a347
[]:=
a462
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi


Stackid alen=0

Stackid alen=0const=5
interpreting the operator alen:=5
:=
alen5
ARRAY
aalen
[]:=
a023
[]:=
a185
[]:=
a210
[]:=
a347
[]:=
a462
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

alen:=5

Stack

Stackid a=0

Stackid a=0id alen=5
interpreting the operator ARRAY a[alen]
ARRAY
aalen
[]:=
a023
[]:=
a185
[]:=
a210
[]:=
a347
[]:=
a462
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Created new array a
a00000

Stack

Stackid a=0

Stackid a=0const=0

Stackid a=0const=0const=23
interpreting the operator a[0]:=23
[]:=
a023
[]:=
a185
[]:=
a210
[]:=
a347
[]:=
a462
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 23 to a[0]
a230000

Stack

Stackid a=0

Stackid a=0const=1

Stackid a=0const=1const=85
interpreting the operator a[1]:=85
[]:=
a185
[]:=
a210
[]:=
a347
[]:=
a462
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 85 to a[1]
a2385000

Stack

Stackid a=0

Stackid a=0const=2

Stackid a=0const=2const=10
interpreting the operator a[2]:=10
[]:=
a210
[]:=
a347
[]:=
a462
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 10 to a[2]
a23851000

Stack

Stackid a=0

Stackid a=0const=3

Stackid a=0const=3const=47
interpreting the operator a[3]:=47
[]:=
a347
[]:=
a462
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 47 to a[3]
a238510470

Stack

Stackid a=0

Stackid a=0const=4

Stackid a=0const=4const=62
interpreting the operator a[4]:=62
[]:=
a462
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 62 to a[4]
a2385104762

Stack

Stackid i=0

Stackid i=0const=0
interpreting the operator i:=0
:=
i0
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

i:=0

Stack
FORi:
Stackid j=0

Stackid j=0id i=0

Stackid j=0id i=0const=1
interpreting the operator (i+1)
+
i1

1 = 0 + 1

Stackid j=0tm=1
interpreting the operator j:=(i+1)
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=1

Stack
FORj:
Stackid a=0

Stackid a=0id i=0
interpreting the operator a[i]
->
ai
->
aj
a[0]=23
Stacktm=23

Stacktm=23id a=0

Stacktm=23id a=0id j=1
interpreting the operator a[j]
->
aj
a[1]=85
Stacktm=23tm=85
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

23 <= 85 ?

Stacktm=1
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackNOSWAP:
interpreting the operator NOSWAP:
label
NOSWAP

StackNOSWAP:
interpreting the operator GOTO NOSWAP
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto NOSWAP
NOSWAP:
Stackid j=1

Stackid j=1id j=1

Stackid j=1id j=1const=1
interpreting the operator (j+1)
+
j1

2 = 1 + 1

Stackid j=1tm=2
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=2

Stack

Stackid j=2

Stackid j=2id alen=5
interpreting the operator (j<
jalen

2 < 5 ?

Stacktm=1
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORj:
interpreting the operator FORj:
label
FORj

StackFORj:
interpreting the operator GOTO FORj
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto FORj
FORj:
Stackid a=0

Stackid a=0id i=0
interpreting the operator a[i]
->
ai
->
aj
a[0]=23
Stacktm=23

Stacktm=23id a=0

Stacktm=23id a=0id j=2
interpreting the operator a[j]
->
aj
a[2]=10
Stacktm=23tm=10
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

23 <= 10 ?

Stacktm=0
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stackid t=0

Stackid t=0id a=0

Stackid t=0id a=0id i=0
interpreting the operator a[i]
->
ai
a[0]=23
Stackid t=0tm=23
interpreting the operator t:=a[i]
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

t:=23

Stack

Stackid a=0

Stackid a=0id i=0

Stackid a=0id i=0id a=0

Stackid a=0id i=0id a=0id j=2
interpreting the operator a[j]
->
aj
a[2]=10
Stackid a=0id i=0tm=10
interpreting the operator a[i]:=a[j]
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 10 to a[0]
a1085104762

Stack

Stackid a=0

Stackid a=0id j=2

Stackid a=0id j=2id t=23
interpreting the operator a[j]:=t
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 23 to a[2]
a1085234762

Stack
NOSWAP:
Stackid j=2

Stackid j=2id j=2

Stackid j=2id j=2const=1
interpreting the operator (j+1)
+
j1

3 = 2 + 1

Stackid j=2tm=3
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=3

Stack

Stackid j=3

Stackid j=3id alen=5
interpreting the operator (j<
jalen

3 < 5 ?

Stacktm=1
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORj:
interpreting the operator FORj:
label
FORj

StackFORj:
interpreting the operator GOTO FORj
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto FORj
FORj:
Stackid a=0

Stackid a=0id i=0
interpreting the operator a[i]
->
ai
->
aj
a[0]=10
Stacktm=10

Stacktm=10id a=0

Stacktm=10id a=0id j=3
interpreting the operator a[j]
->
aj
a[3]=47
Stacktm=10tm=47
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

10 <= 47 ?

Stacktm=1
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackNOSWAP:
interpreting the operator NOSWAP:
label
NOSWAP

StackNOSWAP:
interpreting the operator GOTO NOSWAP
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto NOSWAP
NOSWAP:
Stackid j=3

Stackid j=3id j=3

Stackid j=3id j=3const=1
interpreting the operator (j+1)
+
j1

4 = 3 + 1

Stackid j=3tm=4
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=4

Stack

Stackid j=4

Stackid j=4id alen=5
interpreting the operator (j<
jalen

4 < 5 ?

Stacktm=1
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORj:
interpreting the operator FORj:
label
FORj

StackFORj:
interpreting the operator GOTO FORj
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto FORj
FORj:
Stackid a=0

Stackid a=0id i=0
interpreting the operator a[i]
->
ai
->
aj
a[0]=10
Stacktm=10

Stacktm=10id a=0

Stacktm=10id a=0id j=4
interpreting the operator a[j]
->
aj
a[4]=62
Stacktm=10tm=62
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

10 <= 62 ?

Stacktm=1
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackNOSWAP:
interpreting the operator NOSWAP:
label
NOSWAP

StackNOSWAP:
interpreting the operator GOTO NOSWAP
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto NOSWAP
NOSWAP:
Stackid j=4

Stackid j=4id j=4

Stackid j=4id j=4const=1
interpreting the operator (j+1)
+
j1

5 = 4 + 1

Stackid j=4tm=5
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=5

Stack

Stackid j=5

Stackid j=5id alen=5
interpreting the operator (j<
jalen

5 < 5 ?

Stacktm=0
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stackid i=0

Stackid i=0id i=0

Stackid i=0id i=0const=1
interpreting the operator (i+1)
+
i1

1 = 0 + 1

Stackid i=0tm=1
interpreting the operator i:=(i+1)
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

i:=1

Stack

Stackid i=1

Stackid i=1id alen=5

Stackid i=1id alen=5const=1
interpreting the operator (alen-1)
-
alen1

4 = 5 - 1

Stackid i=1tm=4
interpreting the operator (i<(alen-1))
<
i-
alen1

1 < 4 ?

Stacktm=1
interpreting the operator IF (i<(alen-1)) THEN
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORi:
interpreting the operator FORi:
label
FORi

StackFORi:
interpreting the operator GOTO FORi
GOTO
label
FORi
goto FORi
FORi:
Stackid j=5

Stackid j=5id i=1

Stackid j=5id i=1const=1
interpreting the operator (i+1)
+
i1

2 = 1 + 1

Stackid j=5tm=2
interpreting the operator j:=(i+1)
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=2

Stack
FORj:
Stackid a=0

Stackid a=0id i=1
interpreting the operator a[i]
->
ai
->
aj
a[1]=85
Stacktm=85

Stacktm=85id a=0

Stacktm=85id a=0id j=2
interpreting the operator a[j]
->
aj
a[2]=23
Stacktm=85tm=23
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

85 <= 23 ?

Stacktm=0
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stackid t=23

Stackid t=23id a=0

Stackid t=23id a=0id i=1
interpreting the operator a[i]
->
ai
a[1]=85
Stackid t=23tm=85
interpreting the operator t:=a[i]
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

t:=85

Stack

Stackid a=0

Stackid a=0id i=1

Stackid a=0id i=1id a=0

Stackid a=0id i=1id a=0id j=2
interpreting the operator a[j]
->
aj
a[2]=23
Stackid a=0id i=1tm=23
interpreting the operator a[i]:=a[j]
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 23 to a[1]
a1023234762

Stack

Stackid a=0

Stackid a=0id j=2

Stackid a=0id j=2id t=85
interpreting the operator a[j]:=t
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 85 to a[2]
a1023854762

Stack
NOSWAP:
Stackid j=2

Stackid j=2id j=2

Stackid j=2id j=2const=1
interpreting the operator (j+1)
+
j1

3 = 2 + 1

Stackid j=2tm=3
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=3

Stack

Stackid j=3

Stackid j=3id alen=5
interpreting the operator (j<
jalen

3 < 5 ?

Stacktm=1
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORj:
interpreting the operator FORj:
label
FORj

StackFORj:
interpreting the operator GOTO FORj
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto FORj
FORj:
Stackid a=0

Stackid a=0id i=1
interpreting the operator a[i]
->
ai
->
aj
a[1]=23
Stacktm=23

Stacktm=23id a=0

Stacktm=23id a=0id j=3
interpreting the operator a[j]
->
aj
a[3]=47
Stacktm=23tm=47
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

23 <= 47 ?

Stacktm=1
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackNOSWAP:
interpreting the operator NOSWAP:
label
NOSWAP

StackNOSWAP:
interpreting the operator GOTO NOSWAP
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto NOSWAP
NOSWAP:
Stackid j=3

Stackid j=3id j=3

Stackid j=3id j=3const=1
interpreting the operator (j+1)
+
j1

4 = 3 + 1

Stackid j=3tm=4
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=4

Stack

Stackid j=4

Stackid j=4id alen=5
interpreting the operator (j<
jalen

4 < 5 ?

Stacktm=1
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORj:
interpreting the operator FORj:
label
FORj

StackFORj:
interpreting the operator GOTO FORj
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto FORj
FORj:
Stackid a=0

Stackid a=0id i=1
interpreting the operator a[i]
->
ai
->
aj
a[1]=23
Stacktm=23

Stacktm=23id a=0

Stacktm=23id a=0id j=4
interpreting the operator a[j]
->
aj
a[4]=62
Stacktm=23tm=62
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

23 <= 62 ?

Stacktm=1
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackNOSWAP:
interpreting the operator NOSWAP:
label
NOSWAP

StackNOSWAP:
interpreting the operator GOTO NOSWAP
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto NOSWAP
NOSWAP:
Stackid j=4

Stackid j=4id j=4

Stackid j=4id j=4const=1
interpreting the operator (j+1)
+
j1

5 = 4 + 1

Stackid j=4tm=5
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=5

Stack

Stackid j=5

Stackid j=5id alen=5
interpreting the operator (j<
jalen

5 < 5 ?

Stacktm=0
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stackid i=1

Stackid i=1id i=1

Stackid i=1id i=1const=1
interpreting the operator (i+1)
+
i1

2 = 1 + 1

Stackid i=1tm=2
interpreting the operator i:=(i+1)
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

i:=2

Stack

Stackid i=2

Stackid i=2id alen=5

Stackid i=2id alen=5const=1
interpreting the operator (alen-1)
-
alen1

4 = 5 - 1

Stackid i=2tm=4
interpreting the operator (i<(alen-1))
<
i-
alen1

2 < 4 ?

Stacktm=1
interpreting the operator IF (i<(alen-1)) THEN
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORi:
interpreting the operator FORi:
label
FORi

StackFORi:
interpreting the operator GOTO FORi
GOTO
label
FORi
goto FORi
FORi:
Stackid j=5

Stackid j=5id i=2

Stackid j=5id i=2const=1
interpreting the operator (i+1)
+
i1

3 = 2 + 1

Stackid j=5tm=3
interpreting the operator j:=(i+1)
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=3

Stack
FORj:
Stackid a=0

Stackid a=0id i=2
interpreting the operator a[i]
->
ai
->
aj
a[2]=85
Stacktm=85

Stacktm=85id a=0

Stacktm=85id a=0id j=3
interpreting the operator a[j]
->
aj
a[3]=47
Stacktm=85tm=47
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

85 <= 47 ?

Stacktm=0
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stackid t=85

Stackid t=85id a=0

Stackid t=85id a=0id i=2
interpreting the operator a[i]
->
ai
a[2]=85
Stackid t=85tm=85
interpreting the operator t:=a[i]
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

t:=85

Stack

Stackid a=0

Stackid a=0id i=2

Stackid a=0id i=2id a=0

Stackid a=0id i=2id a=0id j=3
interpreting the operator a[j]
->
aj
a[3]=47
Stackid a=0id i=2tm=47
interpreting the operator a[i]:=a[j]
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 47 to a[2]
a1023474762

Stack

Stackid a=0

Stackid a=0id j=3

Stackid a=0id j=3id t=85
interpreting the operator a[j]:=t
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 85 to a[3]
a1023478562

Stack
NOSWAP:
Stackid j=3

Stackid j=3id j=3

Stackid j=3id j=3const=1
interpreting the operator (j+1)
+
j1

4 = 3 + 1

Stackid j=3tm=4
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=4

Stack

Stackid j=4

Stackid j=4id alen=5
interpreting the operator (j<
jalen

4 < 5 ?

Stacktm=1
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORj:
interpreting the operator FORj:
label
FORj

StackFORj:
interpreting the operator GOTO FORj
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto FORj
FORj:
Stackid a=0

Stackid a=0id i=2
interpreting the operator a[i]
->
ai
->
aj
a[2]=47
Stacktm=47

Stacktm=47id a=0

Stacktm=47id a=0id j=4
interpreting the operator a[j]
->
aj
a[4]=62
Stacktm=47tm=62
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

47 <= 62 ?

Stacktm=1
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackNOSWAP:
interpreting the operator NOSWAP:
label
NOSWAP

StackNOSWAP:
interpreting the operator GOTO NOSWAP
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi
goto NOSWAP
NOSWAP:
Stackid j=4

Stackid j=4id j=4

Stackid j=4id j=4const=1
interpreting the operator (j+1)
+
j1

5 = 4 + 1

Stackid j=4tm=5
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=5

Stack

Stackid j=5

Stackid j=5id alen=5
interpreting the operator (j<
jalen

5 < 5 ?

Stacktm=0
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stackid i=2

Stackid i=2id i=2

Stackid i=2id i=2const=1
interpreting the operator (i+1)
+
i1

3 = 2 + 1

Stackid i=2tm=3
interpreting the operator i:=(i+1)
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

i:=3

Stack

Stackid i=3

Stackid i=3id alen=5

Stackid i=3id alen=5const=1
interpreting the operator (alen-1)
-
alen1

4 = 5 - 1

Stackid i=3tm=4
interpreting the operator (i<(alen-1))
<
i-
alen1

3 < 4 ?

Stacktm=1
interpreting the operator IF (i<(alen-1)) THEN
IF
<
i-
alen1
GOTO
label
FORi

Stack

StackFORi:
interpreting the operator FORi:
label
FORi

StackFORi:
interpreting the operator GOTO FORi
GOTO
label
FORi
goto FORi
FORi:
Stackid j=5

Stackid j=5id i=3

Stackid j=5id i=3const=1
interpreting the operator (i+1)
+
i1

4 = 3 + 1

Stackid j=5tm=4
interpreting the operator j:=(i+1)
:=
j+
i1
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=4

Stack
FORj:
Stackid a=0

Stackid a=0id i=3
interpreting the operator a[i]
->
ai
->
aj
a[3]=85
Stacktm=85

Stacktm=85id a=0

Stacktm=85id a=0id j=4
interpreting the operator a[j]
->
aj
a[4]=62
Stacktm=85tm=62
interpreting the operator (a[i]<=a[j])
<=
->
ai
->
aj

85 <= 62 ?

Stacktm=0
interpreting the operator IF (a[i]<=a[j]) THEN
IF
<=
->
ai
->
aj
GOTO
label
NOSWAP
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stackid t=85

Stackid t=85id a=0

Stackid t=85id a=0id i=3
interpreting the operator a[i]
->
ai
a[3]=85
Stackid t=85tm=85
interpreting the operator t:=a[i]
:=
t->
ai
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

t:=85

Stack

Stackid a=0

Stackid a=0id i=3

Stackid a=0id i=3id a=0

Stackid a=0id i=3id a=0id j=4
interpreting the operator a[j]
->
aj
a[4]=62
Stackid a=0id i=3tm=62
interpreting the operator a[i]:=a[j]
[]:=
ai->
aj
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 62 to a[3]
a1023476262

Stack

Stackid a=0

Stackid a=0id j=4

Stackid a=0id j=4id t=85
interpreting the operator a[j]:=t
[]:=
ajt
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Writed value 85 to a[4]
a1023476285

Stack
NOSWAP:
Stackid j=4

Stackid j=4id j=4

Stackid j=4id j=4const=1
interpreting the operator (j+1)
+
j1

5 = 4 + 1

Stackid j=4tm=5
interpreting the operator j:=(j+1)
:=
j+
j1
IF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

j:=5

Stack

Stackid j=5

Stackid j=5id alen=5
interpreting the operator (j<
jalen

5 < 5 ?

Stacktm=0
interpreting the operator IF (jIF
<
jalen
GOTO
label
FORj
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

Stackid i=3

Stackid i=3id i=3

Stackid i=3id i=3const=1
interpreting the operator (i+1)
+
i1

4 = 3 + 1

Stackid i=3tm=4
interpreting the operator i:=(i+1)
:=
i+
i1
IF
<
i-
alen1
GOTO
label
FORi

i:=4

Stack

Stackid i=4

Stackid i=4id alen=5

Stackid i=4id alen=5const=1
interpreting the operator (alen-1)
-
alen1

4 = 5 - 1

Stackid i=4tm=4
interpreting the operator (i<(alen-1))
<
i-
alen1

4 < 4 ?

Stacktm=0
interpreting the operator IF (i<(alen-1)) THEN
IF
<
i-
alen1
GOTO
label
FORi
program ext3.tri is completed

THE VARIABLES:

alen=5
a=0
i=4
j=5
t=85

ARRAYS:

a1023476285

Interpreter ended at Sun Dec 12 23:12:43 2010