Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
language:langs:chp [2021/12/29 15:47]
rajit [More on channel expressions and probes]
language:langs:chp [2021/12/31 19:18]
rajit
Line 126: Line 126:
 </code> </code>
 A do-while loop can have only one guard. This program executes ''S'', and then evaluates the guard ''G''. If ''G'' is true, then the loop repeats; otherwise, the loop terminates. A do-while loop can have only one guard. This program executes ''S'', and then evaluates the guard ''G''. If ''G'' is true, then the loop repeats; otherwise, the loop terminates.
 +
 +Loop guards can only use local variables. Hence, it is an error if a variable appearing in a loop guard is either (i) a global variable; or (ii) accessible via the port list of the process; or (iii) involves a channel probe. This ensures that loop guards cannot include any shared variables.
  
 ==== Channels in expressions ==== ==== Channels in expressions ====