Presentation is loading. Please wait.

Presentation is loading. Please wait.

Constraints for Service Contracts Ugo Montanari Università di Pisa, Italy Marzia Buscemi formerly IMT Lucca, Italy Mario Coppo Università di Torino, Italy.

Similar presentations


Presentation on theme: "Constraints for Service Contracts Ugo Montanari Università di Pisa, Italy Marzia Buscemi formerly IMT Lucca, Italy Mario Coppo Università di Torino, Italy."— Presentation transcript:

1 Constraints for Service Contracts Ugo Montanari Università di Pisa, Italy Marzia Buscemi formerly IMT Lucca, Italy Mario Coppo Università di Torino, Italy Mariangiola Dezani Università di Torino, Italy CINA Kick-off Meeting Pisa, February 4-6, 2013

2 What if the hotel is booked on the wrong date? Example airline date2 client date1date2 flight room date2 date 1 hotel date1date2 2

3 Negotiation: the two partners search for an agreement Commit: if an agreement is found Execution: the interaction is carried on according to the agreement In a constraint-based approach: Negotiation: constraint combination (for every pair of partners) Commit: existence of a constraint solution Monitored Execution: via guards (harmful branches are avoided) Negotiate-Commit-Execute 3

4 Declarative knowledge: knowledge as data, model checking, theorem proving, nondetermism, logic programming with backtracking, constraint logic programming Procedural knowledge: knowledge as programs, program execution, operational semantics, indeterminism Declarative & procedural knowledge: committed choice languages, deep and shallow guards, ask & tell constraint programming Compile time vs. execution time:  Classical: model check, compile, assert using declarative knowledge; execute using procedural knowledge  Autonomic: mix proving properties with procedural execution Declarative vs. Procedural Knowledge 4

5 Source calculus (Possibly recursive) clients with nested calls Services offering finite interactions Target calculus: source calculus + constraints expressing which communication branches can be taken Compilation: from source to target calculus Client and server commit if the union of their constraints is consistent Results: soundness and completeness Contribution 5

6 Source Client Processes P :: =0inert process □.Pservice call ■.Pcall end α!.Paction P + P choice rec p.Precursion precursive variables Source Client T = □.P Source Service Processes Q :: = α?.Qaction Q + Q choice ● service end Source Service S = ◊.Q Source calculus: syntax 6

7 Source calculus: semantics client □. flight!. □. room!. (date1_r!. ■. date1_f!. ■ + date2_r!. ■. date2_f!. ■ ) 7

8 Source calculus: semantics client □. flight!. □. room!. (date1_r!. ■. date1_f!. ■ + date2_r!. ■. date2_f!. ■ ) airline ◊. flight?. date2_f?. ● 8

9 Source calculus: semantics client flight!. □. room!. (date1_r!. ■. date1_f!. ■ + date2_r!. ■. date2_f!. ■ ) airline flight?. date2_f?. ● 9

10 Source calculus: semantics client □. room!.(date1_r!. ■. date1_f!. ■ + date2_r!. ■. date2_f!. ■ ) airline date2_f?. ● 10

11 Source calculus: semantics client □. room!.(date1_r!. ■. date1_f!. ■ + date2_r!. ■. date2_f!. ■ ) ◊. room?. (date1_r?. ● + date2_r?. ● ) airline hotel date2_f?. ● 11

12 Source calculus: semantics client room!.(date1_r!. ■. date1_f!. ■ + date2_r!. ■. date2_f!. ■ ) room?. (date1_r?. ● + date2_r?. ● ) airline hotel date2_f?. ● 12

13 Source calculus: semantics client (date1_r!. ■. date1_f!. ■ + date2_r!. ■. date2_f!. ■ ) (date1_r?. ● + date2_r?. ● ) airline hotel date2_f?. ● 13

14 Source calculus: semantics client ■. date1_f!. ■ ● airline hotel date2_f?. ● 14

15 Source calculus: semantics client date1_f!. ■ airline date2_f?. ● 15

16 Source calculus: semantics client date1_f!. ■ airline date2_f?. ● Deadlock 16

17 A constraint is a set of ground assignments of all variables to terms of the signature  = { α(), end | α an action } Examples: x=y, x=α(β(y)), x=end. Variables not mentioned are assigned in all possible ways The set of all constraints forms a named constraint semiring with  c  d = c  d  c  d = c  d  0 =   1 = the set of all ground assignments  x.c = { s[h/x] | h a ground term} Constraints 17

18 Target Client Processes P :: =0inert process □.Pservice call ■.Pcall end α!.Paction check c 1.P 1, check c 2.P 2 choice rec x p.Rrecursion p recursive variables R :: =(X)c|Pconstrained process Target Client T = (X)c | □.P Target Service Processes Q :: = α?.Qaction Q + Q choice ● service end Target Service S = (X)c | ◊.Q Target calculus: syntax 18

19 Analogous to the source semantics, apart from taking into account constraints. Guards block harmful branches A service call is executed only if client and service constraints guarantee at least a successful interaction Target calculus: semantics 19

20 Source processes are compiled into target processes. The compilation adds constraints which represent all the possible interactions offered. Stuck interactions are excluded at commit time. Compilation is independent of the set of available services. Compilation 20

21 Constraints client ( room:date1 AND flight:date1 ) OR ( room:date2 AND flight:date2 ) room:date1 OR room:date2 airline hotel flight:date2 21

22 Negotiation client ( room:date1 AND flight:date1 ) OR ( room:date2 AND flight:date2 ) room:date1 OR room:date2 airline hotel flight:date2 22

23 Commit client ( room:date1 AND flight:date1 ) OR ( room:date2 AND flight:date2 ) room:date1 OR room:date2 airline hotel flight:date2 23

24 Stuck-freedom: Given a target client and a set of target services, if an agreement exists then the computation terminates with no deadlock. Soundness and Completeness: A source client and a set of source services can have a successful interaction iff their compilations in the target calculus can have an agreement. Results 24

25 Generalising to Soft Constraint Logic Programming Client/service interactions would be given a weight Reduction rules will take into account weights in order to allow only interactions that maximise client’s satisfaction. Future work 25


Download ppt "Constraints for Service Contracts Ugo Montanari Università di Pisa, Italy Marzia Buscemi formerly IMT Lucca, Italy Mario Coppo Università di Torino, Italy."

Similar presentations


Ads by Google