[CSUSB]
>> [CNS]
>> [Comp Sci Dept]
>> [R J Botting]
>> [CSci620]
>>
Minsky
[Source]
Example
While a>0, subtract one from a and add one to b.
*a(-a+b)
Here is a rough translation into C/C++/Java:
while(a>0){--a; ++b}
I = 0,1,2,.. , values of variables: integers greater than or equal to zero. S = V -> I, state: each variable has a value.
For s:S, v:V, s(v) = the value of v in s.
For s:S, v:V, i:I, s[ i / v ] = the state with the value of v set to i,
Net
Semantic Function Declaration
m<<a>>: S->S, the meaning of a.
m<<a>>s is the effect of a on state s.
Semantic Function Equations
For s: S, a,a1,a2:A, v:V.
(a): m<<empty>>s = s.
(b): m<<0 v>>s = s[0/v].
(c): m<<+ v>>s = s[s(v) +1 / v].
(d): m<<- v>>s = s[ max(0, s(v) -1) / v].
(e): m<<* v(a)>>s = if s(v)=0 then s else m<<*v(a)>> ( m<<a>> s).
(f): m<<?v(a1:a2)>>s = if s(v) =0 then m<<a2>>s else m<<a1>> s.
(g): m<<a1 a2>> s = m<<a2>> (m<<a1>>s).
Initially:
Let s1=m<<-a>>s then
Notice, s1(b)=s0[0/a](b) =s0(b) =0, by (s2) above.
So,
So, in s2, a=0 and b=1.
0b+b+b
0b*a(+b-a)
0b*a(+b+b-a)
0b0c*a(-a+b+c)*c(-c+a)
0b*a(+b-a-a)
?a( 0b+b : 0b)
0c*a(-a ?a(:+c)-a)
0r0q0b *a(+q+b-a ?a(:+r) -a+b) *b(-b+a)
0r0q0b *a(+q+b-a ?a(:+r) -a+b) *b(-b+a) ?r(-q-a)(Improved, but may still have a bug or two).
. . . . . . . . . ( end of section The Programming Language Minsk) <<Contents | Index>>
Glossary