:- use_module(library(chr)). handler forward_chaining. constraints fact/1. fact(rains), fact(go_out), fact(have_not(umbrella)) ==> fact(get_wet). fact(shower_bath) ==> fact(get_wet). fact(need(X)), fact(have_not(X)) ==> fact(go_out), fact(buy(X)). fact(thirsty) ==> fact(need(beer)). /******* fact(thirsty), fact(rains), fact(have_not(beer)), fact(have_not(umbrella)). ***/