Building Larger Systems A case study requiring: Development of a - - PowerPoint PPT Presentation

building larger systems
SMART_READER_LITE
LIVE PREVIEW

Building Larger Systems A case study requiring: Development of a - - PowerPoint PPT Presentation

Building Larger Systems A case study requiring: Development of a task-specific language Term transformation Term unfolding Meta-interpretation Connection to an asynchronous environment Domain: Peer to peer coordination


slide-1
SLIDE 1

1

Logic Programming School of Informatics, University of Edinburgh

Building Larger Systems

A case study requiring:

  • Development of a task-specific language
  • Term transformation
  • Term unfolding
  • Meta-interpretation
  • Connection to an asynchronous environment

Domain: Peer to peer coordination This lecture: Overview of task and language Next lecture: Automation

slide-2
SLIDE 2

2

Logic Programming School of Informatics, University of Edinburgh

Overview

  • ut

Agent a1 Agent a2 in

Media Constraint solver Protocol interpreter Transport

  • n media

Global state of this interaction

slide-3
SLIDE 3

3

Logic Programming School of Informatics, University of Edinburgh

Basic Example

Agent a1 Agent a2 Agent a3 ask(p(Y)) tell(p(a)) ask(q(Y)) query_from(p(Y), a2) query_from(q(Y), a3) know(p(a))

slide-4
SLIDE 4

4

Logic Programming School of Informatics, University of Edinburgh

Example Protocol

A requester will ask about something from an informer then get an answer from it then continue as a requester An informer will be asked by a requester then should tell the requester if it knows a(requester, A) ::= ask(X) => a(informer, B) query_from(X, B) then tell(X) <= a(informer, B) then a(requester, A) a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) => a(requester, A) know(X)

Role Message out Message in Constraint Recursive role

slide-5
SLIDE 5

5

Logic Programming School of Informatics, University of Edinburgh

Operator Declarations for Protocol

:- op(900, xfx, '::='),

  • p(800, xfx, '=>'),
  • p(800, xfx, '<='),
  • p(830, xfx, ‘'),
  • p(820, xfy, and),
  • p(850, xfy, par),
  • p(850, xfy, then),
  • p(850, xfy, or).

::= a(informer, B) then <= ask(X) a(requester, A)

  • know(X)

=> tell(X) a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) => a(requester, A) know(X) a(requester, A)

slide-6
SLIDE 6

6

Logic Programming School of Informatics, University of Edinburgh

Interaction Example

Agent a1

a(requester, A) ::= ask(X) => a(informer, B) query_from(X, B) then tell(X) <= a(informer, B) then a(requester, A) a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) => a(requester, B) know(X)

Agent a2

a(requester, a1) ::= ask(p(Y)) => a(informer, a2) then tell(p(Y)) <= a(informer, a2) then a(requester, a1)

ask(p(Y)) General Specific query_from(p(Y), a2)

slide-7
SLIDE 7

7

Logic Programming School of Informatics, University of Edinburgh

Interaction Example

a(requester, A) ::= ask(X) => a(informer, B) query_from(X, B) then tell(X) <= a(informer, B) then a(requester, A) a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) => a(requester, B) know(X)

Agent a1 Agent a2

a(requester, a1) ::= ask(p(Y)) => a(informer, a2) then tell(p(Y)) <= a(informer, a2) then a(requester, a1) a(informer, a2) ::= ask(p(Y)) <= a(requester, a1) then tell(p(Y)) => a(requester, a1) know(p(Y))

ask(p(Y)) General Specific

slide-8
SLIDE 8

8

Logic Programming School of Informatics, University of Edinburgh

Interaction Example

Agent a1 Agent a2 tell(p(a)) General Specific

a(requester, A) ::= ask(X) => a(informer, B) query_from(X, B) then tell(X) <= a(informer, B) then a(requester, A) a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) => a(requester, B) know(X) a(requester, a1) ::= ask(p(Y)) => a(informer, a2) then tell(p(Y)) <= a(informer, a2) then a(requester, a1) a(informer, a2) ::= ask(p(a)) <= a(requester, a1) then tell(p(a)) => a(requester, a1)

know(p(a))

slide-9
SLIDE 9

9

Logic Programming School of Informatics, University of Edinburgh

Interaction Example

Agent a1 Agent a2 tell(p(a)) General Specific

a(requester, A) ::= ask(X) => a(informer, B) query_from(X, B) then tell(X) <= a(informer, B) then a(requester, A) a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) => a(requester, B) know(X) a(requester, a1) ::= ask(p(a)) => a(informer, a2) then tell(p(a)) <= a(informer, a2) then a(requester, a1) ::=

ask(X) => a(informer, B) query_from(X, B) then tell(X) <= a(informer, B) then a(requester, a1)

a(informer, a2) ::= ask(p(a)) <= a(requester, a1) then tell(p(a)) => a(requester, a1)

slide-10
SLIDE 10

10

Logic Programming School of Informatics, University of Edinburgh

And so on…

Agent a1 Agent a3 General Specific q(Y)

Agent a2

a(requester, A) ::= ask(X) => a(informer, B) need(X) and source(B) then tell(X) <= a(informer, B) then a(requester, A) a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) => a(requester, B) know(X) a(requester, a1) ::= ask(p(a)) => a(informer, a2) then tell(p(a)) <= a(informer, a2) then a(requester, a1) ::=

ask(q(Y)) => a(informer, a3) then tell(q(Y)) <= a(informer, a3) then a(requester, a1)

a(informer, a2) ::= ask(p(a)) <= a(requester, a1) then tell(p(a)) => a(requester, a1)

query_from(q(Y), a3)

slide-11
SLIDE 11

11

Logic Programming School of Informatics, University of Edinburgh

Agents Determining Peers

Headhunter Headhunter Finder Finder Person Person Ask for best people Ask for best people Suggest best people Suggest best people Organiser Organiser Ask for agent of a person Ask for agent of a person Inform his/her agent Inform his/her agent Available? Available? Confirm/disconfirm Confirm/disconfirm

slide-12
SLIDE 12

12

Logic Programming School of Informatics, University of Edinburgh

For Example…

Headhunter Headhunter Finder Finder Person Person Ask for best people Ask for best people Organiser Suggest [nick_jennings,mike_wooldridge] Organiser Agent for mike_wooldridge? Agent for mike_wooldridge? Agent is n_jennings Agent is n_jennings Available? Available? Confirm Confirm d_robertson w_hall d_sleeman Person Person n_jennings m_wooldridge Available? Confirm DEMO Agent is m_wooldridge Agent for nick_jennings?

slide-13
SLIDE 13

13

Logic Programming School of Informatics, University of Edinburgh

Protocol for Example

An organiser service on some topic will ask a headhunter service for the best people on that topic, then it will be informed by the headhunter who those people are, then it will change role to be a locator for these people, then it will become a time coordinator for these people A locator for a set of people will ask a finder service for an address for a person in the set, then it will be informed by the finder of the address, then it will continue to locate all the other people in the set until it finishes at the end An organiser service on some topic will ask a headhunter service for the best people on that topic, then it will be informed by the headhunter who those people are, then it will change role to be a locator for these people, then it will become a time coordinator for these people A locator for a set of people will ask a finder service for an address for a person in the set, then it will be informed by the finder of the address, then it will continue to locate all the other people in the set until it finishes at the end a(organiser(Topic,H,F), O) ::= ask(best_people(Topic)) => a(headhunter, H) then inform(best_people(Topic, People)) <= a(headhunter, H) then a(locator(F,People,Locations), O) then a(time_coordinator(People,Locations,Topic,Times,Time), O) ← times(Times) a(locator(F,People,Locations), L) ::= ( ask(locate(Person)) => a(finder, F) ← People = [Person|Rp] and Locations = [Loc|Rl] then inform(located(Person, Loc)) <= a(finder, F) then a(locator(F,Rp, Rl), L) ) or null ← People = [] and Locations = [] a(organiser(Topic,H,F), O) ::= ask(best_people(Topic)) => a(headhunter, H) then inform(best_people(Topic, People)) <= a(headhunter, H) then a(locator(F,People,Locations), O) then a(time_coordinator(People,Locations,Topic,Times,Time), O) ← times(Times) a(locator(F,People,Locations), L) ::= ( ask(locate(Person)) => a(finder, F) ← People = [Person|Rp] and Locations = [Loc|Rl] then inform(located(Person, Loc)) <= a(finder, F) then a(locator(F,Rp, Rl), L) ) or null ← People = [] and Locations = []