Mon code est censé s'arrêter lorsqu'il trouve un arrêt dans le fichier qu'il lit, mais ce n'est pas le cas. Je continue à obtenir une erreur :
% reads in a character and then checks whether this character is a blank,
% a carriage return or the end of the stream. In any of these cases a
% complete word has been read otherwise the next character is read.
calculate([stop],_) :- !.
calculate([],_):-!.
calculate([Word|Rest],X) :-
word_to_number(Word,Symbol),
concat(X,Symbol,NewX),
calculate(Rest,NewX),
atom_to_term(NewX,Eq,[]),
print('Calculating '),print(NewX),print(' The result is: '),
Result is Eq,
print(Result),nl,
execute.
Toute aide serait grandement appréciée !