web services (ws)

39
ASE2002 -- McIlraith 09/27/2002 Web Services (WS) b Services are Web-accessible programs and devices. Background

Upload: laith-atkinson

Post on 30-Dec-2015

65 views

Category:

Documents


1 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Web Services (WS)

Web Services are Web-accessible programs and devices.

Background

Page 2: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Knowledge Rep’n for the “Semantic Web” Background

XML Schema RDF (Resource Description Framework)

RDFS (RDF Schema)

RULE-ML (Logic)

DAML+OIL (Ontology)

XML (Extensible Markup Language)

Page 3: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Broad Objective

1. Self-describing Web Services:

• automated reasoning techniques that exploits semantic markup to support automated Web service discovery, execution, composition and interoperation.

• semantic markup to enable automation by making service capabilities, user constraints & procedures computer-interpretable & use-apparent.

2. Automation of Web Service Tasks:

Page 4: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

GoalAutomation of:• Web service discovery

Find me a shipping service that will transport frozenvegetables 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

Page 5: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

DAML-S: Semantic Markup for Web Services

DAML-S: A DARPA Agent Markup Language for Services • DAML+OIL ontology for 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]

Page 6: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

DAML-S: An Ontology for Service Description

Service ServiceProfilepresents

ServiceModel

describedBy

ProcessModel ProcessCtrl

Grounding

Page 7: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Process Model

service process

atomicprocess

compositeprocess

hasProcess

simpleprocess

expandsexpands

collapsescollapsescontrol

constructs

composedBy

whilesequence

If-then-else

fork

...

inputs outputs preconditions effects

: function & action metaphor

Page 8: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Ontologies of Services

Service

Shipping

BuyBook

AmazonBuyBook

CongoBuyBook

BuyTicket

BuyAirTicket

Purchase

AirShipping

TruckShipping

BoatShipping

AcmeTruckShipping

BuyConcertTicket

Page 9: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Semantics of DAML-S

Problem: DAML+OIL has a well-defined semantics, butit is not sufficiently expressive to characterize all and onlythe intended interpretations of DAML-S.

Solution:1. Distributed operational semantics defined in terms of

Petri Nets.

Page 10: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Implications for Decision Procedures

Using the Operational Semantics, many service automationtasks can be related to reachability analysis.

Expressive Power of DAML-S Reachability Analysis

DAML-S P-Space Complete

DAML-S w/o Iteration NP Complete

DAML-S w/o Iteration, Choice, Condition Polynomial

[Narayana & McIlraith, 02]

Page 11: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Semantics of DAML-S

Problem: DAML+OIL has a well-defined semantics, butit is not sufficiently expressive to characterize all and onlythe intended interpretations of DAML-S.

Solution:1. Distributed operational semantics defined in terms of

Petri Nets.

2. Model-theoretic semantics partially defined by a translation to (mostly) first-order logic.

Page 12: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

-- 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 ActionsWeb services are encoded as primitive and complex actions

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

Page 13: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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)

Fluentse.g., ownTicket(x, do(a,s))

rent-car

S0

bookAirTicket

.........

bookTaxi

bookCruise

......

bookCar

bookHotel

do(bookTaxi,S0)

Page 14: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Situation Calculus [Reiter 01, McCarthy 68], etc.

A situation calculus theory D comprises 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)))

Page 15: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Recap

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

automating Web service composition

2. Automation of Web Service Tasks:

Page 16: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

…Composing Semantic-Web Services…

Page 17: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Semantic Web Services

DAML

DAML

DAML

DAML

DAML

DAMLDAML

DAML

DAML

DAML

DAML

DAML

DAML

DAMLDAML

DAML

DAML

DAML

Page 18: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Automating Web Service Composition

Possible Approach: Program Synthesis?Find a computable function body: D R that satisfies a formal specification Spec=(D,R,I,O). I.e., find body such that O(x,body(x)) holds for all x 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

Problem: Automatically select and execute services to achieve a user objective.E.g., Make the travel arrangements for my KR2002 conference

Page 19: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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))

Page 20: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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

Page 21: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Generic Procedures

Desiderata for Generic ProceduresGeneric: 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

Page 22: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Golog [Levesque et al. 97, De Giacomo et al. 00, etc]

rent-car

S0

bookAirTicket

.........

bookTaxi

bookCruise

......

bookCar

bookHotel

procedural constructs:• sequence• if-then-else• nondeterministic choice• while-do, etc.

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

bookTaxi

Generic

E.g., bookAirTicket(x); if far then bookCar(x) else bookTaxi(y)

Page 23: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

“Big Do”

Do( , s, s’) is an abbreviation. It holds whenever s’ is a terminating situation following the execution of complex action in s.

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’) ...

E.g., Let be bookAirTicket(x); if far then bookCar(x) else bookTaxi(y)

rent-car

S0

bookAirTicket

.........

bookTaxi

bookCruise

......

bookCar

bookHotel

bookTaxi D s’.Do(, S0, s’)

Generic

Page 24: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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.

Customizable

bookTaxi

rent-car

S0

bookAirTicket

.........

bookTaxi

bookCruise

......

bookCar

bookHotel

Page 25: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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.

Customizable

bookTaxi

rent-car

S0

bookAirTicket

.........

bookTaxi

bookCruise

......

bookCar

bookHotelNew distinguished predicate

Desirable(a,s)

Modified Computational Semantics Trans(a,s,,s’) Poss(a[s],s) ’ = nil s’=do(a[s],s) Final(a,s) false

Desirable(a[s],s)

Page 26: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Specifying User ConstraintsCustomizable

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 DPC PC

Page 27: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Specifying User ConstraintsCustomizable

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 DPC PC

A = 1 2 … n

bookAirTicket = gt(DriveTime(o,d),3,s)

Page 28: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Specifying User ConstraintsCustomizable

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))

Desirable(bookAirTicket(o,d,dt,s)) gt(DriveTime(o,d),3,s) (d=Home MustbeHome(dt,s))

Assume DnecD & DPC specify all conditions under which Desirable(a,s) is true

Desirable(a,s) A C DPC PC

A = 1 2 … 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)))]

Page 29: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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

Customizable

Page 30: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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

Page 31: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Usable: Self-Sufficient Golog Programs

Definition [Self-Sufficient Program (KSSF & PSSF)]:

is KSSF relative to theory D and kernel initial state Init iff

D Init (S0) and D ssf(, S0) true

is physically self-sufficient (PSSF) iff it is KSSF and

D ( s). Do(,S0,s)

Usable

Page 32: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

Interpretable: Middle-Ground ConGolog InterpreterInterpretable

Page 33: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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

Interpretable

Middle-Ground Interpreter: MG(D,, Init , )

Online information gathering interleaved with offline “simulation” of

world-altering actions to generate a sequence of actions w in for

future execution. Benefits of backtracking (offline) + search space reduction (online) Enables user interaction/intervention

Page 34: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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 that PSSF(, 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 in D, then for all fluents F in D,

D F(x, do(w, do(s, S0) F(x, do(, SO)).

Interpretable

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.

Page 35: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

We’ve built it and it’s running on the Web!

DAML-enabled web pages

Web Service Ontologies

Web Procedures Ontologies

AgentBroker

E-mail

DAML-enabled personal/company

constraints and prefs...

GOLOG

Page 36: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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

Page 37: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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.

Page 38: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

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/

Page 39: Web Services (WS)

ASE2002 -- McIlraith 09/27/2002

The End