Implementation of transforming FlatCurry expressions by applying partially and non-deterministically defined expression transformations as long as possible with a chaotic (non-deterministic) strategy.
transformExprND
:: (() -> (Int, [Int]) -> Expr -> (Expr, String, Int)) -> Expr -> Expr
Simplifies a FlatCurry expression according to some expression transformation which can be partially or non-deterministically defined. Since the expression transformation might be non-deterministic, we pass it as a function which is similarly to passing it via run-time choice.
To apply transformation steps, some subexpression is non-deterministically selected.
transformExprMaxND
:: Int -> (() -> (Int, [Int]) -> Expr -> (Expr, String, Int)) -> Expr -> Expr
The same as transformExprND but takes the maximum number of transformation steps to be applied as a further argument. If the number is negative, then keep going until no transformation can be applied.