Module FlatCurry.Transform.ExecDet

Author
Michael Hanus, Steven Libby
Version
September 2025

Implementation of transforming FlatCurry expressions by applying deterministically defined expressions transformations as long as possible.

Exported Functions


transformFuncsInProgDet :: ((Int, [Int]) -> Expr -> Maybe (Expr, String, Int)) -> Prog -> Prog  Deterministic 

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  Deterministic 

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  Deterministic 

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)  Deterministic 

The same as transformExprMaxDet but returns also a formatted trace of all applied transformation steps as well as its total number.