Query Stability in Monotonic Data-aware Business Processes*
Ognjen Savković - “Ogi” joint work with Elisa Marengo and Werner Nutt
Oxford, 2016
* Supported by the project MAGIC, funded by the Province of Bozen-Bolzano
Query Stability in Monotonic Data-aware Business Processes* Ognjen - - PowerPoint PPT Presentation
Query Stability in Monotonic Data-aware Business Processes* Ognjen Savkovi - Ogi joint work with Elisa Marengo and Werner Nutt Oxford, 2016 * Supported by the project MAGIC, funded by the Province of Bozen-Bolzano Thesis Scope:
Oxford, 2016
* Supported by the project MAGIC, funded by the Province of Bozen-Bolzano
Data-Centric Business Processes [Deutsch, Vianu, et al.], Data-Centric Dynamic Systems (DCDS) [Calvanese, et al.]
Data Layer
Schema
Customer In Debt Customer Gold Customer Loan
closed
peer
Instance
Cust(ann) peer(mark, john) Gold(john)
· · · Process Layer
Actions
GetLoan(x) : 9y.peer(x, y) {owes(x, UInput(x))}, Cust(z) {Cust(z)}, Loan(z) {Loan(z)}, InDebt(z) {InDebt(z)}, Gold(z) {Gold(z)}
Service Calls
UInput(x)
Condition Action Rules
peer(x, y) ^ Gold(y) 7 ! GetLoan(x)
Examples: LTLFO : ∀x. Customer(x)→ F Gold(x)
These are foundational work that focuses on decidability borders of verification over BPs No fine-grained analysis of sources of complexity. Control-flow is abstracted-away
We want a “simple” process model that captures
Over such a model we want to “check” query stability: Does the query answer stay the same while the process executes?
“Every student is a precious flower”
Faculty(of(Economics % Sum 41,45% Faculty(of(Computer(Science % Sum <15,25% Enrollments 2014(/(2015 Enrollments 2015(/(2016 Bachelor)in)Economics)and)Management
231 279
Bachelor)in)Tourism,)Sport)and)Event)Management
153 267
74,51% Master)in)Entrepreneurship)and)Innovation
42 90
114,29% Bachelor)in)Economics)and)Social)Sciences
87 102
17,24% Bachelor)in)Computer)Science)and)Engineering)
115 150
30,43% Master)in)Economics)and)Management)of)the)public)sector
66 81
22,73%
579 819
Master)of)Science)in)Computer)Science
180 100
<44,44%
295 250
Enrollments 2014(/(2015 Enrollments 2015(/(2016 20,78%
Of Course! The deadline for international programs is not over. The part of registration process is still running.
Why do we have so few students? Keep calm …
Dean of the Faculty Secretary
process manipulates data
getting the flags may become obsolete
Can you code a procedure that will add a reliability/stability flag for each of the figures?
IT Technician Dean of the Faculty
Modeled as directed graph with:
is intl. app. is reg. app. isn't admitted is admitted
early / reg. late early / intl. late
accept app. approve app. approve cond. complete app. register app. withdraw app. reject app.
end start
stud. decis. acad. check
register directly
StudyPlan course type program compLogic intl mscCS compLogic reg mscCS econ reg mscECO AdmittedIntl student course bob compLogic mary compLogic Deadline registration date noregst 1st Jul pre-enrol 30th Sept reg 31st Oct intl 31st Dec Registered student course bob compLogic alice econ
from the external world
for each process instance In(alice, compLogic, 1/11/2015)
Transition t Execution Condition Et
is reg. app.
𝑱𝒐 𝑻, 𝑫, 𝑼 , 𝑻𝒖𝒗𝒆𝒛𝑸𝒎𝒃𝒐 𝑫, 𝒔𝒇𝒉, 𝑸 , ¬𝑻𝒖𝒗𝒆𝒛𝑸𝒎𝒃𝒐(𝑫, 𝒋𝒐𝒖𝒎, 𝑸)
…
….
is intl. app. is reg. app. isn't admitted is admitted
early / reg. late early / intl. late
accept app. approve app. approve cond. complete app. register app. withdraw app. reject app.
end start
stud. decis. acad. check
register directly
𝑭𝒖 ∶ 𝑱𝒐 𝒕 9 , 𝑺𝟐 𝒗 <𝟐 , … , 𝑺𝒍 𝒗 <𝒍 , ¬𝑺𝒍?𝟐 𝒗 <𝒍?𝟐 , … , ¬𝑺𝒏 𝒗 <𝒏
is intl. app. is reg. app. isn't admitted is admitted
early / reg. late early / intl. late
accept app. approve app. approve cond. complete app. register app. withdraw app. reject app.
end start
stud. decis. acad. check
register directly
Transition t Writing Rule Wt
register app. …
….
𝑺𝒇𝒉𝒋𝒕𝒖𝒇𝒔 𝑻, 𝑫 ← 𝑱𝒐 𝑻, 𝑫, 𝑼 , 𝑻𝒖𝒗𝒆𝒛𝑸𝒎𝒃𝒐 𝑻, 𝒁, 𝑸
𝑿𝒖 ∶ 𝑺 𝒗 < ← 𝑱𝒐 𝒕 9 , 𝑺𝟐 𝒗 <𝟐 , … , 𝑺𝒍 𝒗 <𝒍 , ¬𝑺𝒍?𝟐 𝒗 <𝒍?𝟐 , … , ¬𝑺𝒏 𝒗 <𝒏
a writing rule is not a recursive rule
We allow an unbounded number of instances to:
The process instances are modeled by a pair I = (O,M) where
e.g.
process instance MIn MP
In(john, compLogic, 23/10/2014) start
In(nick, econ, 10/10/2014) end
In(bob, compLogic, 20/09/2014) end
M = O = = {ojo
john,
, oal
alice, , obo bob}
Two kinds of execution steps: Introduction and Traversal
The process only combines data from instances and database
Enabled: always
start start
Inp(John, EMCL, 05/06/2014@14:00
In(alice, compLogic, 12/12/2014)
9
Enabled: if D ∪ 𝑱𝒐 𝒕 9 ⊨ 𝑭𝒖 Effect: D += 𝑿𝒖 (D ∪ 𝑱𝒐 𝒕 9 )
cond: Et
action: Wt
cond: Et
action: Wt
Fresh data can be imported
Process instances share the same database (excluding input records) Database can only grow
is intl. app. is reg. app. isn't admitted is admitted
early / reg. late early / intl. late
accept app. approve app. approve cond. complete app. register app. withdraw app. reject app.
end start
stud. decis. acad. check
register directly
𝑱𝒐 𝑻, 𝑫, 𝑼 , 𝑻𝒖𝒗𝒆𝒛𝑸𝒎𝒃𝒐 𝑫, 𝒔𝒇𝒉, 𝑸 , ¬𝑻𝒖𝒗𝒆𝒛𝑸𝒎𝒃𝒐 𝑫, 𝒋𝒐𝒖𝒎, 𝑸 Execution Condition 𝑺𝒇𝒉𝒋𝒕𝒖𝒇𝒔 𝑻, 𝑫 ← 𝑱𝒐 𝑻, 𝑫, 𝑼 , 𝑻𝒖𝒗𝒆𝒛𝑸𝒎𝒃𝒐 𝑻, 𝒁, 𝑸 Writing Action Process Net
is intl. app. is reg. app. isn't admitted is admitted
early / reg. late early / intl. late
accept app. approve app. approve cond. complete app. register app. withdraw app. reject app.
end start
stud. decis. acad. check
register directly
Process Net
ids Instance record place
In(john, compLogic, 23/10/2014) start
In(nick, econ, 10/10/2014)
In(bob, compLogic, 20/09/2014) end
Running Instances Database Tables
Query 𝑹 is stable in MDBP B B with initial database instance D if for every execution in B that generates a database instance D’ D’ it holds 𝑹 D = 𝑹 D’ D’ * We analyze stability for (positive) Conjunctive Queries
Faculty(of(Economics % Sum 41,45% Faculty(of(Computer(Science % Sum <15,25% Enrollments 2014(/(2015 Enrollments 2015(/(2016 Bachelor)in)Economics)and)Management
231 279
Bachelor)in)Tourism,)Sport)and)Event)Management
153 267
74,51% Master)in)Entrepreneurship)and)Innovation
42 90
114,29% Bachelor)in)Economics)and)Social)Sciences
87 102
17,24% Bachelor)in)Computer)Science)and)Engineering)
115 150
30,43% Master)in)Economics)and)Management)of)the)public)sector
66 81
22,73%
579 819
Master)of)Science)in)Computer)Science
180 100
<44,44%
295 250
Enrollments 2014(/(2015 Enrollments 2015(/(2016 20,78%
Stable? YES! Stable? NO! YES! NO! YES! YES! YES! YES! YES!
relations are partitioned into read and write relations
Interaction: general - rowo
no negation (no “ ≠ ”, yes “X<5”)
Interaction: general - rowo Rules: normal - positive
Interaction: general - rowo Rules: normal - positive Net: cyclic - acyclic
instances can be arbitrarily distributed in the net
initially, there are no instances running
Interaction: general - rowo Rules: normal - positive Net: cyclic - acyclic Configuration: arbitrary - fresh
new process instances can start
Interaction: general - rowo Rules: normal - positive Net: cyclic - acyclic Configuration: arbitrary - fresh Semantics:
Interaction: general - rowo Rules: normal - positive Net: cyclic - acyclic Configuration: arbitrary - fresh Semantics:
1. simulating all possible executions of instances 2. extending the db by applying writing rules
3. running the given query on extended dbs, and comparing if new answer appears For a query 𝑹 and MDBP 𝓒 we construct a Datalog program 𝜬𝓒,𝑹 s.t.: 𝑹 is not stable in 𝓒 iff program 𝜬𝓒,𝑹 derives a test fact
Defining Restriction Optional Restriction Data Instance Process Query Combined
Defining Restriction Optional Restriction Data Instance Process Query Combined
There are infinitely many possible executions The database may grow in an unbounded way over time
Defining Restriction Optional Restriction Data Instance Process Query Combined –– ––
??
Defining Restriction Optional Restriction Data Instance Process Query Combined –– ––
Undec. Undec.
𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒇, 𝟐 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒅, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒇, 𝒈, 𝟏 , … … a b c 0 1 0
Defining Restriction Optional Restriction Data Instance Process Query Combined –– ––
Undec. Undec. Undec. Undec.
𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒇, 𝟐 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒅, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒇, 𝒈, 𝟏 , … … a b c 0 1 0
Defining Restriction Optional Restriction Data Instance Process Query Combined –– ––
Undec. Undec. Undec. Undec. Undec.
𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒇, 𝟐 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒅, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒇, 𝒈, 𝟏 , … … a b c 0 1 0
Defining Restriction Optional Restriction Data Instance Process Query Combined –– ––
Undec. Undec. Undec. Undec. Undec.
𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒇, 𝟐 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒅, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒇, 𝒈, 𝟏 , … … a b c 0 1 0
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒃, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒇, 𝟐 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒄, 𝒈, 𝟏 , … 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒅, 𝒇, 𝟏 , 𝒘𝒇𝒔𝒕𝒋𝒑𝒐 𝒇, 𝒈, 𝟏 , … … a b c 0 1 0
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
under stable model semantics with brave reasoning
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c co−NExpTime-c
under stable model semantics with brave reasoning (co−NExpTime)
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
𝐐-c in query size
(by encoding 3 coloring extension problem for graphs)
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive ––
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive ––
Abstraction Principle:
𝒃𝒆𝒑𝒏∗ = 𝒃𝒆𝒑𝒏 ∪ 𝒃𝟐, … , 𝒃𝒐
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive ––
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive ––
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive ––
PTIME-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive ––
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive closed
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive fresh, acyclic
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive clos / fr, acyc
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
closed, acyclic ––
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive clos / fr, acyc
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
closed, acyclic ––
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive clos / fr, acyc
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
closed, acyclic ––
in AC0 co-NP-c PSpace-c 𝚸𝟑
𝐐-c
PSpace−c
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive clos / fr, acyc
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
closed, acyclic positive
in AC0 co-NP-c PSpace-c 𝚸𝟑
𝐐-c
PSpace−c
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive clos / fr, acyc
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
closed, acyclic positive
in AC0 co-NP-c PSpace-c 𝚸𝟑
𝐐-c
PSpace−c
rowo *
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive clos / fr, acyc
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
closed, acyclic positive
in AC0 co-NP-c PSpace-c 𝚸𝟑
𝐐-c
PSpace−c
rowo *
in AC0 in AC0 𝚸𝟑
𝐐-c
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive clos / fr, acyc
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
closed, acyclic positive
in AC0 co-NP-c PSpace-c 𝚸𝟑
𝐐-c
PSpace−c
rowo *
in AC0 in AC0 co-NP-c 𝚸𝟑
𝐐-c
𝚸𝟑
𝐐-c
Defining Restriction Optional Restriction Data Instance Process Query Combined –– fresh, acyclic
Undec. Undec. Undec. Undec. Undec.
closed ––
co-NP-c co-NP-c co−NExpTime-c 𝚸𝟑
𝐐-c
co−NExpTime-c
positive clos / fr, acyc
PTIME-c co-NP-c ExpTime-c 𝚸𝟑
𝐐-c
ExpTime-c
closed, acyclic positive
in AC0 co-NP-c PSpace-c 𝚸𝟑
𝐐-c
PSpace-c
rowo *
in AC0 in AC0 co-NP-c 𝚸𝟑
𝐐-c
𝚸𝟑
𝐐−c
We already know that complexity jumps (ExpSpace-h)
E.g., how much (min/max) figures can change?