a rule-‐based calculus and processing of complex events
DESCRIPTION
cep, rules,TRANSCRIPT
A Rule-‐based Calculus and Processing of Complex Events Stefano Bragaglia, Federico Chesani, Paola Mello, and Davide So9ara DEIS, University of Bologna
RuleML 2012 – Montpellier, 28 August 2012
Outline ¡ IntroducEon and MoEvaEons
¡ Technical Choices and Non-‐funcEonal Requisites
¡ Architecture and Modes of FuncEoning
¡ Experiments and Use Case
¡ Conclusions and Future Work
Montpellier, 28 August 2012 RuleML 2012
2
IntroducEon and MoEvaEons
Montpellier, 28 August 2012 RuleML 2012
IntroducEon and MoEvaEons ¡ Problem: asserEng/enforcing the online compliance of complex domains’ processes with respect to the descripEon of a desired/expected behaviour
¡ Example: Business Process Management, (Computerised Clinical Guidelines, Service-‐Oriented CompuEng, MulE-‐Agent Systems, etc.
¡ SoluHon: descripEon + monitoring + compliance check
¡ Requirements: efficient declaraEve approach, natural and rich descripEve capabiliEes, versaEle matching funcEon
Montpellier, 28 August 2012 RuleML 2012
3
IntroducEon and MoEvaEons ¡ Formalism to describe and reason about domains ¡ Generic, easily understandable and customisable
¡ Domains are complex, chaoEc and dense of acEons ¡ Efficient
¡ ImplementaEon should be ¡ Self-‐contained, modular, extensible
Montpellier, 28 August 2012 RuleML 2012
4
Technical Choices and Non-‐funcEonal
Requisites
Montpellier, 28 August 2012 RuleML 2012
The Event Calculus
Montpellier, 28 August 2012 RuleML 2012
5
¡ Event: ¡ Anything occurring on a domain in a given Eme
¡ Causing at least a parEal change in its state
¡ Fluent: ¡ Any measurable aspect of a domain
¡ Subject to changes over Eme
¡ Domain’s state (in a given Hme): ¡ the set of values of all its fluents
Axioms of Event Calculus ¡ Core Axiom: a fluent is true in a given 8me iff it was ini8ally true or it has been made true in the past and it has not been made false in the mean8me
¡ Auxiliary Domain-‐dependent Axioms and Knowledge: ¡ Full list of domain’s fluents and events ¡ Full list of causal informa8on on who ini/ates or terminates what (and under which circumstances)
¡ Full knowledge on fluents’ ini/al state ¡ Full no8fica8on of events’ occurance
Montpellier, 28 August 2012 RuleML 2012
6
Example: the Torchlight Problem
¡ Fluents: ¡ lightOn, pwrAvail, switchOn
¡ Events: ¡ turnOn, turnOff, pwrRest, pwrFail
Montpellier, 28 August 2012 RuleML 2012
7
¡ Causal InformaHon: ¡ ini8ates(turnOn, switchOn) ¡ ini8ates(pwrRest, pwrAvail) ¡ ini8ates(turnOn, lightOn, pwrAvail) ¡ ini8ates(pwrRest, lightOn,
switchOn)
¡ terminates(turnOff, switchOn) ¡ terminates(prwFail, pwrAvail) ¡ terminates(turnOff, lightOn) ¡ terminates(pwrFail, lightOn)
¡ IniHal state: ¡ Ini8ally(pwrAvail)
¡ AcHons: ¡ pwrRest @ 5 nothing happens
¡ turnOn @ 10 the light bulb is on
Example: the Torchlight Problem
¡ Fluents: ¡ lightOn, pwrAvail, switchOn
¡ Events: ¡ turnOn, turnOff, pwrRest, pwrFail
Montpellier, 28 August 2012 RuleML 2012
7
¡ Causal InformaHon: ¡ ini8ates(turnOn, switchOn) ¡ ini8ates(pwrRest, pwrAvail) ¡ ini8ates(turnOn, lightOn, pwrAvail) ¡ ini8ates(pwrRest, lightOn,
switchOn)
¡ terminates(turnOff, switchOn) ¡ terminates(prwFail, pwrAvail) ¡ terminates(turnOff, lightOn) ¡ terminates(pwrFail, lightOn)
¡ IniHal state: ¡ Ini8ally(pwrAvail)
¡ AcHons: ¡ pwrRest @ 5 nothing happens
¡ turnOn @ 10 the light bulb is on
pwrAvail
lightOn
switchOn
Example: the Torchlight Problem
¡ Fluents: ¡ lightOn, pwrAvail, switchOn
¡ Events: ¡ turnOn, turnOff, pwrRest, pwrFail
Montpellier, 28 August 2012 RuleML 2012
7
¡ Causal InformaHon: ¡ ini8ates(turnOn, switchOn) ¡ ini8ates(pwrRest, pwrAvail) ¡ ini8ates(turnOn, lightOn, pwrAvail) ¡ ini8ates(pwrRest, lightOn,
switchOn)
¡ terminates(turnOff, switchOn) ¡ terminates(prwFail, pwrAvail) ¡ terminates(turnOff, lightOn) ¡ terminates(pwrFail, lightOn)
¡ IniHal state: ¡ Ini8ally(pwrAvail)
¡ AcHons: ¡ pwrRest @ 5 nothing happens
¡ turnOn @ 10 the light bulb is on
pwrAvail
lightOn
switchOn turnOn turnOff pwrRest pwrFail
Example: the Torchlight Problem
¡ Fluents: ¡ lightOn, pwrAvail, switchOn
¡ Events: ¡ turnOn, turnOff, pwrRest, pwrFail
Montpellier, 28 August 2012 RuleML 2012
7
¡ Causal InformaHon: ¡ ini8ates(turnOn, switchOn) ¡ ini8ates(pwrRest, pwrAvail) ¡ ini8ates(turnOn, lightOn, pwrAvail) ¡ ini8ates(pwrRest, lightOn,
switchOn)
¡ terminates(turnOff, switchOn) ¡ terminates(prwFail, pwrAvail) ¡ terminates(turnOff, lightOn) ¡ terminates(pwrFail, lightOn)
¡ IniHal state: ¡ Ini8ally(pwrAvail)
¡ AcHons: ¡ pwrRest @ 5 nothing happens
¡ turnOn @ 10 the light bulb is on
pwrAvail
lightOn
switchOn turnOn turnOff pwrRest pwrFail
Example: the Torchlight Problem
¡ Fluents: ¡ lightOn, pwrAvail, switchOn
¡ Events: ¡ turnOn, turnOff, pwrRest, pwrFail
Montpellier, 28 August 2012 RuleML 2012
7
¡ Causal InformaHon: ¡ ini8ates(turnOn, switchOn) ¡ ini8ates(pwrRest, pwrAvail) ¡ ini8ates(turnOn, lightOn, pwrAvail) ¡ ini8ates(pwrRest, lightOn,
switchOn)
¡ terminates(turnOff, switchOn) ¡ terminates(prwFail, pwrAvail) ¡ terminates(turnOff, lightOn) ¡ terminates(pwrFail, lightOn)
¡ IniHal state: ¡ Ini8ally(pwrAvail)
¡ AcHons: ¡ pwrRest @ 5 nothing happens
¡ turnOn @ 10 the light bulb is on
pwrAvail
lightOn
switchOn turnOn turnOff pwrRest pwrFail
Example: the Torchlight Problem
¡ Fluents: ¡ lightOn, pwrAvail, switchOn
¡ Events: ¡ turnOn, turnOff, pwrRest, pwrFail
Montpellier, 28 August 2012 RuleML 2012
7
¡ Causal InformaHon: ¡ ini8ates(turnOn, switchOn) ¡ ini8ates(pwrRest, pwrAvail) ¡ ini8ates(turnOn, lightOn, pwrAvail) ¡ ini8ates(pwrRest, lightOn,
switchOn)
¡ terminates(turnOff, switchOn) ¡ terminates(prwFail, pwrAvail) ¡ terminates(turnOff, lightOn) ¡ terminates(pwrFail, lightOn)
¡ IniHal state: ¡ Ini8ally(pwrAvail)
¡ AcHons: ¡ pwrRest @ 5 nothing happens
¡ turnOn @ 10 the light bulb is on
pwrAvail
lightOn
switchOn turnOn turnOff pwrRest pwrFail
Example: the Torchlight Problem
¡ Fluents: ¡ lightOn, pwrAvail, switchOn
¡ Events: ¡ turnOn, turnOff, pwrRest, pwrFail
Montpellier, 28 August 2012 RuleML 2012
7
¡ Causal InformaHon: ¡ ini8ates(turnOn, switchOn) ¡ ini8ates(pwrRest, pwrAvail) ¡ ini8ates(turnOn, lightOn, pwrAvail) ¡ ini8ates(pwrRest, lightOn,
switchOn)
¡ terminates(turnOff, switchOn) ¡ terminates(prwFail, pwrAvail) ¡ terminates(turnOff, lightOn) ¡ terminates(pwrFail, lightOn)
¡ IniHal state: ¡ Ini8ally(pwrAvail)
¡ AcHons: ¡ pwrRest @ 5 nothing happens
¡ turnOn @ 10 the light bulb is on
pwrAvail
lightOn
switchOn turnOn turnOff pwrRest pwrFail
CLIK!
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
Families of Event Calculus variants
OEC / BEC (Kowalski -‐ Sergot, 1986)
EEC (Miller – Shanahan, late 90’s)
FEC (Miller – Shanahan, late 90’s)
SEC / BEC (Kowalski, 1992)
CEC (Chiaaro -‐ Montanari, 1994)
REC (UniBO, 2010)
Montpellier, 28 August 2012 RuleML 2012
8
The StraEficaEon Problem
Montpellier, 28 August 2012 RuleML 2012
9
The Event Calculus ontology
clipped(F, T1, T2) Fluent F is terminated by an event in (T1,T2)
happens_at(E, T) Event E happens at Eme T
holds_at(F, T) Fluent F holds at Eme T
ini8ally(F) Fluent F holds from the iniEal Eme
ini8ates(E, F, T) Event E iniEates fluent F at Eme T
terminates(E, F, T) Event E terminated fluent F at Eme T
mvi(F, [T1, T2]) (T1, T2] is a maximal validity interval for F
The StraEficaEon Problem
Montpellier, 28 August 2012 RuleML 2012
10
Architecture and Modes of FuncEoning
Montpellier, 28 August 2012 RuleML 2012
module’s logic
Architectural Paaern of a Module
Montpellier, 28 August 2012 RuleML 2012
11
Model
Data Outcome
Architectural Paaern of a Module
Montpellier, 28 August 2012 RuleML 2012
11
1st stage
2nd stage
Model
Data Outcome
Architectural Paaern of a Module
Montpellier, 28 August 2012 RuleML 2012
11
1st stage
2nd stage
Model
Data Outcome
rewriting
Architectural Paaern of a Module
Montpellier, 28 August 2012 RuleML 2012
11
1st stage
2nd stage
Model
Data Outcome
rewriting
Architectural Paaern of a Module
Montpellier, 28 August 2012 RuleML 2012
11
1st stage
2nd stage
Model
Data Outcome
rewriting
The StraEficaEon Problem
Montpellier, 28 August 2012 RuleML 2012
11
1st stage
2nd stage
Model
Data Outcome
The StraEficaEon Problem
Montpellier, 28 August 2012 RuleML 2012
11
1st stage
2nd stage
Model
Data Outcome
Two modes of operation: - full: CEC-like - lite: REC-like, inline events only!!!
Modes of OperaEon
Montpellier, 28 August 2012 RuleML 2012
12
1st stage
2nd stage
Model
Data Outcome
Two modes of operation: - full: CEC-like - lite: REC-like, inline events only!!!
Lite mode: REC-‐like
¡ Requires less resources
¡ Simpler module
¡ Fast but “with limitaEons”
¡ Ordered events
¡ Predicates on current Eme
Full mode: CEC-‐like
¡ Requires MVIs
¡ More complex module
¡ Slower but “complete”
¡ Events in any order
¡ Predicates on any Eme
Full Mode rules (1/2) query holdsAt( Fluent $f, long $t ) MVI( fluent == $f, start < $t, stop >= $t ) end rule "1. A declip out of any MVI with nothing next -‐-‐> new open MVI" when Declip( $f: fluent, $i: Eme ) not MVI( fluent == $f, init <= $i, term >= $i ) not Sample( fluent == $f, Eme > $i ) then insert( new MVI($f, $i,
Long.MAX_VALUE) ); end
rule "2. A declip out of any MVI preceeding a Clip -‐-‐> new closed MVI" when Declip( $f: fluent, $i: Eme ) not MVI( fluent == $f, init <= $i, term >= $i ) exists Sample( fluent == $f, Eme > $i ) accumulate ( Sample( fluent == $f, $p: Eme > $i ), $t: min($p) ) exists Clip( fluent == $f, Eme ==
$t.longValue() ) then insert( new MVI($f, $i, $t.longValue()) ); end
Montpellier, 28 August 2012 RuleML 2012
13
Full Mode rules (2/2) rule "3. A declip out of any MVI preceeding a Declip/MVI -‐-‐> extend current MVI leo" when Declip( $f: fluent, $i: Eme ) not MVI( fluent == $f, init <= $i, term >= $i ) exists Sample( fluent == $f, Eme > $i ) accumulate ( Sample( fluent == $f, $p: Eme > $i ), $v: min($p) ) $m: MVI( fluent == $f, init == $v.longValue() )
then modify( $m ) { setInit($i); } end rule "4. A clip in a MVI -‐-‐> cut MVI's tail” when Clip( $f: fluent, $t: Eme ) $m: MVI( fluent == $f, init < $t, $t < term ) then modify( $m ) { setTerm($t); } end
Montpellier, 28 August 2012 RuleML 2012
13
Experiments and Use Case
Montpellier, 28 August 2012 RuleML 2012
Experiments and Use Cases ¡ Test case: ¡ 4284 single tests ¡ NarraEves of up to 6 events ¡ All the combinaEon of clipping/declipping events
¡ For each combinaEon, all the permutaEons of events (delay)
¡ The memory content was verified aUer each test to be consistent with the expected evolu8on of the fluents
Montpellier, 28 August 2012 RuleML 2012
14
Experiments and Use Cases
¡ Experiments: ¡ Torchlight Problem ¡ A trace of 600 events: ¡ Ordered ¡ Inverted order ¡ Delayed
¡ Survey for a Prolog comparison ¡ YAP Prolog 6.2 and Drools 5.3 on an Intel i5 @ 2,4 GHz with 4GB
Montpellier, 28 August 2012 RuleML 2012
15
Experiments and Use Cases
Montpellier, 28 August 2012 RuleML 2012
16
Experiments and Use Cases
Montpellier, 28 August 2012 RuleML 2012
17
Experiments and Use Cases
Montpellier, 28 August 2012 RuleML 2012
18
Experiments and Use Cases
Montpellier, 28 August 2012 RuleML 2012
19
¡ Use Case: ¡ Jolie: language and plaxorm for the rapid prototyping of SOA services
¡ Simple scripted local orchestraEon: ¡ Session start/end ¡ Service start/end ¡ Free memory (not used yet) ¡ SessionOn, ServiceOn
¡ Outcome forwarded to a Jolie’s Java service for displaying the results
Conclusions and Future Work
Montpellier, 28 August 2012 RuleML 2012
Conclusions ¡ ImplementaEon of Event Calculus ¡ DeclaraEve approach (forward producEon rules) ¡ Incremental efficient calculus (complex event processing) ¡ Safe by straEficaEon ¡ Two modes of operaEons
¡ Experiment Evidences
¡ Use Case
Montpellier, 28 August 2012 RuleML 2012
20
Future Work ¡ Extensions: ¡ Generic Fluents ¡ Fuzzy Fluents ¡ Simultaneous Events (EEC?)
¡ Augmented Reasoning: ¡ Contextual DeducEve, AbducEve and InducEve Reasoning
¡ Domains: ¡ Compliance checking ¡ Knowledge reviewing
Montpellier, 28 August 2012 RuleML 2012
21
Thanks for your aaenEon! Any quesEon?
Contacts: [email protected]
Montpellier, 28 August 2012
RuleML 2012 72