(VAR x y) (RULES app(app(minus, x), 0) -> x app(app(minus, app(s, x)), app(s, y)) -> app(app(minus, x), y) app(f, 0) -> app(s, 0) app(f, app(s, x)) -> app(app(minus, app(s, x)), app(g, app(f, x))) app(g, 0) -> 0 app(g, app(s, x)) -> app(app(minus, app(s, x)), app(f, app(g, x))) )