Back to table

Variable out of scope

The following is an invalid µOCCAM program. The variable y is used out of scope

Program file: /public/cs3/web/ipptests/scopeprobs.reject
PAR

  INT x:

  SEQ
    INT y:
    INT z:
    z := x+y  -- all variables in scope

  x := x+y -- the y here is not in scope

  STOP