Seminar@KRDB 2011 - Montali - Runtime Reasoning with the Event Calculus: from Theory to Practice
Outline
™  Event Calculus
™  Reasoning
™  Proactive vs reactive
™  Cached Event Calculus
™  Implementation
™  Applications: monitoring of
™  Business constraints
™  Commitment-based business interactions
The Event Calculus
™  First formalization: Kowalski and Sergot, 1986
™  “Simple EC”
™  Temporal reasoning in classical logic
™  Deals with atomic events
™  No frame axioms: time periods, no global state, NAF
™  Extended versions: (Kowalski and Sadri, 1995)
(Shanahan, 1999) (Miller and Shanahan, 2002)
™  Events with durations, continuous fluents, trajectories, …
A logic-based framework for reasoning about
events and their effects
Time, Events and Traces
™  Actions executed by agents
™  The execution of an action is represented by means of
events occurring at time points (atomic events)
™  The time structure is linear and has an initial state
™  The (finite) set of events occurred during an instance of
the system is a narrative or execution trace
0
event
event
occurrence
Fluents and States
™  Events affect the state of the system through their effects
™  Making some properties true
™  Making some properties false
™  Properties change over time, and are called fluents
™  Each fluent models a “partial” system’s state
0
fluent
Some applications 1/2
™  Active databases
™  (Kowalski, 1992) and (Fernandes et al., 1997)
™  Commonsense reasoning
™  Book by Mueller (2006)
™  Contains also a detailed description of the EC and of a
SAT-based Discrete EC Reasoner
™  Cognitive robotics
™  Shanahan et al.
™  see the Cognitive Robotics I and II projects:
http://www.iis.ee.ic.ac.uk/~m.witkowski/cogrob2/
Some applications 2/2
™  Normative aspects and legal reasoning
™  Open Multi-Agent Systems
™  Specification of norms and “social constraints” (Artikis et al., 2009)
™  Commitment-based interactions (Yolum and Singh, 2002), (Chesani et
al, 2009)
™  Specification of the normative states of contracts (Farrell et al., 2005)
™  Service Oriented Computing
™  Formalization of BPEL (Rouached et al., 2008),(Galooul et al. 2010)
™  WS-Agreement requirements (Mahbub and Spanoudakis, 2007)
™  Business Process Management
™  Workflow modeling (Cicekli and Cicekli, 2006)
™  Monitoring of business constraints (Montali et al, 2011)
™  Clinical guidelines and BMK (Bottrighi et al, 2011)
An example
™  When a robot moves from room X to room Y, it is no
more at X and it is now at Y, provided that the battery
is non empty
™  When a robot executes a move, then the battery level
decreases of one unit
An example
™  When a robot moves from room X to room Y, it is no
more at X and it is now at Y, provided that the battery
is non empty
™  When a robot executes a move, then the battery level
decreases of one unit
Event Effect Context
Proof Theory and Reasoning Facilities
EC Framework
Logic-Based Framework
Logic-based language
Event Calculus Axiomatization
EC ontology
EC Specification Execution Trace
Domain
dependent
Domain
independent
The Simple EC Ontology
1 2 3 4 5 6 7 8 9 10 11 12 13 14
initiates(a,f,3) terminates(b,f,12)
happens(a,3)
holdsat(f,7)
declip
clip
0
f
MVI (3,12] for f
a b
Simple EC Ontology
with MVIs
holds_at(f,t)
Fluent f holds at time t.
!!! f does not hold at the time it is declipped, but
holds at the time it is clipped
initially(f) Fluent f begins to hold from the initial state
happens(e,t) Event e occurs at time t
initiates(e,f,t)
e has the capability of initiating f at time t.
If f does not already hold at t, it is declipped and will
start to hold from t+1.
terminates(e,f,t)
e has the capability of terminating f at time t.
If f holds at t, it is clipped and will cease to hold
from t+1.
mvi(f,ts,te)
(ts,te] is a maximal validity interval for f :
• f uninterruptedly holds inside (ts,te]
• f is clipped at ts
• f is declipped at te
weak EC
Common sense
law of inertia
Specification of a system 1/2
™  Description of the initial state of the system
™  Initiates and terminates axioms relating domain-
dependent events with domain-specific fluents
™  Test of holds_at predicates for context-
dependent effects
™  The specification is given by a set of clauses
™  The definition can be omitted when true
initially(F):- definition.
initiates(E,F,T):- definition.
terminates(E,F,T):- definition.
Specification of a system 1/2
™  What about the definitions?
™  We are in a FO setting à variables
™  Variables are universally quantified with scope the entire close
™  initiates(a,f,T) states that a can initiate f at any time
™  The definitions of clauses are a conjunction of literals and
may contain
™  Other predicates taken from the EC ontology
™  holds_at predicates represent a context
™  Constructs made available by the underlying logical
language à Horn fragment of FOL + NAF
An example
™  When a robot moves from room X to room Y, it is no
more at X and it is now at Y, provided that the battery is
non empty
™  When a robot executes a move, then the battery level
decreases of one unit
™  Events: move(R,X,Y)
™  Fluents: at(R,X) blevel(R,L)
An example
™  When a robot moves from room X to room Y, it is no
more at X and it is now at Y, provided that the battery is
non empty
initiates(move(R,X,Y),at(Y),T):-
holds_at(blevel(R,L),T), L > 0.
terminates(move(R,X,Y),at(X),T):-
holds_at(blevel(R,L),T), L > 0.
An example
™  When a robot executes a move, then the battery level
decreases of one unit
initiates(move(R,X,Y),blevel(R,New),T):-
holds_at(blevel(R,Old),T),
Old > 0, New = Old - 1.
terminates(move(R,X,Y), blevel(R,Old),T):-
holds_at(blevel(R,Old),T), L > 0.
Species of Inference
™  Pierce differentiated the genus of reasoning into three
species of inference
™  Deductive reasoning
™  Application of a general rule to a particular case,
inferring a specific result
™  Inductive reasoning
™  Synthesis of a general rule starting from particular cases
and results
™  Abductive reasoning
™  Synthesis of a case (explanation/case) from a general rule
and a particular result (observation)
EC Abductive Reasoning
™  Goal: generate possible execution traces (plans) that lead to
a desired state of affairs, according to an EC specification
™  Example
™  Which sequence of actions leads the robot to room2, giving
an initial situation where it is in room1 with battery=5 ?
events' effects
[initiates/terminates]
validity of fluents
[holds_at]
EC
abductive
reasoning
initial state
[initially]
trace
[happens]
EC Proactive Reasoning
™  A form of deductive reasoning
™  Given a narrative, answers queries over the validity of
fluents
™  Example: giving a sequence of wall-e’s movements…
?- holds_at(blevel(wall-e,L),T), L < 5.
events' effects
[initiates/terminates]
EC
proactive
reasoning
initial state
[initially]
trace
[happens]
validity of fluents
[holds_at]
Axiomatization in Prolog
™  The simple EC can be simply formalized in the Horn
fragment of FOL, augmented with negation as failure
(Kowalski and Sergot, 1986)
™  The formalization focuses on fluents’ transitions
™  it centres around intervals in which
™  A fluent switches from false to true (is declipped)
™  A fluent switches from true to false (is clipped)
Semantics of holds_at
™  Fluent F holds at time T if
™  F has been declipped in the past
™  At the beginning of the execution (initially)
™  When an event occurred initiating it
™  F has not been clipped in between
holds_at(F,T):- happens(E,Ts), Ts<T,
inititates(E,F,Ts),
¬clipped(Ts,F,T).
holds_at(F,T):- initially(F),
¬clipped(0,F,T). T
F
0
TTs
F
E
Semantics of clipped
™  F is clipped inside a time interval [T1, T2) if an event
occurs inside the interval and terminates F
clipped(T1,F,T2):- happens(E,T),
T ≥ T1, T < T2,
terminates(E,F,T).
Reasoning with Prolog
™  Given
™  An EC specification (KBdom)
™  The axiomatization of holds_at and clipped (KBEC)
™  An execution trace (T)
™  A query Q
™  Verifying whether T leads to Q corresponds to check whether
KBdom ∪KBEC ∪T satisfies Q
™  Which in turn can be verified by means of a Prolog SLDNF
derivation
™  Prolog performs backward, proactive reasoning starting from Q
Example
™  KBdom: initially(f).
terminates(a,f,T).
initiates(b,f,T).
™  T: happens(a,2). happens(b,6).
™  Q: ?-holds_at(f,8) YES!
1 2 3 4 5 6 7 80
f
a b
Example – SLDNF derivation
holds_at(f,8)
initially(f) / ¬clipped(0,f,8)
¬clipped(0,f,8)
clipped(0,f,8)
happens(E,T) / T≥0 / T<8
/ terminates(E,f,T)
2≥0 / 2<8 / terminates(a,f,2)
terminates(a,f,2)
happens(E,T) / T<8 ¬clipped(T,f,8)
…E/a,T/2
false
true
2<8 ¬clipped(2,f,8)
clipped(0,f,8)
happens(E,T) / T≥2 / T<8
/ terminates(E,f,T)
2≥0 / 2<8 / terminates(a,f,2)
terminates(a,f,2)
…E/a,T/2
false
true
E/a,T/2 E/b,T/6
clipped(0,f,8)
happens(E,T) / T≥6 / T<8
/ terminates(E,f,T)
2≥6 / …
E/a,T/2
true
false
6<8 ¬clipped(6,f,8)
E/b,T/6
6≥6 / 6<8
/ terminates(b,f,6)
terminates(b,f,6)
false
EC Reactive Reasoning
™  Dynamically growing trace à narrative updates
™  Interest in showing the evolution of all fluents à
?- “extract all the maximal validity intervals of fluents”
events' effects
[initiates/terminates]
EC
reactive
reasoning
initial state
[initially]
partial trace
[happens]
evolution of fluents
[holds_at]
Ongoing/Future Work
™  Integration between procedural and declarative
knowledge in the clinical setting
Is Proactive Reactive?
™  Chittaro and Montanari [1994]: No!
™  Narrative update is constant, but the query must be
executed from scratch
™  No possibility of reusing the previously inferred results
™  Idea: Cached Event Calculus
Cached Event Calculus
Chittaro and Montanari, 1995
™  Caches the current result for future use
™  Extends/revises it as new events are acquired
™  Complexity moved from the query to the narrative update
™  What is cached? The Maximal Validity Intervals (MVIs)
™  Reasoning shifts from transitions to levels of fluents
™  (Simple) query complexity: linear in the size of the cached
MVIs
holds_at(F,T):-
mvi(F,T1,T2),
gt(T,T1), le(T,T2).
Axiomatizations
™  Cached Event Calculus (Prolog) [Chittaro and Montanari,
1995]
™  Prolog-based, with assert/retract
™  Reactive Event Calculus (SCIFF)
™  [Chesani et al, 2010] Based on an ALP framework
™  Declarative semantics à formal properties
™  Reactive Event Calculus (Prolog): light-weight CEC
™  Embedded in JAVA à jREC
™  Naïve management of out-of-order events
™  “Roll-back and re-execute”
REC - Idea
™  A new event occurrence is acquired: happens(e,t)
™  Hp: t is greater than the events occurred so far
™  If not, roll-back + replay
™  Steps
1.  Assert happens(e,t)
2.  Extract all the effects caused by e at time t
declip(F,T):-
happens(E,T),
initiates(E,F,T),
+ holds_at(F,T).
clip(F,T):-
happens(E,T),
terminates(E,F,T),
holds_at(F,T).
REC - Idea
3.  For each fluent f to be declipped
a)  Assert MVI for f (t,inf]
4.  For each fluent f to be clipped
a)  Retract MVI for f (ts,inf]
b)  Assert MVI for f (ts,t]
te
f
te
f
te
f
te
f
jREC
jREC
TuProlog
l-CEC
model
Set model
Evaluate
trace
U
Reset
effects
minates]
EC
reactive
reasoning
state
lly]
partial trace
[happens]
evolution of fluents
[holds_at]
EC in the BPM Setting
Action Activity
Event Event in the activity lifecycle (start, complete, …)
System instance Case
Initial state Beginning of the case
Event occurrence Audit trail entry
Narrative Execution trace
Fluent Property characterizing an aspect of the case
Operational Decision Support
with Wil van der Aalst, Fabrizio Maggi, Federico Chesani, Paola Mello
™  Runtime support to running processes
™  Check
™  Predict
™  Recommend
PAIS OS
Service
... ...
event log business
constraints
process
models
request
response
Monitoring
Business Constraints
™  Runtime compliance checking of business constraints,
reporting their status as events occur
™  Desiderata
™  Expressive constraints with metric temporal constraints,
data, data-aware conditions
™  The system cannot be controlled à continuous support
™  System health metrics à catch and count violations
ConDec++
™  Study of all the ConDec [Pesic and van der Aalst,
2006] constraints extended with metric time constraints
™  Extension with non-atomic activities and data
™  Example: The respondent bank must always be added to the
black list in case its due diligence evaluation fails
ResultBank
Result = failed
add to.Bank = diligence.Bank,
diligence
evaluation
add to
black list
Bank
add to.O = diligence.O
Formalization in the EC
™  Formalization of the activity lifecycle
™  Notion of constraint instance
™  At each time, a constraint instance can be pending, satisfied
or violated
™  Transitions determined by the occurrence of events
™  Example
™  Complete evaluation with result = failure generates a new
pending instance of the constraint
™  The instance becomes satisfied if the same responsible
successfully adds the involved bank to the black list
™  The instance becomes violated if the case is completed and it is
still pending
activeinitial
completed
canceled
ts (start)
tc (complete)
tx (cancel)
Monitoring Outcome
ResultBank
Result = failed
add to.Bank = diligence.Bank,
diligence
evaluation
add to
black list
Bank
add to.O = diligence.O
MoBuCon
ProM implementation
Commitments and Interactions
with Federico Chesani, Paola Mello, Paolo Torroni
™  Social Commitments [Castelfranchi, 1995], [Singh, 1998]
for modeling interaction in open systems
™  MAS, SOA, Business interactions, …
™  Open systems à interacting entities are
™  Heterogeneous
™  Autonomous
™  Interaction: focus on commitments established by agents
™  not by fixing specific courses of interaction in advance
™  C(x,y,p) à debtor agent (x) committed towards a creditor
agent (y) to bring about some desired property (p)
Commitment Life Cycle
™  Agents perform actions, traced by means of events
™  Event occurrences
™  Have effects (initiate/terminate fluents)
™  (in)directly trigger operations on commitments
™  Each operation results in a commitment state change
™  States of all commitments: normative state of the
interaction
™  When a customer c pays seller s for an order, s becomes
committed to deliver that order (make the order
delivered) à payment creates C(s,c,orderDelivered)
Simplified Life Cycle
active
violated
satisfied
create
C(s,c,orderDelivered)
pay(c,s) sendByAirMail(s,c)
orderDelivered
Monitoring Commitments
™  Model business contracts and protocols by means of
commitments
™  Timed extensions to deal with deadlines and properties
that must be maintained true
™  Use the EC formalization of the commitment life cycle
™  Extension of [Singh and Yolum, 2000]
™  Track the normative state of contract by monitoring a
running interaction with jREC
™  Demo!
Conclusion
™  EC is an expressive and computational framework for
reason about event-based systems
™  Monitoring with the EC requires suitable reactive
reasoners
™  jREC is a practical solution to tackle this issue
™  Applications in the BPM context
™  Monitoring Business Constraints
™  Tracking Commitment-Based Interactions
Ongoing/Future Work
™  Integration between declarative and procedural
knowledge in clinical guidelines
™  Experimental assessment: first experiments
encouraging
™  Complexity investigation
™  Starting from Chittaro and Montanari’s work
™  Focusing on specific classes of EC programs
™  New application in the context of artifact-centric
business processes
™  Formalization of the GSM paradigm?

More Related Content

PPTX
Building Immutable Machine Images with Packer and Ansible
ODP
Apache ppt
PDF
Building Stream Infrastructure across Multiple Data Centers with Apache Kafka
ODP
Using ANTLR on real example - convert "string combined" queries into paramete...
PDF
Scalability, Availability & Stability Patterns
PDF
Open stack
PDF
Introduction to WebSockets Presentation
PDF
Spark overview
Building Immutable Machine Images with Packer and Ansible
Apache ppt
Building Stream Infrastructure across Multiple Data Centers with Apache Kafka
Using ANTLR on real example - convert "string combined" queries into paramete...
Scalability, Availability & Stability Patterns
Open stack
Introduction to WebSockets Presentation
Spark overview

What's hot (20)

PPTX
Feature store: Solving anti-patterns in ML-systems
PPTX
Kafka 101
PPTX
Designing data intensive applications
PDF
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
PPTX
PPTX
Web services SOAP
PPT
Introduction To Dotnet
PPTX
Introduction to Apache ZooKeeper
PDF
Hibernate Presentation
PPTX
Hibernate ppt
PDF
Streaming Data Analytics with ksqlDB and Superset | Robert Stolz, Preset
PPT
6&7-Query Languages & Operations.ppt
PPT
Java Servlets
PPTX
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
PDF
Intro to HBase
PPTX
Kafka presentation
PPT
Mvc architecture
PDF
Learning to Rank in Solr: Presented by Michael Nilsson & Diego Ceccarelli, Bl...
PDF
Networking in Java with NIO and Netty
Feature store: Solving anti-patterns in ML-systems
Kafka 101
Designing data intensive applications
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Web services SOAP
Introduction To Dotnet
Introduction to Apache ZooKeeper
Hibernate Presentation
Hibernate ppt
Streaming Data Analytics with ksqlDB and Superset | Robert Stolz, Preset
6&7-Query Languages & Operations.ppt
Java Servlets
Cryptography for Java Developers: Nakov jProfessionals (Jan 2019)
Intro to HBase
Kafka presentation
Mvc architecture
Learning to Rank in Solr: Presented by Michael Nilsson & Diego Ceccarelli, Bl...
Networking in Java with NIO and Netty
Ad

Similar to Seminar@KRDB 2011 - Montali - Runtime Reasoning with the Event Calculus: from Theory to Practice (20)

PPT
Dynamic Process Modeling
PPT
Dynamic Process Modeling
PDF
F023064072
PDF
F023064072
PDF
PAGOdA paper
PDF
Bifurcation Analysis and Model Redictive the Control of the Jewettforger-Kron...
PDF
Bifurcation Analysis and Model Redictive the Control of the Jewettforger-Kron...
PDF
Algorithm to Generate Wavelet Transform from an Orthogonal Transform
PPTX
control system, open and closed loop engineering
PDF
Modeling and Reasoning in Event Calculus using Goal-Directed Constraint Answe...
PDF
Parameterized Model Checking for Timed Systems with Conjunctive Guards
PPT
slides
PPT
Elements Of Stochastic Processes
PPSX
System Test Evaluation and Review Technique
PPTX
IMP lecture1_2 Princeton University-converted.pptx
PDF
Parameterized Model Checking of Rendezvous Systems
PPT
Fourier transformation presentation engineering
PDF
PDF
solver (1)
PDF
Frequency and Power Estimator for Digital Receivers in Doppler Shift Environm...
Dynamic Process Modeling
Dynamic Process Modeling
F023064072
F023064072
PAGOdA paper
Bifurcation Analysis and Model Redictive the Control of the Jewettforger-Kron...
Bifurcation Analysis and Model Redictive the Control of the Jewettforger-Kron...
Algorithm to Generate Wavelet Transform from an Orthogonal Transform
control system, open and closed loop engineering
Modeling and Reasoning in Event Calculus using Goal-Directed Constraint Answe...
Parameterized Model Checking for Timed Systems with Conjunctive Guards
slides
Elements Of Stochastic Processes
System Test Evaluation and Review Technique
IMP lecture1_2 Princeton University-converted.pptx
Parameterized Model Checking of Rendezvous Systems
Fourier transformation presentation engineering
solver (1)
Frequency and Power Estimator for Digital Receivers in Doppler Shift Environm...
Ad

More from Faculty of Computer Science - Free University of Bozen-Bolzano (20)

PDF
From Case-Isolated to Object-Centric Processes - A Tale of two Models
PDF
Reasoning on Labelled Petri Nets and Their Dynamics in a Stochastic Setting
PDF
Constraints for Process Framing in Augmented BPM
PDF
PDF
Process Reasoning and Mining with Uncertainty
PDF
From Case-Isolated to Object-Centric Processes
PDF
Modeling and Reasoning over Declarative Data-Aware Processes
PDF
Soundness of Data-Aware Processes with Arithmetic Conditions
PDF
Strategy Synthesis for Data-Aware Dynamic Systems with Multiple Actors
PDF
Extending Temporal Business Constraints with Uncertainty
PDF
Extending Temporal Business Constraints with Uncertainty
PDF
Modeling and Reasoning over Declarative Data-Aware Processes with Object-Cent...
PDF
Enriching Data Models with Behavioral Constraints
PDF
Representing and querying norm states using temporal ontology-based data access
PDF
Compliance monitoring of multi-perspective declarative process models
PDF
Processes and organizations - a look behind the paper wall
From Case-Isolated to Object-Centric Processes - A Tale of two Models
Reasoning on Labelled Petri Nets and Their Dynamics in a Stochastic Setting
Constraints for Process Framing in Augmented BPM
Process Reasoning and Mining with Uncertainty
From Case-Isolated to Object-Centric Processes
Modeling and Reasoning over Declarative Data-Aware Processes
Soundness of Data-Aware Processes with Arithmetic Conditions
Strategy Synthesis for Data-Aware Dynamic Systems with Multiple Actors
Extending Temporal Business Constraints with Uncertainty
Extending Temporal Business Constraints with Uncertainty
Modeling and Reasoning over Declarative Data-Aware Processes with Object-Cent...
Enriching Data Models with Behavioral Constraints
Representing and querying norm states using temporal ontology-based data access
Compliance monitoring of multi-perspective declarative process models
Processes and organizations - a look behind the paper wall

Recently uploaded (20)

PPTX
WEEK 6 and 7 (1).pptx ingles de psicologia
PDF
_INVITATIONS AND REPLIES.pdffhihgushfuhug
PPTX
The Power of Communication & Overcoming
PDF
Unit 3 Ratio Analysis.pdf xdvdssdfsdfsd sdf
PDF
Enhancing the Value of African Agricultural Products through Intellectual Pro...
PDF
Ch-5.pdf important formulas requires for class 12
PPTX
IIINtroduction_Macroperspective (1).pptx
PPTX
Ruth Week 2 - Redemption Is Coming 08-31-2025.pptx
PPTX
1_055gggggggggggh054_مراجعهالاختبار.pptx
PPTX
Where is the Best Place to Invest in Real Estate.pptx
PPTX
Special Occasion Speech by NBA YoungBoy.pptx
PPTX
Go Kiss the World book review presentation.pptx
PPTX
Basics of Stereotypes and Prejudice(1).pptx
PPTX
All important rules of procedure for any upcoming MUN
PPTX
Staff WelFare Presentation for Larger Organizations
PPTX
Outcomes of Communication & Overcoming
DOCX
Sheka Indigenous Knowledge and Governance
PDF
Community User Group Leaders_ Agentblazer Status, AI Sustainability, and Work...
PPTX
Template for edu 3D Stairs Templates.pptx
PPTX
Swadesh sapthaha - Athma Nirbhar Bharath.
WEEK 6 and 7 (1).pptx ingles de psicologia
_INVITATIONS AND REPLIES.pdffhihgushfuhug
The Power of Communication & Overcoming
Unit 3 Ratio Analysis.pdf xdvdssdfsdfsd sdf
Enhancing the Value of African Agricultural Products through Intellectual Pro...
Ch-5.pdf important formulas requires for class 12
IIINtroduction_Macroperspective (1).pptx
Ruth Week 2 - Redemption Is Coming 08-31-2025.pptx
1_055gggggggggggh054_مراجعهالاختبار.pptx
Where is the Best Place to Invest in Real Estate.pptx
Special Occasion Speech by NBA YoungBoy.pptx
Go Kiss the World book review presentation.pptx
Basics of Stereotypes and Prejudice(1).pptx
All important rules of procedure for any upcoming MUN
Staff WelFare Presentation for Larger Organizations
Outcomes of Communication & Overcoming
Sheka Indigenous Knowledge and Governance
Community User Group Leaders_ Agentblazer Status, AI Sustainability, and Work...
Template for edu 3D Stairs Templates.pptx
Swadesh sapthaha - Athma Nirbhar Bharath.

Seminar@KRDB 2011 - Montali - Runtime Reasoning with the Event Calculus: from Theory to Practice

  • 2. Outline ™  Event Calculus ™  Reasoning ™  Proactive vs reactive ™  Cached Event Calculus ™  Implementation ™  Applications: monitoring of ™  Business constraints ™  Commitment-based business interactions
  • 3. The Event Calculus ™  First formalization: Kowalski and Sergot, 1986 ™  “Simple EC” ™  Temporal reasoning in classical logic ™  Deals with atomic events ™  No frame axioms: time periods, no global state, NAF ™  Extended versions: (Kowalski and Sadri, 1995) (Shanahan, 1999) (Miller and Shanahan, 2002) ™  Events with durations, continuous fluents, trajectories, … A logic-based framework for reasoning about events and their effects
  • 4. Time, Events and Traces ™  Actions executed by agents ™  The execution of an action is represented by means of events occurring at time points (atomic events) ™  The time structure is linear and has an initial state ™  The (finite) set of events occurred during an instance of the system is a narrative or execution trace 0 event event occurrence
  • 5. Fluents and States ™  Events affect the state of the system through their effects ™  Making some properties true ™  Making some properties false ™  Properties change over time, and are called fluents ™  Each fluent models a “partial” system’s state 0 fluent
  • 6. Some applications 1/2 ™  Active databases ™  (Kowalski, 1992) and (Fernandes et al., 1997) ™  Commonsense reasoning ™  Book by Mueller (2006) ™  Contains also a detailed description of the EC and of a SAT-based Discrete EC Reasoner ™  Cognitive robotics ™  Shanahan et al. ™  see the Cognitive Robotics I and II projects: http://www.iis.ee.ic.ac.uk/~m.witkowski/cogrob2/
  • 7. Some applications 2/2 ™  Normative aspects and legal reasoning ™  Open Multi-Agent Systems ™  Specification of norms and “social constraints” (Artikis et al., 2009) ™  Commitment-based interactions (Yolum and Singh, 2002), (Chesani et al, 2009) ™  Specification of the normative states of contracts (Farrell et al., 2005) ™  Service Oriented Computing ™  Formalization of BPEL (Rouached et al., 2008),(Galooul et al. 2010) ™  WS-Agreement requirements (Mahbub and Spanoudakis, 2007) ™  Business Process Management ™  Workflow modeling (Cicekli and Cicekli, 2006) ™  Monitoring of business constraints (Montali et al, 2011) ™  Clinical guidelines and BMK (Bottrighi et al, 2011)
  • 8. An example ™  When a robot moves from room X to room Y, it is no more at X and it is now at Y, provided that the battery is non empty ™  When a robot executes a move, then the battery level decreases of one unit
  • 9. An example ™  When a robot moves from room X to room Y, it is no more at X and it is now at Y, provided that the battery is non empty ™  When a robot executes a move, then the battery level decreases of one unit Event Effect Context
  • 10. Proof Theory and Reasoning Facilities EC Framework Logic-Based Framework Logic-based language Event Calculus Axiomatization EC ontology EC Specification Execution Trace Domain dependent Domain independent
  • 11. The Simple EC Ontology 1 2 3 4 5 6 7 8 9 10 11 12 13 14 initiates(a,f,3) terminates(b,f,12) happens(a,3) holdsat(f,7) declip clip 0 f MVI (3,12] for f a b
  • 12. Simple EC Ontology with MVIs holds_at(f,t) Fluent f holds at time t. !!! f does not hold at the time it is declipped, but holds at the time it is clipped initially(f) Fluent f begins to hold from the initial state happens(e,t) Event e occurs at time t initiates(e,f,t) e has the capability of initiating f at time t. If f does not already hold at t, it is declipped and will start to hold from t+1. terminates(e,f,t) e has the capability of terminating f at time t. If f holds at t, it is clipped and will cease to hold from t+1. mvi(f,ts,te) (ts,te] is a maximal validity interval for f : • f uninterruptedly holds inside (ts,te] • f is clipped at ts • f is declipped at te weak EC Common sense law of inertia
  • 13. Specification of a system 1/2 ™  Description of the initial state of the system ™  Initiates and terminates axioms relating domain- dependent events with domain-specific fluents ™  Test of holds_at predicates for context- dependent effects ™  The specification is given by a set of clauses ™  The definition can be omitted when true initially(F):- definition. initiates(E,F,T):- definition. terminates(E,F,T):- definition.
  • 14. Specification of a system 1/2 ™  What about the definitions? ™  We are in a FO setting à variables ™  Variables are universally quantified with scope the entire close ™  initiates(a,f,T) states that a can initiate f at any time ™  The definitions of clauses are a conjunction of literals and may contain ™  Other predicates taken from the EC ontology ™  holds_at predicates represent a context ™  Constructs made available by the underlying logical language à Horn fragment of FOL + NAF
  • 15. An example ™  When a robot moves from room X to room Y, it is no more at X and it is now at Y, provided that the battery is non empty ™  When a robot executes a move, then the battery level decreases of one unit ™  Events: move(R,X,Y) ™  Fluents: at(R,X) blevel(R,L)
  • 16. An example ™  When a robot moves from room X to room Y, it is no more at X and it is now at Y, provided that the battery is non empty initiates(move(R,X,Y),at(Y),T):- holds_at(blevel(R,L),T), L > 0. terminates(move(R,X,Y),at(X),T):- holds_at(blevel(R,L),T), L > 0.
  • 17. An example ™  When a robot executes a move, then the battery level decreases of one unit initiates(move(R,X,Y),blevel(R,New),T):- holds_at(blevel(R,Old),T), Old > 0, New = Old - 1. terminates(move(R,X,Y), blevel(R,Old),T):- holds_at(blevel(R,Old),T), L > 0.
  • 18. Species of Inference ™  Pierce differentiated the genus of reasoning into three species of inference ™  Deductive reasoning ™  Application of a general rule to a particular case, inferring a specific result ™  Inductive reasoning ™  Synthesis of a general rule starting from particular cases and results ™  Abductive reasoning ™  Synthesis of a case (explanation/case) from a general rule and a particular result (observation)
  • 19. EC Abductive Reasoning ™  Goal: generate possible execution traces (plans) that lead to a desired state of affairs, according to an EC specification ™  Example ™  Which sequence of actions leads the robot to room2, giving an initial situation where it is in room1 with battery=5 ? events' effects [initiates/terminates] validity of fluents [holds_at] EC abductive reasoning initial state [initially] trace [happens]
  • 20. EC Proactive Reasoning ™  A form of deductive reasoning ™  Given a narrative, answers queries over the validity of fluents ™  Example: giving a sequence of wall-e’s movements… ?- holds_at(blevel(wall-e,L),T), L < 5. events' effects [initiates/terminates] EC proactive reasoning initial state [initially] trace [happens] validity of fluents [holds_at]
  • 21. Axiomatization in Prolog ™  The simple EC can be simply formalized in the Horn fragment of FOL, augmented with negation as failure (Kowalski and Sergot, 1986) ™  The formalization focuses on fluents’ transitions ™  it centres around intervals in which ™  A fluent switches from false to true (is declipped) ™  A fluent switches from true to false (is clipped)
  • 22. Semantics of holds_at ™  Fluent F holds at time T if ™  F has been declipped in the past ™  At the beginning of the execution (initially) ™  When an event occurred initiating it ™  F has not been clipped in between holds_at(F,T):- happens(E,Ts), Ts<T, inititates(E,F,Ts), ¬clipped(Ts,F,T). holds_at(F,T):- initially(F), ¬clipped(0,F,T). T F 0 TTs F E
  • 23. Semantics of clipped ™  F is clipped inside a time interval [T1, T2) if an event occurs inside the interval and terminates F clipped(T1,F,T2):- happens(E,T), T ≥ T1, T < T2, terminates(E,F,T).
  • 24. Reasoning with Prolog ™  Given ™  An EC specification (KBdom) ™  The axiomatization of holds_at and clipped (KBEC) ™  An execution trace (T) ™  A query Q ™  Verifying whether T leads to Q corresponds to check whether KBdom ∪KBEC ∪T satisfies Q ™  Which in turn can be verified by means of a Prolog SLDNF derivation ™  Prolog performs backward, proactive reasoning starting from Q
  • 25. Example ™  KBdom: initially(f). terminates(a,f,T). initiates(b,f,T). ™  T: happens(a,2). happens(b,6). ™  Q: ?-holds_at(f,8) YES! 1 2 3 4 5 6 7 80 f a b
  • 26. Example – SLDNF derivation holds_at(f,8) initially(f) / ¬clipped(0,f,8) ¬clipped(0,f,8) clipped(0,f,8) happens(E,T) / T≥0 / T<8 / terminates(E,f,T) 2≥0 / 2<8 / terminates(a,f,2) terminates(a,f,2) happens(E,T) / T<8 ¬clipped(T,f,8) …E/a,T/2 false true 2<8 ¬clipped(2,f,8) clipped(0,f,8) happens(E,T) / T≥2 / T<8 / terminates(E,f,T) 2≥0 / 2<8 / terminates(a,f,2) terminates(a,f,2) …E/a,T/2 false true E/a,T/2 E/b,T/6 clipped(0,f,8) happens(E,T) / T≥6 / T<8 / terminates(E,f,T) 2≥6 / … E/a,T/2 true false 6<8 ¬clipped(6,f,8) E/b,T/6 6≥6 / 6<8 / terminates(b,f,6) terminates(b,f,6) false
  • 27. EC Reactive Reasoning ™  Dynamically growing trace à narrative updates ™  Interest in showing the evolution of all fluents à ?- “extract all the maximal validity intervals of fluents” events' effects [initiates/terminates] EC reactive reasoning initial state [initially] partial trace [happens] evolution of fluents [holds_at]
  • 28. Ongoing/Future Work ™  Integration between procedural and declarative knowledge in the clinical setting
  • 29. Is Proactive Reactive? ™  Chittaro and Montanari [1994]: No! ™  Narrative update is constant, but the query must be executed from scratch ™  No possibility of reusing the previously inferred results ™  Idea: Cached Event Calculus
  • 30. Cached Event Calculus Chittaro and Montanari, 1995 ™  Caches the current result for future use ™  Extends/revises it as new events are acquired ™  Complexity moved from the query to the narrative update ™  What is cached? The Maximal Validity Intervals (MVIs) ™  Reasoning shifts from transitions to levels of fluents ™  (Simple) query complexity: linear in the size of the cached MVIs holds_at(F,T):- mvi(F,T1,T2), gt(T,T1), le(T,T2).
  • 31. Axiomatizations ™  Cached Event Calculus (Prolog) [Chittaro and Montanari, 1995] ™  Prolog-based, with assert/retract ™  Reactive Event Calculus (SCIFF) ™  [Chesani et al, 2010] Based on an ALP framework ™  Declarative semantics à formal properties ™  Reactive Event Calculus (Prolog): light-weight CEC ™  Embedded in JAVA à jREC ™  Naïve management of out-of-order events ™  “Roll-back and re-execute”
  • 32. REC - Idea ™  A new event occurrence is acquired: happens(e,t) ™  Hp: t is greater than the events occurred so far ™  If not, roll-back + replay ™  Steps 1.  Assert happens(e,t) 2.  Extract all the effects caused by e at time t declip(F,T):- happens(E,T), initiates(E,F,T), + holds_at(F,T). clip(F,T):- happens(E,T), terminates(E,F,T), holds_at(F,T).
  • 33. REC - Idea 3.  For each fluent f to be declipped a)  Assert MVI for f (t,inf] 4.  For each fluent f to be clipped a)  Retract MVI for f (ts,inf] b)  Assert MVI for f (ts,t] te f te f te f te f
  • 35. EC in the BPM Setting Action Activity Event Event in the activity lifecycle (start, complete, …) System instance Case Initial state Beginning of the case Event occurrence Audit trail entry Narrative Execution trace Fluent Property characterizing an aspect of the case
  • 36. Operational Decision Support with Wil van der Aalst, Fabrizio Maggi, Federico Chesani, Paola Mello ™  Runtime support to running processes ™  Check ™  Predict ™  Recommend PAIS OS Service ... ... event log business constraints process models request response
  • 37. Monitoring Business Constraints ™  Runtime compliance checking of business constraints, reporting their status as events occur ™  Desiderata ™  Expressive constraints with metric temporal constraints, data, data-aware conditions ™  The system cannot be controlled à continuous support ™  System health metrics à catch and count violations
  • 38. ConDec++ ™  Study of all the ConDec [Pesic and van der Aalst, 2006] constraints extended with metric time constraints ™  Extension with non-atomic activities and data ™  Example: The respondent bank must always be added to the black list in case its due diligence evaluation fails ResultBank Result = failed add to.Bank = diligence.Bank, diligence evaluation add to black list Bank add to.O = diligence.O
  • 39. Formalization in the EC ™  Formalization of the activity lifecycle ™  Notion of constraint instance ™  At each time, a constraint instance can be pending, satisfied or violated ™  Transitions determined by the occurrence of events ™  Example ™  Complete evaluation with result = failure generates a new pending instance of the constraint ™  The instance becomes satisfied if the same responsible successfully adds the involved bank to the black list ™  The instance becomes violated if the case is completed and it is still pending activeinitial completed canceled ts (start) tc (complete) tx (cancel)
  • 40. Monitoring Outcome ResultBank Result = failed add to.Bank = diligence.Bank, diligence evaluation add to black list Bank add to.O = diligence.O
  • 42. Commitments and Interactions with Federico Chesani, Paola Mello, Paolo Torroni ™  Social Commitments [Castelfranchi, 1995], [Singh, 1998] for modeling interaction in open systems ™  MAS, SOA, Business interactions, … ™  Open systems à interacting entities are ™  Heterogeneous ™  Autonomous ™  Interaction: focus on commitments established by agents ™  not by fixing specific courses of interaction in advance ™  C(x,y,p) à debtor agent (x) committed towards a creditor agent (y) to bring about some desired property (p)
  • 43. Commitment Life Cycle ™  Agents perform actions, traced by means of events ™  Event occurrences ™  Have effects (initiate/terminate fluents) ™  (in)directly trigger operations on commitments ™  Each operation results in a commitment state change ™  States of all commitments: normative state of the interaction ™  When a customer c pays seller s for an order, s becomes committed to deliver that order (make the order delivered) à payment creates C(s,c,orderDelivered)
  • 45. Monitoring Commitments ™  Model business contracts and protocols by means of commitments ™  Timed extensions to deal with deadlines and properties that must be maintained true ™  Use the EC formalization of the commitment life cycle ™  Extension of [Singh and Yolum, 2000] ™  Track the normative state of contract by monitoring a running interaction with jREC ™  Demo!
  • 46. Conclusion ™  EC is an expressive and computational framework for reason about event-based systems ™  Monitoring with the EC requires suitable reactive reasoners ™  jREC is a practical solution to tackle this issue ™  Applications in the BPM context ™  Monitoring Business Constraints ™  Tracking Commitment-Based Interactions
  • 47. Ongoing/Future Work ™  Integration between declarative and procedural knowledge in clinical guidelines ™  Experimental assessment: first experiments encouraging ™  Complexity investigation ™  Starting from Chittaro and Montanari’s work ™  Focusing on specific classes of EC programs ™  New application in the context of artifact-centric business processes ™  Formalization of the GSM paradigm?