The following code isn't working
:- arithmetic_function(i/2).
i(X,Y,Z) :-
Z is X+Y.
calcola :-
write('Give me an expression'),nl,
read(ESP),
Z is ESP,nl,nl,
write(Z).
but the following is
:- arithmetic_function(i/2).
i(X,Y,Z) :-
Z is X+Y.
calcola :-
write('Give me an expression'),nl,
Z is 4 i 2,nl,nl,
write(Z).
Why is that? Seems like the "read" function isn't working properly