(VAR x y z) (RULES app(app(:, app(app(:, x), y)), z) -> app(app(:, x), app(app(:, y), z)) app(app(:, app(app(+, x), y)), z) -> app(app(+, app(app(:, x), z)), app(app(:, y), z)) app(app(:, z), app(app(+, x), app(f, y))) -> app(app(:, app(app(g, z), y)), app(app(+, x), a)) )