390 likes | 545 Views
Web Services (WS). Background. Web Services are Web-accessible programs and devices. RULE-ML (Logic). DAML+OIL (Ontology). RDFS (RDF Schema). RDF (Resource Description Framework). XML Schema.
E N D
Web Services (WS) Background Web Services are Web-accessible programs and devices.
RULE-ML (Logic) DAML+OIL (Ontology) RDFS (RDF Schema) RDF (Resource Description Framework) XML Schema XML (Extensible Markup Language) Background Knowledge Rep’n for the “Semantic Web”
Broad Objective 1. Self-describing Web Services: • semantic markup to enable automation by making • service capabilities, user constraints & procedures • computer-interpretable & use-apparent. 2. Automation of Web Service Tasks: • automated reasoning techniques that exploits semantic markup to support automated Web service discovery, execution, composition and interoperation.
Goal • Automation of: • Web service discovery • Find me a shipping service that will transport frozen • vegetables from San Francisco to Tuktoyuktuk. • Web service invocation • Buy me “Harry Potter and the Philosopher’s Stone” at • www.amazon.com • Web service selection, composition and interoperation • Make the travel arrangements for my ASE2002 conference. • Web service execution monitoring • Has my book been shipped yet? • Web service simulation and verification
DAML-S: Semantic Markup for Web Services • DAML-S: A DARPA Agent Markup Language for Services • DAML+OIL ontologyfor Web services: • equivalent to expressive description logic plus (XML) datatypes • well-defined semantics • decidable • ontologies support reuse, mapping, succinct markup, ... • Developed by a coalition of researchers from Stanford, SRI, CMU, BBN, • Nokia, and Yale. • (alphabetically: Ankolekar, Burstein, Hobbs, Lassila, Martin, McDermott, • McIlraith, Narayanan, Paolucci, Payne, Sycara.) • DAML-S version 0.7 posted October,2002 • http://www.daml.org/services/ [McIlraith, Son & Zeng, 01] [DAML-S Coalition, 01, 02]
describedBy ServiceModel ProcessModel ProcessCtrl Grounding DAML-S: An Ontology for Service Description presents Service ServiceProfile
: function & action metaphor inputs outputs preconditions effects atomic process composite process composedBy expands expands control constructs collapses collapses simple process sequence while ... If-then-else fork Process Model hasProcess process service
CongoBuyBook AmazonBuyBook Ontologies of Services Service Shipping Purchase AirShipping BoatShipping BuyTicket BuyBook TruckShipping AcmeTruckShipping BuyAirTicket BuyConcertTicket
Semantics of DAML-S • Problem: DAML+OIL has a well-defined semantics, but • it is not sufficiently expressive to characterize all and only • the intended interpretations of DAML-S. • Solution: • Distributed operational semantics defined in terms of Petri Nets.
Implications for Decision Procedures Using the Operational Semantics, many service automation tasks can be related to reachability analysis. Expressive Power of DAML-SReachability Analysis DAML-S P-Space Complete DAML-S w/o Iteration NP Complete DAML-S w/o Iteration, Choice, Condition Polynomial [Narayana & McIlraith, 02]
Semantics of DAML-S • Problem: DAML+OIL has a well-defined semantics, but • it is not sufficiently expressive to characterize all and only • the intended interpretations of DAML-S. • Solution: • Distributed operational semantics defined in terms of Petri Nets. • Model-theoretic semantics partially defined by a translation to (mostly) first-order logic.
Primitive Action/Service: • getWeather • preconditions: know(cityname(y)) • effects: know(weather(y)) • Complex Action/Service: • buyAirTicket(x) locateFlight(x);if available(x) okPrice(x)then • provideCustInfo(x); payTicket(x)endif • -- i.e., knowledge preconditions • -- i.e., (conditional) knowledge effects • Recall: atomic and composite services are described in terms of • • inputs • • (conditional) outputs • • preconditions • • (conditional) effects • Composite services have additional encapsulated representations. Modeling Web Services as Actions Web services are encoded as primitive and complex actions
S0 bookTaxi bookAirTicket ... ... • do(bookTaxi,S0) bookCruise bookCar rent-car bookHotel ... ... ... Situation Calculus [Reiter, 01] [McCarthy, 68], etc. We appeal to the “Reiter axiomatization” of the situation calculus. • Sorts: • Actions • e.g., a, bookTaxi(x) • Situations • e.g., s, S0, • do(bookTaxi(x),s) • Fluents • e.g., ownTicket(x, do(a,s))
Situation Calculus [Reiter 01, McCarthy 68], etc. A situation calculus theory Dcomprises the following axioms: • D = Duna DS0 Dap DSS • domain independent foundational axioms, • unique names assumptions for actions,Duna • axioms describing the initial situation,DS0 • action precondition axioms, Dap, Poss(a,s) (x,s) • e.g., Poss(pickup(x),s) holding(x,s) • successor state axioms, DSS, F(x,s) (x,s) • e.g., holding(x,do(a,s)) a = pickup(x) • (holding(x,s) (a putdown(x) a drop(x)))
1. Self-describing Web Services: • DAML-S:decidable description logic for Web services • “side effects” of programs are critical to WS composition • semantics defined by translation to (mostly) first-order logic • composite services have additional encapsulated representation 2. Automation of Web Service Tasks: • automating Web service composition Recap
DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML DAML Semantic Web Services
Automating Web Service Composition Problem: Automatically select and execute services to achieve a user objective. E.g., Make the travel arrangements for my KR2002 conference • Possible Approach: Program Synthesis? • Find a computable function body: D R that satisfies a formal • specification Spec=(D,R,I,O).I.e., findbodysuch thatO(x,body(x)) • holds for allx D satisfying I(x). • What’s different (harder, and easier ) • I/O specification is inadequate – must also consider pgm side effects specifications are complex constraints based on intermediate state • programs are compositions of component software • search space generally very large simple sequencing is adequate for many tasks • compositions are generally small
Automating Web Service Composition Problem: Automatically select and execute services to achieve a user objective. E.g., Make the travel arrangements for my KR2002 conference Approach: I. Plan a sequences of services that realize user’s objective. (NP complete or worse (often P-Space complete))
Automating Web Service Composition Problem: Automatically select and execute services to achieve a user objective. E.g., Make the travel arrangements for my KR2002 conference Approach: I. Plan a sequences of services that realize user’s objective. (NP complete or worse (often P-Space complete)) II. Customize reusable generic procedures - Define and archive reusable generic procedures - Customize with user’s constraints. (Same complexity in a reduced search space) Advantages: efficiency, ease of use, customization
Desiderata for Generic Procedures • Generic: High degree of non-determinism to accommodate • customization. • Customizable: Easily customizable by individual users. • (Re)Usable: Usable by agents w/ different levels of knowledge • Self-sufficient wrt required knowledge. • Interpretable: Able to be interpretted and executed. • Claim: • Golog is natural formalism for creating generic procedures Generic Procedures
procedural constructs: • sequence • if-then-else • nondeterministic choice • while-do, etc. S0 bookTaxi bookAirTicket ... ... bookCruise bookCar rent-car bookHotel ... ... ... Computational Semantics [De Giacomo et al, 00] e.g., Trans(a,s,,s’) Poss(a[s],s) ’ = nil s’=do(a[s],s) Final(a,s) false Generic Golog[Levesque et al. 97, De Giacomo et al. 00, etc] E.g., bookAirTicket(x); if far then bookCar(x) else bookTaxi(y) bookTaxi
S0 bookTaxi bookAirTicket ... ... bookCruise bookCar bookTaxi E.g., Let bebookAirTicket(x);if far then bookCar(x) else bookTaxi(y) rent-car bookHotel ... ... ... D s’.Do(, S0, s’) Generic • Do( , s, s’) is an abbreviation. It holds whenever s’ is a terminating situation following the execution of complex action ins. • Each abbreviation is a formula in the situation calculus. • Do(a, s, s’) Poss( a[s],s) s’= do([s],s) • Do([a1; a2], s, s’) ( s*).(Do(a1, s, s*) Do(a2, s*, s’) • ... “Big Do”
S0 bookTaxi bookAirTicket ... ... bookCruise bookCar rent-car bookHotel ... ... ... Customizable Customizable: User Customization of Golog E.g., • Marielle would like to fly if the driving distance is greater than 3 hours. • Marielle must be home for her daughter’s hockey game on April 24. bookTaxi
S0 bookTaxi bookAirTicket ... ... bookCruise bookCar New distinguished predicate Desirable(a,s) rent-car bookHotel ... ... ... Modified Computational Semantics Trans(a,s,,s’) Poss(a[s],s) ’ = nil s’=do(a[s],s) Final(a,s) false Customizable Customizable: User Customization of Golog E.g., • Marielle would like to fly if the driving distance is greater than 3 hours. • Marielle must be home for her daughter’s hockey game on April 24. bookTaxi Desirable(a[s],s)
Customizable Specifying User Constraints Necessary conditions for a to be desirable in s, DnecD Desirable(a,s) i Desirable(bookAirTicket(o,d,dt,s)) gt(DriveTime(o,d),3,s) Personal Constraints, DPC (Away(dt,s) MustbeHome(dt,s)) Assume DnecD & DPC specify all conditions under which Desirable(a,s) is true Desirable(a,s) A C DPCPC
Customizable Specifying User Constraints Necessary conditions for a to be desirable in s, DnecD Desirable(a,s) i Desirable(bookAirTicket(o,d,dt,s)) gt(DriveTime(o,d),3,s) Personal Constraints, DPC (Away(dt,s) MustbeHome(dt,s)) Assume DnecD & DPC specify all conditions under which Desirable(a,s) is true Desirable(a,s) A C DPCPC A = 12 … n bookAirTicket= gt(DriveTime(o,d),3,s)
Customizable Specifying User Constraints Necessary conditions for a to be desirable in s, DnecD Desirable(a,s) i Desirable(bookAirTicket(o,d,dt,s)) gt(DriveTime(o,d),3,s) Personal Constraints, DPC (Away(dt,s) MustbeHome(dt,s)) Assume DnecD & DPC specify all conditions under which Desirable(a,s) is true Desirable(a,s) A C DPCPC A = 12 … n bookAirTicket= gt(DriveTime(o,d),3,s) PC R[C(do(A(x)s))] PC R [ (Away(dt, do(bookAirTicket(o,d,dt,s))) MustbeHome(dt, do(bookAirTicket(o,d,dt,s)))] Desirable(bookAirTicket(o,d,dt,s)) gt(DriveTime(o,d),3,s) (d=Home MustbeHome(dt,s))
Customizable Discussion • Desirable individually definable for each user • elaboration tolerant (simple rewrite) • reduces the search space, rather than providing an • evaluation of a sequence of actions after their computation • doesn’t account for “soft” constraints (current work) • approach amenable to other deontic constraints • (e.g., Able, Should) • easily implemented in ConGolog interpreter using Trans/Final
Usable Usable: Self-Sufficient Golog Programs • Goal: Define Golog programs that are self-sufficient wrt the knowledge • they require to execute. • Define the notion of self sufficiency of, ssf( ,s), inductively, e.g., • ssf(nil, s) true • ssf(a, s) Kwhether(Poss(a[s], s)) Kwhether(Desirable(a[s],s)) • ssf(1;2, s) ssf(1, s) s’.[Do(1, s, s’) ssf(2, s’)] • ssf(if then 1 else 2, s) Kwhether([s], s) • [s] ssf(1, s)] • [s] ssf(2, s) • etc.
Usable Usable: Self-Sufficient Golog Programs • Definition [Self-Sufficient Program (KSSF & PSSF)]: • is KSSF relative to theory D and kernel initial state Initiff • D Init(S0)and D ssf(, S0) true • is physically self-sufficient (PSSF) iff it is KSSF and • D ( s). Do(,S0,s)
Interpretable Interpretable: Middle-Ground ConGolog Interpreter
Interpretable Interpretable: Middle-Ground ConGolog Interpreter Trade-off between online interpreter and offline interpreter online: incomplete no backtracking offline: computationally expensive larger search space need to generate conditional plans • Middle-Ground Interpreter: MG(D,, Init , ) • Online information gathering interleaved with offline “simulation” of • world-altering actions to generate a sequence of actions win for • future execution. • Benefits of backtracking (offline) + search space reduction (online) • Enables user interaction/intervention
Interpretable Why the Interpreter Works • Key Idea: Invocation and Reasonable Persistence Assumption (IRP) • sensing actions are Poss-ible at the outset (put preconditions in Init ) • fluents affecting decisions (?), once sensed, persist til final execution • Theorem: (“The interpreter does the right thing.”) • Given an action theory D and Golog program such thatPSSF(, Init ) • and(, Init )adheres to IRP, suppose MG(D,, Init, ) holds for some. Assume that there are no sensor error and that no exogenous actions affect fluents inD, then for all fluentsFinD, • D F(x, do(w, do(s,S0)F(x, do(, SO)). • See also [McIlraith & Son, 02] • The code that implements the interpreter. • How to translate the situation calculus theory to Prolog. • Proof of correctness of the implementation.
Web Procedures Ontologies Agent Broker Web Service Ontologies DAML-enabled personal/company constraints and prefs ... E-mail GOLOG DAML-enabled web pages We’ve built it and it’s running on the Web!
Summary 1. Self-describing Web services: • DAML-S:decidable description logic ontology for Web services • “side effects” of programs are critical to WS composition • semantics defined by translation to (mostly) first-order logic 2. Automating Web service composition: • Modeled Web Services as primitive and complex actions. • Encapsulated representation of complex actions enables • automated web service composition via plan-like synthesis. • Our approach: Generic Procedures and Customizing User Constraints • - Generic - Customizable • - Usable - Interpretable • Implemented and interpreter proved correct wrt specification. • Embedded into a working system that communicates with Web services
Related Work • Web service descriptions & process models: • WSDL, WSFL, XLANG, BPEL4WS, UDDI, BPML, PSL, etc. • Internet agents: [Etzioni et al., 94], etc. • Program Synthesis: [Bates&Constable, 85], [Burstall&Darlington, 77], • [Green, 69], [Manna & Waldinger, 79], [Smith, 94], etc. • Golog [Levesque et al., 97], [de Giacomo & Levesque, 99] , • [Lakemeyer, 99] [Sardina, 01], [Boutilier et al., 01], • [Lesperance et al, 01], [Lesperance et al., 02] etc. • Web service automation [Waldinger, 00], • [Sycara et al. 00], [Denker et al., 01], [McDermott, 02], etc. • Ubiquitous Computing [Weiser, 96],etc.
Want to Learn More? Papers: http://ksl.stanford.edu/people/sam/publications.html DAML-S: http://www.daml.org/services/ DAML Program: http://www.daml.org/