home › Forums › # Technical Support › not operator
Tagged: logic operators rules
- This topic has 2 replies, 2 voices, and was last updated 9 years, 5 months ago by
Unknown.
-
AuthorPosts
-
May 2, 2014 at 07:56 #1066
Unknown
MemberHi 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.
May 2, 2014 at 09:31 #1070Juan Rada-Vilela (admin)
KeymasterHi 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.
May 2, 2014 at 12:56 #1073Unknown
MemberJuan,
Ok, no problem. Thanks for letting me know. I will proceed using the advised negation syntax.
Thanks again,
John
-
This topic was modified 9 years, 5 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.