Sample Consultation Using Fuzzy Logic: Rules

%:::  KPI KNOWLEDGE BASE FOR INVESTMENT DECISIONS
%:::  Investment Attractiveness (IA) as a function
%:::  of Annual Revenue Growth (ARG). The rules
%:::  are structured similarly to those in the
%:::  Meehan and Joy shoe-size knowledge base.

if arg be very_low then ia := very_unattractive.

if arg be low then ia := unattractive.

if arg be moderate then ia := neutral.

if arg be high then ia := attractive.

if arg be very_high then ia := very_attractive.

% Domain definitions for ARG.
low(arg, -10).
high(arg, 100).
scale(arg, 'Percent').

% Fuzzy set definitions for ARG.
fuzzy_set(arg, very_low, down(-10, 0)).
fuzzy_set(arg, low, tri(0, 10, 20)).
fuzzy_set(arg, moderate, tri(20, 50, 80)).
fuzzy_set(arg, high, tri(80, 90, 100)).
fuzzy_set(arg, very_high, up(100, 110)).

% Domain definitions for Investment Attractiveness.
low(ia, 0).
high(ia, 10).
scale(ia, '0-10').

% Fuzzy set definitions for Investment Attractiveness.
fuzzy_set(ia, very_unattractive, down(0, 2)).
fuzzy_set(ia, unattractive, tri(1, 3, 5)).
fuzzy_set(ia, neutral, tri(4, 5, 6)).
fuzzy_set(ia, attractive, tri(5, 7, 9)).
fuzzy_set(ia, very_attractive, up(8, 10)).