7.5.5 FUZZYCOMPARE

The FUZZYCOMPARE object can be used to state fuzzy constraints of the following format:

FUZZYCOMPARE FuzzyVar1 IS FuzzyVar2 CompareOp Expr

where FuzzyVar1 and FuzzyVar2 are FUZZYVAR objects. CompareOp is a compare operator out of a user-definable set of operators. In most cases these would be {=, #, <, >}. Expr is a regular expression as defined in section 7.4. A brief example shows the use of FUZZYCOMPARE:

/* declaration of FUZZYVAR objects and their PARAMETERSET objects */

FUZZYVAR fuzzy_variable1 parameterset1

FUZZYVAR fuzzy_variable2 parameterset1

FUZZYVAR fuzzy_constraint parameterset2

/* give the variables values */

LET crisp_variable = 5

SET fuzzy_variable1 = 20

SET fuzzy_variable2 = 0

/* define and evaluate some constraints */

FUZZYCOMPARE fuzzy_constraint IS fuzzy_variable1 = 10

EVAL fuzzy_constraint

FUZZYCOMPARE fuzzy_constraint IS fuzzy_variable1 # fuzzy_variable2

EVAL fuzzy_constraint

FUZZYCOMPARE fuzzy_constraint IS fuzzy_variable1 < SQR(crisp_variable)

EVAL fuzzy_constraint

FUZZYCOMPARE fuzzy_constraint IS fuzzy_variable1 > crisp_variable

EVAL fuzzy_constraint

A FUZZYCOMPARE constraint compares a fuzzy variable FUZZYVAR fuzzy_variable to a crisp value. What the compare operators are and how single linguistic terms correspond to other when such comparison is done, has to be described in a TABLE file explicitly. This makes sure that the system is open to extensions by the user. The format of such TABLE files can be found in section 7.5.7. Whenever such a constraint is encountered, CSI(C&F) generates automatically the appropriate rules using the table of correspondings as defined in TABLE. So the programmer has to take care about defining the right TABLE before the use of FUZZYCOMPARE.