From DB-nets to Coloured Petri Nets with Priorities
Marco Montali and Andrey Rivkin
KRDB Research Centre for Knowledge and Data Free University of Bozen-Bolzano, Italy
.KRDB
3From DB-nets to Coloured Petri Nets with Priorities 1 / 22
From DB-nets to Coloured Petri Nets with Priorities Marco Montali - - PowerPoint PPT Presentation
From DB-nets to Coloured Petri Nets with Priorities Marco Montali and Andrey Rivkin KRDB Research Centre for Knowledge and Data Free University of Bozen-Bolzano, Italy . KRDB 3 From DB-nets to Coloured Petri Nets with Priorities 1 / 22
From DB-nets to Coloured Petri Nets with Priorities 1 / 22
From DB-nets to Coloured Petri Nets with Priorities 2 / 22
◮ Petri nets: enrich PNs with some form of data that accounts for, e.g.,
◮ Databases: enrich DBs with actions
From DB-nets to Coloured Petri Nets with Priorities 3 / 22
From DB-nets to Coloured Petri Nets with Priorities 4 / 22
◮ ∆D – a value domain (could be infinite!) ◮ ΓD – a finite set of predicate symbols ◮ Examples: string = S, {=s}, int = Z, {=int, <int, succ} From DB-nets to Coloured Petri Nets with Priorities 4 / 22
◮ ∆D – a value domain (could be infinite!) ◮ ΓD – a finite set of predicate symbols ◮ Examples: string = S, {=s}, int = Z, {=int, <int, succ}
From DB-nets to Coloured Petri Nets with Priorities 4 / 22
◮ ∆D – a value domain (could be infinite!) ◮ ΓD – a finite set of predicate symbols ◮ Examples: string = S, {=s}, int = Z, {=int, <int, succ}
◮ VD – “normal” variables ◮ ΥD – fresh variables (a la ν-PNs) ◮ unbounded variables in the output arc expressions account for
From DB-nets to Coloured Petri Nets with Priorities 4 / 22
◮ ∆D – a value domain (could be infinite!) ◮ ΓD – a finite set of predicate symbols ◮ Examples: string = S, {=s}, int = Z, {=int, <int, succ}
◮ VD – “normal” variables ◮ ΥD – fresh variables (a la ν-PNs) ◮ unbounded variables in the output arc expressions account for
From DB-nets to Coloured Petri Nets with Priorities 4 / 22
From DB-nets to Coloured Petri Nets with Priorities 5 / 22
From DB-nets to Coloured Petri Nets with Priorities 6 / 22
◮ “get all products available in the warehouse and whose price has been
◮ “get all registered users”
◮ “get all bonus holders”
From DB-nets to Coloured Petri Nets with Priorities 7 / 22
From DB-nets to Coloured Petri Nets with Priorities 8 / 22
◮ Like in STRIPS planning ◮ Follow the order ⇒ avoid situations in which one fact is both added
◮ If an action application result violates database constraints ⇒ rollback! From DB-nets to Coloured Petri Nets with Priorities 8 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 9 / 22
From DB-nets to Coloured Petri Nets with Priorities 10 / 22
From DB-nets to Coloured Petri Nets with Priorities 10 / 22
From DB-nets to Coloured Petri Nets with Priorities 10 / 22
From DB-nets to Coloured Petri Nets with Priorities 10 / 22
From DB-nets to Coloured Petri Nets with Priorities 11 / 22
From DB-nets to Coloured Petri Nets with Priorities 11 / 22
From DB-nets to Coloured Petri Nets with Priorities 12 / 22
◮ A view place Users is equipped with query Qusers
From DB-nets to Coloured Petri Nets with Priorities 13 / 22
◮ AcquireBonus and ChangeBonus have actions assigned to them
From DB-nets to Coloured Petri Nets with Priorities 13 / 22
From DB-nets to Coloured Petri Nets with Priorities 14 / 22
From DB-nets to Coloured Petri Nets with Priorities 14 / 22
From DB-nets to Coloured Petri Nets with Priorities 14 / 22
From DB-nets to Coloured Petri Nets with Priorities 14 / 22
From DB-nets to Coloured Petri Nets with Priorities 14 / 22
◮ External libraries allow to fully account for actions, view places and DB
◮ We also know how to tame the infinity achieving decidabiluty of
From DB-nets to Coloured Petri Nets with Priorities 15 / 22
◮ The content of view places is changed by actions and not properly
From DB-nets to Coloured Petri Nets with Priorities 15 / 22
◮ The content of view places is changed by actions and not properly
From DB-nets to Coloured Petri Nets with Priorities 15 / 22
From DB-nets to Coloured Petri Nets with Priorities 16 / 22
◮ UCQs= correspond to SELECT-FROM-WHERE SQL queries ◮ PKs, FKs and domain constraints are just easy to manage
From DB-nets to Coloured Petri Nets with Priorities 16 / 22
. . .
1
2
3
4
From DB-nets to Coloured Petri Nets with Priorities 17 / 22
input places Tenter Lock Entered binding net Bound Tcancel P_Low Tcond P_High [G(~ y)] GuardOk update net Updated
relation places . . . check constraints net
no-op places ConstrOk ConstrViol consume net undo net DoRollback DoCommit Trollback Tcommit
rollback places ~ z ~ z ~ z h~ z, ~ xi ~ z h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi h~ z, ~ xi ~
r ~ x1 ~ xm ~ z h~ z, ~ xi h~ z, ~ xi
From DB-nets to Coloured Petri Nets with Priorities 18 / 22
From DB-nets to Coloured Petri Nets with Priorities 19 / 22
From DB-nets to Coloured Petri Nets with Priorities 19 / 22
Bonus Holders P change (uid, bt, bt′, u) Change Bonus uid, cid, bt uid, cid uid, bt′ change(uid, bt, bt′): · change·del = {WithBonus(uid, bt′)} · change·add = {WithBonus(uid, bt)}
Bonus Holders Change Bonus WithBonus D1 DoneD1 ExistsD1 P High NotExistsD1 P Low A1 DoneA1 NotExistsA1 P Low ExistsA1 P High P ξ := uid, cid, bt uid, cid, bt uid, bt′ ξ ξ ξ true false uid, bt′ ξ ξ ξ ξ false true
i d , b t
sid, tid uid, bt
From DB-nets to Coloured Petri Nets with Priorities 20 / 22
Bonus Holders P change (uid, bt, bt′, u) Change Bonus uid, cid, bt uid, cid uid, bt′ change(uid, bt, bt′): · change·del = {WithBonus(uid, bt′)} · change·add = {WithBonus(uid, bt)}
Bonus Holders Change Bonus WithBonus D1 DoneD1 ExistsD1 P High NotExistsD1 P Low A1 DoneA1 NotExistsA1 P Low ExistsA1 P High P ξ := uid, cid, bt uid, cid, bt uid, bt′ ξ ξ ξ true false uid, bt′ ξ ξ ξ ξ false true
i d , b t
sid, tid uid, bt
From DB-nets to Coloured Petri Nets with Priorities 20 / 22
Bonus Holders P change (uid, bt, bt′, u) Change Bonus uid, cid, bt uid, cid uid, bt′ change(uid, bt, bt′): · change·del = {WithBonus(uid, bt′)} · change·add = {WithBonus(uid, bt)}
Bonus Holders Change Bonus WithBonus D1 DoneD1 ExistsD1 P High NotExistsD1 P Low A1 DoneA1 NotExistsA1 P Low ExistsA1 P High P ξ := uid, cid, bt uid, cid, bt uid, bt′ ξ ξ ξ true false uid, bt′ ξ ξ ξ ξ false true
i d , b t
sid, tid uid, bt
From DB-nets to Coloured Petri Nets with Priorities 20 / 22
Bonus Holders P change (uid, bt, bt′, u) Change Bonus uid, cid, bt uid, cid uid, bt′ change(uid, bt, bt′): · change·del = {WithBonus(uid, bt′)} · change·add = {WithBonus(uid, bt)}
Bonus Holders Change Bonus WithBonus D1 DoneD1 ExistsD1 P High NotExistsD1 P Low A1 DoneA1 NotExistsA1 P Low ExistsA1 P High P ξ := uid, cid, bt uid, cid, bt uid, bt′ ξ ξ ξ true false uid, bt′ ξ ξ ξ ξ false true
i d , b t
sid, tid uid, bt
From DB-nets to Coloured Petri Nets with Priorities 20 / 22
WithBonus WrongValue P High [bt = 50/ ∧ bt = 15eur ∧ bt = extra item] NoWrongValue P Low P
ConstrViol uid, cid, bt uid, cid, bt uid, cid, bt uid, cid uid, bt A DoneA DoRevertA SkipRevertA DoRollBack P’ ξ ξ uid, cid, bit uid, cid, bit false true uid, bit ξ ξ ξ ξ From DB-nets to Coloured Petri Nets with Priorities 21 / 22
WithBonus WrongValue P High [bt = 50/ ∧ bt = 15eur ∧ bt = extra item] NoWrongValue P Low P
ConstrViol uid, cid, bt uid, cid, bt uid, cid, bt uid, cid uid, bt A DoneA DoRevertA SkipRevertA DoRollBack P’ ξ ξ uid, cid, bit uid, cid, bit false true uid, bit ξ ξ ξ ξ
From DB-nets to Coloured Petri Nets with Priorities 21 / 22
From DB-nets to Coloured Petri Nets with Priorities 22 / 22
◮ Modelling and analyzing data-intensive applications in CPN Tools ◮ Study concurrency in databases ◮ Implement the translation in the DB-net extension ◮ Add more support for different types of integrity constraints ◮ Make our state-space abstraction technique operational in CPN Tools From DB-nets to Coloured Petri Nets with Priorities 22 / 22
From DB-nets to Coloured Petri Nets with Priorities 23 / 22