Decision table

Last updated
Golf dataset.png

Decision tables are a concise visual representation for specifying which actions to perform depending on given conditions. Decision table is the term used for a Control table or State-transition table in the field of Business process modeling; they are usually formatted as the transpose of the way they are formatted in Software engineering.

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

In software engineering, code coverage, also called test coverage, is a percentage measure of the degree to which the source code of a program is executed when a particular test suite is run. A program with high code coverage has more of its source code executed during testing, which suggests it has a lower chance of containing undetected software bugs compared to a program with low code coverage. Many different metrics can be used to calculate test coverage. Some of the most basic are the percentage of program subroutines and the percentage of program statements called during execution of the test suite.

<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. For any non-deterministic finite-state machine, an equivalent deterministic one can be constructed.

Prolog is a logic programming language that has its origins in artificial intelligence, automated theorem proving 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, an abstract machine is a theoretical model that allows for a detailed and precise analysis of how a computer system functions. It is similar to a mathematical function in that it receives inputs and produces outputs based on predefined rules. Abstract machines vary from literal machines in that they are expected to perform correctly and independently of hardware. Abstract machines are "machines" because they allow step-by-step execution of programmes; they are "abstract" because they ignore many aspects of actual (hardware) machines. A typical abstract machine consists of a definition in terms of input, output, and the set of allowable operations used to turn the former into the latter. They can be used for purely theoretical reasons as well as models for real-world computer systems. In the theory of computation, abstract machines are often used in thought experiments regarding computability or to analyse the complexity of algorithms. This use of abstract machines is fundamental to the field of computational complexity theory, such as finite state machines, Mealy machines, push-down automata, and Turing machines.

<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 a declarative programming language, an implementation of the functional logic programming paradigm, and 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, leading to unexpected or inconsistent results. It becomes a bug when one or more of the possible behaviors is undesirable.

In computer science, software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It is an alternative to lock-based synchronization. STM is a strategy implemented in software, rather than as a hardware component. A transaction in this context occurs when a piece of code executes a series of reads and writes to shared memory. These reads and writes logically occur at a single instant in time; intermediate states are not visible to other (successful) transactions. The idea of providing hardware support for transactions originated in a 1986 paper by Tom Knight. The idea was popularized by Maurice Herlihy and J. Eliot B. Moss. In 1995, Nir Shavit and Dan Touitou extended this idea to software-only transactional memory (STM). Since 2005, STM has been the focus of intense research and support for practical implementations is growing.

In computing, data validation or input 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.

<span class="mw-page-title-main">Intelligent agent</span> Software agent which acts autonomously

In intelligence and artificial intelligence, an intelligent agent (IA) is an agent that perceives its environment, takes actions autonomously in order to achieve goals, and may improve its performance with learning or acquiring knowledge. An intelligent agent may be simple or complex: A thermostat or other control system is considered an example of an intelligent agent, as is a human being, as is any system that meets the definition, such as a firm, a state, or a biome.

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.

In artificial intelligence, reactive planning denotes a group of techniques for action selection by autonomous agents. These techniques differ from classical planning in two aspects. First, they operate in a timely fashion and hence can cope with highly dynamic and unpredictable environments. Second, they compute just one next action in every instant, based on the current context. Reactive planners often exploit reactive plans, which are stored structures describing the agent's priorities and behaviour. The term reactive planning goes back to at least 1988, and is synonymous with the more modern term dynamic planning.

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.

<span class="mw-page-title-main">Control table</span> Data structures that control the execution order of computer commands

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 engineering, debugging is the process of finding the root cause of and workarounds and possible fixes for bugs.

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