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
equivalent to a
forall loop stopped after the first iteration
with f='F1', t=1 do
make(f,t) <= MAXCAP(f,t)
end-do
i := 1
while (i <= 10) do
write(' ', i)
i += 1
end-do
i := 1
repeat
write(' ', i)
i += 1
until (i > 10)
- 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)