Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:answers_storing [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== Answers storing ======
 +{{tag>​knowledge_base interactive}}
 +===== Description =====
 +Program remember answer
 +
 +**Source**: ​ Building Expert Systems in PROLOG Publisher
 +===== Download =====
 +Program source code: {{answers_storing.pl}}
 +===== Listing =====
 +<code prolog>
 +ask(A, V):-
 +known(yes, A, V), % succeed if true
 +!. % stop looking
 +
 +ask(A, V):-
 +known(_, A, V), % fail if false
 +!, fail.
 +
 +ask(A, V):-
 +write(A:V), % ask user
 +write('?​ : '),
 +read(Y), % get the answer
 +asserta(known(Y,​ A, V)), % remember it
 +Y == yes. % succeed or fail
 +</​code>​
 +===== Comments =====
  
pl/prolog/pllib/answers_storing.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0