Monday, August 17, 2009

GCs (cont.)

อ่านอันนี้เข้าใจขึ้น http://en.wikipedia.org/wiki/Guarded_Command_Language

In pseudocode:

if a < b then c := True
else c := False

In guarded command language:

if a < b c := true
[] a ≥ b c := false
fi

Skip and Abort
Skip and Abort are very simple as well as important statements in the guarded command language. Abort is the undefined instruction: do anything. The abort statement does not even need to terminate. It is used to describe the program when formulating a proof, in which case the proof usually fails. Skip is the empty instruction: do nothing. It is used in the program itself, when the syntax requires a statement, but the programmer does not want the machine to change states.

No comments:

Post a Comment