AOSE Agent-Oriented Programming. Introduction A class of programming language that often embodies the various principles proposed by theorists. –Many.

Slides:



Advertisements
Similar presentations
Design by Contract.
Advertisements

Building Bug-Free O-O Software: An Introduction to Design By Contract A presentation about Design By Contract and the Eiffel software development tool.
ARCHITECTURES FOR ARTIFICIAL INTELLIGENCE SYSTEMS
Intelligent Architectures for Electronic Commerce Part 1.5: Symbolic Reasoning Agents.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Classes & Objects Computer Science I Last updated 9/30/10.
OASIS Reference Model for Service Oriented Architecture 1.0
Object-Oriented Analysis and Design
Adding Organizations and Roles as Primitives to the JADE Framework NORMAS’08 Normative Multi Agent Systems, Matteo Baldoni 1, Valerio Genovese 1, Roberto.
Informatics 43 – May 7, Restatement of Goals for Testing Want to verify software’s correctness  Need to test  Need to decide on test cases  No.
Introduction To System Analysis and Design
Concrete architectures (Section 1.4) Part II: Shabbir Ssyed We will describe four classes of agents: 1.Logic based agents 2.Reactive agents 3.Belief-desire-intention.
Agent UML Stefano Lorenzelli
Brent Dingle Marco A. Morales Texas A&M University, Spring 2002
WSN Simulation Template for OMNeT++
CS533 - Concepts of Operating Systems
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
Guide To UNIX Using Linux Third Edition
COMP 5138 Relational Database Management Systems Semester 2, 2007 Lecture 8A Transaction Concept.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
Chapter 1 - Introduction. Ch 1Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
TCU CoSc Introduction to Programming (with Java) Getting to Know Java.
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
Object Oriented Software Development
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
2APL A Practical Agent Programming Language March 6, 2007 Cathy Yen.
An Object-Oriented Approach to Programming Logic and Design
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Introduction To System Analysis and Design
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Objected Oriented Programming & Design JAVA Shishir Gupta (704) (704)
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 3: SOA Reference Model OASIS 2006.
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
Cohesion and Coupling CS 4311
Systems Analysis and Design in a Changing World, 3rd Edition
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
Multi-Agent Systems University “Politehnica” of Bucarest Spring 2010 Adina Magda Florea curs.cs.pub.ro.
Requirements Engineering Methods for Requirements Engineering Lecture-30.
Writing requirements specifications. Why we need requirements specifications To give structure to your desires To avoid waste of resources To avoid slippage.
Data Structures Using C++ 2E1 Inheritance An “is-a” relationship –Example: “every employee is a person” Allows new class creation from existing classes.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
8:15 AM Tuesday September 15, 2009 Karl Frank, Point of Contact for Constellation Projects Validating Integration Requirements Diagrams for illustrative.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Lecture 5 Multi-Agent Systems Lecture 5 University “Politehnica” of Bucarest Adina Magda Florea
EEL 5937 Agent communication EEL 5937 Multi Agent Systems Lotzi Bölöni.
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Introduction to OOP CPS235: Introduction.
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
Object-Oriented Design Concepts University of Sunderland.
Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition)
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
1 SOA Seminar Seminar on Service Oriented Architecture SOA Reference Model OASIS 2006.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Coupling and Cohesion Pfleeger, S., Software Engineering Theory and Practice. Prentice Hall, 2001.
Artificial Intelligence Logical Agents Chapter 7.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Visit for more Learning Resources
Object-Oriented Programming Concepts
Java Primer 1: Types, Classes and Operators
Distribution and components
About the Presentations
Architecture Components
Computer Programming.
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
Presentation transcript:

AOSE Agent-Oriented Programming

Introduction A class of programming language that often embodies the various principles proposed by theorists. –Many of these languages draw from work done on agent architectures. –They couple such architectures with high-level languages that are derived from the agent theories. Concept of Agent-Oriented Programming introduced in 1993 by Yoav Shoham. –Adopts a view of programs that are implemented as a set of interacting agents. –Inspired by agent theory - agents viewed as mental entities that employ a set of mental states. –Agents executed on purpose-built interpreters that manipulate this state in a well-defined way.

OOP versus AOP (Shoham) OOPAOP Basic UnitObjectAgent Parameters describing unconstrainedbeliefs, commitments, state of basic unitcapabilities Process of Computationmessage passing andmessage passing andresponse methods Types of Messageunconstrainedinform, request, offer Constrains on Methodsnonehonesty, consistency

AOP System Requirements A complete AOP System includes three primary components: –a restricted formal language with clear syntax and semantics for describing mental states. –an interpreted programming language in which to define and program agents, with primitive commands (such as request and inform). –an ”agentifier”, converting neutral devices into programmable agents. Shoham illustrates this through a prototype AOP language, Agent-0.

Agent-0: Mental State Actions: represented as facts that must be true when the action is perform. –Rather than stating that the agent performed an action at a time, we state that the fact that the action was performed at a given time: holding(robot, cup) t : the robot is holding the cup at time t. Beliefs: beliefs are facts that are temporally specified. –You believe X at a given time where X is a sentence about the state of the world at a point in time. B b 10 likes(a,b) 7 : b believes at time point 10 that a likes b at time point 7. B a 3 B b 10 likes(a,b) 7 : a believes at time point 3 that b believes at time point 10 that a likes b at time point 7.

Agent-0: Mental State Obligations: agents make commitments to one another about a fact holding. –Agents represent decisions about what will happen as commitments to facts: OBL a,b t greets(a,b) t’ : a is obliged to b at time t to the fact that a greets b at time t’. –Encodes the idea of social agreement Decisions: represents the personal choices of the agent as to what actions it will perform. –This can be represented as obligation to oneself. DEC a t X = def OBL a,a t X

Agent-0: Mental State Capabilities: which actions the agent is able achieve at a given time. –Defines what actions are achievable when: CAP a t greets(a,b) t’ : at time t, a believes that a is capable of greeting b at time t’. –Leads to the notion of ability – that at time t, the agent Is capable of achieving an action at time t: ABLE a X =def CAPatime(X)X

Agent-0: Mental State Properties internal consistency: that beliefs and obligations are not contradictory –for all a,t {ψ: B a t ψ} is consistent –for all a,t {ψ: OBL a,b t ψ for some b} is consistent good faith: the agents only commit to actions they believe they are able to perform –for any a, b, ψ: OBL a,b t ψ => B a t ((ABLE a ψ) ∧ ψ) Introspection: agents are aware of their obligations –for any a, b, ψ: OBL a,b t ψ => B a t OBL a,b t ψ –for any a, b, ψ: ~OBL a,b t ψ => B a t ~OBL a,b t ψ

Agent-0: Mental State Properties persistence of mental state: how the mental state components change over time. –Beliefs persist by default: that is, everything an agent believes at one time point is still believed at the next time point unless a contradictory fact is learnt. –Absence of belief persists by default: anything that an agent does not know at a time point is still unknown at the next time point unless it learns the belief.

Agent-0: Mental State Properties persistence of mental state: how the mental state components change over time. –Obligations persist by default: an agent continues to honour its obligations unless the contracting party agrees to the dropping of the obligation or the agent realises that it is not able to fulfill its obligations. –Decisions persist by default: property is inherited from obligation, but interesting to note that decisions can be dropped unilaterally (they are personal to an agent) –Capabilities are fixed: what an agent can do at one time point can be done at the next time point subject to associated conditions.

Agent-0: The Interpreter

Agent-0: Assumptions Message Passing: –Agents are addressable by name –Names are location independent –The form of the messages is interpreter dependent –The interpreter controls when the messages are sent Clock: –A global clock (scheduler) manages execution of the agent at regular intervals. –Execution lasts for a fixed amount of time (timegrain) Actions: –The agent has a static library of actions that may be invoked by name.

Agent-0: Language Syntax Facts: –“Smith is an employee of acme at time t” (t (employee smith acme)) –“Jones is NOT an employee of acme at time t” (NOT (t (employee smith acme))) Private Actions: –“kick the ball at time t” (DO t kick-ball)

Agent-0: Language Syntax Communicative Actions: –“Inform a of a fact at time t” (INFORM t a fact) –“(Un-)Request that a perform an action at time t” (REQUEST t a action) (UNREQUEST t a action) –“Don’t perform this action” (REFRAIN action) –“Request at time 1 that a updates the database at time 10” (REQUEST 1 a (DO 10 update-database)) –“Request at time 1 that a requests at time 5 that b informs at time 10 c of a fact” (REQUEST 1 a (REQUEST 5 b (INFORM 10 c fact)))

Agent-0: Language Syntax Conditional Actions: –“Only do the action if some mental condition holds” (IF mntlcond action) –“If the agent believes that smith is an employee of acme at time t’ then tell a this at time t” (IF (B (t’ (employee smith acme))) (INFORM t a (t’ (employee smith acme)))) –“Request at time t that b informs at time t+1 c of a fact only if b beliefs the fact to hold” (REQUEST t b (IF (B fact) (INFORM t+1 a fact))) –“If the agent sees the ball at time t and the agent is committed to shooting a time t then perform shoot” (IF (AND (t sees-ball) (CMT shoot)) (DO t shoot))

Agent-0: Language Syntax Commitment Rules: –“If a given message condition is satisfied and a given mental condition is satisfied, commit to zero or more action(s) on behalf of some agent(s)” (COMMIT msgcond mntlcond (agent action)*) –“If an agent sends a request for an action and you believe that a is now a friend then commit to the action” (COMMIT (?a REQUEST ?action) (B (now (myfriend ?a))) (?a ?action)) –Here ? denotes a variable.

Agent-0: Language Syntax Commitments (Obligations): –A list of agent name and action pairs (agent action) –Can be queried using the the following templates: ((CMT agent) time action) / ((CMT agent) action) Capabilities: –Associate conditions with primitive actions to stop incompatible actions being attempted: (action mntlcond) –“Perform the rotate wheelbase action only if you are not committed to servicing the wheelbase at that time” ((!?time (rotate wheelbase ?degree)) (NOT ((CMT ?x) ?!time (service wheelbase))))

Example: Airline Booking System “Issue boarding passes precisely one hour before departure; no seat assignments” –(issue_bp pass flightnum time) => (IF (AND (B ((- time h) (present pass))) (B time (flight ?from ?to flightnum))) (DO time-h (physical_issue_bp pass flightnum time))) “Ask an askee to tell you if it believes some fact q, and return all matching facts” –(query_which t asker askee q) => (REQUEST t askee (IF (B q) (INFORM (+ t 1) asker q))) “Ask an askee to tell you whether or not it believes some fact q, and return all matching facts” –(query_which t asker askee q) => (REQUEST t askee (IF (B q) (INFORM (+ t 1) asker q)))

Example: Airline Booking System “Issue boarding passes precisely one hour before departure; no seat assignments” –(issue_bp pass flightnum time) => (IF (AND (B ((- time h) (present pass))) (B time (flight ?from ?to flightnum))) (DO time-h (physical_issue_bp pass flightnum time))) “Ask an askee to tell you if it believes some fact q, and return all matching facts” –(query_which t asker askee q) => (REQUEST t askee (IF (B q) (INFORM (+ t 1) asker q))) “Ask an askee to tell you whether or not it believes some fact q, and return all matching facts” –(query_whether t asker askee q) => (REQUEST t askee (IF (B q) (INFORM (+ t 1) asker q))) (REQUEST t askee (IF (B (NOT q)) (INFORM (+ t 1) asker (NOT q))))

Example: Airline Booking System Capability: There are no constrains on issuing a boarding pass –((issue_bp ?a ?flight ?time) true) Capability: The update remaining seats can only be carried out if the agent believes that there are seats available –((DO ?time (update_remaining_seats ?time1 ?flight_number ?additional_seats)) (B ?time (remaining_seats ?time1 ?flight_number ?current_seats))))

Example: Airline Booking System Commitment Rules: –(COMMIT (?pass REQUEST (IF (B ?p) (INFORM ?t ?pass ?p))) true (?pass (IF (B ?p) (INFORM ?t ?pass ?p)))) –(COMMIT (?cust REQUEST (issue_bp ?pass ?flight ?time)) (AND (B (?time (remaining_seats ?flight ?n))) (?n > 0) (NOT ((CMT ?anyone) (issue_bp ?pass ?anyflight ?time)))) (myself (DO (+ now 1) (update_remaining_seats ?time ?flight -1))) (?cust (issue_bp ?pass ?flight ?time)))

Conclusions Agent-0 demonstrates how agents can be programmed as mental entities Contains a relatively small set of constructs but is VERY difficult to understand programs –Nesting of actions powerful but can cause confusion –Undone by the fact the the agent must have a commitment rule to handle each incoming message. No tool support –Agent program is a text file (no syntax checker / code verifier) –Debugging supported through output to the console