f(x1,...,xn) = sdefines a strategy operator
f
with n
strategy parameters. An application f(s1,...sn)
of this
operator is equivalent to
let x1 = s1 ... xn = sn in sthat is, binding the actual strategy parameters
si
to the formal parameters xi
.
Strategy definitions may be recursive.
The RecursionOperator rec
can be used to create recursive strategy locally without need
to give a name.
rec x(s)is equivalent to
let x = s in x end
Typical examples of strategy definitions are
try(s) = s <+ id repeat(s) = try(s; repeat(s)) topdown(s) = s; all(topdown(s))