building larger systems
play

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


  1. 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 Logic Programming School of Informatics, University of Edinburgh 1

  2. Overview Constraint Protocol Transport solver interpreter on media Media out in Agent a2 Agent a1 Global state of this interaction Logic Programming School of Informatics, University of Edinburgh 2

  3. Basic Example ask(p(Y)) Agent a2 tell(p(a)) Agent a1 know(p(a)) ask(q(Y)) Agent a3 query_from(p(Y), a2) query_from(q(Y), a3) Logic Programming School of Informatics, University of Edinburgh 3

  4. Example Protocol Role Message out a(requester, A) ::= A requester will ask(X) => a(informer, B) � ask about something from an informer then query_from(X, B) then Constraint get an answer from it then tell(X) <= a(informer, B) then continue as a requester a(requester, A) Message in Recursive role An informer will a(informer, B) ::= ask(X) <= a(requester, A) then be asked by a requester then tell(X) => a(requester, A) � should tell the requester if it knows know(X) Logic Programming School of Informatics, University of Edinburgh 4

  5. Operator Declarations for Protocol :- op(900, xfx, '::='), ::= op(800, xfx, '=>'), op(800, xfx, '<='), a(informer, B) then op(830, xfx, ‘ � '), op(820, xfy, and), <= op(850, xfy, par), op(850, xfy, then), � ask(X) a(requester, A) op(850, xfy, or). know(X) => a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) a(requester, A) tell(X) => a(requester, A) � know(X) Logic Programming School of Informatics, University of Edinburgh 5

  6. Interaction Example General Specific a(requester, A) ::= a(requester, a1) ::= ask(X) => a(informer, B) � ask(p(Y)) => a(informer, a2) then query_from(X, B) then tell(p(Y)) <= a(informer, a2) then tell(X) <= a(informer, B) then a(requester, a1) a(requester, A) a(informer, B) ::= ask(X) <= a(requester, A) then tell(X) => a(requester, B) � know(X) Agent a1 ask(p(Y)) Agent a2 query_from(p(Y), a2) Logic Programming School of Informatics, University of Edinburgh 6

  7. Interaction Example Specific General a(requester, A) ::= a(requester, a1) ::= ask(X) => a(informer, B) � ask(p(Y)) => a(informer, a2) then query_from(X, B) then tell(p(Y)) <= a(informer, a2) then tell(X) <= a(informer, B) then a(requester, a1) a(requester, A) a(informer, a2) ::= a(informer, B) ::= ask(p(Y)) <= a(requester, a1) then ask(X) <= a(requester, A) then tell(p(Y)) => a(requester, a1) � tell(X) => a(requester, B) � know(p(Y)) know(X) Agent a1 Agent a2 ask(p(Y)) Logic Programming School of Informatics, University of Edinburgh 7

  8. Interaction Example General Specific a(requester, A) ::= ask(X) => a(informer, B) � a(requester, a1) ::= query_from(X, B) then ask(p(Y)) => a(informer, a2) then tell(X) <= a(informer, B) then tell(p(Y)) <= a(informer, a2) then a(requester, A) a(requester, a1) a(informer, B) ::= a(informer, a2) ::= ask(X) <= a(requester, A) then ask(p(a)) <= a(requester, a1) then tell(X) => a(requester, B) � tell(p(a)) => a(requester, a1) know(X) Agent a1 tell(p(a)) Agent a2 know(p(a)) Logic Programming School of Informatics, University of Edinburgh 8

  9. Interaction Example General Specific a(requester, a1) ::= a(requester, A) ::= ask(X) => a(informer, B) � ask(p(a)) => a(informer, a2) then tell(p(a)) <= a(informer, a2) then query_from(X, B) then a(requester, a1) ::= tell(X) <= a(informer, B) then ask(X) => a(informer, B) � a(requester, A) query_from(X, B) then tell(X) <= a(informer, B) then a(informer, B) ::= a(requester, a1) ask(X) <= a(requester, A) then a(informer, a2) ::= tell(X) => a(requester, B) � ask(p(a)) <= a(requester, a1) then know(X) tell(p(a)) => a(requester, a1) tell(p(a)) Agent a1 Agent a2 Logic Programming School of Informatics, University of Edinburgh 9

  10. And so on… General Specific a(requester, A) ::= a(requester, a1) ::= ask(X) => a(informer, B) � ask(p(a)) => a(informer, a2) then need(X) and source(B) then tell(p(a)) <= a(informer, a2) then tell(X) <= a(informer, B) then a(requester, a1) ::= a(requester, A) ask(q(Y)) => a(informer, a3) then tell(q(Y)) <= a(informer, a3) then a(requester, a1) a(informer, B) ::= a(informer, a2) ::= ask(X) <= a(requester, A) then ask(p(a)) <= a(requester, a1) then tell(X) => a(requester, B) � tell(p(a)) => a(requester, a1) know(X) Agent a2 Agent a1 q(Y) Agent a3 query_from(q(Y), a3) Logic Programming School of Informatics, University of Edinburgh 10

  11. Agents Determining Peers Inform his/her agent Inform his/her agent Finder Finder Person Person Available? Available? Ask for agent of a person Ask for agent of a person Confirm/disconfirm Confirm/disconfirm Organiser Organiser Suggest best people Ask for best people Suggest best people Ask for best people Headhunter Headhunter Logic Programming School of Informatics, University of Edinburgh 11

  12. For Example… Agent is m_wooldridge n_jennings d_sleeman Agent for mike_wooldridge? Person Agent for mike_wooldridge? Finder Person Finder Available? Confirm d_robertson m_wooldridge Agent is n_jennings Available? Agent is n_jennings Organiser Available? Organiser Person Person Agent for nick_jennings? Confirm Confirm Ask for best people Ask for best people Suggest [nick_jennings,mike_wooldridge] w_hall Headhunter Headhunter DEMO Logic Programming School of Informatics, University of Edinburgh 12

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

Recommend


More recommend