Title: Use Case: Composition
1Use Case Composition
- OWL-S applied to the
- Berardi-Hull
- problem
2Component Web Services
- op1 book the plane ticket
- op2 register for event
- op3 book a hotel room
- Problem Compose in ways corresponding to needs
of tourist, researcher, manager - Variations One-shot vs. reusable composition
3Representing service
define atomic process take_it_and_leave Inputs
Outputs okay - Boolean, carrier_there,
carrier_back - Airline, fnum_there -
Flight_num, occ_going - Flight_occ,
fnum_back - Flight_num, occ_returning -
Flight_occ Results -- continued below --
4ResultsBundling Conditions, Outputs, Effects
- results
- when (fl_there fl_back - Flight)
- (tightly_scheduled(fl_there, fl_back))
- available(fl_there, 1)
- available(fl_back, 1))
- -gt (exists (fl_there fl_back - Flight)
- tightly_scheduled(fl_there,
fl_back) - air_reserved(cust, fl_there)
- air_reserved(cust, fl_back))
- output okay true,
- carrier_there
fl_there.carrier, - carrier_back fl_back.carrier,
- fnum_there fl_there.num,
- fnum_back fl_back.num,
- occ_going fl_there.occ_desig,
- occ_back fl_back.occ_desig
Condition
Effect
Output
5Failure Case
- when ()
- (not (exists (fl_there fl_back - Flight)
- tightly_scheduled(fl_there,
fl_back)))) - output okay false
6Auxiliary Definition
- tightly_scheduled(fl_there, fl_back)
- iff (flight_departs_from(fl_there,
departure_place) - flight_lands_at(fl_there,
arrive_place) - flight_departs_from(fl_there,
arrive_place) - flight_lands_at(fl_there,
departure_place) - flight_depart_time(fl_there)
- max_over((? (fl1)
- flight_departs_from(
fl1, departure_place) -
flight_lands_at(fl1, arrive_place) -
flight_depart_time(fl1) lt date_leave), - flight_depart_time)
- flight_depart_time(fl_back)
- min_over((? (fl1)
- flight_departs_from(
fl1, departure_place) -
flight_lands_at(fl1, arrive_place) -
flight_arrive_time(fl1) gt date_back), - flight_depart_time))
7Hotel
- define atomic process book_hotel
- Inputs name_hotel String,
- place_hotel Location,
- date_leave, date_back Date
- Outputs okay - Boolean
- Results
- when (h - Hotel)
- name(h) name_hotel
- located(h, place_hotel)
- (forall (d Date)
- on_or_before(date_leave, d)
- before(d, date_back)
- -gt hotel_available(h, d))
- -gt hotel_reserved(cust, h,
- convex_hull(date_leave,
-
day_before(date_back))) - outputs okay true
- failure case okay false
8Goals Tourist
- reserved(emh, Pamplona_Run_04)
- exists (date - Time_interval)
- beg(date) day(start(Pamplona_Run_04))
- - 1 day
- end(date) day(start(Pamplona_Run_04))
- 1 day
- exists(h - Hotel)
- dist(h, Pamplona) lt 5 km
- cost_per_night(h) lt 100 Euro
- reserved(emh, Pamplona_Run_04)
- hotel_reserved(emh, h, date)
- exists(af - Air_flight)
- ...
9Goals Manager
- let e pi_meeting(miracle_intelligence,
qtr(2004,1)) - registered(rr, e)
-
- let ps set_of_all ((\\ (p) presentation(p)
- at_conf(p,
e) -
given_by(rr))) - ch set_of_all
- ((\\ (m) small_group_discussion(m)
- participant(m, rr)
- participant(m,
- Program-mgr
-
(miracle_intelligence)))) - --CONTINUED--
10Goals Manager (cont.)
-
-
- exists (intvl - Time_interval)
- beg(intvl) min(min_over
- (ps, (?(p)
beg(scheduled_time(p)))), - min_over
- (ch, (? (m)
beg(scheduled_time(m)))) - end(intvl)
- max(max_over
- (ps, (\\ (p)
beg(scheduled_time(p)))), - max_over
- (ch, (\\ (m)
beg(scheduled_time(m))))
11Goals Manager (cont.)
- exists (af_there af_back - Air_flight)
- ...
- af_there
- time (arg_max
- (? (f)
- before(arrival_time(f)
, - beg(intvl)))
- (? (f) beg(intvl)
- -
arrival_time(f))) - af_back ...
- exists (h - Hotel)
- for_all (beg_date end_date - Day)
- beg_date
- end_date
- -gt hotel_reserved
- (rr, h,
- convex_hull(beg_date,
end_date)))
12Okay, this looks hopelessly hairybut most of
it is pure computation(maxes, mins, etc.)
13Planning Paradigm
- Take goal of user agent and match it against
effects of services. - Preconditions become new goals the planner must
find services and inputs that achieve all the
outstanding goals. - Composition is automatic
14Tourist Case
Matches effect of book_hotel
- Goal is
- is Hotel ?h
- dist(?h, Pamplona) lt 5 km
- cost_per_night(?h) lt 100 Euro
- reserved(emh, Pamplona_Run_04)
- hotel_reserved(emh, ?h, date)
- is Air_flight ?af
- beg(?date) day(start(Pamplona_Run_04))
- - 1 day
- end(?date) day(start(Pamplona_Run_04))
- 1 day
- ...
Added to Conditions of book_hotel
15Where Did the Composition Happen?
- Multiple actions get instantiated, involving
multiple web services. - The order may be unimportant, or the Berardi-Hull
argument may play a role (not clear).
16Why Book Flights Ahead of Time?
Because you can? Better question Why sometimes
delay booking (e.g, use PriceLine?) First, we
have to make explicit the time-dependence of
prices. Second, we have to allow for
optimization of objective functions.
17Planning wrt Existing Composite Process
- Suppose an omnibus travel-agent process
advertises its process model - define composite process S4tP()
- participants customer // Plus the service
itself, of course - inputs
- outputs
- accept(open_session)
- send to customer (confirm_session)
- run_all
- parallel
-
- ---ticket process---
-
-
- iterate
-
- ---event-booking process
-
-
-
18- Approach Decompose composite into individual
control flows. - Introduce state where needed. Example
open_session puts us in session open state. - Each thread through the process becomes a series
of actions to plan with.