Although the answers of Tudor and Gohan give the desired result, I think there is a more elegant solution.
Portable solution
Prolog :
operation(X, Y, Operator, Result):-
Goal =.. [Operator, X, Y],
Result is Goal.
, SWI-Prolog
SWI-Prolog . , :
:- meta_predicate(operation(+,+,2,-)).
operation(X, Y, Module:Operator, Result):-
Goal =.. [Operator, X, Y],
Module:(Result is Goal).
, SWI-Prolog , .
operation/4:
?- operation(1, 2, mod, X).
X = 1.
?- operation(1, 2, //, X).
X = 0.
?- operation(1, 2, /, X).
X = 0.5.
?- operation(1, 2, -, X).
X = -1.
?- operation(1, 2, +, X).
X = 3.