120 likes | 236 Views
Process Logic. Outline Decision tree Decision table Structured English Tight English (skip). Why not Narrative English?. Same thing can be represented in different sentences/statements. Ex Go to movies only on weekends, unless it’s holidays No movies unless it’s weekends or holidays
E N D
Process Logic • Outline • Decision tree • Decision table • Structured English • Tight English (skip)
Why not Narrative English? • Same thing can be represented in different sentences/statements. Ex • Go to movies only on weekends, unless it’s holidays • No movies unless it’s weekends or holidays • Undefined adjectives Ex. Good customers?
Boundary Specification Ex. Company discount policy: Children between 2 and 12 pay half price. Children under 2 years old get 90% discount. 4 possible interpretations
And/Or Ambiguity Ex. Passengers over 67 or students under 26 and traveling at least 150 km one way receive a 50% discount. A: the passenger is over 67 B: the passenger is a student under 26 C: the passenger travels at least 150 km one way ABC (literally) A(BC) (AB)C
An Example • NSB provides attractive prices for group travel. 2-9 people traveling together will receive 25% discount; 10 people or more will receive a 40% discount. It also takes into account students and military service. Students are eligible for 50% discount and military service-personal to pay only 25% of the standard rate.
Decision Tree • Identify conditions and actions • Clear boundary, and/or ambiguities • Define unclear adjectives • Construct the tree 50% dis. student military 75% dis. NSB 1 people 0% dis. others 2-9 people 25% dis. 10 and more 40% dis.
Standard Decision Tree 50% S M O 1 75% 0% error S M O ST 2-9 error error S M O error >=10 error error NSB error S M O 1 error error 50% S M O GT 2-9 75% 25% 50% S M O >=10 75% 40%
Decision Table • Collect all conditions and actions • List all combinations from the conditions • Assign relevant action to each combination • Merge combinations with only one different condition but same action together
Structured English • Use if-then-else, do-while, repeat-until (no in-case) to specify conditions, and statements to actions. Ex. ifcategory is student then discount is 50% else ifcategory is military thendiscount is 75% else ifgroup size is 1 then no discount else ifgroup size is 2-9 then discount is 25% else(group size is 10 or more) discount is 40%
Desirable Features • Completeness—Has every case been considered? • Consistency—Does each case lead to only one unique set of actions? • Compactness—Are the rules independent of each other? Implications: • quality software • Efficiency • Ease of modification and maintenance • Ease of comprehension