Implementation of transforming FlatCurry expressions by applying deterministically defined expressions transformations as long as possible.
transformFuncsInProgDet
:: ((Int, [Int]) -> Expr -> Maybe (Expr, String, Int)) -> Prog -> Prog
Transforms the bodies of all functions in a FlatCurry program according to some deterministic(!) expression transformation provided as the first argument.
transformExprDet
:: ((Int, [Int]) -> Expr -> Maybe (Expr, String, Int)) -> Expr -> Expr
Transforms an expression by applying some deterministic(!) expression transformation as long as possible with a bottom-up strategy.
transformExprMaxDet
:: Int -> ((Int, [Int]) -> Expr -> Maybe (Expr, String, Int)) -> Expr -> Expr
The same as transformExprDet 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.
showTransformExprDet
:: Int -> ((Int, [Int]) -> Expr -> Maybe (Expr, String, Int)) -> Expr -> (Expr, String, Int)
The same as transformExprMaxDet but returns also a formatted trace of all applied transformation steps as well as its total number.