Right-linearity analysis: check whether functions are defined by right-linear rules.
The right-linearity analysis is a global function dependency analysis. It assigns to a function a flag which is True if this function is right-linear, i.e., defined by right-linear rules and depend only on functions defined by right-linear rules.
showRightLinear
:: AOutFormat -> Bool -> String
Show right-linearity information as a string.
hasRightLinearRules
:: FuncDecl -> Bool
The right-linearity analysis can also be applied to individual functions. It returns True for a function if it is defined by right-linear rules.
linearExpr
:: Expr -> Bool
Check an expression for linearity: