Nested T ransactions in a Logical Language fo r Active - - PowerPoint PPT Presentation

nested t ransactions in a logical language fo r active
SMART_READER_LITE
LIVE PREVIEW

Nested T ransactions in a Logical Language fo r Active - - PowerPoint PPT Presentation

Nested T ransactions in a Logical Language fo r Active Rules Bertram Lud ascher W olfgang Ma y Geo rg Lausen Institut f ur Info rmatik Universit at F reiburg Germany Overview Intro duction


slide-1
SLIDE 1 Nested T ransactions in a Logical Language fo r Active Rules Bertram Lud
  • ascher
W
  • lfgang
Ma y Geo rg Lausen Institut f ur Info rmatik Universit
  • at
F reiburg Germany Overview
  • Intro
duction Deductive vs Active Rules
  • Flat
Statelog and F riends Unifying Active and Deductive Rules
  • Pro
cedures and Nested T ransactions
  • Conclusion
and Outlo
  • k
  • LID
slide-2
SLIDE 2 Intro duction Deductive Rules ak a Datalog
  • p
  • w
erful query language decla rative semantics
  • IC
checking
  • static
description
  • f
the mo deled w
  • rld
  • no
supp
  • rt
fo r up dates and reactive b ehavio r Active Rules
  • reactive
b ehavio r esp eciallyup dates
  • view
maintenance IC enfo rcement monito ring applications
  • semantics
p redictabilit y
  • f
rule eects termination
  • a
Unied F ramew
  • rk
fo r Active and Deductive Rules Up date
  • Active
Rules
  • Logic
  • Datalog
  • X
  • LID
slide-3
SLIDE 3 Execution Mo del Datalog vs Statelog Queries Answ ers P
  • tcXY
  • S
D Datalog S
  • events
S f inal
  • actions
Queries Answ ers P
  • tcXY
  • delQX
  • delTXY
  • S
RX
  • S
insRX
  • S
D
  • S
  • D
  • S
  • nD
  • S
f inal D BOT EOT Flat Statelog
  • LID
slide-4
SLIDE 4 Flat Statelog Syntax UserDened Rules Queries S
  • tcXY
  • tcXZ
tcZY Integrit y Constraints S
  • ab
  • rt
  • Up
dates
  • empD
REFERENCES deptD ON DELETE CASCADE S
  • delempESalD
  • deldeptD
  • empESalD
SystemDened Rules F rame Rules S
  • RX
  • S
  • RX
not delRX S
  • RX
  • S
  • insRX
Integrit y Constraints S
  • ab
  • rt
  • insRX
delRX
  • LID
slide-5
SLIDE 5 Flat Statelog Semantics
  • Exp
ressive P
  • w
er Standa rd LP Semantics S
  • pX
  • S
  • not
qY
  • psuccSX
  • qSY
  • pX
  • qY
Exp ressivenessComplexit y
  • Flat
Statelog
  • WhilePFP
  • PSP
A CE
  • n
  • rdered
DBs
  • monotone
Statelog
  • Fixp
  • intLFP
  • PTIME
  • n
  • rdered
DBs termination gua ranteed
  • Gua
rded Statelog
  • Stratied
Datalog
  • PTIME
  • n
  • rdered
DBs Related App roaches XYDatalog Zaniolo Datalog S T emplog ChomickiBaudinet ELSDatalog KempRamamohana raoStuck ey Datalog
  • Abiteb
  • ulVianu
HeraclitusAlgC Ghandeha rizadeh etal
  • LID
slide-6
SLIDE 6 Flat Statelog Problems Hire emplo y ee E with sala ry Sal fo r depa rtment Dept p rovided the average sala ry after the up date do es not exceed a certain limit S
  • insempsalESalinsemp
depEDept S
  • checksalDept
  • S
  • hireE
Sal Dept S
  • check
  • k
  • checksalDept
avgDept Amt Amt
  • S
  • delempsalESaldelemp
depEDept
  • S
  • hireESalDept
S
  • not
check
  • k
Problems
  • Undoing
the eect
  • f
changes has to b e p rogrammed explicitly
  • There
is no structure which allo ws grouping
  • f
semantically closely related rules
  • The
eects
  • f
ephemeral up dates zanioloDOOD and hyp
  • thetical
up dates a re visible to
  • ther
rules since there is no encapsulation
  • group
rules into p ro cedures which execute as nested transactions
  • LID
slide-7
SLIDE 7 Pro cedures and Nested T ransactions
  • A
Statelog p ro cedure
  • is
a set
  • f
lo cal Statelog rules
  • A
p ro cedure
  • denes
a transaction T
  • at
runtime The b ehavio r
  • f
  • is
encapsu lated
  • If
  • calls
  • then
T
  • executes
as subtransaction
  • Simultaneously
called p ro cedures
  • and
  • execute
indep endently and in isolation
  • SubT
ransactions execute atomically allo rnothing
  • LID
slide-8
SLIDE 8 UserDened Rules Pro cedures p ro c
  • A
  • A
n
  • OI
  • I
k
  • M
O
  • O
l
  • initial
P initial
  • alw
a ys P al w ay s
  • nal
P f inal
  • endp
ro c O R
  • imp
  • rt
EDBIDB relation R M R
  • exp
  • rt
EDB relation R Rules Views S
  • V
  • X
  • V
  • I
D B P
  • Change
Requests S
  • ins
R
  • X
  • S
  • delR
  • X
  • R
  • E
D B P
  • S
  • mo
d R
  • X
  • X
  • Pro
cedure Calls S
  • X
  • P
r
  • cP
  • External
Actions S
  • A
  • X
  • A
  • Act
P
  • T
ransaction Control S
  • ab
  • rt
  • ab
  • rt
  • C
tl P
  • all
userdened rules a re lo cal
  • LID
slide-9
SLIDE 9 Nested T ransactions State Space F
  • F
n F
  • F
  • F
  • F
  • F
  • F
  • F
  • m
F
  • F
  • m
  • F
  • F
  • F
  • k
  • F
  • T
ransaction F rames F
  • F
  • F
  • States
F n
  • F
n
  • F
  • m
  • LID
slide-10
SLIDE 10 SystemDened Rules Deltas S
  • R
  • X
  • S
  • ins
R
  • X
  • not
EOT S
  • R
  • X
  • S
  • R
  • X
  • not
delR
  • X
  • not
EOT
  • Proto
col Relations S
  • insd
R
  • X
  • S
  • ins
R
  • X
  • not
EOT S
  • insd
R
  • X
  • S
  • insd
R
  • X
  • not
delR
  • X
  • not
EOT S
  • deldR
  • X
  • S
  • del
R
  • X
  • not
EOT S
  • deldR
  • X
  • S
  • deld
R
  • X
  • not
insR
  • X
  • not
EOT Control S
  • running
  • S
  • ins
R
  • X
  • not
R
  • X
  • S
  • running
  • S
  • delR
  • X
  • R
  • X
  • S
  • EOT
  • S
  • BOT
not running
  • S
  • EOT
  • S
  • running
  • not
ab
  • rt
  • S
  • not
running
  • Pro
cedures S
  • X
  • BOT
  • S
  • X
  • S
  • committed
  • X
  • S
  • X
  • S
  • X
N
  • EOT
not ab
  • rt
S
  • ab
  • rted
  • X
  • S
  • X
  • S
  • X
N
  • EOT
ab
  • rt
  • LID
slide-11
SLIDE 11 Statelog Compilation and T ermination
  • Statelog
p rograms P can b e directly translated into logic p rograms with function symb
  • ls
S
  • RX
  • S
  • insPY
QXY
  • RS
  • X
  • insPS
  • Y
QS
  • XY
stateS
  • Denition
  • f
states state
  • stateS
  • X
  • S
  • X
  • stateS
  • stateS
  • aliveS
  • if
nitely many states a re created b y P
  • E
D B
  • E
B Event Base then P terminates
  • aliveS
  • BOTS
  • aliveS
  • runningS
  • not
EOTS
  • In
every frame F
  • there
is at most
  • ne
state F n st MP
  • E
D B
  • E
B
  • j
  • EOTF
n
  • LID
slide-12
SLIDE 12 Example revisited p ro c hireESalDept O empsalemp dep Mempsalemp dep initial new empESalDept
  • checksalDept
  • alw
a ys ab
  • rt
ab
  • rtedchecksalDept
endp ro c p ro c new empESalDept M empsalemp dep initial insempsalESal
  • insemp
depEDept
  • endp
ro c p ro c checksalDept Oemp depempsal initial ab
  • rt
avgDeptAmt not Amt endp ro c
  • LID
slide-13
SLIDE 13 Statelog Conclusion and Outlo
  • k
Statelog
  • decla
rative semantics fo r active rules and up dates
  • classes
  • f
terminating active rules
  • increased
exp ressive p
  • w
er checking and enfo rcing
  • f
static and dynamic ICs
  • Integration
and fo rmalization
  • f
nested transactions i Logic p rogramming semantics ii Kripk est yle semantics fo rmalizes the conceptual mo del
  • f
nested transactions in Statelog Outlo
  • k
  • Exp
ressive p
  • w
er with nested transactions
  • Goalo
riented evaluation
  • Implementation
  • Reasoning
ab
  • ut
transactions P
  • E
D B
  • E
B
  • j
  • I
C fo r all E B and all E D B reachable via P
  • LID
slide-14
SLIDE 14 Statelog Kripk e Structures Def A Statelog Kripk e structure
  • ver
signature
  • is
a tuple K
  • G
  • A
Q R S
  • U
  • M
P
  • where
G is a set
  • f
states A actions is a set
  • f
p ro cedure names Q S
  • G
  • A
  • U
  • G
  • a
re t w
  • ma
rk ed accessibilit y relations b et w een states rep resenting the p ro cedurecall resp return relation Qg
  • x
g
  • the
rst state
  • f
the subtransaction induced b y
  • x
is g
  • S
g
  • x
  • g
  • g
  • is
the nal state
  • f
the subtransaction induced b y
  • x
in g
  • results
  • f
subtransactions a re communicated via S R
  • G
  • G
mo dels the temp
  • ral
successo r relation U is the universe
  • f
elements M maps states to rsto rder interp retations P is a function which maps every g
  • G
to a set
  • f
lo cal rules the rules visible in g
  • LID
slide-15
SLIDE 15 Statelog Kripk e Structures
  • R
R R R R R R R R Q Q S S
  • LID
slide-16
SLIDE 16 Statelog Kripk e Structures Theo rem Adequacy
  • EDB
relations a re changed exactly via requests
  • Every
state contains all requests contributed b y subtransactions
  • IDB
relations a re derived lo cally b y userdened rules
  • Requests
a re derived b y userdened rules
  • r
contributed b y subtransactions
  • In
all states the p roto col relations contain all nonrevok ed changes
  • f
the co rre sp
  • nding
subtransactions
  • LID