Verification of Web Services Jianwen Su University of California, - - PowerPoint PPT Presentation

verification of web services
SMART_READER_LITE
LIVE PREVIEW

Verification of Web Services Jianwen Su University of California, - - PowerPoint PPT Presentation

Verification of Web Services Jianwen Su University of California, Santa Barbara The Verification Problem Given a web service/composition/choreography/workflow/ a goal do all executions satisfy the goal? ? = Choices for


slide-1
SLIDE 1

Verification of Web Services

Jianwen Su University of California, Santa Barbara

slide-2
SLIDE 2

2009/6/6 School of Formal Methods 2

Given

a web service/composition/choreography/workflow/… a goal ϕ

do all executions satisfy the goal? Choices for and ϕ

The Verification Problem

⎥=

ϕ ?

slide-3
SLIDE 3

2009/6/6 School of Formal Methods 3

Outline

Motivations Transitions systems BPEL services and compositions Choreographies (of BPEL services) Artifact-centric workflow Concluding remarks

⎥=

ϕ ?

slide-4
SLIDE 4

2009/6/6 School of Formal Methods 4

Software Systems in the Real World

Wide range of applications: Web stores, e-tailors, … Accounting, financial systems, … Automated flight control, … Patient profiles, cases, care records, … Governments: local, federal, courts, prisons, … … Challenges: Interoperation & integration Design and analysis Improvements (evolution)

slide-5
SLIDE 5

2009/6/6 School of Formal Methods 5

Web Services: Standardization

The Web: Flexible human-software interaction Web services: Flexible software-software interaction SAAS: Software As A Service A working definition: software services accessible via

standardized protocols

SOA: a potential basis for software system design,

interoperation, integration, …

Lots of interest in trade press, academic community,

standards bodies, . . .

Applications in e-commerce, telecom, science,

cloud, government, education, . . .

slide-6
SLIDE 6

2009/6/6 School of Formal Methods 6

Fundamental Elements (WS Apps)

Process: a collection of actions to be taken in a

meaningful manner (sequential, parallel, conditional, …)

Communication or messages: different software

systems need to cooperate, collaborate

Data: guide the actions to be taken and processes to

follow

Actors (human, external environment): their reasoning

for making decisions may not be captured in the logic specification/running systems

slide-7
SLIDE 7

2009/6/6 School of Formal Methods 7

Research Challenges (Biz Workflows)

Models: process, data, messages, actors Analysis and verification Integration/interoperation Improvements

(biz intelligence, operation optimization, …)

Management of workflows and executions

slide-8
SLIDE 8

2009/6/6 School of Formal Methods 8

Goal of This Talk

Focus on analysis & verification problem Depending on models A sampler of verification problems, approaches and

results

slide-9
SLIDE 9

2009/6/6 School of Formal Methods 9

Outline

Motivations Transitions systems BPEL services and compositions Choreographies (of BPEL services) Artifact-centric workflow Concluding remarks

⎥=

ϕ ?

slide-10
SLIDE 10

2009/6/6 School of Formal Methods 10

Transition Systems

A finite transition system (Kripke structure) is a tuple

T = (S, I, R, L) where

a finite set of states

S

a set of initial states

I ⊆ S

a transition relation

R ⊆ S × S

a labeling function

L : S → 2P

P : a set of atomic propositions

slide-11
SLIDE 11

2009/6/6 School of Formal Methods 11

Example

P = {q1, q2, q3}

s0 FFF s1 TFF s3 TTF s4 FTT s2 FTF s5 TTT s6 TTF s7 FFT

L(s3) = {q1, q2}

slide-12
SLIDE 12

2009/6/6 School of Formal Methods 12

Runs (Execution Paths)

Given a finite transition system T = (S, I, R, L) A run is an infinite sequence of states

Z = s0s1s2 ⋅ ⋅ ⋅

where for each i ≥ 0, (si, si+1) ∈ R

s0s1s2s3s5s1s2 …

s0 FFF s1 TFF s3 TTF s4 FTT s2 FTF s5 TTT s6 TTF s7 FFT

slide-13
SLIDE 13

2009/6/6 School of Formal Methods 13

Linear Temporal Logic (LTL)

A set P of atomic propositions: q1, q2, q3, … Logical connectives: ∧, ∨, ¬ Temporal operators: X ϕ : ϕ is true in the next state G ϕ : ϕ is true in every state ψ U ϕ : ψ is true in every state before the state ϕ is

true

F ϕ : ϕ is true in some future state

X: next G: always U: until F: eventually

Example: G (money → F food)

slide-14
SLIDE 14

2009/6/6 School of Formal Methods 14

Semantics of Temporal Operators

Truth value of a formula is defined on runs Propositional connectives have the usual meaning Temporal operators:

X: next G: always U: until F: eventually F q1 ≡ true U q1 G q1 ≡ ¬F¬q1

q1 q1 U q2 X q1 G q1 q1 q1 q1 q1 q1 q1 F q1 ⋅ ⋅ ⋅ q1 q1 q2 q1 q1 q1 q1 q1 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅

⋅ ⋅ ⋅

slide-15
SLIDE 15

2009/6/6 School of Formal Methods 15

LTL Semantics

A state is a set of propositions A run Z=s0s1s2⋅⋅⋅ satisfies an LTL formula: Z⎟= q

if s0⎟= q or q ∈ L(s0)

Z⎟= ¬ϕ

if Z⎟≠ ϕ

Z⎟= ϕ∧ψ

if Z⎟= ϕ and Z⎟= ψ

Z⎟= ϕ∨ψ

if Z⎟= ϕ or Z⎟= ψ

Z⎟= X ϕ

if s1s2⋅⋅⋅⎟= ϕ

Z⎟= G ϕ

if for each i, sisi+1⋅⋅⋅⎟= ϕ

Z⎟= F ϕ

if for some i, sisi+1⋅⋅⋅⎟= ϕ

Z⎟= ψ U ϕ if for some i, sisi+1⋅⋅⋅⎟= ϕ and

for each j < i, sjsj+1⋅⋅⋅⎟= ψ

slide-16
SLIDE 16

2009/6/6 School of Formal Methods 16

Transition Systems and LTL

A transition system T satisfies an LTL formula ϕ if

every run of T satisfies ϕ

F q3

G(¬q3 → X q3)

s0 FFF s1 TFF s3 TTF s4 FTT s2 FTF s5 TTT s6 TTF s7 FFT

slide-17
SLIDE 17

2009/6/6 School of Formal Methods 17

Verifying LTL Properties

Problem: given a transition system T, an LTL formula ϕ,

determine if ϕ is satisfied by T (i.e. every run of T)

A decision algorithm:

  • 1. Construct a Büchi automaton B¬ϕ equivalent to ¬ϕ
  • 2. Explore (depth-first search) simultaneously T and

B¬ϕ,

if a repeat is found involving a final state of B¬ϕ,

halt and output “no” (with the found path) Otherwise, output “Yes” (T satisfies ϕ)

slide-18
SLIDE 18

2009/6/6 School of Formal Methods 18

Büchi Automata

P is a (finite) set of propositions A Büchi automaton is a tuple B = (Q, I, δ, F) where Q is a finite set of states I ⊆ Q is a (nonempty) set of initial states F ⊆ Q is a set of final states δ ⊆ Q × 2P × Q is a transition relation Essentially nondeterministic finite state automata but

accepting infinite words:

A word in (2P)ω is accepted if final states are entered

infinitely often The language of B, L(B), is the set of words accepted

slide-19
SLIDE 19

2009/6/6 School of Formal Methods 19

An Example

q0 q1

{q1}, {q2} {q2} {q2}

slide-20
SLIDE 20

2009/6/6 School of Formal Methods 20

LTL to Büchi Automata

A Büchi automaton B is equivalent to an LTL formula ϕ:

an infinite sequence Z satisfies ϕ iff Z ∈ L(B)

For each LTL formula ϕ, one can construct a Büchi

automaton Bϕ equivalent to ϕ

Number of states in Bϕ is 2O(|ϕ|) Emptiness of a Büchi automaton can be determined in

O(n) where n is the number of states

[Merz MOVEP 2001]

slide-21
SLIDE 21

2009/6/6 School of Formal Methods 21

Model Checking

T : a transition system, ϕ : an LTL formula

  • 1. Construct a Büchi automaton B¬ϕ equivalent to ¬ϕ
  • 2. Explore (depth-first search) simultaneously T and B¬ϕ,

if a repeat is found involving a final state of B¬ϕ,

halt and output “no” (the trace is the counter example) Otherwise, output “Yes” (T satisfies ϕ)

Complexity: O(2O(|ϕ|)|T|) time, PSPACE

[Merz MOVEP 2001]

slide-22
SLIDE 22

2009/6/6 School of Formal Methods 22

Outline

Motivations Transitions systems BPEL services and compositions Choreographies (of BPEL services) Artifact-centric workflow Concluding remarks

⎥=

ϕ ?

slide-23
SLIDE 23

2009/6/6 School of Formal Methods 23

Business Process Execution Language

Allow specification of compositions of Web services business processes as coordinated interactions of

Web services

Allow abstract and executable processes Influences from Traditional flow models Structured programming Successor of WSFL and XLANG Assumes WSDL ports OASIS standard

slide-24
SLIDE 24

2009/6/6 School of Formal Methods 24

Illustrating a BPEL Service

〈invoke ⋅⋅⋅ 〉 〈receive ⋅⋅⋅ 〉 〈assign〉 ⋅⋅⋅ 〈reply ⋅⋅⋅ 〉

slide-25
SLIDE 25

2009/6/6 School of Formal Methods 25

BPEL to Transition Systems

Translate each atomic activity to a transition system

with single entry, single exit

〈receive …

  • peration = “approve”

variable = “request” /〉

?approve_Out request := approve_Out

〈invoke

  • peration=“approve”,

invar="request“,

  • utvar=“aprvInfo” 〉

〈catch faultname=“loanfault“〉 〈 ... handler1 ... /〉 〈/catch〉 〈/invoke〉

handler1

?approve_Out approve_In := request; !approve_In aprvInfo := approve_Out

[Fu-Bultan-S. WWW ’04]

loanfault

Treat actions as propositions

slide-26
SLIDE 26

2009/6/6 School of Formal Methods 26

BPEL to Transition Systems

〈sequence〉 〈… activity1 …/〉 〈… activity2 …/〉 〈/sequence〉 〈flow〉 〈activity1 …〉 〈source linkname = “link1”…/〉 〈/activity1〉 〈activity2 …〉 〈target linkname = “link1”/〉 〈/activity2〉 〈/flow〉

Control flow constructs: assemble pieces of transition

systems

activity1 activity2 activity2 activity1

X disallow the orders prohibited by the link

[Fu-Bultan-S. WWW ’04]

slide-27
SLIDE 27

2009/6/6 School of Formal Methods 27

S: a BPEL service, P: a set of propositions,

ϕ: an LTL formula

Determine if every execution of S satisfies ϕ Algorithm:

  • 1. Construct a transition system TS,P
  • 2. Determine if TS,P satisfies ϕ

Complexity: O(2O(|ϕ|)|S|) time Good news but Control states (flow) only, no variables/data Single service, no composition

Verifying BPEL Services

slide-28
SLIDE 28

2009/6/6 School of Formal Methods 28

Adding Data

BPEL allows variables to hold XML documents Bad news (folklore):

BPEL is Turing (computationally) complete

Immediate consequence:

It is undecidable if a given BPEL service satisfies a given LTL formula

One possible restriction: limit variables to finite domains: the number of possible values is finite

slide-29
SLIDE 29

2009/6/6 School of Formal Methods 29

Finite Domain Variables

Represent variable contents explicitly through states Transition states increased by nm times:

n : (max) domain size, m : number of variables

Complexity of verification: O(2O(|ϕ|)|S|nm) time

ϕ : LTL formula, S : BPEL service

?quantity ?quantity = 1

. . .

?quantity = 2 ?quantity = 15

[Fu-Bultan-S. ISSTA ’04]

slide-30
SLIDE 30

2009/6/6 School of Formal Methods 30

Composition of BPEL Services

Peer to peer Mediated or

hub-and-spoke

report Investor Research Dept. Stock Broker accept, reject, bill request, terminate register, ack, cancel Investor Research Dept. Stock Broker Mediator

slide-31
SLIDE 31

2009/6/6 School of Formal Methods 31

store

Synchronous Messaging Model

Two specific actions: Send a message (!) Receive a message (?)

!authorize

bank

?authorize !ok ?ok

<invoke>:

request-response …

<invoke>:

request

<receive>:

response synchronization

slide-32
SLIDE 32

2009/6/6 School of Formal Methods 32

Product with Synchronous Messaging

Two services Their synchronous product as a transition system:

a1, a2 !r1 !r2 ?a1 ?a2 !e

1 2

r1, r2 e ?r2 !a1 !a2 ?e ?r1

4 3 2 1

requester server 11 24 e 12 13 r1 r2 a1 a2

slide-33
SLIDE 33

2009/6/6 School of Formal Methods 33

Product with Synchronous Messaging

In general, the composition of k BPEL services with

synchronous messaging can be modeled as a transition system with rk states where

r is the (max) number of states in a single service Complexity of verification: O(2O(|ϕ|)(|S|nm)k) time ϕ : LTL formula |S| : size of a BPEL service n : domain size m : number of variables in a BPEL service k : number of BPEL services

slide-34
SLIDE 34

2009/6/6 School of Formal Methods 34

Two specific actions: Send a message (!) Receive a message (?) FIFO queues are used to buffer unconsumed messages One queue per service for incoming messages

store

Asynchronous Messaging

!authorize

bank

?authorize !ok ?ok

〈invoke〉:

request-response …

〈invoke〉:

request

〈receive〉:

response

[Bultan-Fu-Hull-S. WWW ’03]

slide-35
SLIDE 35

2009/6/6 School of Formal Methods 35

Verification is Undecidable

Finite state automata with FIFO queues are Turing

complete

[Brand-Zafiropulo JACM’83]

Immediate consequence:

Verification problem is undecidable

One possible restriction: bound queue size

slide-36
SLIDE 36

2009/6/6 School of Formal Methods 36

Bounded Queues & Finite State Automata

Observation: a bounded length queue has a finite

number of states

Asynchronous + bounded queue can be simulated Note: Only focus on message types not content

!a

a b a

?a

… …

!b

… …

?b

synchronize

?a

… …

b

!a

… …

slide-37
SLIDE 37

2009/6/6 School of Formal Methods 37

BPEL with Asynchronous Messaging

Number of states for queues: el, where

e : number of message types, l : queue length bound

With message contents: elnl, where n is domain size Complexity of verification: O(2O(|ϕ|)(|S|nmelnl)k) time ϕ : LTL formula |S| : size of a BPEL service n : domain size m : number of variables in a BPEL service k : number of BPEL services

slide-38
SLIDE 38

2009/6/6 School of Formal Methods 38

Summary of Verifying BPEL Services

Focus on decidability boundary of LTL properties

  • f BPEL + compositions (synchronous, bounded

queue asynchronous messaging)

Verification algorithms: map to exiting verifiers Model checker: SPIN [Fu-Bultan-S. 2003-4] [Nakajima

2004], [Pistore-Traverso-et al 2005]

Process algebras: LTSA [Foster-Uchitel-Magee-

Kramer 2003],

CWB [vanBreugel-Koshkina 2004] [Salaun-Bordeaux-Schaef

2004], LOTOS [Ferara 2004][Salaun-Ferara-Chirichiello 2004]

ASM: [Farahbod-Classer-Vajihollahj 2004][Deutsch-Sui-

Vianu 2004] [Fahland-Reisig 2005]

slide-39
SLIDE 39

2009/6/6 School of Formal Methods 39

Outline

Motivations Transitions systems BPEL services and compositions Choreographies (of BPEL services) Artifact-centric workflow Concluding remarks

⎥=

ϕ ?

slide-40
SLIDE 40

2009/6/6 School of Formal Methods 40

Composition: Common Topologies

Peer-to-peer Mediated, or

“hub and spoke”

report Investor Research Dept. Stock Broker accept, reject, bill request, terminate register, ack, cancel Investor Research Dept. Stock Broker Mediator

slide-41
SLIDE 41

2009/6/6 School of Formal Methods 41

Orchestration vs Choreography

SOAP OWL-S ServiceProfile XML Messaging (Individual) Service Description WSCL WSDL Composition BPEL Choreography WS-CDL OWL-S ServiceModel

slide-42
SLIDE 42

2009/6/6 School of Formal Methods 42

WS Choreography Definition Language

Specification of choreography Model complex business protocol (e.g. order

management) to enable interoperability

Generate computational logic of individual collaborating

participants

Key concepts Collaborating participants: role, relationship,

participants

Information driven collaboration: channel, activities,

workunit, choreography

Standardization through W3C (Version 1.0: December

2004)

slide-43
SLIDE 43

2009/6/6 School of Formal Methods 43

Composition: BPEL and WS-CDL

BPEL

WS-CDL Focus on local actions Focus on global behaviors

report Investor Research Dept. Stock Broker accept, reject, bill request, terminate register, ack, cancel Investor Research Dept. Stock Broker Mediator

slide-44
SLIDE 44

2009/6/6 School of Formal Methods 44

Composition: BPEL and WS-CDL

BPEL

WS-CDL Focus on local actions Focus on global behaviors

  • rchestration

Choreography report Investor Research Dept. Stock Broker accept, reject, bill request, terminate register, ack, cancel Investor Research Dept. Stock Broker Mediator

For “hub and spoke”, the difference is small

For “peer-to-peer”, the concept of choreography is interesting and not well understood

slide-45
SLIDE 45

2009/6/6 School of Formal Methods 45

Verification and analysis of choreography Focus on the conversation model

Automated Design: Top-down vs Bottom-up

specification of global behaviors specification of individual services

Top-down Bottom-up

e.g., WS-CDL e.g., BPEL

  • rchestration

Choreography report Investor Research Dept. Stock Broker accept, reject, bill request, terminate register, ack, cancel

slide-46
SLIDE 46

2009/6/6 School of Formal Methods 46

Verification of choreography of a WS (BPEL) composition Services: finite transition systems on messaging actions Unbounded FIFO queues for messages Choreography: message sequences (send only) How to model? LTL on choreography

Verification of WS Choreography

[Fu-Bultan-S. WWW’04, ISSTA’04]

report Investor Research Dept. Stock Broker accept, reject, bill request, terminate register, ack, cancel

slide-47
SLIDE 47

2009/6/6 School of Formal Methods 47

An Example: Stock Analysis Service (SAS)

Three peers: Investor, Stock Broker, and Research Dept

Inv initiates the stock analysis service by sending a

register message to SB

SB may accept or reject the registration If the registration is accepted, SB sends an analysis

request to the RD

RD sends the results of the analysis directly to the Inv

as a report

After receiving a report Inv can either send an ack to SB

  • r cancel the service

Then, SB either sends the bill for the services to Inv, or

continues the service with another analysis request

slide-48
SLIDE 48

2009/6/6 School of Formal Methods 48

SAS Composition

SAS is a web service composition a finite set of peers: Inv, SB, RD, and a finite set of message classes: register, ack, cancel,

accept, ...

report Investor (Inv) Research Dept. (RD) Stock Broker (SB) register accept request terminate ack cancel reject bill

slide-49
SLIDE 49

2009/6/6 School of Formal Methods 49

Asynchronous Messaging

We assume that the messages among the peers are

exchanged through reliable and asynchronous messaging

FIFO and unbounded message queues This model is similar to industry efforts such as JMS (Java Message Service) MSMQ (Microsoft Message Queuing Service)

req Stock Broker (SB) Research Dept. (RD) req

slide-50
SLIDE 50

2009/6/6 School of Formal Methods 50

Mealy Service Model

Finite state control Acts on a finite set of message classes Transitions are based on receiving a message ?m or

sending a message !m

report

Investor (Inv) Research Dept. (RD) Stock Broker (SB)

register, ack, cancel accept, reject, bill request, terminate !register ?reject ?accept ?report !ack !cancel ?bill ?bill [Bultan-Fu-Hull-S. WWW’03]

slide-51
SLIDE 51

2009/6/6 School of Formal Methods 51

req reg ack ?register !reject !accept !request ?ack ?cancel !bill !terminate !bill !register ?reject ?accept ?report !ack !cancel ?bill ?bill

Investor Stock Broker Firm Research Dept.

acc rep

Composite Mealy Service Execution

bill ter ?request ?terminate !report

Execution halts if All Mealy services are

in final states, and

All queues are empty

slide-52
SLIDE 52

2009/6/6 School of Formal Methods 52

Conversations and Conversation Protocols

Conversation: a message sequence A conversation protocol specifies the set of desired

conversations

1 2 3 4 6 5 7 10 9 12 11

register reject terminate accept request report ack request report ack cancel bill cancel bill terminate Investor (Inv) Research Dept. (RD) Stock Broker (SB) report request, terminate register, ack, cancel accept, reject, bill

8

slide-53
SLIDE 53

2009/6/6 School of Formal Methods 53

bill

Conversations of Composite Services

A virtual watcher records the messages as they are sent

Watcher

A conversation is a sequence of messages the watcher

sees in a successful run (or enactment)

Conversation language: the set of all possible

conversations

What properties do conversation languages have?

register accept request report

Investor (Inv) Research Dept. (RD) Stock Broker (SB)

ack rep acc bil reg ack req ter terminate

slide-54
SLIDE 54

2009/6/6 School of Formal Methods 54

Conversation Languages Are Not Regular

?b !a p1 p2 ?a !b a b

The set of conversations CL ∩ a∗b∗ = anbn Conversation languages are not always regular Some may not even be context free Causes: asynchronous communication &

unbounded queue

Bounded queues or synchronous: CL always regular CLs are always context sensitive

slide-55
SLIDE 55

2009/6/6 School of Formal Methods 55

Remarks

Communicating finite state machines with queues are

computationally Turing complete

Conversation languages ≠ tracing execution states Why regular languages? They would allow static analysis, e.g. model checking Testing and debugging in SOA are harder Queue v.s. no queue: design time decision!

slide-56
SLIDE 56

2009/6/6 School of Formal Methods 56

Two Key Questions

Is the composition of (BPEL) services “correct”? Verify conversations Automated design of services from the desired

conversation protocol?

report

Investor (Inv) Research Dept. (RD) Stock Broker (SB)

register ack, cancel accept, reject, bill request, terminate

slide-57
SLIDE 57

2009/6/6 School of Formal Methods 57

Temporal Properties of Conversations

The notion of conversation enables reasoning about

temporal properties of the composite web services

Extend LTL extends naturally to conversations LTL temporal operators

X (neXt), U (Until), G (Globally), F (Future)

Atomic properties

Predicates on message classes (or contents)

Example:

G (accept → F bill)

Verification problem: Given an LTL property, does the

conversation language (i.e. every conversation) satisfy the property?

slide-58
SLIDE 58

2009/6/6 School of Formal Methods 58

Given a composition of services, does its CL satisfy the

LTL properties?

Problem: the general case is undecidable

[Brand-Zafiropulo JACM’83]

Design Scenario 1: Bottom Up

!msg1 ?msg2

Input Queue

...

Conversation

⎟= G(msg1 → F(msg3 ∨ msg5))

?

Peer A

?msg6 !msg5 !msg3 ?msg4

Peer B

!msg6 ?msg1 !msg2 ?msg3 !msg4

Peer C

?msg5

slide-59
SLIDE 59

2009/6/6 School of Formal Methods 59

Design Scenario 2: Top Down

Specify the global messaging behavior explicitly as a

conversation protocol

Determine if the conversations allowed by the protocol

satisfy LTL properties

Problem: the conversation protocol may not be

realizable

Conversation Protocol

A→B: msg1 B→A: msg2 B→C: msg3 C→B: msg4 B→C: msg5 B→A: msg6

C B A

⎟= G(msg1 → F(msg3 ∨ msg5))

?

slide-60
SLIDE 60

2009/6/6 School of Formal Methods 60

Approaches

(Bottom up) verification is undecidable Approach 1: check if the conversations using

bounded queue satisfy LTL property —partial verification

Approach 2: sufficient condition for bounded queue

CL = unbounded queue CL —synchronizablility

(Top down) protocol may be unrealizable Approach 3: sufficient condition for realizability

slide-61
SLIDE 61

2009/6/6 School of Formal Methods 61

Realizability Problem

Not all conversation protocols are realizable!

A→B: m1 C→D: m2

Conversation protocol

!m1 ?m1 !m2 ?m2

Peer A Peer B Peer C Peer D

Conversation “m2 m1” will be generated by any legal peer

implementation which follows the protocol

Projection of the conversation protocol to the peers

slide-62
SLIDE 62

2009/6/6 School of Formal Methods 62

Another Non-Realizable Protocol

m3 m1 m2

A B C

m1 m2 m3

A B C Generated conversation:

m1 m2 m3

m1AB m2BA m3AC m2BA m1AB ?m1 !m2 ε !m2 ?m1

B A

!m1 ?m2 !m3 ?m2 !m1 ε ?m3

C

ε ε ε

Conversation protocol

slide-63
SLIDE 63

2009/6/6 School of Formal Methods 63

A Sufficient Condition for Realizability

Three parts for realizability (contentless messages) Lossless join

Conversation protocol should be equal to the “join” of its projections to each peer

Synchronous compatible

When the projections are composed synchronously, there should not be a state where a peer is ready to send a message while the corresponding receiver is not ready to receive

Autonomous

Each peer should be able to make a deterministic decision on whether to send or to receive or to terminate

[Fu-Bultan-S. CIAA ’03]

slide-64
SLIDE 64

2009/6/6 School of Formal Methods 64

Bottom-Up Approach

Given a composition of web services, check if its

conversations satisfy some LTL properties

General problem is undecidable due to asynchronous

communication (with unbounded queues)

Naïve idea: limit the queue length Problem 1: only partial verification, unless we are

lucky

Problem 2: state size explosion

slide-65
SLIDE 65

2009/6/6 School of Formal Methods 65

a1, a2

Example 1: Regular CL, Bounded Queues

requester server

!r2 ?a1 ?a2 !e !r1 r1, r2 e ?r2 !a1 !a2 ?e ?r1

Conversation language is regular: (r1a1 | r2a2)∗ e During every halting run two queues are bounded

slide-66
SLIDE 66

2009/6/6 School of Formal Methods 66

a1, a2

Example 2: Not Regular, Unbounded

!r1 !r2 ?a1 ?a2 !e

requester

r1, r2 e

server

?r2 !a1 !a2 ?e ?r1

Conversation language is not regular Queues are not bounded

slide-67
SLIDE 67

2009/6/6 School of Formal Methods 67

Conversation language is regular: (r1 | r2 | ra)∗ e Queues are not bounded

Example 3: Regular, Unbounded

requester server

!r1 !r2 !e ?a !r ?r1 ?r2 ?e !a ?r a r, r1, r2 e

slide-68
SLIDE 68

2009/6/6 School of Formal Methods 68

Three Examples

Verification of Examples 2 and 3 are difficult even if we

bound the queue length

How can we distinguish Examples 1 and 3 (with

regular conversation languages) from 2?

Synchronizability Analysis

queue length # of states x 103

200 400 600 800 1000 1200 1400 1600 1 3 5 7 9 1 1 1 3

Example 1, regular, bounded Example 2, not regular, unbounded Example 3, regular, unbounded

slide-69
SLIDE 69

2009/6/6 School of Formal Methods 69

Synchronizability Analysis

A composite web service is synchronizable, if its

conversation language does not change

when asynchronous communication with unbounded

queues is replaced with synchronous communication

  • r bounded queues

A composite web service is synchronizable, if it satisfies

the synchronous compatible and autonomous conditions

[Fu-Bultan-S. WWW’04]

slide-70
SLIDE 70

2009/6/6 School of Formal Methods 70

Are These Conditions Too Restrictive?

yes

6 7 5 Cauction

yes

7 7 6 StarLoan

collaxa.com (Oracle) yes

10 9 9 Auction

yes

6 6 6 Loan

yes

3 3 2 shipping

BPEL spec yes

15 10 8 AMAB

no

8 5 8 Haggle

yes

6 5 5 Buy

yes

5 4 2 Chat

no

6 4 4 MetaConv

yes

4 4 4 CvSetup

IBM Conv. Support Project yes

15 12 9 SAS

ISSTA’04

#trans. #states #msg

Name Source Synchronizable? Size Problem Set

slide-71
SLIDE 71

2009/6/6 School of Formal Methods 71

Summary

Verification of choreography is intricate Choreography of composition may not be regular

and does not fall into natural formal language classes

Must be concerned with the realizability problem Realizability and verification on conversations with

Mealy machines [Fu-Bultan-S. 2003-6]

Realizability on process algebras, choreography

languages [many, 2005-]

slide-72
SLIDE 72

2009/6/6 School of Formal Methods 72

Outline

Motivations Transitions systems BPEL services and compositions Choreographies (of BPEL services) Artifact-centric workflow Concluding remarks

⎥=

ϕ ?

slide-73
SLIDE 73

2009/6/6 School of Formal Methods 73

Workflow (Business Process)

A bookseller example: Traditional control-centric model

ID Customer Shipping Preference Payment information Confirmation Archive Fill Shopping Cart

slide-74
SLIDE 74

2009/6/6 School of Formal Methods 74

Workflow (Business Process)

A bookseller example: Traditional control oriented model Multiple steps needed for each activity

ID Customer Shipping Preference Payment information Confirmation Archive Fill Shopping Cart

Credit PayPal Check

Hard to reason, find useful views: missing data

In practice, 100s to 1000s of nodes

Check Inventory In-stock Handling Back-order Handling Existing Customer Login New Customer Registration Air Warehouses/ Size Ground

slide-75
SLIDE 75

2009/6/6 School of Formal Methods 75

Business Intelligence: Data View

Extract-Transform-Load

cust_db catalog inventory

Data Warehouse

Analysis workflow activities

workflow is missing!

Transactions Transactions Transactions

slide-76
SLIDE 76

2009/6/6 School of Formal Methods 76

Business Artifacts !

A business artifact is a key conceptual business entity

that is used in guiding the operation of the business

fedex package delivery, patient visit, application form,

insurance claim, order, financial deal, registration, …

both “information carrier” and “road-maps” Very natural to business managers and BP modelers Includes two parts: Information model:

data needed to move through workflow

Lifecycle:

possible ways to evolve

slide-77
SLIDE 77

2009/6/6 School of Formal Methods 77 Guest Check

Artifacts

Kitchen Order Receipt Cash Balance

Open GCs Archived KOs Closed GCs Archived GCs Pending Receipts Archived Receipts Cash Balance Pending KOs Paid Receipts Disagreed Receipts Ready KOs

Add Item Deliver Prepare & Test Quality Create Guest Check Prepare Receipt Update Cash Balance Payment Recalculate Receipt

Example: Restaurant

slide-78
SLIDE 78

2009/6/6 School of Formal Methods 78

Prepare Receipt

Guest Check

Artifacts

Kitchen Order Receipt Cash Balance

Open GCs Archived KOs Closed GCs Archived GCs Pending Receipts Archived Receipts Cash Balance Pending KOs Paid Receipts Disagreed Receipts Ready KOs

Add Item Deliver Prepare & Test Quality Create Guest Check

GC KO

Update Cash Balance Payment Recalculate Receipt

RC CB

Example: Restaurant

slide-79
SLIDE 79

2009/6/6 School of Formal Methods 79

Emerging Artifact-Centric BPs

Informal model [Nigam-Caswell IBM Sys J 03] Systems: BELA (IBM 2005), Siena (IBM 2007) Formal models State machines

[Bhattacharya-Gerede-S. SOCA 07] [Gerede-S. ICSOC 07]

Rules [Bhattacharya-Gerede-Hull-Liu-S. BPM 07]

customer info cart

. . .

Artifacts (Info models)

Specification of artifact lifecycles

+

slide-80
SLIDE 80

2009/6/6 School of Formal Methods 80

A Logical Artifact Model for BPs

A variation of [Bhattacharya-Gerede-Hull-Liu-S. BPM 07] [Hull-S. 09] (in preparation)

Artifacts (info models)

+

Semantic services (IOPEs)

+

if C enable …

Condition- action

slide-81
SLIDE 81

2009/6/6 School of Formal Methods 81

Given a workflow and a goal, do all executions of the

workflow satisfy the goal?

[Bhattacharya-Gerede-S. SOCA 07] [Gerede-S. ICSOC 07] [Bhattacharya-Gerede-Hull-Liu-S. BPM 07] [Deutsch-Hull-Patrizi-Vianu ICDT 09] [Vianu ICDT 09]

Verification Problem

Artifacts (Info models)

+

Semantic services (IOPEs)

+

if C enable …

Condition- action

⎥= ϕ

?

slide-82
SLIDE 82

2009/6/6 School of Formal Methods 82

Given a goal and a set of services, construct a set of

rules so that every execution satisfies the goal

[Fritz-Hull-S. ICDT 09]

(restricted to single artifact, first-order goals)

+ + ϕ

Goal (FO)

?

Synthesis Problem

if C enable …

Artifact (Info model) Semantic services (IOPEs) Condition- action

slide-83
SLIDE 83

2009/6/6 School of Formal Methods 83

Workflow Schema

A workflow schema is a triple

W = ( Γ, S, R )

Γ : a set of artifacts classes (artifact schema) S : a set of (semantic) services R : a set of condition-action rules

slide-84
SLIDE 84

2009/6/6 School of Formal Methods 84

A First-Order Logic + Structure

Assuming some first order logic L with a fixed structure U is the universe Existence of an infinite set of artifact IDs Existence of an infinite set of attributes

slide-85
SLIDE 85

2009/6/6 School of Formal Methods 85

Artifact Classes

An artifact class consists of a finite set of attributes, of type U or artifacts IDs a finite set of states, initial and final states

(transitions not defined)

An artifact is a pair: a mapping from attributes to U ∪ IDs ∪ {⊥} a state

GuestCheck Artifact

GCID date time Name KOID table# TOTAL Payment ptime

Waiting for table Seated Ordered Completed Delivered

slide-86
SLIDE 86

2009/6/6 School of Formal Methods 86

Artifacts in a Workflow

During runtime, each artifact class in Γ may have a

finite set of artifacts

The union I of sets of artifacts must be closed under

“cross-referencing”

slide-87
SLIDE 87

2009/6/6 School of Formal Methods 87

(Semantic) Services

A service has a precondition and effects, conditions on Attribute values Defined-ness of attribute values Equality of artifact IDs An attribute holds the ID of a newly created artifact

SERVICE SeatingGuests WRITE: {x: GuestCheck} READ:

{x: GuestCheck, y: Table}

PRE-CONDITION:

¬Defined(x.table#) ∧ ¬Defined(y.GCID)

EFFECTS:

  • Defined(x.table#) ∧ Seated(x)
  • ¬Defined(x.table#) ∧ Waiting4table(x)
slide-88
SLIDE 88

2009/6/6 School of Formal Methods 88

Another Example

σ 0 ≤ A ≤ 2 0 ≤ A < 1 ∧ 0 ≤ B ∨ 1 ≤ A ≤ 2 ∧ 1 ≤ B A B

slide-89
SLIDE 89

2009/6/6 School of Formal Methods 89

(Semantic) Services

A (semantic) service is a tuple (σ, R, W, π, ρ), where σ is a task name R, W are finite sets of (resp., read, write) artifacts π, ρ are quantifier-free formulas (pre- and post-

condition, resp.) over attributes of artifacts in R, R ∪

W, resp.

allow Defined(A) for an attribute A I′ is the result of executing σ on I, I → I′, if (I, I′)⎟= π ∧ ρ, and frame conditions are satisfied

σ

slide-90
SLIDE 90

2009/6/6 School of Formal Methods 90

Condition-Action Rules

Rules that define business logic Invoke a service Change artifact states

states are used to organize the processing

if Waiting4Table(x) enable SeaingGuest(x) if Defined(x.GCID) ∧ Defined(x.GCID.table#) change state to Taken(x) ∧ Seated(x.GCID)

slide-91
SLIDE 91

2009/6/6 School of Formal Methods 91

A condition-action rule is an expression of form

“if ϕ enable σ” or “if ϕ change state to φ” or where

ϕ is a (quantifier-free) formula σ is a semantic service φ is a state changing formula I′ is the result of executing a rule r : if ϕ … on I, I → I′,

if

I⎟= ϕ, and I → I′ or I, I′ only differ on states as specified

Condition-Action Rules

r σ

slide-92
SLIDE 92

2009/6/6 School of Formal Methods 92

Workflow Schema

A workflow schema is a triple W = (Γ, S, R) Γ : artifact schema S : a finite set of semantic services R : a finite set of condition-action rules Denote → the closure of ∪ →

r ∈ R ∗ r

slide-93
SLIDE 93

2009/6/6 School of Formal Methods 93

Given a workflow and a goal, do all executions of the

workflow satisfy the goal?

[Bhattacharya-Gerede-Hull-Liu-S. BPM 07] [Deutsch-Hull-Patrizi-Vianu ICDT 09]

Verification Problem

Artifacts (Info models)

+

Semantic services (IOPEs)

+

if C enable …

Condition- action

⎥= ϕ

?

slide-94
SLIDE 94

2009/6/6 School of Formal Methods 94

Analysis Problems

An artifact system W = ( Γ, S, R )

artifacts, services, rules

Completion:

Does W allow a complete run of some artifact?

Dead-end:

Does W have a dead-end path?

Attribute redundancy:

Does W have a redundant attribute? No attribute value comparisons

[Bhattacharya-Gerede-Hull-Liu-S. BPM 07]

slide-95
SLIDE 95

2009/6/6 School of Formal Methods 95

Results

The problems are undecidable

Primary reason: workflow language is Turing complete

If we disallow creation of new artifacts Initial: if each artifact has only initial attributes

defined The analysis problems are PSPACE-complete

even for a single artifact Consider only a single artifact

[Bhattacharya-Gerede-Hull-Liu-S. BPM 07]

slide-96
SLIDE 96

2009/6/6 School of Formal Methods 96

Monotonic Workflow

Once an attribute is assigned a value, it cannot be

changed

For monotonic services:

Complexity ranging from linear to intractable under various conditions

[Bhattacharya-Gerede-Hull-Liu-S. BPM 07]

slide-97
SLIDE 97

2009/6/6 School of Formal Methods 97

Completion (Monotonic Workflow)

Linear time if Services are deterministic (single effect) Preconditions has no negation Rule conditions are positive and does not check state

information

NP-complete if the above conditions are slightly relaxed

(single artifact)

[Bhattacharya-Gerede-Hull-Liu-S. BPM 07]

slide-98
SLIDE 98

2009/6/6 School of Formal Methods 98

Dead-End & Redundancy (Monotonic Workflow)

Checking if there is a dead end path is Π2-complete,

even with various restrictions

Checking redundant attributes is co-NP-complete, even

with various restrictions (single artifact)

p

[Bhattacharya-Gerede-Hull-Liu-S. BPM 07]

slide-99
SLIDE 99

2009/6/6 School of Formal Methods 99

Three Analysis Problems: Review

An artifact system W = ( Γ, S, R )

artifacts, services, rules

Completion: Does W allow a complete run of an artifact? Dead-end: Does W have a dead-end path? Attribute redundancy: Does W have a redundant

attribute?

Undecidable in general, PSPACE if no artifact creation,

intractable for monotonic workflows

[Bhattacharya-Gerede-Hull-Liu-S. BPM 07]

Ad hoc properties, restricted to defined-ness How to verify LTL properties?

[Deutsch-Hull-Patrizi-Vianu ICDT 09]

slide-100
SLIDE 100

2009/6/6 School of Formal Methods 100

Adding Infinite States to Artifacts

An artifact is a pair: a mapping from attributes to U ∪ IDs ∪ {⊥} a state relation

ItemNo Qty cookingReq Table#

GuestCheck Artifact

GCID date time Name KOID table# TOTAL Payment ptime

Waiting for table Seated Ordered Completed Delivered

Items

slide-101
SLIDE 101

2009/6/6 School of Formal Methods 101

Services Can Update State Relations

Model operations on artifacts updates of the artifact attributes insertions/deletions in artifact states Insertions & updates can draw values from … current artifacts, state relations external inputs (by programs or humans),

computation that returns new values

slide-102
SLIDE 102

2009/6/6 School of Formal Methods 102

Service Specification

Consists of

pre-condition: a Boolean query on current snapshot of

artifact system

post-condition : constraints on the updated artifacts for each state relation, state insertion/deletion rules specify tuples to add to (remove from) state relations Defined as queries (over current snapshot)

queries, constraints: FO logic formulas

slide-103
SLIDE 103

2009/6/6 School of Formal Methods 103

LTL(FO) to Express Properties

LTL with propositions replaced by FO formulas

(statements on individual snapshots)

Classic LTL temporal operators

X p p holds in next snapshot p U q p is true in every snapshot until q is F p p is eventually true G p p is always true

Example (with slight abuse of notation) :

G ¬(¬Defined(table#) ∧∃z Items(z))

The domain is dense order without endpoints

slide-104
SLIDE 104

2009/6/6 School of Formal Methods 104

Verification Problem

In general, it is undecidable [Deutsch-Hull-Patrizi-Vianu ICDT 09] Need restrictions to turn it into decidable

ItemNo Qty cookingReq Table#

GuestCheck Artifact

GCID date time Name KOID table# TOTAL Payment ptime

Items

Services

⎥= ϕ

?

LTL(FO)

slide-105
SLIDE 105

2009/6/6 School of Formal Methods 105

Guarded FO

Guarded FO formulas restrict quantifications:

∃x ϕ(x) ⇒ ∃x (A(...,x,...) ∧ ϕ(x)) ∀x ϕ(x) ⇒ ∀x (A(...,x,...) → ϕ(x)) A(...,x,...) : x is an attribute value and x cannot appear

in any state atoms in ϕ

All formulas used to update states are guarded FO Guarded LTL(FO): only allow guarded FO formulas Originated from input boundedness of [Spielmann 2003]

[Deutsch-Hull-Patrizi-Vianu ICDT 09]

slide-106
SLIDE 106

2009/6/6 School of Formal Methods 106

Guardedness is a Serious Limitation

Not guarded:

G ¬(¬Defined(table#) ∧∃z Items(z))

Guarded:

G ¬(¬Defined(table#) ∧ Items(fish, 1, x, 12))

slide-107
SLIDE 107

2009/6/6 School of Formal Methods 107

Decidability Result

It can be decided in PSPACE if a guarded artifact schema

satisfies a (guarded) LTL(FO)

Actually complete in PSPACE

[Deutsch-Hull-Patrizi-Vianu ICDT 09]

slide-108
SLIDE 108

2009/6/6 School of Formal Methods 108

Summary

Biz workflow a very promising application area for WS—

tremendous impact (potentially)

Analysis is hard but could be helped with modeling

choices

Artifact-centric workflow models: right intuition and

positive experiences in practice (IBM)

“Report on 2009 NSF Workshop on Data Centric

Workflows” dcw2009.cs.ucsb.edu

More than 20 contributors, experts from CS, MIS,

digital government, healthcare, scientific workflow

slide-109
SLIDE 109

2009/6/6 School of Formal Methods 109

Concluding Remarks

WS analysis and verification is important & interesting Modeling Design Current results: a good starting point SOA themes are yet to emerge, many open issues

related to analysis

Dynamic analysis

slide-110
SLIDE 110

2009/6/6 School of Formal Methods 110

Acknowledgements

Collaborators: Tevfik Bultan (U C Santa Barbara) Xiang Fu (Hofstra University) Richard Hull, Kamal Bhatacharya, Rong Liu (IBM TJ

Watson)

Others: Victor Vianu, Alin Deutsch (UCSD) Fabio Patrizi (U of Rome)

slide-111
SLIDE 111

2009/6/6 School of Formal Methods 111

References

  • K. Bhattacharya, C. Gerede, R. Hull, R. Liu, and J. Su: Towards Formal Analysis of Artifact-Centric Business Process Models. BPM

2007: 288-304

  • D. Brand and P. Zafiropulo: On Communicating Finite-State Machines. J. ACM 30(2): 323-342 (1983)
  • T. Bultan, X. Fu, R. Hull, and J. Su: Conversation specification: a new approach to design and analysis of e-service composition. WWW

2003: 403-410

  • A. Deutsch, R. Hull, F. Patrizi, and V. Vianu: Automatic verification of data-centric business processes. ICDT 2009: 252-267
  • A. Deutsch, L. Sui, and V. Vianu: Specification and Verification of Data-driven Web Services. PODS 2004: 71-82
  • D. Fahland and W. Reisig: ASM-based Semantics for BPEL: The Negative Control Flow. Abstract State Machines 2005: 131-152
  • R. Farahbod, U. Glässer, and M. Vajihollahi: Specification and Validation of the Business Process Execution Language for Web
  • Services. Abstract State Machines 2004: 78-94
  • A. Ferrara: Web services: a process algebra approach. ICSOC 2004: 242-251
  • H. Foster, S. Uchitel, J. Magee, J. Kramer: Model-based Verification of Web Service Compositions. ASE 2003: 152-163
  • C. Fritz, R. Hull, and J. Su: Automatic construction of simple artifact-based business processes. ICDT 2009: 225-238
  • X. Fu, T. Bultan, and J. Su: Conversation Protocols: A Formalism for Specification and Verification of Reactive Electronic Services.

CIAA 2003: 188-200

  • X. Fu, T. Bultan, and J. Su: Analysis of interacting BPEL web services. WWW 2004: 621-630
  • X. Fu, T. Bultan, and J. Su: Model checking XML manipulating software. ISSTA 2004: 252-262
  • C. Gerede and J. Su: Specification and Verification of Artifact Behaviors in Business Process Models. ICSOC 2007: 181-192
  • C. Gerede, K. Bhattacharya, and J. Su: Static Analysis of Business Artifact-centric Operational Models. SOCA 2007: 133-140
  • M. Koshkina and F. van Breugel: Modelling and verifying web service orchestration by means of the concurrency workbench. ACM

SIGSOFT Software Engineering Notes 29(5): 1-10 (2004)

  • S. Merz: Model Checking: A Tutorial Overview. MOVEP 2000: 3-38
  • S. Nakajima: Model-Checking of Safety and Security Aspects in Web Service Flows. ICWE 2004: 488-501
  • A. Nigam and N. Caswell: Business artifacts: An approach to operational specification. IBM Systems Journal 42(3): 428-445 (2003)
  • M. Pistore, P. Traverso, P. Bertoli, and A. Marconi: Automated Synthesis of Composite BPEL4WS Web Services. ICWS 2005: 293-301
  • G. Salaun, L. Bordeaux, and M. Schaerf: Describing and Reasoning on Web Services using Process Algebra. ICWS 2004: 43-51
  • G. Salaun, A. Ferrara, and A. Chirichiello: Negotiation Among Web Services Using LOTOS/CADP. ECOWS 2004: 198-212
  • M. Spielmann: Verification of relational transducers for electronic commerce. J. Comput. Syst. Sci. 66(1): 40-65 (2003)
  • V. Vianu: Automatic verification of database-driven systems: a new frontier. ICDT 2009: 1-13