Table of Contents


Basic fuzzy rule language syntax

This section describes various components of the fuzzy rule language and how to enter them.

On this page...


Comments

A comment may appear in only two places: on a line by itself or at the end of a line containing a fuzzy rule language statement. Comments may be delimited by a beginning // (slash-slash) or a beginning ; (semicolon). There is no terminating delimiter. The following lines all demonstrate valid comments:


    //------------------------------------
    // These comments are on lines by
    // themselves.
    //------------------------------------
    ;Comment using semicolon.

    a = b    ; Comments at the ends  
    c Is d  // of lines.
     
Return to top

White space

White space (blanks, tabs, newlines, etc.) may be sprinkled freely throughout a source file. They are all ignored. The following two fuzzy rules are parsed identically:


    rule_001: if Temperature is slightly elevated then Pressure is positively moderate

    rule_002
      :
      if
        Temperature is slightly elevated
      then
        Pressure is positively moderate
     
Return to top

Keywords

All rule language keywords are not case sensitive. For example, the keyword true may be entered as any of true, True, tRue, TRUE, and so on.

Some of the longer keywords may be abbreviated. The following table identifies those keywords that may be abbreviated along with their acceptable abbreviations.

Keywords and their Abbreviations
Complement Comp
InputVariables InputVars, InputVar, Input
OutputVariables OutputVars, OutputVar, Output
SetDefinitions SetDefs, SetDef
Return to top

Identifiers

All identifiers (that is, names of variables, fuzzy sets, and rules defined by you) are case sensitive. For example, if you define a continuous variable with the name of myVar you cannot later refer to that variable as MYvar as the latter name is taken to refer to a completely different variable that might even be of a different type (if it exists at all).

Identifiers can be composed of alphabetics (a-zA-Z), numerics (0-9), and the characters . (dot), _ (underscore), and $ (dollar). Note, however, that neither numerics nor the dot character can be used to begin an identifier. The following are all valid identifiers:


    this.IsVar_1
    this_Is.var.2
    foo$
    $foo
     

The following are examples of illegal identifiers:


    .IsVar_1    // Begins with a dot
    9foo        // Begins with a number
     
Return to top

Numbers

Numbers may be entered with a leading + (plus) or - (minus) sign. Numbers between -1 and +1 must be entered with a leading zero before the decimal point. The following are all valid:


    0.55         -0.55         +0.55
    100          -100          +100
    +100.00       0.001        -36.99
     

The following are examples of illegal numbers:


    .56     // No zero before the decimal point
    -.05    // No zero before the decimal point
     
Return to top

Lists

Most lists can be entered with each element separated by one or more blanks, a comma, or both. The following are all valid:


    myContinuousVar is positively very very Hot
    myContinuousVar is positively very, very Hot
    myContinuousVar is positively very,very Hot
    myContinuousVar is positively, very, very, Hot

    mySymbolicVar Symbolic(a 9 d 4.7 F)
    mySymbolicVar Symbolic(a,9,d,4.7,F)

    mySymbolicVar Symbolic(a,   9,   d,   4.7,   F)

    mySymbolicVar Symbolic(     // List on multiple lines    
                           a,
                           9,
                           d,
                           4.7,
                           F
                          )
     
Return to top
Rule language table of contents.
Fuzzy editor table of contents.
Fuzzy System table of contents.

Last modified: Tue Jun 6 08:58:54 CDT 2000