Herein we provide an overview of different GCL construct. Detail information about the language can be found in following paper. A GCL program consists of three programming elements: declarations, facts, and queries.

Declarations

The declaration part defines the truth-value system as well as the linguistic variables, fuzzy quantifiers, and fuzzy probabilities used throughout the program. The truth value system determines the t-norm, t-conorm, and the negation operations. The truth value system that is used in CWShell is Zadeh's truth system.

Linguistic Variables

Two types of linguistic variables are considered: atomic and composite. The atomic linguistic variable is specified by a name, an optional unit, a range of valid values, and an optional set of linguistic terms. Each linguistic term is defined by its name, the type of membership function, and a set of numbers which form the parameters of the membership function.

The following code segment declares a linguistic variable “oil-price” with three terms "cheap", "average", and "expensive".

Atomic Linguistic Variable Example

Atomic_Linguistic_Variable
begin
name: insurance_premium;
unit: dollar_per_year;
range: 0..1500;
Term
term_name: cheap;
membership_function: z;
parameters: 600,800;
Term
term_name: average;
membership_function: pi;
parameters: 600,700,800,900;
Term
term_name: expensive;
membership_function: s;
parameters: 900, 1000;
Term
term_name: about_850;
membership_function: gaussian;
parameters: 50,850;
end

Fuzzy Quantifier Example

fuzzy_quantifier
begin
name: many;
membership_function: s;
parameters: .3, .5;
end


GCL Facts

The fact base consists of a set of generalized constraint assertions. A generalized constraint assertion may be atomic, quantified, probabilistic, or a fuzzy graph.

Facts Example

insurance_premium [ purvag ] is high

Fuzzy Graph Example

begin
input_variables: age[$x];
output_variable:age_factor[$x];
fuzzy_points: (teenager, high)(young,average)(middle_age, low)(old, low)(over_about_75, high);
end

Queries

After specifying a set of GCL facts, user can write a set of queries asking for the value of a linguistic variable, a fuzzy quantifier, or a fuzzy probability. A linguistic
value query has the general form: "X[a1 , . . . , an ] is ? ;" seeking the value of the linguistic variable X with arguments (a 1,. . . ,a n).

Query Example

insurance_premium[Sarah] is ?;