20 likes | 121 Views
[ repeat tt ns ] <S, s> s’ <repeat S until B, s> s’. if B b s ’= tt. Natural Semantics for Repeat. [ repeat ff ns ] <S , s> s’, <while b do S, s’> s’’ <while b do S, s> s’’ . if B b s ’=ff. Random. If n N. [ random ns ] <random(x) , s> s[x n].
E N D
[repeatttns] <S, s> s’<repeat S until B, s> s’ if Bbs’=tt Natural Semantics for Repeat [repeatffns] <S , s> s’, <while b do S, s’> s’’ <while b do S, s> s’’ if Bbs’=ff
Random If n N [randomns] <random(x) , s> s[x n] [randomsos] <random(x) , s> s[x n] If n N x :=0 ; finish := false; while not finish do (finish := true or x := x +1)