The most common way to do arithmetic calculations in Prolog is to use the built-in predicate is/2.
is/2
is
Expr must not contain any uninstantiated variables. Do not confuse is/2 with =/2.
=/2