.


:




:

































 

 

 

 


16.6. . Prolog




expert

%

expert:-

getquestion(Question), % (answeryes(Question) %


answerno(Question)).

% ,

answeryes(Question):- % Question
mar-kstatus(negative), %

explore! Question, [], Answer), %


16.



positive! Answer}, %

markstatusC positive), %

present! Answer), nl,

write! 'Mere solutions? '),

getreply(Reply), %

Reply = . % explore

answernoC Question):- %

retract! no_positive_ari5wer_yet),!, % ?

explore] Question, [], Answer),

negative (Answer),

present! Answer), nl,

write("More negative solutions? '),

getreply{ Reply),

Reply - no. %

markstatus(negative):-

assert (no_positive_answer_yet) * markstatust positive;:-

retract{ no_positive_answer yet},!

true. getquestion(Question):-

nl, write{ 'Question, please'), nl, read(Question).

, , Prolog. , , , , , , . , , . , . , Prolog, .





:


: 2015-10-01; !; : 392 |


:

:

, .
==> ...

1721 - | 1537 -


© 2015-2024 lektsii.org - -

: 0.007 .