Top Banner
A Rulebased 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
72

A Rule-‐based Calculus and Processing of Complex Events

Nov 01, 2014

Download

Technology

Adrian GIURCA

cep, rules,
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A Rule-‐based Calculus and Processing of Complex Events

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    

Page 2: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 3: A Rule-‐based Calculus and Processing of Complex Events

IntroducEon    and  MoEvaEons  

Montpellier,  28  August  2012  RuleML  2012  

Page 4: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 5: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 6: A Rule-‐based Calculus and Processing of Complex Events

Technical  Choices    and  Non-­‐funcEonal  

Requisites  

Montpellier,  28  August  2012  RuleML  2012  

Page 7: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 8: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 9: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 10: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 11: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 12: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 13: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 14: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 15: A Rule-‐based Calculus and Processing of Complex Events

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!  

Page 16: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 17: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 18: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 19: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 20: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 21: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 22: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 23: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 24: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 25: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 26: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 27: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 28: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 29: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 30: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 31: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 32: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 33: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 34: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 35: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 36: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 37: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 38: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 39: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 40: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 41: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 42: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 43: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 44: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 45: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 46: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 47: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 48: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 49: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 50: A Rule-‐based Calculus and Processing of Complex Events

The  StraEficaEon  Problem  

Montpellier,  28  August  2012  RuleML  2012  

10  

Page 51: A Rule-‐based Calculus and Processing of Complex Events

Architecture    and  Modes  of  FuncEoning  

Montpellier,  28  August  2012  RuleML  2012  

Page 52: A Rule-‐based Calculus and Processing of Complex Events

module’s  logic  

Architectural  Paaern  of  a  Module  

Montpellier,  28  August  2012  RuleML  2012  

11  

Model

Data Outcome

Page 53: A Rule-‐based Calculus and Processing of Complex Events

Architectural  Paaern  of  a  Module  

Montpellier,  28  August  2012  RuleML  2012  

11  

1st  stage  

2nd  stage  

Model

Data Outcome

Page 54: A Rule-‐based Calculus and Processing of Complex Events

Architectural  Paaern  of  a  Module  

Montpellier,  28  August  2012  RuleML  2012  

11  

1st  stage  

2nd  stage  

Model

Data Outcome

rewriting

Page 55: A Rule-‐based Calculus and Processing of Complex Events

Architectural  Paaern  of  a  Module  

Montpellier,  28  August  2012  RuleML  2012  

11  

1st  stage  

2nd  stage  

Model

Data Outcome

rewriting

Page 56: A Rule-‐based Calculus and Processing of Complex Events

Architectural  Paaern  of  a  Module  

Montpellier,  28  August  2012  RuleML  2012  

11  

1st  stage  

2nd  stage  

Model

Data Outcome

rewriting

Page 57: A Rule-‐based Calculus and Processing of Complex Events

The  StraEficaEon  Problem  

Montpellier,  28  August  2012  RuleML  2012  

11  

1st  stage  

2nd  stage  

Model

Data Outcome

Page 58: A Rule-‐based Calculus and Processing of Complex Events

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!!!

Page 59: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 60: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 61: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 62: A Rule-‐based Calculus and Processing of Complex Events

Experiments    and  Use  Case  

Montpellier,  28  August  2012  RuleML  2012  

Page 63: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 64: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 65: A Rule-‐based Calculus and Processing of Complex Events

Experiments  and  Use  Cases  

Montpellier,  28  August  2012  RuleML  2012  

16  

Page 66: A Rule-‐based Calculus and Processing of Complex Events

Experiments  and  Use  Cases  

Montpellier,  28  August  2012  RuleML  2012  

17  

Page 67: A Rule-‐based Calculus and Processing of Complex Events

Experiments  and  Use  Cases  

Montpellier,  28  August  2012  RuleML  2012  

18  

Page 68: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 69: A Rule-‐based Calculus and Processing of Complex Events

Conclusions  and  Future  Work  

Montpellier,  28  August  2012  RuleML  2012  

Page 70: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 71: A Rule-‐based Calculus and Processing of Complex Events

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  

Page 72: A Rule-‐based Calculus and Processing of Complex Events

Thanks  for  your  aaenEon!  Any  quesEon?  

Contacts:  [email protected]  

Montpellier,  28  August  2012  

RuleML  2012   72