SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
rapidgen.com 
Decision Tables as a 
Programming tool 
Howard Rogers 
Director Technical Support 
howard.rogers@rapidgen.com
Agenda 
• A brief history 
• Decision table structures 
• Rule formats 
• Rule redundancy, reduction and optimisation 
• Relevance testing 
• Some practical examples 
• Current examples of use 
• Future developments 
• Questions and Answers 
rapidgen.com 
2
Speaker 
• Statistics & Operation Research 
• UK National Health Service 
• 35 years IT 
• Decision table based languages and compilers 
• Query & reporting tools 
• Generic file & database access 
• Brief interlude with RTPI 
• Technical support 
rapidgen.com 
3
History 
• NASA 
• Morgan Crucible – LITA – List &Tabulate 
• TABN for ICL 1900 series mainframes 
• (DE)TAB-360 for IBM System/360 
• UNITAB for UNIVAC 
• HTAB for Honeywell 
• TAB-11 for RSTS/E on PDP-11 
• FTL6/DTPL for ICT 1900 series 
• RPL-11 for RT-11, RSTS/E, RSX-11 on PDP-11 
• RPL-3 for IBM System/3 
• Filetab-D for x86 and PDP-11, OpenVMS VAX 
• FPL - IBM PCs and compatibles. 
• RPL, Rapid-Expert and expertGenius extended syntax for Microsoft 
Windows, Unix, Linux and OpenVMS,VAX, Alpha & Itanium 
rapidgen.com 
4
History 
• Excel – query tables 
• COPE – Translate DTs to COBOL 
• LogicGEM – Translate to BASIC,C, C++, FORTRAN, Pascal etc etc 
• CCIDE – Pre-processor for BASIC, JAVA, CC, C++, BASH, QB, VB, 
and EX(euphoria) 
• Silk (Simple In-line Logic Kompiler) converting decision tables to 
Cobol code and vice versa. 
• PASPREP – Pascal preprocessor 
• Many many others 
rapidgen.com 
5
Decision table structure 
• Conditions 
• Actions 
• Condition rules 
• Action rules 
rapidgen.com 
6
Single Condition Decision Table 
Condition Stubs Rules 
Action Stubs Actions 
Quantity > 100 Y N 
Apply 20% Discount X - 
rapidgen.com 
7
Quantity > 100 Apply 20% Discount 
Y 
N 
rapidgen.com 
Decision Tables 
Horizontal vs Vertical 
Condition Stubs Action Stubs 
Rules Actions 
8 
X 
-
Multiple Single Decision Table 
Condition Stubs Rules 
Action Stubs Actions 
rapidgen.com 
Quantity > 100 Y Y N N 
Cash payment Y N Y N 
Apply 20% Discount X - - - 
Apply 10% Discount - X - - 
Apply 5% Discount - - X - 
No discount - - - - 
9
Multiple Condition DTs 
• Complete True/False Y N require 
2^Conditions rules 
• 3 Conditions – 8 rules 
• 4 Conditions – 16 rules 
• etc 
• Use of “-” to reduce completeness 
• Practical limit 32 
rapidgen.com 
10
Five Conditions – One rule 
Initially no discount 
Quantity > 100 Y - 
Cash payment Y - 
Credit_check Y - 
Product type is laptop Y - 
Employee N - 
Apply 5% Discount X - 
rapidgen.com 
11
Multiple Section Decision Table 
Quantity > 100 Y Y N N 
Cash payment Y N Y N 
Apply 20% Discount X - - - 
Apply 10% Discount - X - - 
Apply 5% Discount - - X - 
No discount - - - - 
Discount_amount < $1 Y - 
No discount X - 
Discount amount > $1000 Y - 
Set discount $1000 X - 
rapidgen.com 
12
Simplifying Decision Tables 1 
rapidgen.com 
1 2 3 4 5 6 7 8 
13 
Credit limit 
exceeded 
Y Y Y Y N N N N 
Cash payment Y Y N N Y Y N N 
Special clearance Y N Y N Y N Y N 
Accept order X X X - X X X X 
Reject Order - - - X - - - -
Simplifying Decision Tables 2 
rapidgen.com 
1&2 3 4 5 6 7 8 
14 
Credit limit 
exceeded 
Y Y Y N N N N 
Cash payment Y N N Y Y N N 
Special clearance - Y N Y N Y N 
Accept order X X - X X X X 
Reject Order - - X - - - -
Simplifying Decision Tables 3 
rapidgen.com 
1&2 3 4 5&6 7&8 
15 
Credit limit 
exceeded 
Y Y Y N N 
Cash payment Y N N Y N 
Special clearance - Y N - - 
Accept order X X - X X 
Reject Order - - X - -
Simplifying Decision Tables 4 
rapidgen.com 
1&2 3 4 567&8 
16 
Credit limit 
exceeded 
Y Y Y N 
Cash payment Y N N - 
Special clearance - Y N - 
Accept order X X - X 
Reject Order - - X -
Simplifying Decision Tables 5 
rapidgen.com 
17 
4 123567&8 
Credit limit 
exceeded 
Y ELSE 
Cash payment N - 
Special clearance N - 
Accept order - X 
Reject Order X -
Optimising Decision Tables 
rapidgen.com 
1 2 3 4 5 6 7 8 
18 
Credit limit 
exceeded 
Y Y Y Y N N N N 
Cash payment Y Y N N Y Y N N 
Special clearance Y N Y N Y N Y N 
Accept order X - X - X X X X 
Reject Order - X - X - - - - 
2&4 123567&8 
Credit limit 
exceeded 
Y ELSE 
Special clearance N - 
Accept order - X 
Reject Order X -
ELSE Rule 
rapidgen.com 
19 
4 123567&8 
Credit limit 
exceeded 
Y ELSE 
Cash payment N - 
Special clearance N - 
Accept order - X 
Reject Order X -
Simplifying Decision Tables – 
Extended entry 
TRANSKEY GT MASTKEY Y - - - ELSE 
TRANSKEY EQ MASTKEY - Y Y - - 
TRANSKEY LT MASTKEY - - - Y - 
TRANSTYPE = “I” - - - Y - 
TRANSTYPE = “D” - - Y - - 
TRANSTYPE = “A” - Y - - - 
CALL PROCESS_MATCH - X - - - 
CALL PROCESS_MISS - - X - - 
CALL PROCESS_ADD - - - X - 
CALL NEXT_TRANS - X X X - 
CALL NEXT_MAST X X X - - 
REPEAT X X X X - 
rapidgen.com 
20
Simplifying Decision Tables – 
Extended entry 
TRANSKEY ? MASTKEY > = = < ELSE 
TRANSTYPE = “?” - A D I - 
CALL PROCESS_? - MATCH MISS ADD - 
CALL NEXT_TRANS - X X X - 
CALL NEXT_MAST X X X - - 
REPEAT X X X X - 
rapidgen.com 
21
Ambiguity or Multi-ruling? 
rapidgen.com 
22 
Set discount 
Initialise DISCOUNT_PERC 
Cash payment Y - - - 
Special offer - Y - - 
Good credit history - - Y - 
DISCOUNT_PERC + ? 5 10 2 -
|--------------------------------------------------| 
|--------------------------------------------------| 
|# |STATEMENT 1 2 3 4 5 6 7 8 | 
|--------------------------------------------------| 
|C1 |Cash payment |y |y |y |y |n |n |n |n | 
|C2 |Special offer |y |y |n |n |y |y |n |n | 
|C3 |Good credit history |y |n |y |n |y |n |y |n | 
|==================================================| 
|A1 |Discount initialise | | | | | | | | | 
|A2 |Discount + 5 |X |X |X |X | | | | | 
|A3 |Discount + 10 |X |X | | |X |X | | | 
|A4 |Discount + 2 |X | |X | |X | |X | | 
|--------------------------------------------------| 
rapidgen.com 
Code generation 1 
23
Generation – Nested If/else 1 
rapidgen.com 
24 
{ 
if ((Cash payment)) { 
if ((Special offer)) { 
if ((Good credit history)) { 
/* rule 1 */ 
Discount + 5; 
Discount + 10; 
Discount + 2; } 
else { 
/* rule 2 */ 
Discount + 5; 
Discount + 10; } 
} 
else { 
if ((Good credit history)) { 
/* rule 3 */ 
Discount + 5; 
Discount + 2; } 
else { 
/* rule 4 */ 
Discount + 5; 
} 
} 
} 
else {
Generation – Nested If/else 2 
rapidgen.com 
25 
if ((Special offer)) { 
if ((Good credit history)) { 
/* rule 5 */ 
Discount + 10; 
Discount + 2; 
} 
else { 
/* rule 6 */ 
Discount + 10; 
} 
} 
else { 
if ((Good credit history)) { 
/* rule 7 */ 
Discount + 2; 
} 
else { 
/* rule 8 */ 
} 
} 
} 
}
Generation – Case Switch 1 
rapidgen.com 
26 
{ 
if ((Cash payment)) { 
if ((Special offer)) { 
if ((Good credit history)) { 
rule_number = 1; 
} 
else { 
rule_number = 2; 
} 
} 
else { 
if ((Good credit history)) { 
rule_number = 3; 
} 
else { 
rule_number = 4; 
} 
} 
}
Generation – Case Switch 2 
rapidgen.com 
27 
else { 
if ((Special offer)) { 
if ((Good credit history)) { 
rule_number = 5; 
} 
else { 
rule_number = 6; 
} 
} 
else { 
if ((Good credit history)) { 
rule_number = 7; 
} 
else { 
rule_number = 8; 
} 
} 
}
Generation – Case Switch 3 
rapidgen.com 
28 
switch (rule_number) { 
case 1: 
Discount + 5; 
Discount + 10 ; 
Discount + 2; 
break; 
case 2: 
Discount + 5; 
Discount + 10; 
break; 
case 3: 
Discount + 5; 
Discount + 2; 
break; 
case 4: 
Discount + 5; 
break;
Generation – Case Switch 4 
rapidgen.com 
29 
case 5: 
Discount + 10; 
Discount + 2; 
break; 
case 6: 
Discount + 10; 
break; 
case 7: 
Discount + 2; 
break; 
case 8: 
break; }
rapidgen.com 
Generation – Rule List 1 
30 
{ 
if ( ((Cash payment)) && 
((Special offer)) && 
((Good credit history)) ) { 
Discount + 5; Discount + 10; Discount + 2; 
} 
if ( ((Cash payment)) && 
((Special offer)) && 
(!(Good credit history)) ) { 
Discount + 5; Discount + 10; 
} 
if ( ((Cash payment)) && 
(!(Special offer)) && 
((Good credit history)) ) { 
Discount + 5; Discount + 2; 
} 
if ( ((Cash payment)) && 
(!(Special offer)) && 
(!(Good credit history)) ) { 
Discount + 5; 
}
rapidgen.com 
Generation – Rule List 2 
31 
if ( (!(Cash payment)) && 
((Special offer)) && 
((Good credit history)) ) { 
Discount + 10; Discount + 2; 
} 
if ( (!(Cash payment)) && 
((Special offer)) && 
(!(Good credit history)) ) { 
Discount + 10; 
} 
if ( (!(Cash payment)) && 
(!(Special offer)) && 
((Good credit history)) ) { 
Discount + 2; 
} 
if ( (!(Cash payment)) && 
(!(Special offer)) && 
(!(Good credit history)) ) { 
} 
}
rapidgen.com 
Generation – Rule Mask 
32 
{Mask = 11111111 
{if ( Cash payment) 
Mask AND 11110000; 
} 
{if ( Special Offer) 
Mask AND 11001100; 
} 
{if (Good credit history) 
Mask AND 10101010; 
} 
{if (Mask AND 11110000) 
Discount + 5 ; 
} 
if (Mask AND 11001100) 
Discount + 10; 
} 
if (Mask AND 10101010) 
Discount + 2; 
}
• Succinct code 
• Reduces repetition of condition testing 
• Reduced repetition of action code 
• Fast execution 
• No frequency/cost weighting of rules 
needed 
•  All conditions are evaluated 
rapidgen.com 
Rule masking 
33
AGE > 50 Y - - 
CALL ADJUST_COVER Y - - 
TRANSKEY LT MASTKEY - Y - 
LOOKUP MASTER TRANSKEY - Y - 
rapidgen.com 
Relevance Testing 
Some operations require dynamic masking where actions 
may be performed or I/O occurs 
34
AGE > 50 Y - - 
COVER + 20 R - - 
TRANSKEY LT MASTKEY - Y - 
DISPLAY “Message” - R - 
rapidgen.com 
Relevance Testing 
Dynamic masking again needed when Actions are inserted 
into condition section of Decision Table using “R” 
35
CALL Credit_limit_exceeded Y ELSE 
CALL Cash_payment N - 
CALL Special_clearance N - 
CALL ACCEPT_ORDER - X 
CALL REJECT_ORDER X - 
CALL Credit_limit_exceeded Y ELSE 
CALL Cash_payment N - 
CALL Special_clearance N - 
GOTO ACCEPT_ORDER - X 
CALL_I Variable_name X - 
rapidgen.com 
Decision table linkage 
CALLs to other DTs or object library routines 
GOTO link to DT or indirect CALL 
36
Requirements of a DT language 
• Feature rich language 
• Support for multiple data types 
• Unmatched data type comparison 
• Good string handling/text manipulation 
• Access external routines/library functions 
• File, database, object and data dictionary 
• Callable access from other products 
• Source code maintenance, version control 
• Compiled and portable execution 
rapidgen.com 
37
Decision Tables in other products 
• Uses GUI in SAP HANA Studio 
• SAP Parameter/Database DTs 
• Alternate use via Excel spreadsheets 
• SMARTS 
• OpenRules Engine 
• Decision First Modeler 
• Drools 
• Many more … 
rapidgen.com 
38
Usage of RPL - expertGenius 
• Self compiling 
• Cross compiling 
• Source of Genius Suite 
• Code writing and compiling 4GL and RAD 
toolset 
• Complete layered application suites 
• Reporting – fixed logic 
rapidgen.com 
39
Genius deployment 
• Aerospace factory tracking systems 
• Mobile phone billing systems 
• Payroll data mining 
• HR system ad-hoc querying 
• Newspaper distribution system 
• Stock control 
• Sales order dashboard & EIS 
• Web based on-line parts ordering 
rapidgen.com 
40
CDT Callable Decision Tables 
• Simple calculator 
• Calculator code 
• Tax formula (UK) 
• Tax calculator 
• Tax code 
• CDT Callable access from other 
languages and applications 
rapidgen.com 
41
Future developments 
• Extend range of generic database access 
• Ports to new architectures 
• Macro expansions for FEEL or S-FEEL 
• GUI extensions 
• CDT Callable access from other 
languages and applications 
• Cloud based compiler 
rapidgen.com 
42
rapidgen.com 
Decision Tables as a 
Programming tool 
Howard Rogers 
Director Technical Support 
howard.rogers@rapidgen.com 
howard.rogers@rapidgen.co.uk

Contenu connexe

En vedette

Ipp business analysis & financial modeling summary
Ipp business analysis & financial modeling summaryIpp business analysis & financial modeling summary
Ipp business analysis & financial modeling summaryJi Won Seo
 
Decision tree lecture 3
Decision tree lecture 3Decision tree lecture 3
Decision tree lecture 3Laila Fatehy
 
Decision tree powerpoint presentation templates
Decision tree powerpoint presentation templatesDecision tree powerpoint presentation templates
Decision tree powerpoint presentation templatesSlideTeam.net
 
DFD, Decision Table, Decision Chart, Structure Charts
DFD, Decision Table, Decision Chart, Structure ChartsDFD, Decision Table, Decision Chart, Structure Charts
DFD, Decision Table, Decision Chart, Structure ChartsSOuvagya Kumar Jena
 
Lecture5---Gantt Chart
Lecture5---Gantt ChartLecture5---Gantt Chart
Lecture5---Gantt Chartdanishrafiq
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignMotaz Saad
 
System Analysis and Design
System Analysis and DesignSystem Analysis and Design
System Analysis and DesignAamir Abbas
 

En vedette (9)

Ipp business analysis & financial modeling summary
Ipp business analysis & financial modeling summaryIpp business analysis & financial modeling summary
Ipp business analysis & financial modeling summary
 
Decision tree lecture 3
Decision tree lecture 3Decision tree lecture 3
Decision tree lecture 3
 
Decision tree powerpoint presentation templates
Decision tree powerpoint presentation templatesDecision tree powerpoint presentation templates
Decision tree powerpoint presentation templates
 
DFD, Decision Table, Decision Chart, Structure Charts
DFD, Decision Table, Decision Chart, Structure ChartsDFD, Decision Table, Decision Chart, Structure Charts
DFD, Decision Table, Decision Chart, Structure Charts
 
Decision Trees
Decision TreesDecision Trees
Decision Trees
 
Decision tree
Decision treeDecision tree
Decision tree
 
Lecture5---Gantt Chart
Lecture5---Gantt ChartLecture5---Gantt Chart
Lecture5---Gantt Chart
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
 
System Analysis and Design
System Analysis and DesignSystem Analysis and Design
System Analysis and Design
 

Similaire à Decision Tables as a Programming Tool Overview

Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...
Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...
Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...confluent
 
MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013
MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013
MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013Sergey Petrunya
 
Financial Supply chain Management.
Financial Supply chain Management.Financial Supply chain Management.
Financial Supply chain Management.Rajeev Kumar
 
Airline scheduling and pricing using a genetic algorithm
Airline scheduling and pricing using a genetic algorithmAirline scheduling and pricing using a genetic algorithm
Airline scheduling and pricing using a genetic algorithmAlan Walker
 
Statistical Models for Proportional Outcomes
Statistical Models for Proportional OutcomesStatistical Models for Proportional Outcomes
Statistical Models for Proportional OutcomesWenSui Liu
 
Pattern Matching with SQL - APEX World Rotterdam 2019
Pattern Matching with SQL - APEX World Rotterdam 2019Pattern Matching with SQL - APEX World Rotterdam 2019
Pattern Matching with SQL - APEX World Rotterdam 2019Connor McDonald
 
Global Cash Access Investor Presentation
Global Cash Access Investor PresentationGlobal Cash Access Investor Presentation
Global Cash Access Investor Presentationglobalcashaccess
 
IoTで成功を収めるための製品と戦略 〜 Salesforce IoT 〜
IoTで成功を収めるための製品と戦略 〜 Salesforce IoT 〜IoTで成功を収めるための製品と戦略 〜 Salesforce IoT 〜
IoTで成功を収めるための製品と戦略 〜 Salesforce IoT 〜Salesforce Developers Japan
 
V mware forecasting process.jl
V mware forecasting process.jlV mware forecasting process.jl
V mware forecasting process.jlMark Leslie
 
Amibroker AFL Coding - Webinar
Amibroker AFL Coding - WebinarAmibroker AFL Coding - Webinar
Amibroker AFL Coding - WebinarMarketcalls
 
M|18 Understanding the Query Optimizer
M|18 Understanding the Query OptimizerM|18 Understanding the Query Optimizer
M|18 Understanding the Query OptimizerMariaDB plc
 
Test case format
Test case formatTest case format
Test case formatAtul Tiwari
 
Latin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingLatin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingConnor McDonald
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performanceMariaDB plc
 

Similaire à Decision Tables as a Programming Tool Overview (20)

Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...
Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...
Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...
 
MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013
MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013
MySQL/MariaDB query optimizer tuning tutorial from Percona Live 2013
 
Financial Supply chain Management.
Financial Supply chain Management.Financial Supply chain Management.
Financial Supply chain Management.
 
Tally.ERP 9 shortcut keys
Tally.ERP 9 shortcut keysTally.ERP 9 shortcut keys
Tally.ERP 9 shortcut keys
 
Airline scheduling and pricing using a genetic algorithm
Airline scheduling and pricing using a genetic algorithmAirline scheduling and pricing using a genetic algorithm
Airline scheduling and pricing using a genetic algorithm
 
Boston 16 03
Boston 16 03Boston 16 03
Boston 16 03
 
Statistical Models for Proportional Outcomes
Statistical Models for Proportional OutcomesStatistical Models for Proportional Outcomes
Statistical Models for Proportional Outcomes
 
P2 p and o2c
P2 p and o2cP2 p and o2c
P2 p and o2c
 
Pattern Matching with SQL - APEX World Rotterdam 2019
Pattern Matching with SQL - APEX World Rotterdam 2019Pattern Matching with SQL - APEX World Rotterdam 2019
Pattern Matching with SQL - APEX World Rotterdam 2019
 
Global Cash Access Investor Presentation
Global Cash Access Investor PresentationGlobal Cash Access Investor Presentation
Global Cash Access Investor Presentation
 
IoTで成功を収めるための製品と戦略 〜 Salesforce IoT 〜
IoTで成功を収めるための製品と戦略 〜 Salesforce IoT 〜IoTで成功を収めるための製品と戦略 〜 Salesforce IoT 〜
IoTで成功を収めるための製品と戦略 〜 Salesforce IoT 〜
 
Multiperiod Accounting in Oracle EBS R12
Multiperiod Accounting in Oracle EBS R12Multiperiod Accounting in Oracle EBS R12
Multiperiod Accounting in Oracle EBS R12
 
V mware forecasting process.jl
V mware forecasting process.jlV mware forecasting process.jl
V mware forecasting process.jl
 
Шаблон KPI от YouExec
Шаблон KPI от YouExecШаблон KPI от YouExec
Шаблон KPI от YouExec
 
Project KPI presentation sample by YouExec
Project KPI presentation sample by YouExecProject KPI presentation sample by YouExec
Project KPI presentation sample by YouExec
 
Amibroker AFL Coding - Webinar
Amibroker AFL Coding - WebinarAmibroker AFL Coding - Webinar
Amibroker AFL Coding - Webinar
 
M|18 Understanding the Query Optimizer
M|18 Understanding the Query OptimizerM|18 Understanding the Query Optimizer
M|18 Understanding the Query Optimizer
 
Test case format
Test case formatTest case format
Test case format
 
Latin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingLatin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matching
 
How to use histograms to get better performance
How to use histograms to get better performanceHow to use histograms to get better performance
How to use histograms to get better performance
 

Dernier

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Dernier (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Decision Tables as a Programming Tool Overview

  • 1. rapidgen.com Decision Tables as a Programming tool Howard Rogers Director Technical Support howard.rogers@rapidgen.com
  • 2. Agenda • A brief history • Decision table structures • Rule formats • Rule redundancy, reduction and optimisation • Relevance testing • Some practical examples • Current examples of use • Future developments • Questions and Answers rapidgen.com 2
  • 3. Speaker • Statistics & Operation Research • UK National Health Service • 35 years IT • Decision table based languages and compilers • Query & reporting tools • Generic file & database access • Brief interlude with RTPI • Technical support rapidgen.com 3
  • 4. History • NASA • Morgan Crucible – LITA – List &Tabulate • TABN for ICL 1900 series mainframes • (DE)TAB-360 for IBM System/360 • UNITAB for UNIVAC • HTAB for Honeywell • TAB-11 for RSTS/E on PDP-11 • FTL6/DTPL for ICT 1900 series • RPL-11 for RT-11, RSTS/E, RSX-11 on PDP-11 • RPL-3 for IBM System/3 • Filetab-D for x86 and PDP-11, OpenVMS VAX • FPL - IBM PCs and compatibles. • RPL, Rapid-Expert and expertGenius extended syntax for Microsoft Windows, Unix, Linux and OpenVMS,VAX, Alpha & Itanium rapidgen.com 4
  • 5. History • Excel – query tables • COPE – Translate DTs to COBOL • LogicGEM – Translate to BASIC,C, C++, FORTRAN, Pascal etc etc • CCIDE – Pre-processor for BASIC, JAVA, CC, C++, BASH, QB, VB, and EX(euphoria) • Silk (Simple In-line Logic Kompiler) converting decision tables to Cobol code and vice versa. • PASPREP – Pascal preprocessor • Many many others rapidgen.com 5
  • 6. Decision table structure • Conditions • Actions • Condition rules • Action rules rapidgen.com 6
  • 7. Single Condition Decision Table Condition Stubs Rules Action Stubs Actions Quantity > 100 Y N Apply 20% Discount X - rapidgen.com 7
  • 8. Quantity > 100 Apply 20% Discount Y N rapidgen.com Decision Tables Horizontal vs Vertical Condition Stubs Action Stubs Rules Actions 8 X -
  • 9. Multiple Single Decision Table Condition Stubs Rules Action Stubs Actions rapidgen.com Quantity > 100 Y Y N N Cash payment Y N Y N Apply 20% Discount X - - - Apply 10% Discount - X - - Apply 5% Discount - - X - No discount - - - - 9
  • 10. Multiple Condition DTs • Complete True/False Y N require 2^Conditions rules • 3 Conditions – 8 rules • 4 Conditions – 16 rules • etc • Use of “-” to reduce completeness • Practical limit 32 rapidgen.com 10
  • 11. Five Conditions – One rule Initially no discount Quantity > 100 Y - Cash payment Y - Credit_check Y - Product type is laptop Y - Employee N - Apply 5% Discount X - rapidgen.com 11
  • 12. Multiple Section Decision Table Quantity > 100 Y Y N N Cash payment Y N Y N Apply 20% Discount X - - - Apply 10% Discount - X - - Apply 5% Discount - - X - No discount - - - - Discount_amount < $1 Y - No discount X - Discount amount > $1000 Y - Set discount $1000 X - rapidgen.com 12
  • 13. Simplifying Decision Tables 1 rapidgen.com 1 2 3 4 5 6 7 8 13 Credit limit exceeded Y Y Y Y N N N N Cash payment Y Y N N Y Y N N Special clearance Y N Y N Y N Y N Accept order X X X - X X X X Reject Order - - - X - - - -
  • 14. Simplifying Decision Tables 2 rapidgen.com 1&2 3 4 5 6 7 8 14 Credit limit exceeded Y Y Y N N N N Cash payment Y N N Y Y N N Special clearance - Y N Y N Y N Accept order X X - X X X X Reject Order - - X - - - -
  • 15. Simplifying Decision Tables 3 rapidgen.com 1&2 3 4 5&6 7&8 15 Credit limit exceeded Y Y Y N N Cash payment Y N N Y N Special clearance - Y N - - Accept order X X - X X Reject Order - - X - -
  • 16. Simplifying Decision Tables 4 rapidgen.com 1&2 3 4 567&8 16 Credit limit exceeded Y Y Y N Cash payment Y N N - Special clearance - Y N - Accept order X X - X Reject Order - - X -
  • 17. Simplifying Decision Tables 5 rapidgen.com 17 4 123567&8 Credit limit exceeded Y ELSE Cash payment N - Special clearance N - Accept order - X Reject Order X -
  • 18. Optimising Decision Tables rapidgen.com 1 2 3 4 5 6 7 8 18 Credit limit exceeded Y Y Y Y N N N N Cash payment Y Y N N Y Y N N Special clearance Y N Y N Y N Y N Accept order X - X - X X X X Reject Order - X - X - - - - 2&4 123567&8 Credit limit exceeded Y ELSE Special clearance N - Accept order - X Reject Order X -
  • 19. ELSE Rule rapidgen.com 19 4 123567&8 Credit limit exceeded Y ELSE Cash payment N - Special clearance N - Accept order - X Reject Order X -
  • 20. Simplifying Decision Tables – Extended entry TRANSKEY GT MASTKEY Y - - - ELSE TRANSKEY EQ MASTKEY - Y Y - - TRANSKEY LT MASTKEY - - - Y - TRANSTYPE = “I” - - - Y - TRANSTYPE = “D” - - Y - - TRANSTYPE = “A” - Y - - - CALL PROCESS_MATCH - X - - - CALL PROCESS_MISS - - X - - CALL PROCESS_ADD - - - X - CALL NEXT_TRANS - X X X - CALL NEXT_MAST X X X - - REPEAT X X X X - rapidgen.com 20
  • 21. Simplifying Decision Tables – Extended entry TRANSKEY ? MASTKEY > = = < ELSE TRANSTYPE = “?” - A D I - CALL PROCESS_? - MATCH MISS ADD - CALL NEXT_TRANS - X X X - CALL NEXT_MAST X X X - - REPEAT X X X X - rapidgen.com 21
  • 22. Ambiguity or Multi-ruling? rapidgen.com 22 Set discount Initialise DISCOUNT_PERC Cash payment Y - - - Special offer - Y - - Good credit history - - Y - DISCOUNT_PERC + ? 5 10 2 -
  • 23. |--------------------------------------------------| |--------------------------------------------------| |# |STATEMENT 1 2 3 4 5 6 7 8 | |--------------------------------------------------| |C1 |Cash payment |y |y |y |y |n |n |n |n | |C2 |Special offer |y |y |n |n |y |y |n |n | |C3 |Good credit history |y |n |y |n |y |n |y |n | |==================================================| |A1 |Discount initialise | | | | | | | | | |A2 |Discount + 5 |X |X |X |X | | | | | |A3 |Discount + 10 |X |X | | |X |X | | | |A4 |Discount + 2 |X | |X | |X | |X | | |--------------------------------------------------| rapidgen.com Code generation 1 23
  • 24. Generation – Nested If/else 1 rapidgen.com 24 { if ((Cash payment)) { if ((Special offer)) { if ((Good credit history)) { /* rule 1 */ Discount + 5; Discount + 10; Discount + 2; } else { /* rule 2 */ Discount + 5; Discount + 10; } } else { if ((Good credit history)) { /* rule 3 */ Discount + 5; Discount + 2; } else { /* rule 4 */ Discount + 5; } } } else {
  • 25. Generation – Nested If/else 2 rapidgen.com 25 if ((Special offer)) { if ((Good credit history)) { /* rule 5 */ Discount + 10; Discount + 2; } else { /* rule 6 */ Discount + 10; } } else { if ((Good credit history)) { /* rule 7 */ Discount + 2; } else { /* rule 8 */ } } } }
  • 26. Generation – Case Switch 1 rapidgen.com 26 { if ((Cash payment)) { if ((Special offer)) { if ((Good credit history)) { rule_number = 1; } else { rule_number = 2; } } else { if ((Good credit history)) { rule_number = 3; } else { rule_number = 4; } } }
  • 27. Generation – Case Switch 2 rapidgen.com 27 else { if ((Special offer)) { if ((Good credit history)) { rule_number = 5; } else { rule_number = 6; } } else { if ((Good credit history)) { rule_number = 7; } else { rule_number = 8; } } }
  • 28. Generation – Case Switch 3 rapidgen.com 28 switch (rule_number) { case 1: Discount + 5; Discount + 10 ; Discount + 2; break; case 2: Discount + 5; Discount + 10; break; case 3: Discount + 5; Discount + 2; break; case 4: Discount + 5; break;
  • 29. Generation – Case Switch 4 rapidgen.com 29 case 5: Discount + 10; Discount + 2; break; case 6: Discount + 10; break; case 7: Discount + 2; break; case 8: break; }
  • 30. rapidgen.com Generation – Rule List 1 30 { if ( ((Cash payment)) && ((Special offer)) && ((Good credit history)) ) { Discount + 5; Discount + 10; Discount + 2; } if ( ((Cash payment)) && ((Special offer)) && (!(Good credit history)) ) { Discount + 5; Discount + 10; } if ( ((Cash payment)) && (!(Special offer)) && ((Good credit history)) ) { Discount + 5; Discount + 2; } if ( ((Cash payment)) && (!(Special offer)) && (!(Good credit history)) ) { Discount + 5; }
  • 31. rapidgen.com Generation – Rule List 2 31 if ( (!(Cash payment)) && ((Special offer)) && ((Good credit history)) ) { Discount + 10; Discount + 2; } if ( (!(Cash payment)) && ((Special offer)) && (!(Good credit history)) ) { Discount + 10; } if ( (!(Cash payment)) && (!(Special offer)) && ((Good credit history)) ) { Discount + 2; } if ( (!(Cash payment)) && (!(Special offer)) && (!(Good credit history)) ) { } }
  • 32. rapidgen.com Generation – Rule Mask 32 {Mask = 11111111 {if ( Cash payment) Mask AND 11110000; } {if ( Special Offer) Mask AND 11001100; } {if (Good credit history) Mask AND 10101010; } {if (Mask AND 11110000) Discount + 5 ; } if (Mask AND 11001100) Discount + 10; } if (Mask AND 10101010) Discount + 2; }
  • 33. • Succinct code • Reduces repetition of condition testing • Reduced repetition of action code • Fast execution • No frequency/cost weighting of rules needed •  All conditions are evaluated rapidgen.com Rule masking 33
  • 34. AGE > 50 Y - - CALL ADJUST_COVER Y - - TRANSKEY LT MASTKEY - Y - LOOKUP MASTER TRANSKEY - Y - rapidgen.com Relevance Testing Some operations require dynamic masking where actions may be performed or I/O occurs 34
  • 35. AGE > 50 Y - - COVER + 20 R - - TRANSKEY LT MASTKEY - Y - DISPLAY “Message” - R - rapidgen.com Relevance Testing Dynamic masking again needed when Actions are inserted into condition section of Decision Table using “R” 35
  • 36. CALL Credit_limit_exceeded Y ELSE CALL Cash_payment N - CALL Special_clearance N - CALL ACCEPT_ORDER - X CALL REJECT_ORDER X - CALL Credit_limit_exceeded Y ELSE CALL Cash_payment N - CALL Special_clearance N - GOTO ACCEPT_ORDER - X CALL_I Variable_name X - rapidgen.com Decision table linkage CALLs to other DTs or object library routines GOTO link to DT or indirect CALL 36
  • 37. Requirements of a DT language • Feature rich language • Support for multiple data types • Unmatched data type comparison • Good string handling/text manipulation • Access external routines/library functions • File, database, object and data dictionary • Callable access from other products • Source code maintenance, version control • Compiled and portable execution rapidgen.com 37
  • 38. Decision Tables in other products • Uses GUI in SAP HANA Studio • SAP Parameter/Database DTs • Alternate use via Excel spreadsheets • SMARTS • OpenRules Engine • Decision First Modeler • Drools • Many more … rapidgen.com 38
  • 39. Usage of RPL - expertGenius • Self compiling • Cross compiling • Source of Genius Suite • Code writing and compiling 4GL and RAD toolset • Complete layered application suites • Reporting – fixed logic rapidgen.com 39
  • 40. Genius deployment • Aerospace factory tracking systems • Mobile phone billing systems • Payroll data mining • HR system ad-hoc querying • Newspaper distribution system • Stock control • Sales order dashboard & EIS • Web based on-line parts ordering rapidgen.com 40
  • 41. CDT Callable Decision Tables • Simple calculator • Calculator code • Tax formula (UK) • Tax calculator • Tax code • CDT Callable access from other languages and applications rapidgen.com 41
  • 42. Future developments • Extend range of generic database access • Ports to new architectures • Macro expansions for FEEL or S-FEEL • GUI extensions • CDT Callable access from other languages and applications • Cloud based compiler rapidgen.com 42
  • 43. rapidgen.com Decision Tables as a Programming tool Howard Rogers Director Technical Support howard.rogers@rapidgen.com howard.rogers@rapidgen.co.uk