SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Mark Proctor
Distinguished Engineer II
Chief Architect - Rules, BPM and Optimisation
Red Hat
Modernising Production Rule Systems

Rule Modularity and Execution Control
OPS5 (It Begins)
OPS
OPS5 1981
•Language
•Rete
•LEX/MEA
(p mb17
(goal ^status active ^type on ^object <o>)
(object ^name <o> ^at <p>)
(monkey ^at <p> ^holds nil)
-->
(write (crlf) "climb onto" <o>)
(modify 3 ^on <o>)
(modify 1 ^status satisfied))
OPS
•Official Production System.
•pre OPS5 linear Search.
•Conflict Resolution <McDermott, Forgy 1976>.
Working
Memory
Rules
Inference Engine
Pattern
Matching
Agenda
CLIPS
CLIPS 1993
•Lisp (ish)
•exists/forall
•Subnetworks
•Modules
•Simple TMS
(defrule climb-directly ""
?goal <- (goal-is-to (action on) (arguments ?obj))
(thing (name ?obj) (location ?place) (on-top-of ?on))
?monkey <- (monkey (location ?place) (on-top-of ?on) (holding blank))
=>
(printout t "Monkey climbs onto the " ?obj "." crlf)
(modify ?monkey (on-top-of ?obj))
(retract ?goal))
CLIPS
•Syntax based on ART (Haley Systems)
•Modules based on GoldWorks
•PIE Clips Modules
Working
Memory
Modules
Inference Engine
Pattern
Matching
Agenda
Jess
Jess7 2006
•Accumulate
•Slot Specific
•Backward Chaining (ish)
(deftemplate employee (slot salary) (slot name))
(defrule count-highly-paid-employees
?c <- (accumulate (bind ?count 0) ;; initializer
(bind ?count (+ ?count 1)) ;; action
?count ;; result
(employee (salary ?s&:(> ?s 100000)))) ;; CE
=>
(printout t ?c " employees make more than $100000/year." crlf))
Jess
•Java implementation of Clips syntax
Working
Memory
Modules
Inference Engine
Pattern
Matching
Agenda
Drools
Drools 6.x/7.x 2018
•Accumulate
•Temporal Operators
•Property Reactive
•Prolog(ish) Backward Chaining
•OOPath Graph Reasoning
Drools
•Clips/Jess derivative with Java-like language
Working
Memory
Modules
Inference Engine
Pattern
Matching
Agenda
Slow Progress
Is Still Progress
Still Here
Working
Memory
Modules
Inference Engine
Pattern Matching
Agenda
Still Here Working
Memory
Modules
Inference Engine
Pattern
Matching
Agenda
“Today, I want to make clear that the future prospects for
production rule technology are diminishing..…

production rule technology is inadequate ” 

(Paul Haley 2013)

http://haleyai.com/wordpress/2013/06/22/confessions-of-a-production-rule-vendor-part-1/
Still Here Working
Memory
Modules
Inference Engine
Pattern
Matching
Agenda
“Today, I want to make clear that the future prospects for
production rule technology are diminishing..…

production rule technology is inadequate” 

(Paul Haley 2013)

http://haleyai.com/wordpress/2013/06/22/confessions-of-a-production-rule-vendor-part-1/
Still Here Working
Memory
Modules
Inference Engine
Pattern
Matching
Agenda
“It’s time to trade rule technology dating back to the 80’s for
state of the art AI.” 

(Paul Haley 2018)

• http://haleyai.com/wordpress/2018/04/02/confessions-of-a-production-rule-vendor-part-2/
Still Here
Working MemoryModules
Inference Engine
Pattern Matching
Agenda
Still Here
Rule Modularity and
Execution Control
• Production system conflict resolution strategies (McDermott, Forgy 1976)
• Conflict Resolution + Control Token (Signals, GOTO)
• Mixes Control and Domain Logic in single rule
• This Pollution may be undesirable for readability and maintainability
• Does not guarantee rules for one token have fired before processing another token
• OPS MEA (Forgy 1981)
• Compares recency for the first pattern to find the dominant rule.
• Typically matches against a fact called a Context, Phase or Goal.
• Allows for goal-directed controlling of production systems which also introduces a
type of rule subroutine.
• Compares recency for the remaining elements
• LEX falls back on specificity and arbitrary.
Stylistic
• ROSIE (D. A. Waterman, 1979)
• Multiple data sets and rule sets.
• Only one ruleset and one data set can be active at a time.
• Eclips (NASA, 1991) PIE (NASA, 1988)
• Goal directed.
• Each goal has a context.
• Subroutine like.
• Clips Modules (NASA 1993)
• Push/Pop Stack
• No Context
• External Orchestration
• Rule Flow
Syntactic
Venus
• Rules and data are decoupled.
• Venus full hybrid C++ language.
• Single Root Module.
• Guard does not directly invoke Rule.

Instead it makes it legible for evaluation.
• Current consequence finishes, 

before potential next module is entered.
• Module may have 1..n Support. Will 

continue to evaluate, while it has support.
• If support is removed, module continues until it reaches fixed point (then it’s removed).
• Is single threaded a fair deterministic policy is used to help with selection,

which is controlled by the priority of the rule against its peers.
• Submitted module is identified by the combination of module name plus the passed
arguments.
Venus Rule Language
Venus Rule Language
Rule Works
• ENTRY-BLOCK
• C-callable entry block
• Can have their own rules
• Implicitly activate
• May activate one or more rule Rule-Blocks
• RULE-BLOCK
• Allow for rules to be shared across ENTRY-BLOCKs
• May not call other ENTRY-BLOCKs or RULE-BLOCKs.
• External Orchestration
Rule Works
• ON-ENTRY: Before the match step of the first recognize- act cycle. This can be used for
tasks like data initialisation.
• ON-EVERY: After the act step of every cycle except the last one. This can be used for
tasks like printing out the rule count.
• ON-EMPTY: After the select step when the conflict set is empty. This can be used to
detect state and return error information.
• ON-EXIT: After the act step of the last cycle. This can be used for things like cleanup
actions.
Rule Works
Rule Works Life Cycles
ON-ENTRY ON-EVERY
Match Act
Select ON-EMPTY
ON-EXIT
Call to Entry
Block
Operating
System
Caller of Entry
Block
• Neither Venus or RuleWorks made it into industrial or academic mainstream.
• Business Rules have simple requirements.
• Often spreadsheet driven.
• Variations Rule Flow suffices.
• Academia is funding driven, interests change over time.
Recency and Relevance of Works
Units
Units
package org.mypackage.myunit
public class AdultUnit implements RuleUnit {
private int adultAge;
private DataSource<Person> persons;
public AdultUnit( ) { }
public AdultUnit( DataSource<Person> persons, int age
) {
this.persons = persons;
this.age = age;
}
}
Units
package org.mypackage.myunit
public class AdultUnit implements RuleUnit {
private int adultAge;
private DataSource<Person> persons;
public AdultUnit( ) { }
public AdultUnit( DataSource<Person> persons, int age ) {
this.persons = persons;
this.age = age;
}
}
package org.mypackage.myunit
unit AdultUnit
rule Adult when
$p : /persons[age >= adultAge]
then
System.out.println($p.getName() +
" is adult and greater than " + 

adultAge);
end
Units package org.mypackage.myunit
unit AdultUnit
rule Adult when
$p : /persons[age >= adultAge]
then
System.out.println($p.getName() +
" is adult and greater than " + 

adultAge);
end
package org.mypackage.myunit
public class AdultUnit implements RuleUnit {
private int adultAge;
private DataSource<Person> persons;
public AdultUnit( ) { }
public AdultUnit( DataSource<Person> persons, int age ) {
this.persons = persons;
this.age = age;
}
@Override
public boolean onStart(RuleUnitInstance instance) { 

System.out.println(getName() + " started.”);
return true;
}
@Override
public boolean onEnd(RuleUnitInstance instance) {
return true;
}
}
Recommendation and Bidding Example
Recommendation and Bidding Example
Recommendation and Bidding Example
• PENDING: The unit is instantiated, but has not yet been started. 

• RUNNING: The unit is evaluating and executing rules. 

• DORMANT: The unit has either reached a fixed point and has no more work to
evaluate, or it has been requested 

to stop further evaluation. 

• YIELDED: The current executing unit has yielded (while 

still having more work to do) to another unit that has 

earlier scheduling. 

States
Unit Life Cycles
RUNNINGDORMANT YIELDED
start
true
resume
true
yield
true
onSuspend
suspend
true
onResume
onStart
onEnd
onYield
onResume
PENDING
FINISHED
RuleUnitInstance
Created
CANCELLED
start
false
resume
true
resume
false
suspend
false
yeld
false
resume
false
resume
request
resume
request
suspend
request
yield
request
start
request
ON-ENTRY ON-EVERY
Match Act
Select ON-EMPTY
ON-EXIT
Call to Entry
Block
Operating
System
Caller of Entry
Block
• @Yield(<boolean>)
• @TerminateOnEmpty
Additional Control via Annotations
• Depth first LIFO.
• Where the two guards exist for the same unit, the one that comes earlier in the rule
order has priority. 

• Where the two guards are not from the same unit, but the path of one subsumes the
path of the other, the deepest unit has priority. 

• Where the two guards are not from the same unit and one path does not subsume the
other, it will iterate the parent chain until it reaches the unit that is shared by both
Fairness
• Units as generic abstractions for runtimes
• Execution guards
• On every
• Inheritance
• Alternative orchestrations
• Refinements in rule execution
• @DataDriven / @Existence Driven
• @Incremental(<boolean>)
• @Sequential
Future Works
Conclusion
Mark Proctor
Distinguished Engineer II
Chief Architect - Rules, BPM and Optimisation
Red Hat
Modernising Production Rule Systems

Rule Modularity and Execution Control

Weitere ähnliche Inhalte

Ähnlich wie Rule Modularity and Execution Control

Module Rules. Overview, use cases, API
Module Rules. Overview, use cases, APIModule Rules. Overview, use cases, API
Module Rules. Overview, use cases, APIArtem Berdishev
 
Migrating To PostgreSQL
Migrating To PostgreSQLMigrating To PostgreSQL
Migrating To PostgreSQLGrant Fritchey
 
Performance tuning Grails applications
Performance tuning Grails applicationsPerformance tuning Grails applications
Performance tuning Grails applicationsLari Hotari
 
Oracle Course
Oracle CourseOracle Course
Oracle Courserspaike
 
Property based testing - Less is more
Property based testing - Less is moreProperty based testing - Less is more
Property based testing - Less is moreHo Tien VU
 
MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxsenthilkumar969017
 
A data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonA data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonTerry Bunio
 
XRE demo presentation
XRE demo presentationXRE demo presentation
XRE demo presentationPablo Pazos
 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Supportnkarag
 
Building a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationJonathan Katz
 
TDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleTDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleNoam Kfir
 
The Evolution of Development Testing
The Evolution of Development TestingThe Evolution of Development Testing
The Evolution of Development TestingCathal King
 
SFDC Batch Apex
SFDC Batch ApexSFDC Batch Apex
SFDC Batch ApexSujit Kumar
 
PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko Neotys
 
System analysis
System analysisSystem analysis
System analysisMomina Mateen
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven developmentStephen Fuqua
 
SQL Tuning 101
SQL Tuning 101SQL Tuning 101
SQL Tuning 101Carlos Sierra
 

Ähnlich wie Rule Modularity and Execution Control (20)

Module Rules. Overview, use cases, API
Module Rules. Overview, use cases, APIModule Rules. Overview, use cases, API
Module Rules. Overview, use cases, API
 
Rules
RulesRules
Rules
 
Migrating To PostgreSQL
Migrating To PostgreSQLMigrating To PostgreSQL
Migrating To PostgreSQL
 
Performance tuning Grails applications
Performance tuning Grails applicationsPerformance tuning Grails applications
Performance tuning Grails applications
 
Oracle Course
Oracle CourseOracle Course
Oracle Course
 
Property based testing - Less is more
Property based testing - Less is moreProperty based testing - Less is more
Property based testing - Less is more
 
MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptx
 
STL Algorithms In Action
STL Algorithms In ActionSTL Algorithms In Action
STL Algorithms In Action
 
A data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonA data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madison
 
XRE demo presentation
XRE demo presentationXRE demo presentation
XRE demo presentation
 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
 
Building a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management ApplicationBuilding a Complex, Real-Time Data Management Application
Building a Complex, Real-Time Data Management Application
 
Compiler Design Unit 4
Compiler Design Unit 4Compiler Design Unit 4
Compiler Design Unit 4
 
TDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleTDD and the Legacy Code Black Hole
TDD and the Legacy Code Black Hole
 
The Evolution of Development Testing
The Evolution of Development TestingThe Evolution of Development Testing
The Evolution of Development Testing
 
SFDC Batch Apex
SFDC Batch ApexSFDC Batch Apex
SFDC Batch Apex
 
PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko
 
System analysis
System analysisSystem analysis
System analysis
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven development
 
SQL Tuning 101
SQL Tuning 101SQL Tuning 101
SQL Tuning 101
 

Mehr von Mark Proctor

Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationMark Proctor
 
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Mark Proctor
 
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Mark Proctor
 
Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016Mark Proctor
 
Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Mark Proctor
 
RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning Mark Proctor
 
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsRed Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsMark Proctor
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyMark Proctor
 
Classic Games Development with Drools
Classic Games Development with DroolsClassic Games Development with Drools
Classic Games Development with DroolsMark Proctor
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Mark Proctor
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 OverviewMark Proctor
 
Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)Mark Proctor
 
UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)Mark Proctor
 
What's new in Drools 6 - London JBUG 2013
What's new in Drools 6 - London JBUG 2013What's new in Drools 6 - London JBUG 2013
What's new in Drools 6 - London JBUG 2013Mark Proctor
 
Property Reactive RuleML 2013
Property Reactive RuleML 2013Property Reactive RuleML 2013
Property Reactive RuleML 2013Mark Proctor
 
Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)Mark Proctor
 
Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Mark Proctor
 
Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Mark Proctor
 
UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)Mark Proctor
 
UberFire (JudCon 2013)
UberFire (JudCon 2013)UberFire (JudCon 2013)
UberFire (JudCon 2013)Mark Proctor
 

Mehr von Mark Proctor (20)

Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentation
 
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
Reducing the Cost of the Linear Growth Effect using Adaptive Rules with Unlin...
 
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
Drools, jBPM and OptaPlanner (NYC and DC Sept 2017 - Keynote Talk Video)
 
Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016Learning Rule Based Programming using Games @DecisionCamp 2016
Learning Rule Based Programming using Games @DecisionCamp 2016
 
Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016Drools Happenings 7.0 - Devnation 2016
Drools Happenings 7.0 - Devnation 2016
 
RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning RuleML2015 : Hybrid Relational and Graph Reasoning
RuleML2015 : Hybrid Relational and Graph Reasoning
 
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire RoadmapsRed Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
Red Hat Summit 2015 : Drools, jBPM and UberFire Roadmaps
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
 
Classic Games Development with Drools
Classic Games Development with DroolsClassic Games Development with Drools
Classic Games Development with Drools
 
Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)Drools 6.0 (Red Hat Summit)
Drools 6.0 (Red Hat Summit)
 
Drools and jBPM 6 Overview
Drools and jBPM 6 OverviewDrools and jBPM 6 Overview
Drools and jBPM 6 Overview
 
Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)Drools and BRMS 6.0 (Dublin Aug 2013)
Drools and BRMS 6.0 (Dublin Aug 2013)
 
UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)
 
What's new in Drools 6 - London JBUG 2013
What's new in Drools 6 - London JBUG 2013What's new in Drools 6 - London JBUG 2013
What's new in Drools 6 - London JBUG 2013
 
Property Reactive RuleML 2013
Property Reactive RuleML 2013Property Reactive RuleML 2013
Property Reactive RuleML 2013
 
Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)Reactive Transitive Closures with Drools (Backward Chaining)
Reactive Transitive Closures with Drools (Backward Chaining)
 
Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)Drools 6.0 (JudCon 2013)
Drools 6.0 (JudCon 2013)
 
Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)Drools 6.0 (CamelOne 2013)
Drools 6.0 (CamelOne 2013)
 
UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)UberFire Quick Intro and Overview (early beta Jul 2013)
UberFire Quick Intro and Overview (early beta Jul 2013)
 
UberFire (JudCon 2013)
UberFire (JudCon 2013)UberFire (JudCon 2013)
UberFire (JudCon 2013)
 

KĂźrzlich hochgeladen

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

KĂźrzlich hochgeladen (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Rule Modularity and Execution Control

  • 1. Mark Proctor Distinguished Engineer II Chief Architect - Rules, BPM and Optimisation Red Hat Modernising Production Rule Systems
 Rule Modularity and Execution Control
  • 3. OPS OPS5 1981 •Language •Rete •LEX/MEA (p mb17 (goal ^status active ^type on ^object <o>) (object ^name <o> ^at <p>) (monkey ^at <p> ^holds nil) --> (write (crlf) "climb onto" <o>) (modify 3 ^on <o>) (modify 1 ^status satisfied)) OPS •Official Production System. •pre OPS5 linear Search. •Conflict Resolution <McDermott, Forgy 1976>. Working Memory Rules Inference Engine Pattern Matching Agenda
  • 4. CLIPS CLIPS 1993 •Lisp (ish) •exists/forall •Subnetworks •Modules •Simple TMS (defrule climb-directly "" ?goal <- (goal-is-to (action on) (arguments ?obj)) (thing (name ?obj) (location ?place) (on-top-of ?on)) ?monkey <- (monkey (location ?place) (on-top-of ?on) (holding blank)) => (printout t "Monkey climbs onto the " ?obj "." crlf) (modify ?monkey (on-top-of ?obj)) (retract ?goal)) CLIPS •Syntax based on ART (Haley Systems) •Modules based on GoldWorks •PIE Clips Modules Working Memory Modules Inference Engine Pattern Matching Agenda
  • 5. Jess Jess7 2006 •Accumulate •Slot Specic •Backward Chaining (ish) (deftemplate employee (slot salary) (slot name)) (defrule count-highly-paid-employees ?c <- (accumulate (bind ?count 0) ;; initializer (bind ?count (+ ?count 1)) ;; action ?count ;; result (employee (salary ?s&:(> ?s 100000)))) ;; CE => (printout t ?c " employees make more than $100000/year." crlf)) Jess •Java implementation of Clips syntax Working Memory Modules Inference Engine Pattern Matching Agenda
  • 6. Drools Drools 6.x/7.x 2018 •Accumulate •Temporal Operators •Property Reactive •Prolog(ish) Backward Chaining •OOPath Graph Reasoning Drools •Clips/Jess derivative with Java-like language Working Memory Modules Inference Engine Pattern Matching Agenda
  • 9. Still Here Working Memory Modules Inference Engine Pattern Matching Agenda “Today, I want to make clear that the future prospects for production rule technology are diminishing..…
 production rule technology is inadequate ” 
 (Paul Haley 2013)
 http://haleyai.com/wordpress/2013/06/22/confessions-of-a-production-rule-vendor-part-1/
  • 10. Still Here Working Memory Modules Inference Engine Pattern Matching Agenda “Today, I want to make clear that the future prospects for production rule technology are diminishing..…
 production rule technology is inadequate” 
 (Paul Haley 2013)
 http://haleyai.com/wordpress/2013/06/22/confessions-of-a-production-rule-vendor-part-1/
  • 11. Still Here Working Memory Modules Inference Engine Pattern Matching Agenda “It’s time to trade rule technology dating back to the 80’s for state of the art AI.” 
 (Paul Haley 2018)
 • http://haleyai.com/wordpress/2018/04/02/confessions-of-a-production-rule-vendor-part-2/
  • 12. Still Here Working MemoryModules Inference Engine Pattern Matching Agenda
  • 15. • Production system conflict resolution strategies (McDermott, Forgy 1976) • Conflict Resolution + Control Token (Signals, GOTO) • Mixes Control and Domain Logic in single rule • This Pollution may be undesirable for readability and maintainability • Does not guarantee rules for one token have fired before processing another token • OPS MEA (Forgy 1981) • Compares recency for the first pattern to find the dominant rule. • Typically matches against a fact called a Context, Phase or Goal. • Allows for goal-directed controlling of production systems which also introduces a type of rule subroutine. • Compares recency for the remaining elements • LEX falls back on specificity and arbitrary. Stylistic
  • 16. • ROSIE (D. A. Waterman, 1979) • Multiple data sets and rule sets. • Only one ruleset and one data set can be active at a time. • Eclips (NASA, 1991) PIE (NASA, 1988) • Goal directed. • Each goal has a context. • Subroutine like. • Clips Modules (NASA 1993) • Push/Pop Stack • No Context • External Orchestration • Rule Flow Syntactic
  • 17. Venus
  • 18. • Rules and data are decoupled. • Venus full hybrid C++ language. • Single Root Module. • Guard does not directly invoke Rule.
 Instead it makes it legible for evaluation. • Current consequence finishes, 
 before potential next module is entered. • Module may have 1..n Support. Will 
 continue to evaluate, while it has support. • If support is removed, module continues until it reaches fixed point (then it’s removed). • Is single threaded a fair deterministic policy is used to help with selection,
 which is controlled by the priority of the rule against its peers. • Submitted module is identified by the combination of module name plus the passed arguments. Venus Rule Language
  • 21. • ENTRY-BLOCK • C-callable entry block • Can have their own rules • Implicitly activate • May activate one or more rule Rule-Blocks • RULE-BLOCK • Allow for rules to be shared across ENTRY-BLOCKs • May not call other ENTRY-BLOCKs or RULE-BLOCKs. • External Orchestration Rule Works
  • 22. • ON-ENTRY: Before the match step of the first recognize- act cycle. This can be used for tasks like data initialisation. • ON-EVERY: After the act step of every cycle except the last one. This can be used for tasks like printing out the rule count. • ON-EMPTY: After the select step when the conflict set is empty. This can be used to detect state and return error information. • ON-EXIT: After the act step of the last cycle. This can be used for things like cleanup actions. Rule Works
  • 23. Rule Works Life Cycles ON-ENTRY ON-EVERY Match Act Select ON-EMPTY ON-EXIT Call to Entry Block Operating System Caller of Entry Block
  • 24. • Neither Venus or RuleWorks made it into industrial or academic mainstream. • Business Rules have simple requirements. • Often spreadsheet driven. • Variations Rule Flow suffices. • Academia is funding driven, interests change over time. Recency and Relevance of Works
  • 25. Units
  • 26. Units package org.mypackage.myunit public class AdultUnit implements RuleUnit { private int adultAge; private DataSource<Person> persons; public AdultUnit( ) { } public AdultUnit( DataSource<Person> persons, int age ) { this.persons = persons; this.age = age; } }
  • 27. Units package org.mypackage.myunit public class AdultUnit implements RuleUnit { private int adultAge; private DataSource<Person> persons; public AdultUnit( ) { } public AdultUnit( DataSource<Person> persons, int age ) { this.persons = persons; this.age = age; } } package org.mypackage.myunit unit AdultUnit rule Adult when $p : /persons[age >= adultAge] then System.out.println($p.getName() + " is adult and greater than " + 
 adultAge); end
  • 28. Units package org.mypackage.myunit unit AdultUnit rule Adult when $p : /persons[age >= adultAge] then System.out.println($p.getName() + " is adult and greater than " + 
 adultAge); end package org.mypackage.myunit public class AdultUnit implements RuleUnit { private int adultAge; private DataSource<Person> persons; public AdultUnit( ) { } public AdultUnit( DataSource<Person> persons, int age ) { this.persons = persons; this.age = age; } @Override public boolean onStart(RuleUnitInstance instance) { 
 System.out.println(getName() + " started.”); return true; } @Override public boolean onEnd(RuleUnitInstance instance) { return true; } }
  • 32. • PENDING: The unit is instantiated, but has not yet been started. 
 • RUNNING: The unit is evaluating and executing rules. 
 • DORMANT: The unit has either reached a fixed point and has no more work to evaluate, or it has been requested 
 to stop further evaluation. 
 • YIELDED: The current executing unit has yielded (while 
 still having more work to do) to another unit that has 
 earlier scheduling. 
 States
  • 33. Unit Life Cycles RUNNINGDORMANT YIELDED start true resume true yield true onSuspend suspend true onResume onStart onEnd onYield onResume PENDING FINISHED RuleUnitInstance Created CANCELLED start false resume true resume false suspend false yeld false resume false resume request resume request suspend request yield request start request ON-ENTRY ON-EVERY Match Act Select ON-EMPTY ON-EXIT Call to Entry Block Operating System Caller of Entry Block
  • 35. • Depth first LIFO. • Where the two guards exist for the same unit, the one that comes earlier in the rule order has priority. 
 • Where the two guards are not from the same unit, but the path of one subsumes the path of the other, the deepest unit has priority. 
 • Where the two guards are not from the same unit and one path does not subsume the other, it will iterate the parent chain until it reaches the unit that is shared by both Fairness
  • 36. • Units as generic abstractions for runtimes • Execution guards • On every • Inheritance • Alternative orchestrations • Refinements in rule execution • @DataDriven / @Existence Driven • @Incremental(<boolean>) • @Sequential Future Works
  • 38. Mark Proctor Distinguished Engineer II Chief Architect - Rules, BPM and Optimisation Red Hat Modernising Production Rule Systems
 Rule Modularity and Execution Control