LIDO - Reference Manual
The general principle of computations in trees guarantees that the computations specified for each tree node context are executed exactly once. The iteration construct allows to specify cyclic dependencies that may cause certain computations to be iterated until a specified condition holds.
Computation ::= Iteration Terminator | Attribute '=' Iteration Terminator Iteration ::= 'UNTIL' Expression 'ITERATE' Attribute '=' Expression
ATTR cnt, incr: int; RULE: R ::= X COMPUTE X.cnt = 1; R.done = UNTIL GT (X.cnt, 10) ITERATE X.cnt = X.incr; END; RULE: X ::= SomeThing COMPUTE X.incr = ORDER (printf ("%d\n", X.cnt), ADD (X.cnt, 1)); END;
The attribute defined in the
There must be an initializing non-cyclic definition for the iteration attribute.
Some computations that do not lie on the iteration cycle may also be reexecuted on iteration if not specified otherwise. This effect can be avoided by specifying the initial iteration attribute computation to depend on them, or by specifying them to depend on the postcondition of the iteration.
There may be several iterations for the same iteration attribute. The so
specified iterations may be arbitrary merged if not otherwise specified.
In any case the
Termination of iterations has to be ensured by suitable
The iteration attribute may not be a chain attribute.