Interface

Description

The simplest version of ask prompts the user with the requested attribute and value and seeks confirmation or denial of the proposed information.

Source: Building Expert Systems in PROLOG Publisher

Download

Program source code: interface.pl

Listing

ask(Attr, Val):-
write(Attr:Val),
write('? '),
read(yes).
 
eats(X):- ask(eats, X).
 
feet(X):- ask(feet, X).
 
wings(X):- ask(wings, X).
 
neck(X):- ask(neck, X).
 
color(X):- ask(color, X).

Comments

pl/prolog/pllib/interface.txt · ostatnio zmienione: 2017/07/17 08:08 (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