Information Technology Reference
In-Depth Information
Cond( z )= (1 , 0) if z =0
(0 , 1) otherwise
Cond :
N →{
0 , 1
}×{
0 , 1
}
,
.
1
0
s
z
j
0
s
1
s
x
y
0
t
0
0
j
s
s
1
h
Fig. 3. The conditional construct is a function
N →{
0
,
1
}×{
0
,
1
}
The following MP grammar defines the Conditional construct:
R
Φ
ϕ 1 = s
r 1 : z
j
S =
{
x, y, z, j, t, s, h
}
r 2 : j
2 =1
In
=
{
z
}
r 3 :
∅→
3 = s
Out
=
{
x, y
}
r 4 : x
4 = j
= s
Start
r 5 : x
→∅
ϕ 5 = s
= h
Halt
r 6 : y
→∅
ϕ 6 = s
r 7 : s
7 =1
r 8 : t
8 =1
s becomes 1, x is incremented to 1 from the environment and,
at the same time, r 1 : z
Once the
Start
j tries to increase the value of j from 0 to 1 with a
flux of s =1.
Input
z =0:therule r 1 : z
j blocks and the value of j remains 0. In the
next step the rule t
h signals the end of computation and the result in
Out
is ( x, y )=(1 , 0).
Input z
=0:thevalueof j actually changes to 1 and in the next step the
rule r 4 : x → y inverts the values of x and y , leading to a final configuration
where the
is ( x, y )=(0 , 1).
The reactions r 5 : x
Out
→∅
and r 6 : y
→∅
clean up the
Out
substances at
the beginning of any new computation. The rule r 2 : j
In
substance to its original value, if needed. However the ancillary substance j is
not introduced as much for the restoration of x but rather for its two properties.
First, it is the complementary of input z when needed to invert the output and,
second, being always zero at the beginning, the rule r 4 : x
z ,restoresthe
y never blocks the
cleaning of r 5 : x
. Finally the temporary t is introduced for timing purposes
suggesting that the system always takes two steps to execute.
→∅
 
Search WWH ::




Custom Search