home Forums # Technical Support not operator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1066
    Unknown
    Member

    Hi Juan,

    Great library! I have working with the qtfuzzylite and latest fuzzylite and have been constructing rules, etc., to prototype some fuzzy propositions. I am having problem with a rule that I think should work (according to my understanding of FCL), yet is having a problem. I am negating a rule using DeMorgans laws, and using the not operator before a subcondition is allowable in the FCL specification:

    The subcondition begins with the name of a linguistic variable followed by the keyword IS with an
    optional NOT and one linguistic term of the linguistic variable used in the condition.
    Subcondition := linguistic_variable IS [NOT] linguistic_term
    Note: The linguistic terms which are used in the condition shall match the linguistic variable in the same condition. The term
    used has to be previously defined with the keyword TERM.
    Example of subconditions:
    temp IS hot
    temp IS NOT hot
    It is also possible to use the keyword NOT in front of the subcondition. In this case parentheses shall
    be used.
    IF NOT (temp IS hot) THEN …
    The conclusion can be split into several subconclusions and output variables.

    In my specific case, I have:

    if not ( Range is Moderate or Range is Long ) or not ( ClosureRate is Moderate or ClosureRate is Fast) or RelativeAltitude is not Small then StateMachine1 is NotState1
    #[syntax error] expected input variable or logical operator, but found <not> {/src/rule/Antecedent.cpp::load() [line:203]}

    I realize I could express this as:
    if ( Range is not Moderate and Range is not Long ) or ( ClosureRate is not Moderate and ClosureRate is not Fast) or RelativeAltitude is not Small then StateMachine1 is NotState1

    However, the ablity to negate subconditions can be more convenient. If the capability to negate subcontions is in fuzzylite, I just wanted to make sure there is nothing wrong with my usage/syntax.

    Again, thanks for the great library and I am hoping I can contribute to the project in some manner at some point.

    John

    • This topic was modified 9 years, 5 months ago by Unknown.
    #1070

    Hi John,

    thank you for your post and kind words. At the moment, fuzzylite does not support the negation of multiple subconditions as you point out. The solution is to use the negations like you have.

    Cheers,

    Juan.

    #1073
    Unknown
    Member

    Juan,

    Ok, no problem. Thanks for letting me know. I will proceed using the advised negation syntax.

    Thanks again,

    John

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.