Add predicates `int' and `is' to Prolog-S. `int(N)' succeeds if and only if N is bound to an integer. `is(X,E)' or `X is E' succeeds if and only if E is an arithmetic expression containing only operators, numbers and variables bound to numbers and in that case X is unified with the expression's value.
Use `int' and `is' to write a simplifier in Prolog to go with the symbolic differentiator.