Simplifying and Optimizing Tabular Decision Models

Jan   Vanthienen
Jan Vanthienen Professor in Information Management, K.U. Leuven Read Author Bio || Read All Articles by Jan Vanthienen

Decision tables and table structures provide a good overview of a set of business rules.  Relations between tables model the relations between the final decision and lower-level (intermediate) decisions, while the tables model related business rules with common conditions and outcomes.

Experience shows that, although decision table models usually already provide a good representation of the decision logic, there may still be multiple ways to simplify and optimize the model.  Throughout decennia of decision table usage, the following best practices have been observed:

1.  Table Simplifications

Table Contraction

Assuming that all relevant conditions, condition values, and outcomes for condition combinations are known, the table can still be represented in different ways:  expanded or contracted.  Expanded means that every single combination of condition values is shown, while a contracted table 'contracts' one or more rules (columns) into combined rules (columns) using the notation "-" (irrelevant).  Note that this does not, and should not, alter the decision logic.  It is just a matter of visual representation (and a matter of taste, tool, or timing).

Figure 1.  An expanded decision table.

Figure 2.  A contracted decision table.

In Figure 2, the first two rows from Figure 1 are combined into one.  As you could imagine, the expanded view might be more useful when modeling is not yet complete.  Once the business logic is considered correct, consistent, and complete, the contracted view is interesting because of its higher content per ink ratio, meaning it is more concise.  Conciseness can be interesting for human viewers.

The contracted table also has the advantage that the 10% discount for web orders is only written once, so if the percentage changes, there is no risk of inconsistency. 

A big note:  Contraction is not about faster execution.  We are still just modeling.

Another big note:  Not every tabular representation is a good decision table.

There is a common misunderstanding that anything that looks like a table of rules is a decision table.  As already indicated in the earlier CODASYL report on decision tables[1] a good decision table is a complete table with mutually exclusive columns, meaning that each possible combination of conditions can be found in exactly one (one and only one) row (or column).  If the rows are not exclusive, at least one combination of conditions is present in more than one row, which may look like a harmless redundancy but it opens the door to (future) inconsistencies.

The contracted decision table therefore should still contain mutually-exclusive columns only.  That is a matter of contraction discipline (or tool).  Even recent tools or methods sometimes show a decision table as in Figure 3. 

Figure 3.  A bad decision table.

Figure 3 is a bad decision table.  It might originate from a rule stating that "A 10% discount is given for Web or US orders."  The table looks compact, but it is considered bad practice because the combination Web – US is present in both row 1 and row 2.  What if the discount for a Web order for a US customer changes?  This is not a disadvantage of decision tables, it is simply a bad decision table because of the overlapping columns.

The same objection holds against tables that require traversing the rows in a certain order (because of overlapping columns).  Good decision tables (i.e., with exclusive columns) do not require this.

Condition Order Optimization

The order of the conditions is not important, i.e., it does not change the (declarative) business logic.  If it were, there would be some hidden semantics or procedural thinking in the decision table.  But, again for human viewers, reordering the conditions might lead to a different contraction, and therefore to a more compact table.  This is especially the case if some conditions can have more than two values.  Figure 4 shows a reordered version of Figure 2.

Figure 4.  A reordered decision table.

In this case, the table is not more compact, but it shows a different view on the business logic.

Note:  We are still in the modeling phase so the testing order of conditions is not relevant here.  That is an execution-time issue.

Execution-time Optimization

Dealing with execution time is not a decision table modeling issue.  Of course, execution time might be important later, and there exist several algorithms to transform decision tables into general execution trees, taking into account condition test times and condition combination frequencies.  It is interesting to note that an execution tree does not necessarily test conditions in the same order in every branch of the tree and therefore can be made more execution-efficient than a tree where conditions are always examined in the same order (like in a decision table).  But that should not be a decision table modeling concern.

Redundant Conditions

As indicated in an earlier article,[2] there is a striking similarity between decision table modeling and database modeling.  A number of interesting consequences (functional dependencies, primary key, normalization forms, factoring) can already be found in [3] and [4].  Normalization rules for decision tables require that actions are fully dependent on all the conditions (2nd normal form) and that actions are non-transitively dependent on the conditions (3rd normal form).  If the result of the decision table is only dependent on a subset of the conditions, the other conditions are of course redundant, as can be seen in Figure 5.  Figure 6 removes this redundancy.

Figure 5.  A decision table containing a redundant condition (TypeOfOrder).

Figure 6.  The normalized decision table.

2.  Model Simplifications

Because the normalization rules for decision tables require that actions are fully dependent on all the conditions (2nd normal form), these rules can be used to factor (split or join) decision tables.  This is the area of decision table structure modeling and was described in an earlier article.[5]

References

[1]  CODASYL, "A Modern Appraisal of Decision Tables," Report of the Decision Table Task Group, ACM, New York, 1982, pp. 230-232.  return to article

[2]  Vanthienen J., "Rules as Data:  Decision Tables and Relational Databases," Business Rules Journal, Vol. 11, No. 1 (Jan. 2010), URL:  http://www.BRCommunity.com/a2010/b516.html  return to article

[3]  Vanthienen J., Snoeck M., "Knowledge Factoring Using Normalization Theory," International Symposium on the Management of Industrial and Corporate Knowledge (ISMICK'93), Compiègne (FR), pp. 97-106, October 27-28, 1993.  return to article

[4]  Vanthienen J., Wets G., Integration of the Decision Table Formalism with a Relational Database Environment, Information Systems, Vol. 20, No. 7, pp. 595-616, 1995.  return to article

[5]  Vanthienen J., "Modeling Decision Table Structures," Business Rules Journal, Vol. 11, No. 11 (Nov. 2010), URL:  http://www.BRCommunity.com/a2010/b565.html  return to article

# # #

Standard citation for this article:


citations icon
Jan Vanthienen , "Simplifying and Optimizing Tabular Decision Models" Business Rules Journal Vol. 12, No. 10, (Oct. 2011)
URL: http://www.brcommunity.com/a2011/b618.html

About our Contributor:


Jan   Vanthienen
Jan Vanthienen Professor in Information Management, K.U. Leuven

Jan Vanthienen is professor of information management at the Business Information Systems Group of KU Leuven (Belgium), where he is teaching and researching on business rules, processes and decisions. The area of business rules modeling, validation and verification, and decision modeling in the context of business process modeling has been his major area of research and expertise for many years. He is a regular speaker at BBC, where his nickname seems to be: not (just) the decision table guy.

Read All Articles by Jan Vanthienen
Subscribe to the eBRJ Newsletter
In The Spotlight
 Ronald G. Ross
 Silvie  Spreeuwenberg

Online Interactive Training Series

In response to a great many requests, Business Rule Solutions now offers at-a-distance learning options. No travel, no backlogs, no hassles. Same great instructors, but with schedules, content and pricing designed to meet the special needs of busy professionals.