BousiProlog

BOUSI~PROLOG is a Fuzzy Logic Programming system.

As an example, we will translate the examples from the following paper to ProbLog. Iranzo, Pascual Julián, and Clemente Rubio-Manzano. “Bousi~ Prolog-A Fuzzy Logic Programming Language for Modeling Vague Knowledge and Approximate Reasoning.” IJCCI (ICFC-ICNC). 2010.

Introduction: Whiskey

%% PROXIMITY EQUATIONS 0.5::equals(does_not, a_little). 0.2::equals(a_little, very_much). 0.1::equals(does_not, so_much). 0.6::equals(so_much, very_much). 0.5::equals(a_little, so_much). %% FACTS likes(john, whiskey, a_little). likes(mary, whiskey, very_much). likes(peter, whiskey, so_much). likes(paul, whiskey, does_not). %% RULES equals(X,X). equals(X,Y) :- equals(Y,X). buy(X,P) :- likes(X, P, L), equals(L, very_much). %% QUERY query(buy(X, whiskey)).

Flexible Query Answering in Deductive Databases

Movie listings example

%% DIRECTIVE lambdaCut(0.5). %% PROXIMITY RELATIONS %% Location Distance Relationship 0.30::equals(beverly_hills,downtown). 0.45::equals(beverly_hills,santa_monica). 0.56::equals(beverly_hills,hollywood). 0.90::equals(beverly_hills,westwood). 0.45::equals(downtown,hollywood). 0.23::equals(downtown,santa_monica). 0.25::equals(downtown,westwood). 0.30::equals(hollywood,santa_monica). 0.45::equals(hollywood,westwood). 0.90::equals(santa_monica,westwood). %% Category Relationship 0.6::equals(comedy,drama). 0.3::equals(comedy,adventure). 0.3::equals(comedy,suspense). 0.6::equals(drama,adventure). 0.6::equals(drama,suspense). 0.9::equals(adventure,suspense). %% Films Table %% film(Title, Director, Category) film(four_feathers, korda, adventure). film(modern_times, chaplin, comedy). film(psycho, hitchcock, suspense). film(rear_window, hitchcock, suspense). film(robbery, yates, suspense). film(star_wars, lucas, adventure). film(surf_party, dexter, drama). %% Theaters Table %% theater(Name,Owner,Location). theater(chinese,mann,hollywood). theater(egyptian,va,westwood). theater(music_hall,lae,beverly_hills). theater(odeon,cineplex,santa_monica). theater(rialto,independent,downtown). theater(village,mann,westwood). %% Engagements Table %% engagement(Film,Theater) engagement(modern_times,rialto). engagement(start_wars,rialto). engagement(star_wars,chinese). engagement(rear_window,egyptian). engagement(surf_party,village). engagement(robbery,odeon). engagement(modern_times,odeon). engagement(four_feathers,music_hall). %% SOFT RULES equals(X,X). equals(X,Y) :- equals(Y,X). %% MAIN RULE %% search(input, input, output, output) search(Category, Location, Film, Theater) :- film(Film, _, Category2), engagement(Film, Theater), theater(Theater, _, Location2), equals(Category2, Category), equals(Location2, Location). query(search(adventure, westwood, Film, Theater)).