Logic Modelling Decision Tables Modeling Logic with Decision

Logic Modelling Decision Tables

Modeling Logic with Decision Tables • Procedure for Creating Decision Tables • Name the condition and the values that each condition can assume. • Name all possible actions that can occur. • List all possible rules. • Define the actions for each rule. • Simplify the table. 2

Q 1: Create a decision table. Students Campus Burglar Alarm When a burglar alarm sounds, if it is in one of students’ houses where alarm sounds every week, ignore it. Otherwise have a look outside and if the house looks not broken into and there is nobody moving inside it, ignore the alarm. Otherwise call police. • List the resulting rules. 3

A 1: Decision Table – Students Campus Burglar Alarm Rule Stub Condition Stub Action Stub Rule 1 Rule 2 Rule 3 Rule 4 One of those houses Y Y N N Suspicious activity Y N Ignore X X Call Police X X 4

A 1: Simplified Decision Table – Students Campus Burglar Alarm Rule Stub Condition Stub Action Stub Rule 1 Rule 2 Rule 3 One of those houses Y N N Suspicious activity - Y N Ignore X Call Police X X 5

A 1: Resulting Rules- Students Campus Burglar Alarm • Rule 1: if one of those houses then ignore • Rule 2: if not one of those houses and suspicious activity then call police • Rule 3: if not one of those houses and not suspicious activity then ignore Note: rule 2 will work just as well if skip the first check: • Rule 2: if not suspicious activity then ignore 6

Q 2: Create a decision table- Mailing Customers A mailing is to be sent out only to special customers. The content of the mailing is about the current level of discounting and potential levels of discounting. The content is different for different types of customers. Customer Types A, B and C get a normal letter except Customer Type C, who get a special letter. Any customer with 2 or more current lines or with a credit rating of ‘X’ get a special paragraph added with an offer to subscribe to another level of discounting. 7

A 2: Missing Information. Mailing Customers Questions? • “ 2 or more current lines OR credit rating X”. What if both: AND? • Other customer types? See “O-Other” above. 8

A 2: Possible solution- Mailing Customers 9

A 2: Possible solution- Mailing Customers • Exclude the “O-Others” from the decision table and suppose that the description states that: “ 2 or more current lines AND/OR credit rating X”. Condition Stub Action Stub Rule 1 2 3 4 5 6 7 8 9 10 11 12 Customer Type A A B B C C 2 or more Lines Y Y N N Credit rating = X Y N Y N Y N Normal Letter X X X X Special Letter X X Add Paragraph X X X X X 10

A 2: Possible solution- Mailing Customers • Simplify the Table Condition Stub Action Stub Customer Type 2 or more Lines Credit rating = X Normal Letter Special Letter Add Paragraph Rule 1 A Y X X 2 A N Y X X 3 A N N X 4 B Y X X 5 B N Y X X 6 B N N X 7 C Y X X 8 C N Y X X 9 C N N X 11
- Slides: 11