Difference between revisions of "Arden Syntax:Fuzzy Arden Syntax"
Karstenf77 (talk | contribs) (→FAQ) |
Karstenf77 (talk | contribs) (→FAQ) |
||
Line 6: | Line 6: | ||
* '''Question:''' On the example fuzzy set on page 35-36 (''TwotoThree := fuzzy set (2, 0), (2, 1), (2, 1), (3, 1), (3, 0);''). Why did (2, 1) come twice time? | * '''Question:''' On the example fuzzy set on page 35-36 (''TwotoThree := fuzzy set (2, 0), (2, 1), (2, 1), (3, 1), (3, 0);''). Why did (2, 1) come twice time? | ||
** '''Answer:''' The first fuzzy set on page 36 is this<br><br> ''TwotoThree := fuzzy set (2, 0), (2, 1), (2, 1), (3, 1), (3,0);'' <br><br>At point 2 there is a "discontinuity point" which means that if we approaching 2 from the left side we have the membership value 0, while approaching 2 from the right side we have the membership value 1. The question is which membership value is assigned to 2. The document contains the sentence "''The first assignment is the value at that point, unless the second one appears twice.''". <br><br>This means in the above example (fuzzy set TwotoThree) the membership value at point 2 is '''1''', since the (2, 1) appears twice. <br> If we adjust the fuzzy set to <br><br>''TwotoThree := fuzzy set (2, 0), (2, 1), (3, 1), (3,0);''<br><br>the membership value at the point 2 is '''0'''. | ** '''Answer:''' The first fuzzy set on page 36 is this<br><br> ''TwotoThree := fuzzy set (2, 0), (2, 1), (2, 1), (3, 1), (3,0);'' <br><br>At point 2 there is a "discontinuity point" which means that if we approaching 2 from the left side we have the membership value 0, while approaching 2 from the right side we have the membership value 1. The question is which membership value is assigned to 2. The document contains the sentence "''The first assignment is the value at that point, unless the second one appears twice.''". <br><br>This means in the above example (fuzzy set TwotoThree) the membership value at point 2 is '''1''', since the (2, 1) appears twice. <br> If we adjust the fuzzy set to <br><br>''TwotoThree := fuzzy set (2, 0), (2, 1), (3, 1), (3,0);''<br><br>the membership value at the point 2 is '''0'''. | ||
+ | |||
* '''Question:''' Could you provide some examples for using IF-THEN-ELSE(-AGGREGATE) (see section 10.2.2.*) and the expected output? | * '''Question:''' Could you provide some examples for using IF-THEN-ELSE(-AGGREGATE) (see section 10.2.2.*) and the expected output? | ||
** '''Answer:''' | ** '''Answer:''' | ||
+ | |||
+ | ---- | ||
+ | '''"Classic" example using a boolean ''' | ||
Logic: | Logic: | ||
Var := 0; | Var := 0; | ||
Line 20: | Line 24: | ||
Action: | Action: | ||
WRITE Var; | WRITE Var; | ||
− | ''expected output:'' 3 | + | ''expected output:'' <br> |
+ | '''3 <applicability=1>''' | ||
---- | ---- | ||
− | + | '''Example using a truth value ''' | |
Logic: | Logic: | ||
Var := 0; | Var := 0; | ||
Line 38: | Line 43: | ||
The MLM execution branches at the IF statement and all following expressions are executed twice (in parallel) up to the end of the MLM.<br> | The MLM execution branches at the IF statement and all following expressions are executed twice (in parallel) up to the end of the MLM.<br> | ||
''expected output:'' <br> | ''expected output:'' <br> | ||
− | 1 <applicability=0.2> <br> | + | '''1 <applicability=0.2>''' <br> |
− | 3 <applicability=0.8> | + | '''3 <applicability=0.8>''' |
---- | ---- | ||
− | + | '''Example using a truth value with AGGREGATE ''' | |
Logic: | Logic: | ||
Var := 0; | Var := 0; | ||
Line 59: | Line 64: | ||
Therefore, after the ENDIF AGGREGATE statement Var has the value (0.2*1 + 0.8*3) / (0.2 + 0.8) = 2.6. <br> | Therefore, after the ENDIF AGGREGATE statement Var has the value (0.2*1 + 0.8*3) / (0.2 + 0.8) = 2.6. <br> | ||
''expected output:'' <br> | ''expected output:'' <br> | ||
− | 2.6 <applicability=1> | + | '''2.6 <applicability=1>''' |
---- | ---- | ||
− | + | '''Example using truth values with nested IF . . . ELSE statements''' | |
Logic: | Logic: | ||
Var := 0; | Var := 0; | ||
Line 83: | Line 88: | ||
As above, the MLM execution splits into 2 branches on the first IF statement. The second IF statement branches the first branch again into 2 separate executions. Those 3 Branches are executed in parallel. <br> | As above, the MLM execution splits into 2 branches on the first IF statement. The second IF statement branches the first branch again into 2 separate executions. Those 3 Branches are executed in parallel. <br> | ||
''expected output:'' <br> | ''expected output:'' <br> | ||
− | 2 <applicability=0.06> (THEN->THEN) <br> | + | '''2 <applicability=0.06> (THEN->THEN)''' <br> |
− | 4 <applicability=0.14> (THEN->ELSE) <br> | + | '''4 <applicability=0.14> (THEN->ELSE)''' <br> |
− | 3 <applicability=0.8> (ELSE) <br> | + | '''3 <applicability=0.8> (ELSE)''' <br> |
Please note that the sum of all applicabilities of a variable is 1. | Please note that the sum of all applicabilities of a variable is 1. | ||
---- | ---- | ||
− | + | '''How is the CONCLUDE statement handled in parallel processing?''' | |
Logic: | Logic: | ||
Var := 0; | Var := 0; | ||
Line 104: | Line 109: | ||
As specified, the CONCLUDE statement stops the execution of the MLM. That means, the affected branch of execution is stopped. The other one is executed until the end of the MLM.<br> | As specified, the CONCLUDE statement stops the execution of the MLM. That means, the affected branch of execution is stopped. The other one is executed until the end of the MLM.<br> | ||
''expected output:'' <br> | ''expected output:'' <br> | ||
− | 3 <applicability=0.8> <br> | + | '''3 <applicability=0.8>''' <br> |
Revision as of 13:04, 11 May 2012
Introduction
The principal change of version 2.9 is the introduction of support for fuzzy logic. Fuzzy logic is a multi-valued logic that has gained use in formal decision-making because of its value in representing reasoning involving imprecision. Unlike the typical binary (true-false) logic that continues to be supported in this version of the Arden Syntax, fuzzy logic incorporates degrees of truth or set membership (Steimann F. On the use and usefulness of fuzzy sets in medical AI . Artif Intell Med 2001;21:131-7). Clinical practice guidelines and other forms of clinical knowledge representation may employ fuzzy logic, using linguistic variables such as "severe" and "somewhat" without necessarily formally defining them or providing an objective quantification. These changes in the Arden Syntax allow fuzzy logic to be formally represented, thus supporting the representation of clinical guidelines and clinical reasoning generally.
FAQ
- Question: On the example fuzzy set on page 35-36 (TwotoThree := fuzzy set (2, 0), (2, 1), (2, 1), (3, 1), (3, 0);). Why did (2, 1) come twice time?
- Answer: The first fuzzy set on page 36 is this
TwotoThree := fuzzy set (2, 0), (2, 1), (2, 1), (3, 1), (3,0);
At point 2 there is a "discontinuity point" which means that if we approaching 2 from the left side we have the membership value 0, while approaching 2 from the right side we have the membership value 1. The question is which membership value is assigned to 2. The document contains the sentence "The first assignment is the value at that point, unless the second one appears twice.".
This means in the above example (fuzzy set TwotoThree) the membership value at point 2 is 1, since the (2, 1) appears twice.
If we adjust the fuzzy set to
TwotoThree := fuzzy set (2, 0), (2, 1), (3, 1), (3,0);
the membership value at the point 2 is 0.
- Answer: The first fuzzy set on page 36 is this
- Question: Could you provide some examples for using IF-THEN-ELSE(-AGGREGATE) (see section 10.2.2.*) and the expected output?
- Answer:
"Classic" example using a boolean
Logic: Var := 0; Bool_true := true; Con := truth value 0.2; If Bool_true then Var := Var + 1; Else Var := Var + 3; Endif CONCLUDE TRUE; Action: WRITE Var;
expected output:
3 <applicability=1>
Example using a truth value
Logic: Var := 0; Bool_true := true; Con := truth value 0.2; If Con then Var := Var + 1; Else Var := Var + 3; Endif CONCLUDE TRUE; Action: WRITE Var;
The MLM execution branches at the IF statement and all following expressions are executed twice (in parallel) up to the end of the MLM.
expected output:
1 <applicability=0.2>
3 <applicability=0.8>
Example using a truth value with AGGREGATE
Logic: Var := 0; Bool_true := true; Con := truth value 0.2; If Con then Var := Var + 1; Else Var := Var + 3; Endif AGGREGATE CONCLUDE TRUE; Action: WRITE Var;
The MLM execution branches at the IF statement and the expressions in the THEN and ELSE branch are executed in parallel. When execution reaches the ENDIF AGGREGATE statement the aggregated value of Var is calculated. This is done as described in the specification by "Otherwise, if Var is defined in all branches and of the same simple data type except string, the
contents are aggregated according to their weighted middle.".
Therefore, after the ENDIF AGGREGATE statement Var has the value (0.2*1 + 0.8*3) / (0.2 + 0.8) = 2.6.
expected output:
2.6 <applicability=1>
Example using truth values with nested IF . . . ELSE statements
Logic: Var := 0; Bool_true := true; Con := truth value 0.2; If Con then Var := Var + 1; If con_second then Var := Var + 1; Else Var := Var + 3; Endif Else Var := Var + 3; Endif AGGREGATE CONCLUDE TRUE; Action: WRITE Var;
As above, the MLM execution splits into 2 branches on the first IF statement. The second IF statement branches the first branch again into 2 separate executions. Those 3 Branches are executed in parallel.
expected output:
2 <applicability=0.06> (THEN->THEN)
4 <applicability=0.14> (THEN->ELSE)
3 <applicability=0.8> (ELSE)
Please note that the sum of all applicabilities of a variable is 1.
How is the CONCLUDE statement handled in parallel processing?
Logic: Var := 0; Bool_true := true; Con := truth value 0.2; If Con then Var := Var + 1; CONCLUDE FALSE; Else Var := Var + 3; Endif CONCLUDE TRUE; Action: WRITE Var;
As specified, the CONCLUDE statement stops the execution of the MLM. That means, the affected branch of execution is stopped. The other one is executed until the end of the MLM.
expected output:
3 <applicability=0.8>