OEP

107

Title

Modified behaviour for SKIP in ALTs

Summary

Stricter usage rules for SKIP guards in ALT processes.

Owner

Fred Barnes <F.R.M.Barnes@kent.ac.uk>

Status

Accepted

Date-Accepted

2001-12-10

Keywords

language alt usage

The checking of SKIP guards in ALTs and PRI ALTs has been modified. For "ALT" processes, the absence of an "<exp> &" pre-condition on a "SKIP" will result in a warning. If the "-strict" option is used, non-pre-conditioned "SKIP"s will generate errors (as was the default behavior). This code, for example:

PROC wibble (CHAN INT in.0?, in.1?, out!)
  INT v:
  ALT
    in.0 ? v
      out ! v
    SKIP
      out ! 0
    in.1 ? v
      out ! v
:

will generate a warning about the non-pre-conditioned SKIP (or error with "-strict"). For "PRI ALT"s, a non-pre-conditioned SKIP guard is allowed, but only as the last (or only) guard. The following is a valid example:

PROC wibble2 (CHAN INT in.0?, out!)
  PRI ALT
    INT v:
    in.0 ? v
      out ! v
    SKIP
      out ! (-1)
:

OEP/107 (last edited 2007-09-27 00:08:02 by ats1)