% The little knowledge base written as a Prolog program get_wet:- rains, go_out, have_not(umbrella). get_wet:- shower_bath. go_out:- need(X), have_not(X). buy(X):- need(X), have_not(X). need(beer):- thirsty. rains. thirsty. have_not(beer). %%% have_not(umbrella). %% (... a bit inflexible that you need to edit the program...)