Back to table

while-loop

The following is valid µOCCAM. This tests the WHILE loop, when nested inside a sequence. The loop forms a valid process.

Program file: /public/cs3/web/ipptests-phase-1/while-loop.accept
SEQ
  stdin ? n
  stdin ? m

  WHILE n > 0
    SEQ
      temp := n
      n    := m \ n
      m    := temp

  stdout ! m