No, because =/2 does not mean an appointment in Prolog, but rather a union. And the union algorithm does not know anything about arithmetic, just structure. Thus, you can do some interesting things with arithmetic expressions in Prolog, which are quite difficult to do in other languages:
?- X = 5 + 2. X = 5+2.
It seems that nothing happened there, but in fact it happened that X received the value "5 + 2" as a structure. In other words:
?- A + B = 5 + 2. A = 5, B = 2.
Or even:
?- X = 5 + 2, X =.. [Op|_]. X = 5+2, Op = (+).
The latter could make more sense with the whole list:
?- X = 5 + 2, X =.. Y. X = 5+2, Y = [+, 5, 2].
This is the effect of the wonderful operator univ, =../2 , which is able to convert between Lisp-like lists and Prolog syntax, which allows you to make an interesting construction and decomposition of structures in a general way.
Now, is/2 , on the other hand, knows about arithmetic. He combines the left argument with the result of the arithmetic simplification of his right. Please note that it only works in one direction:
?- 7 is 5 + 2. true. ?- 5 + 2 is 7. false.
We can say that =/2 interested in structure, and is/2 interested in numerical equality. But this means that it is unusually easy to learn Prolog algebra:
simplify(X * Y + X * Z, X * (Y + Z)). % distributive property simplify(X, X). ?- simplify(A * 3 + A * 4, Q). Q = A* (3+4)
Now this is not perfect (note that we got 3 + 4, not 7), and there is still a lot of work to make it really smart:
?- simplify(3 * A + 4 * A, Q). Q = 3*A+4*A.
But this is a problem for another day.
Nutshell:
=/2 trigger combinationis/2 arithmetic evaluation of triggers