Both sides previous revision
Poprzednia wersja
Nowa wersja
|
Poprzednia wersja
|
pl:miw:miw08_ruleruntimeg:xshell [2008/04/22 10:49] miw |
pl:miw:miw08_ruleruntimeg:xshell [2019/06/27 15:50] (aktualna) |
% READSTR.PL, READNUM.PL, and GETYESNO.PL from | % READSTR.PL, READNUM.PL, and GETYESNO.PL from |
% Chapter 5. | % Chapter 5. |
% | |
| |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| |
info(X):- | info(X):- |
jpl_datums_to_array(X,Q), | jpl_datums_to_array(X,Q), |
jpl_new('miw2.Info',[Q],D). | jpl_new('miw2.Info',[Q],_). |
| |
myQuestion(Question,Choices,Response):- | myQuestion(Question,Choices,Response):- |
Response = V. | Response = V. |
| |
| change(0,y). |
| change(1,n). |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| |
finish_xshell :- | finish_xshell :- |
retractall(known(_,_)), | retractall(known(_,_)), |
% writeline('Do you want to conduct another consultation?'), | |
yes(['Do you want to conduct another consultation?']), | yes(['Do you want to conduct another consultation?']), |
!, | !, |
| |
prop(Property) :- xkb_question(Property,Question,_,_), | prop(Property) :- xkb_question(Property,Question,_,_), |
% writeline(Question), | |
yes(Question), | yes(Question), |
!, | !, |
parm(Parameter,m,Value) :- xkb_menu(Parameter,Header,Choices,_), | parm(Parameter,m,Value) :- xkb_menu(Parameter,Header,Choices,_), |
length(Choices,L), | length(Choices,L), |
% writeline(Header), | |
% enumerate(Choices,1), | |
myQuestion(Header,Choices,N), | myQuestion(Header,Choices,N), |
readnumber_in_range(1,L,N), | readnumber_in_range(1,L,N), |
% writeline(Question), | % writeline(Question), |
question(Response,Question), | question(Response,Question), |
% readatom(Response), | |
assert(known(Parameter,Response)), | assert(known(Parameter,Response)), |
!, | !, |
| |
parm(Parameter,n,Value) :- xkb_question(Parameter,Question,_,_), | parm(Parameter,n,Value) :- xkb_question(Parameter,Question,_,_), |
% writeline(Question), | |
% readnumber(Response), | |
question(Response,Question), | question(Response,Question), |
assert(known(Parameter,Response)), | assert(known(Parameter,Response)), |
known(identification,RULE), | known(identification,RULE), |
clause(xkb_identify(RULE,_),Condition), | clause(xkb_identify(RULE,_),Condition), |
info(['Rule ', | info([ |
% RULE, | % info([{RULE}]), |
': reach this conclusion IF']), | 'Reach this conclusion IF']), |
explain_aux(Condition), | explain_aux(Condition), |
wait, !. | wait, !. |
xkb_text(N,Text2), | xkb_text(N,Text2), |
append(Text2,Text1,Text). | append(Text2,Text1,Text). |
| |
% | |
% writeline(+Text) | |
% Prints Text consisting of a string or a list of | |
% strings, with each string followed by a new line. | |
% | |
| |
% writeline([]) :- !. | |
% writeline([First|Rest]) :- | |
% !, | |
% info([First, | |
% Rest]). | |
% writeline(String) :- | |
% write(String), | |
% . | |
| |
| |
</code> | </code> |