include "first.inc" predicates nondeterm equation nondeterm znach(integer) goal equation. clauses equation:- readint(R), znach(X1), znach(X2), znach(X3), R = 100*X1+10*X2+X3, write("X1=",X1," X2=",X2," X3=",X3), readchar(_), readchar(_). znach(B):-B=0; B=1,B=2,B=3,B=4,B=5,B=6,B=7,B=8,B=9. 

When launched, the console opens, after which, when entered, it [the console] simply closes.

    1 answer 1

    You confuse unification = / 2 with destructive assignment (ie, as in C , etc.) or you simply made a mistake by typing a comma (and) instead of a semicolon (or), in the sentence znach(B) . In any case, the code could be:

     include "first.inc" domains int_list = interger* predicates nondeterm equation nondeterm znach(integer) nondeterm member(integer, int_list) goal equation. clauses equation:- readint(R), znach(X1), znach(X2), znach(X3), R = 100*X1+10*X2+X3, write("X1=",X1," X2=",X2," X3=",X3) readchar(_), readchar(_). znach(B):-member(B, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]). member( _ , []). member(B, [ X | Xs ]) :- member(B, Xs).