Could not identify decreasing arguments
Given the following code, the function execNo
cannot be transformed. Pushing the pattern (n : m : s')
to the right-hand side of that rule worked again.
data Expr = Val Integer | Add Expr Expr
type Stack = [Integer]
type Code = [Op]
data Op = PUSH Integer | ADD
execNo :: Stack -> Code -> Stack
execNo s [] = s
execNo s (PUSH n : ops) = execNo (n : s) ops
execNo (n : m : s') (ADD : ops) = execNo (n + m : s') ops
Edited by Ghost User