commit 27d0d019ca56ace2a63278f698353fe5d9658a29 Author: ryuga4 Date: Mon May 27 22:58:09 2019 +0200 init diff --git a/expert.pl b/expert.pl new file mode 100644 index 0000000..d026cc9 --- /dev/null +++ b/expert.pl @@ -0,0 +1,87 @@ + + + +pref(P,X) :- + nb_current(P,_), + nb_getval(P,Y), + ( Y = X + ; ( Y = nie(Z), Z \= X)), + !. + +pref(P,X) :- + format("~w:\n", [P]), + read(Y), + nb_setval(P,Y), + ( Y = X + ; ( Y = nie(Z), Z \= 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)) + ), + !. + +termin(XS) :- + format("termin (od-do):\n"), + read(Y), + nb_setval(termin,Y), + member(X,XS), + ( (Y1-Y2 = Y, X >= Y1, X =< Y2) + ; (nie(Y1-Y2) = Y, (X < Y1 ; X > Y2)) + ), + !. + + +cena(X) :- + nb_current(cena,_), + nb_getval(cena,Y), + X=