diff --git a/expert.pl b/expert.pl index d026cc9..ba94118 100644 --- a/expert.pl +++ b/expert.pl @@ -4,21 +4,35 @@ pref(P,X) :- nb_current(P,_), nb_getval(P,Y), + !, ( Y = X - ; ( Y = nie(Z), Z \= X)), - !. + ; ( Y = nie(Z), Z \= X) + ; Y = cokolwiek). pref(P,X) :- format("~w:\n", [P]), read(Y), nb_setval(P,Y), ( Y = X - ; ( Y = nie(Z), Z \= X)). + ; ( Y = nie(Z), Z \= X) + ; Y = cokolwiek). +prefb(P,X) :- + nb_current(P,_), + nb_getval(P,Y), + !, + Y=X. + +prefb(P,X) :- + format("~w?\n",[P]), + read(Y), + nb_setval(P,Y), + Y = X. termin(XS) :- nb_current(termin,_), nb_getval(termin,Y), + !, member(X,XS), ( (Y1-Y2 = Y, X >= Y1, X =< Y2) ; (nie(Y1-Y2) = Y, (X < Y1 ; X > Y2)) @@ -39,6 +53,7 @@ termin(XS) :- cena(X) :- nb_current(cena,_), nb_getval(cena,Y), + !, X=