Decision table

Last updated
Golf dataset.png

Decision tables are a concise visual representation for specifying which actions to perform depending on given conditions. They are algorithms whose output is a set of actions. The information expressed in decision tables could also be represented as decision trees or in a programming language as a series of if-then-else and switch-case statements.

Contents

Overview

Each decision corresponds to a variable, relation or predicate whose possible values are listed among the condition alternatives. Each action is a procedure or operation to perform, and the entries specify whether (or in what order) the action is to be performed for the set of condition alternatives the entry corresponds to.

To make them more concise, many decision tables include in their condition alternatives a don't care symbol. This can be a hyphen [1] [2] [3] or blank, [4] although using a blank is discouraged as it may merely indicate that the decision table has not been finished.[ citation needed ] One of the uses of decision tables is to reveal conditions under which certain input factors are irrelevant on the actions to be taken, allowing these input tests to be skipped and thereby streamlining decision-making procedures. [5]

Demonstration of “don’t care” symbol
Rules
ConditionsFeeling energetic?YesNoYesNo
Is raining?YesYesNoNo
ActionsStay inside.Brown check.svgBrown check.svg
Go running.Brown check.svg
Tend the garden.Brown check.svgBrown check.svg
Rules
ConditionsFeeling energetic?YesNo
Is raining?YesNoNo
ActionsStay inside.Brown check.svg
Go running.Brown check.svg
Tend the garden.Brown check.svgBrown check.svg
The above tables convey identical information, but the second table uses a hyphen as a don't-care symbol for brevity.

Aside from the basic four quadrant structure, decision tables vary widely in the way the condition alternatives and action entries are represented. [6] [7] Some decision tables use simple true/false values to represent the alternatives to a condition (similar to if-then-else), other tables may use numbered alternatives (similar to switch-case), and some tables even use fuzzy logic or probabilistic representations for condition alternatives. [8] In a similar way, action entries can simply represent whether an action is to be performed (check the actions to perform), or in more advanced decision tables, the sequencing of actions to perform (number the actions to perform).

A decision table is considered balanced [4] or complete [3] if it includes every possible combination of input variables. In other words, balanced decision tables prescribe an action in every situation where the input variables are provided. [4]

Example

The limited-entry decision table is the simplest to describe. The condition alternatives are simple Boolean values, and the action entries are check-marks, representing which of the actions in a given column are to be performed.

The following balanced decision table is an example in which a technical support company writes a decision table to enable technical support employees to efficiently diagnose printer problems based upon symptoms described to them over the phone from their clients.

Printer troubleshooter
Rules
ConditionsPrinter printsNoNoNoNoYesYesYesYes
A red light is flashingYesYesNoNoYesYesNoNo
Printer is recognized by computerNoYesNoYesNoYesNoYes
ActionsCheck the power cableBrown check.svg
Check the printer-computer cableBrown check.svgBrown check.svg
Ensure printer software is installedBrown check.svgBrown check.svgBrown check.svgBrown check.svg
Check/replace inkBrown check.svgBrown check.svgBrown check.svg
Check for paper jamBrown check.svgBrown check.svg

This is just a simple example, and it does not necessarily correspond to the reality of printer troubleshooting. Even so, it demonstrates how decision tables can scale to several conditions with many possibilities.

Software engineering benefits

Decision tables, especially when coupled with the use of a domain-specific language, allow developers and policy experts to work from the same information, the decision tables themselves.

Tools to render nested if statements from traditional programming languages into decision tables can also be used as a debugging tool. [9] [10]

Decision tables have proven to be easier to understand and review than code, and have been used extensively and successfully to produce specifications for complex systems. [11]

History

In the 1960s and 1970s a range of "decision table based" languages such as Filetab were popular for business programming.

Program embedded decision tables

Decision tables can be, and often are, embedded within computer programs and used to "drive" the logic of the program. A simple example might be a lookup table containing a range of possible input values and a function pointer to the section of code to process that input.

Static decision table
InputFunction Pointer
"1"Function 1 (initialize)
"2"Function 2 (process 2)
"9"Function 9 (terminate)

Control tables

Multiple conditions can be coded for in similar manner to encapsulate the entire program logic in the form of an "executable" decision table or control table. There may be several such tables in practice, operating at different levels and often linked to each other (either by pointers or an index value).

Implementations

See also

Related Research Articles

<span class="mw-page-title-main">Finite-state machine</span> Mathematical model of computation

A finite-state machine (FSM) or finite-state automaton, finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition. Finite-state machines are of two types—deterministic finite-state machines and non-deterministic finite-state machines. A deterministic finite-state machine can be constructed equivalent to any non-deterministic one.

In artificial intelligence, with implications for cognitive science, the frame problem describes an issue with using first-order logic (FOL) to express facts about a robot in the world. Representing the state of a robot with traditional FOL requires the use of many axioms that simply imply that things in the environment do not change arbitrarily. For example, Hayes describes a "block world" with rules about stacking blocks together. In a FOL system, additional axioms are required to make inferences about the environment. The frame problem is the problem of finding adequate collections of axioms for a viable description of a robot environment.

Prolog is a logic programming language associated with artificial intelligence and computational linguistics.

A fuzzy control system is a control system based on fuzzy logic—a mathematical system that analyzes analog input values in terms of logical variables that take on continuous values between 0 and 1, in contrast to classical or digital logic, which operates on discrete values of either 1 or 0.

Fuzzy logic is a form of many-valued logic in which the truth value of variables may be any real number between 0 and 1. It is employed to handle the concept of partial truth, where the truth value may range between completely true and completely false. By contrast, in Boolean logic, the truth values of variables may only be the integer values 0 or 1.

In computer science, a compiler-compiler or compiler generator is a programming tool that creates a parser, interpreter, or compiler from some form of formal description of a programming language and machine.

<span class="mw-page-title-main">Control system</span> System that manages the behavior of other systems

A control system manages, commands, directs, or regulates the behavior of other devices or systems using control loops. It can range from a single home heating controller using a thermostat controlling a domestic boiler to large industrial control systems which are used for controlling processes or machines. The control systems are designed via control engineering process.

Curry is an experimental functional logic programming language, based on the Haskell language. It merges elements of functional and logic programming, including constraint programming integration.

<span class="mw-page-title-main">Race condition</span> When a systems behavior depends on timing of uncontrollable events

A race condition or race hazard is the condition of an electronics, software, or other system where the system's substantive behavior is dependent on the sequence or timing of other uncontrollable events. It becomes a bug when one or more of the possible behaviors is undesirable.

In computer science, data validation is the process of ensuring data has undergone data cleansing to confirm they have data quality, that is, that they are both correct and useful. It uses routines, often called "validation rules", "validation constraints", or "check routines", that check for correctness, meaningfulness, and security of data that are input to the system. The rules may be implemented through the automated facilities of a data dictionary, or by the inclusion of explicit application program validation logic of the computer and its application.

In computer programming, data-driven programming is a programming paradigm in which the program statements describe the data to be matched and the processing required rather than defining a sequence of steps to be taken. Standard examples of data-driven languages are the text-processing languages sed and AWK, and the document transformation language XSLT, where the data is a sequence of lines in an input stream – these are thus also known as line-oriented languages – and pattern matching is primarily done via regular expressions or line numbers.

Automata-based programming is a programming paradigm in which the program or part of it is thought of as a model of a finite-state machine (FSM) or any other formal automaton. Sometimes a potentially infinite set of possible states is introduced, and such a set can have a complicated structure, not just an enumeration.

In computer programming, a branch table or jump table is a method of transferring program control (branching) to another part of a program using a table of branch or jump instructions. It is a form of multiway branch. The branch table construction is commonly used when programming in assembly language but may also be generated by compilers, especially when implementing optimized switch statements whose values are densely packed together.

Data-driven testing (DDT), also known as table-driven testing or parameterized testing, is a software testing methodology that is used in the testing of computer software to describe testing done using a table of conditions directly as test inputs and verifiable outputs as well as the process where test environment settings and control are not hard-coded. In the simplest form the tester supplies the inputs from a row in the table and expects the outputs which occur in the same row. The table typically contains values which correspond to boundary or partition input spaces. In the control methodology, test configuration is "read" from a database.

<span class="mw-page-title-main">Control table</span>

Control tables are tables that control the control flow or play a major part in program control. There are no rigid rules about the structure or content of a control table—its qualifying attribute is its ability to direct control flow in some way through "execution" by a processor or interpreter. The design of such tables is sometimes referred to as table-driven design. In some cases, control tables can be specific implementations of finite-state-machine-based automata-based programming. If there are several hierarchical levels of control table they may behave in a manner equivalent to UML state machines

NetWeaver Developer is a knowledgebase development system. This article

  1. gives a brief history of the system,
  2. summarizes key features of the software,
  3. is a bit of a primer, describing basic attributes of a NetWeaver knowledgebase, and
  4. provides secondary references that independently document some of the NetWeaver applications developed since the late 1980s.

In computer programming and software development, debugging is the process of finding and resolving bugs within computer programs, software, or systems.

Concolic testing is a hybrid software verification technique that performs symbolic execution, a classical technique that treats program variables as symbolic variables, along a concrete execution path. Symbolic execution is used in conjunction with an automated theorem prover or constraint solver based on constraint logic programming to generate new concrete inputs with the aim of maximizing code coverage. Its main focus is finding bugs in real-world software, rather than demonstrating program correctness.

<span class="mw-page-title-main">Glossary of artificial intelligence</span> List of definitions of terms and concepts commonly used in the study of artificial intelligence

This glossary of artificial intelligence is a list of definitions of terms and concepts relevant to the study of artificial intelligence, its sub-disciplines, and related fields. Related glossaries include Glossary of computer science, Glossary of robotics, and Glossary of machine vision.

This glossary of computer science is a list of definitions of terms and concepts used in computer science, its sub-disciplines, and related fields, including terms relevant to software, data science, and computer programming.

References

  1. LI Jing (1 April 2015). "SEEM 3430 Tutorial: Decision Tables" (PDF). p. 23. Retrieved 11 November 2017.
  2. "Creating a Decision Table in Business Rules". Oracle Help Center. 6 August 2017. Retrieved 11 November 2017.
  3. 1 2 Ross, Ronald G. (2005). "Decision Tables, Part 2 ~ The Route to Completeness". Business Rules Journal. 6 (8). Retrieved 11 November 2017.
  4. 1 2 3 Snow, Paul (19 July 2012). "Decision Tables". DTRules: A Java Based Decision Table Rules Engine. Retrieved 11 November 2017.
  5. LI Jing 2015, p. 24-25.
  6. Rogers, William T. "Decision Table Examples: Medical Insurance". Saint Xavier University Systems Analysis and Design. Archived from the original on March 29, 2007.
  7. "Decision tables". Archived from the original on 2012-09-08. Retrieved 2010-07-07.
  8. Wets, Geert; Witlox, Frank; Timmermans, Harry; Vanthienen, Jan (1996). "Locational choice modelling using fuzzy decision tables". New frontiers in fuzzy logic and computing: 1996 biennial conference of the North American Fuzzy Information Processing Society – NAFIPS. Biennial Conference of the North American Fuzzy Information Processing Society. Berkeley, CA: IEEE. pp. 80–84. doi:10.1109/NAFIPS.1996.534708. ISBN   0-7803-3225-3. S2CID   62056954.
  9. "A Real CCIDE Example"
  10. "Experience With The Cope Decision Table Processor". Archived from the original on 2017-05-04. Retrieved 2010-07-07.
  11. Udo W. Pooch, "Translation of Decision Tables," ACM Computing Surveys, Volume 6, Issue 2 (June 1974) Pages: 125–151 ISSN   0360-0300
  12. "FORTAB: A Decision Table Language for Scientific Computing Applications", 1962, Rand
  13. Alexander Williams (2015). "Ruby decision table parser"

Further reading