A formula definition has the form:
formula-definition: identifier is expression ;
It is normally expected that the operators appearing in the expression are ``pure'' functions, i.e. without side-effect. The interpreter does not allow the use of assignment operators in the expression, but does not otherwise detect the use of ``impure'' functions. It is not advisable to use such functions.
In addition, a formula variable cannot be (directly or indirectly) circularly defined. For example,
f is f + 1;
is an error because f
is defined in terms of itself, and not logically
meaningful. The definitions:
i is j; j is i;
are syntactically correct, but are conflicting with the restriction. Thus the EDEN interpreter rejects the second definition, and produces the error message:
j : CYCLIC DEF : ABORTED near line ...
The examples below are valid definitions of formula variables (assuming they are not circularly defined):
f is a + b; M is max(a,b,c);
The EDEN interpreter controls all the evaluations of formulae. The order
of evaluation is not specified by the language, i.e. can happen in any
order. One version of EDEN interpreter may evaluate the formula of
f
before
that of M
, whenever the value of
a
, for instance, is changed, but some
other versions may do it in the reverse order. A concurrent EDEN system
might do both evaluations in parallel. Therefore, the user should not
make any assumption on the order of evaluation.