Initializing help system before first use

Loops

forall
forall(f in FAC, t in TIME)
  make(f,t) <= MAXCAP(f,t)

forall(t in TIME) do
  use(t) <= MAXUSE(t)
  buy(t) <= MAXBUY(t)
end-do
with
equivalent to a forall loop stopped after the first iteration
with f='F1', t=1 do
  make(f,t) <= MAXCAP(f,t)
end-do
while
i := 1
while (i <= 10) do
  write(' ', i)
  i += 1
end-do
repeat ... until
i := 1
repeat
  write(' ', i)
  i += 1
until (i > 10)
break, next
  • break jumps out of the current loop
  • break n jumps out of n nested loops (where n is a positive integer)
  • next jumps to the beginning of the next iteration of the current loop
  • use break 'looplabel' and next 'looplabel' with labeled loops:
    'L1': repeat
      'L2': while (condition1) do
        if condition2 then
          break 'L1'
        end-if
      end-do
    until condition3
counter
  • Use the construct as counter to specify a counter variable in a bounded loop (i.e., forall or aggregate operators such as sum). At each iteration, the counter is incremented
cnt:=0.0
writeln("Average of odd numbers in 1..10: ",
        (sum(cnt as counter, i in 1..10 | isodd(i)) i) / cnt)