XFL3: The Xfuzzy 3 specification language

Unary function definition

Unary functions are used to describe the linguistic hedges. These functions can be assigned to the not modifier, the very or strongly modifier, the more-or-less modifier, and the slightly modifier. The structure of a unary function definition in a function package is as follows:

		unary identifier { blocks }                     

The blocks that can appear in a unary function definition are alias, parameter, requires, java, ansi_c, cplusplus, derivative and source.

The block alias is used to define alternative names to identify the function. Any of these identifiers can be used to refer the function. The syntax of the block alias is:

		alias identifier, identifier, ... ;                    

The block parameter allows the definition of those parameters which the function depends on. The last identifier can be followed by brackets to define a list of parameters. Its format is:

		parameter identifier, identifier, ..., identifier[] ;                    

The block requires expresses the constraints on the parameter values by means of a Java Boolean expression that validates the parameter values. The structure of this block is:

		requires { expression }                     

The blocks java, ansi_c and cplusplus describe the function behavior by means of its description as a function body in Java, C and C++ programming languages, respectively. Input variable for these functions is 'a'. The format of these blocks is the following:

		java { Java_function_body } 
		ansi_c { C_function_body }  
		cplusplus { C++_function_body }  

The block derivative describes the derivative function with respect to the input variable 'a'. This description consists of a Java assignation expression to the variable 'deriv'. The description of the derivative function allows to propagate the system error derivative used by the supervised learning algorithms based on gradient descent. The format is:

		derivative { Java_expressions }                  

The block source is used to define Java code that is directly included in the class code generated for the function definition. This code allows to define local methods that can be used into other blocks. The structure is:

		source { Java_code }                    

The following example shows the definition of the Yager C-norm, which depends on the parameter w.

 unary yager {
    parameter w;
    requires { w>0 }
    java { return Math.pow( ( 1 - Math.pow(a,w) ) , 1/w ); }
    ansi_c { return pow( ( 1 - pow(a,w) ) , 1/w ); }
    cplusplus { return pow( ( 1 - pow(a,w) ) , 1/w ); }
    derivative { deriv = - Math.pow( Math.pow(a,-w) -1, (1-w)/w ); }

For comments, patches, bug reports, etc contact us at:   xfuzzy-team@imse-cnm.csic.es

©IMSE-CNM 2018