CPE/CSC 580: Intelligent Agents Franz J. Kurfess Computer Science Department California Polytechnic State University San Luis Obispo, CA, U.S.A. 1 Course Overview ❖ ❖ Introduction Intelligent Agent, Multi-Agent Systems Agent Examples Agent Architectures ❖ Reasoning Agents ❖ Agent Encounters, Resource Sharing, Agreements Communication ❖ Observation, Analysis, Performance Improvement Multi-Agent Interactions ❖ Knowledge, Reasoning, Planning Learning Agents ❖ Agent Hierarchy, Agent Design Principles Speech Acts, Agent Communication Languages Collaboration © Franz J. Kurfess 3 Overview Reasoning Agents ❖ Motivation ❖ Objectives ❖ Deductive Reasoning Agents ❖ Planning Agents ❖ Explicit Knowledge Representation Reasoning Planning as Theorem Proving Blocks World Frame Problem Agent-Oriented Programming Practical Reasoning Agents © Franz J. Kurfess 4 Motivation © Franz J. Kurfess 9 Objectives © Franz J. Kurfess 10 Deductive Reasoning Agents Historic Development Symbol Manipulation Transduction Problem KR and Reasoning Problem Deductive Reasoning Rational Agents via Theorem Proving Limitations 13 Historical Development ❖ almost all early agents were symbolic reasoning agents ~1956-1985 ❖ agents use explicit logical reasoning to decide what to do ❖ Limitations of symbolic reasoning led to a counter-reaction reactive agents movement 1985–present ❖ hybrid architectures alternatives that attempt to combine the best of reasoning and reactive architectures ~1990-present © Franz J. Kurfess 14 Symbolic Reasoning Agents ❖ agents as a knowledge-based system relies on explicit knowledge representation and symbol manipulation often with logic as the underlying formalism ❖ this paradigm is known as symbolic AI ❖ a deliberative agent or agent architecture contains an explicitly represented, symbolic model of the world makes decisions via symbolic reasoning for example about what actions to perform © Franz J. Kurfess 15 Transduction Problem ❖ translating the real world into an accurate, adequate symbolic description tradeoffs and limited resources space: compact, but adequate time: fast enough for that description to be useful examples vision, speech understanding, learning © Franz J. Kurfess 16 Representation/Reasoning problem ❖ knowledge representation ❖ symbolically represent information about complex real-world entities and processes, automated reasoning, automatic planning get agents to reason with this information in time for the results to be useful © Franz J. Kurfess 17 Limitations Symbolic Reasoning Agents ❖ complexity of symbol manipulation algorithms in general ❖ most search-based symbol manipulation algorithms of interest are highly intractable very resource-intensive space time unpredictable response times it is unknown (and maybe unknowable) when the reasoning process will come to an end no intermediate “good enough” results may be available led to the exploration of alternative techniques for building agents reactive agents often based on “anytime” algorithms hybrid agents © Franz J. Kurfess 18 Deductive Reasoning Agents ❖ agents that use theorem proving for decision making ❖ selection of the next action uses logic to encode a theory stating the best action to perform in any given situation implementation of “rational agents” as defined in AIMA (Russell & Norvig) logic provides knowledge representation and reasoning methods © Franz J. Kurfess 19 Action Selection Strategy ❖ select an action check the set of rules for explicitly prescribed actions otherwise, explore actions that are not forbidden “safe course” assumption that actions not explicitly forbidden are ok as a last resort, do nothing may get the agent into trouble as well © Franz J. Kurfess 20 Formal Deductive Reasoning Agent Assumptions is a theory typically a set of rules is a logical database describes the current state of the world Ac is the set of actions the agent can perform fvva | means that can be proved from using [Woolridge 2009] 21 Deductive Reasoning Agent /* try to find an action explicitly prescribed */ for each a Ac do if | Do(a) then return a end-if end-for /* try to find an action not excluded */ for each a Ac do if | Do(a) then return a end-if end-for return null /* no action found */ [Woolridge 2009] 22 Vacuum World Example Goal: clear up all dirt [Woolridge 2009] 23 Vacuum World Representation 3 domain predicates to solve the problem: In(x, y) agent is at (x, y) Dirt(x, y) there is dirt at (x, y) Facing(d) the agent is facing direction d Possible actions: Ac = {turn-right, forward, suck} [Woolridge 2009] 24 Vacuum World Rules Rules for determining what to do: … and so on! Using these rules (+ other obvious ones), starting at (0, 0) the robot will clear up dirt [Woolridge 2009] 25 Vacuum World Problems How to convert video camera input to Dirt(0, 1)? decision making assumes a static environment: calculative rationality decision making using first-order logic is undecidable! Typical solutions: Even where we use propositional logic, decision making in the worst case means solving co-NP-complete problems weaken the logic use symbolic, non-logical representations shift the emphasis of reasoning from run time to design time We will look at some examples of these approaches [Woolridge 2009] 26 More Vacuum World Problems The “logical approach” that was presented implies adding and removing things from a database not pure logic but commonly used in knowledge-based systems e.g. Tell/Ask directives Early attempts at creating a “planning agent” tried to use true logical deduction to solve the problem [Woolridge 2009] 27 Planning Agents Planning Basics Search, KR, Reasoning Blocks World Frame Problem Limitations of Symbolic Planners Agent-Oriented Programming 28 Planning Systems find a sequence of actions that transforms an initial state into a goal state a142 a1 I G a17 [Woolridge 2009] 29 Planning involves issues of both Search and Knowledge Representation Sample planning systems: Robot Planning (STRIPS) Planning of biological experiments (MOLGEN) Planning of speech acts sample domain “Blocks World” [Woolridge 2009] 30 The Blocks World The Blocks World (today) consists of equal sized blocks on a table A robot arm can manipulate the blocks using the actions: UNSTACK(a, b) STACK(a, b) PICKUP(a) PUTDOWN(a) [Woolridge 2009] 31 The Blocks World We also use predicates to describe the world: ON(A,B) ONTABLE(B) ONTABLE(C) CLEAR(A) CLEAR(C) HOLDING(A) NOT(ARMEMPTY) A B C [Woolridge 2009] 32 Logic and Blocks World general logical statements relating the predicates Logical Formulas to Describe Facts Always True of the World [ ∃ x HOLDING(x) ] → ¬ ARMEMPTY ∀ x [ ONTABLE(x) → ¬ ∃ y [ON(x,y)] ] ∀ x [ ¬ ∃ y [ON(y, x)] → CLEAR(x) ] ... [Woolridge 2009] 33 Green’s Method Add state variables to the predicates, and use a function DO that maps actions and states into new states DO: A x S S Example: DO(UNSTACK(x, y), S) is a new state [Woolridge 2009] 34 UNSTACK So to characterize the action UNSTACK we could write: [ CLEAR(x, s) ON(x, y, s) ] [HOLDING(x, DO(UNSTACK(x,y),s)) CLEAR(y, DO(UNSTACK(x,y),s))] We can prove that if S0 is ON(A,B,S0) ONTABLE(B,S0) CLEAR(A, S0) then S1 HOLDING(A,DO(UNSTACK(A,B),S0)) CLEAR(B,DO(UNSTACK(A,B),S0)) A B S1 [Woolridge 2009] 35 More Proving The proof could proceed further; if we characterize PUTDOWN: HOLDING(x,s) ONTABLE(x,DO(PUTDOWN(x),s)) Then we could prove: ONTABLE(A, DO(PUTDOWN(A), DO(UNSTACK(A,B), S0))) S2 S1 The nested actions in this constructive proof give you the plan: 1. UNSTACK(A,B); 2. PUTDOWN(A) [Woolridge 2009] 36 More Proving A B So if we have in our database: ON(A,B,S0) ONTABLE(B,S0) CLEAR(A,S0) and our goal is s(ONTABLE(A, s)) we could use theorem proving to find the plan But could I prove: ONTABLE(B, DO(PUTDOWN(A), DO(UNSTACK(A,B), S0))) ? S2 S1 [Woolridge 2009] 37 The “Frame Problem” how to determine what changes and what doesn’t change when an action is performed One solution: “Frame axioms” that specify how predicates can remain unchanged after an action Example: 1. ONTABLE(z, s) ONTABLE(z,DO(UNSTACK(x,y),s)) 2. [ON(m, n, s) DIFF(m, x)] ON(m,n,DO(UNSTACK(x,y),s)) [Woolridge 2009] 38 Frame Axioms Problem: Unless we go to a higher-order logic, Green’s method forces us to write many frame axioms Example: COLOR(x, c, s) COLOR(x,c,DO(UNSTACK(y,z),s)) this gets very tedious and complicated [Woolridge 2009] 39 Agent-Oriented Programming (AOP) ❖ proposed by Yoav Shoham in the 90s ❖ societal view of computation ❖ agents are programmed by using intentional notions ❖ belief commitment intention abstraction mechanism for the description of complex systems Yoav Shoham. 1993. Agent-oriented programming. Artif. Intell. 60, 1 (March 1993), 51-92. DOI=10.1016/0004-3702(93)90034-9 http://dx.doi.org/10.1016/0004-3702(93)90034-9 © Franz J. Kurfess 40 AOP System Components ❖ a logic ❖ an interpreted programming language ❖ for specifying agents and describing their mental states for programming agents an ‘agentification’ process for converting ‘neutral applications’ into agents e.g., databases © Franz J. Kurfess 41 AGENT0 Programming Language ❖ first AOP language ❖ implemented as an extension of LISP ❖ Each agent in AGENT0 has 4 components: a set of capabilities a set of initial beliefs statements about the world that the agent believes to be true a set of initial commitments things the agent can do things the agent will do a set of commitment rules determines the behavior of the agent © Franz J. Kurfess 42 AGENT0 Diagram [Woolridge 2009] 43 AGENT0 Commitment Rule Example COMMIT( if I receive a message ( agent, REQUEST, DO(time, action) ), ;;; msg condition ( B, [now, Friend agent] AND CAN(self, action) AND NOT [time, CMT(self, anyaction)] ), ;;; mental condition self, DO(time, action) ) from agent which requests me to do action at time, and I believe that: agent is currently a friend I can do the action At time, I am not committed to doing any other action then commit to doing action at time [Woolridge 2009] 44 AGENT0 Limitations research prototype Planning Communicating Agents (PLACA) language designed to illustrate some principles, not a production language intended to address a severe drawback to AGENT0 the inability of agents to plan, and communicate requests for action via high-level goals same programming paradigm as AGENT0 mental change rules [Woolridge 2009] 45 Planning Agents Since the early 1970s, the AI planning community has been closely concerned with the design of artificial agents Planning is essentially automatic programming the design of a course of action that will achieve some desired goal Within the symbolic AI community, it has long been assumed that some form of AI planning system will be a central component of any artificial agent Building largely on the early work of Fikes & Nilsson, many planning algorithms have been proposed, and the theory of planning has been well-developed But in the mid 1980s, Chapman established some theoretical results which indicate that AI planners will ultimately turn out to be unusable in any time-constrained system [Woolridge 2009] 46 Practical Reasoning Agents Practical vs. Theoretical Reasoning Deliberation Means-End Reasoning Commitment Intention 47 Practical vs. Theoretical Reasoning ❖ Practical Reasoning ❖ directed towards actions enables the agent to figure out what to do must take into account practical aspects performance time constraints environment Theoretical Reasoning directed towards beliefs reflects deliberations about the agent’s world model can neglect practical aspects © Franz J. Kurfess 48 Human Practical Reasoning ❖ Deliberation ❖ reaching a decision on what to achieve mainly driven by goals results in intentions usually lower level, smaller granularity than goals no conflicts between multiple intentions Means-end Reasoning decisions about how to convert the intentions into actions must take into account agent capabilities resource constraints environment © Franz J. Kurfess 49 Belief, Desire, Intention (BDI) ❖ software model developed for the design and programming of intelligent agents ❖ implements the principal aspects of Michael Bratman's theory of human practical reasoning q [review from Chapter 2 - Agent Architectures] http://en.wikipedia.org/wiki/Belief%E2%80%93desire%E2%80%93intention_software_model © Franz J. Kurfess 50 Beliefs ❖ represent the informational state of the agent ❖ beliefs can include inference rules ❖ beliefs about the world (including itself and other agents) for the generation of new beliefs the term belief is used instead of knowledge expresses the subjective nature may change over time © Franz J. Kurfess 51 Desires ❖ represent the motivational state of the agent ❖ situations that the agent would like to achieve goals are desires adopted for active pursuit sets of multiple goals should be consistent sets of desires can be inconsistent © Franz J. Kurfess 52 Intentions ❖ represent the deliberative state of the agent ❖ the agent has chosen to do something intentions are desires to which the agent has committed to some extent ❖ a plan is a sequence of actions to achieve an intention ❖ an event is a trigger for reactive activity by an agent © Franz J. Kurfess 53 Intentions and Reasoning ❖ an approach to make a stronger connection between goals, tasks, and actions ❖ often used in the context of planning © Franz J. Kurfess 54 Intentions vs. Desires ❖ desires ❖ higher level potential conflicts deliberation about pros and cons intentions a decision already has been made to pursue the intention the agent is ready to convert the intentions into the respective actions © Franz J. Kurfess 55 Intentions in Practical Reasoning ❖ ❖ problem-oriented intentions are directed towards solving problems the agent makes a conscious decision (via deliberation) leading to an intention to solve such a problem the agent expects to devote resources towards an intention no conflicts among intentions any new intentions under consideration should not conflict with already existing ones ❖ similar techniques as truth maintenance systems performance tracking via intentions the outcome of plans and actions directed towards an intention should be tracked if it fails, the agent usually will try an alternative plan © Franz J. Kurfess 56 Intentions in Practical Reasoning (cont.) ❖ believable the agent believes that there is a way to realize an intention otherwise it may be a desire or goal the agent should not believe that it can’t achieve an intention ❖ otherwise the agent would not act rationally intentions can fail although the agent believes that an intention is achievable, the gent knows that intentions may fail known dependence on conditions or circumstances unknown risks related to the plans and actions if something is inevitable, there is little point in formulating an intention to achieve it © Franz J. Kurfess 57 Intentions in Practical Reasoning (cont.) ❖ side effects of intentions the agent does not need to intend expected side effects of an intention the intention to prepare an omelette for dinner does not necessarily imply the intention to break eggs it may be a known side effect, but that does not make it an intention © Franz J. Kurfess 58 Means-End Reasoning ❖ approach to generate a plan for an agent to achieve a goal ❖ also often applied to intentions instead of goals requires representation of a goal or intention to achieve representation of the agent’s capabilities representation of the environment ❖ actions it can perform world model can be viewed as automatic programming © Franz J. Kurfess 59 Planning classical planning problem enhanced planning temporal planning probabilistic planning planning languages STRIPS Examples Blocks World Monkey & Ba 60 Classical Planning Problem ❖ determined by a unique known initial state, durationless deterministic actions can be taken only one at a time a single agent. ❖ the initial state is known unambiguously ❖ all actions are deterministic, ❖ the state of the world after any sequence of actions can be accurately predicted ❖ plans can be defined as sequences of actions ❖ it is always known in advance which actions will be needed nondeterministic actions or other events outside the control of the agent possible executions form a tree plans have to determine the appropriate actions for every node of the tree © Franz J. Kurfess 61 Classical Planning Approaches ❖ popular approaches the classical planning problem are ❖ forward chaining state space search, possibly enhanced with heuristics backward chaining search, possibly enhanced by the use of state constraints (see graphplan) partial-order planning reduction to the propositional satisfiability problem (satplan) in general, classical planning can be solved by methods for Model checking both are essentially problems of traversing state spaces the classical planning problem corresponds to a subclass of model checking problems © Franz J. Kurfess http://en.wikipedia.org/wiki/Automated_planning 62 Temporal Planning ❖ can be solved with methods similar to classical planning. ❖ possibility of several, temporally overlapping actions with a duration being taken concurrently ❖ the definition of a state has to include information about the current absolute time how far the execution of each active action has proceeded planning with rational or real time the state space may be infinite classical planning relies on integer time © Franz J. Kurfess 63 Probabilistic Planning ❖ Markov decision processes (MDP) ❖ suitable for planning with nondeterministic durationless actions with probabilities, full observability, maximization of a reward function, and a single agent partially observable Markov decision process (POMDP) full observability is replaced by partial observability © Franz J. Kurfess 64 Multi-Agent Planning ❖ coordinating the resources and activities of multiple agents ❖ related to game theory ❖ can involve ❖ agents planning for a common goal an agent coordinating the plans (plan merging) or planning of others agents refining their own plans while negotiating over tasks or resources. real-time planning agents do planning in real time while executing plans (distributed continual planning) © Franz J. Kurfess http://www.st.ewi.tudelft.nl/~mathijs/tutorial.php 65 Planner Diagram Goal / Intention / Task State of the Environment Possible Actions Planner Plan to achieve Goal © Franz J. Kurfess 66 Planning Languages ❖ ❖ ❖ ❖ possible state of the world assignment of values to the state variables, actions determine how the values of the state variables change when that action is taken computational aspects a set of state variables induce an exponential state space planning suffers from the curse of dimensionality and the combinatorial explosion representations for goal to be achieved state of the environment actions available to the agent plan itself balance between expressiveness conciseness adequacy computational demands http://en.wikipedia.org/wiki/Automated_planning_and_scheduling © Franz J. Kurfess 67 STRIPS Planner and Language ❖ STRIPS (Stanford Research Institute Problem Solver) an automated planner developed by Richard Fikes and Nils Nilsson in 1971. R. Fikes and N. Nilsson (1971). STRIPS: a new approach to the application of theorem proving to problem solving. Artificial Intelligence, 2:189-208. The same name was later used to refer to the formal language of the inputs to this planner. This language is the base for most of the languages for expressing automated planning problem instances in use today. Such languages are commonly known as action languages. © Franz J. Kurfess http://en.wikipedia.org/wiki/STRIPS 68 Monkey & Banana STRIPS ❖ A monkey is at location A in a lab. ❖ There is a box in location C. ❖ ❖ The monkey wants the bananas that are hanging from the ceiling in location B. It needs to move the box and climb onto it in order to reach them. Initial state: At(A), Level(low), BoxAt(C), BananasAt(B) Goal state: Have(Bananas) Actions: // move from X to Y _Move(X, Y)_ Preconditions: At(X), Level(low) Postconditions: not At(X), At(Y) // climb up on the box _ClimbUp(Location)_ Preconditions: At(Location), BoxAt(Location), Level(low) Postconditions: Level(high), not Level(low) // climb down from the box _ClimbDown(Location)_ Preconditions: At(Location), BoxAt(Location), Level(high) Postconditions: Level(low), not Level(high) // move monkey and box from X to Y _MoveBox(X, Y)_ Preconditions: At(X), BoxAt(X), Level(low) Postconditions: BoxAt(Y), not BoxAt(X), At(Y), not At(X) // take the bananas _TakeBananas(Location)_ Preconditions: At(Location), BananasAt(Location), Level(high) Postconditions: Have(bananas) © Franz J. Kurfess 69 Blocks World Revisited Robot Arm A Blocks B C Table Top © Franz J. Kurfess 70 Blocks World Knowledge Representation ❖ environment: ontology ❖ goal: logical sentence ❖ actions: representation scheme similar to rules ❖ often variations of a technique proposed in the STRIPS planner actions are also referred to as operators plan: sequence of actions instantiated path through the planning space from starting point to the goal variables must be instantiated nodes in the space and the plan are states not necessarily locations © Franz J. Kurfess 71 Blocks World Environment ❖ described through an ontology concepts in the world properties internal structure similar to objects relationships ❖ may be complex expressed as predicates Examples A, B, C, ... /* block instances */ On(x, y) obj x on top of obj y OnTable(x) obj x is on the table Clear(x) nothing is on top of obj x Holding(x) arm is holding x © Franz J. Kurfess 72 Blocks World Example Clear(A) On(A, B) OnTable(B) OnTable(C) Holding(A) A B © Franz J. Kurfess C 73 Closed and Open World Assumption ❖ closed world assumption ❖ anything not stated explicitly is assumed false makes reasoning and planning much simpler may lead to unintended or counterintuitive conclusions open world assumption anything not stated explicitly is treated as unknown much more in agreement with human reasoning can be computationally very expensive ❖ especially the treatment of negation Example: assumption: Blocks {A(red, large), B(green, small), C(blue, medium) query: list all blocks that are not green: CWA: A, B OWA: A, B, ... (still looking for blocks) © Franz J. Kurfess 74 Blocks World Goals ❖ represented as logical sentences ❖ example: OnTable(A) OnTable(B) OnTable(C) B © Franz J. Kurfess C A 75 Blocks World Actions ❖ each action has: a name a pre-condition list list of facts which must be true for action to be executed a delete list may have arguments list of facts that are no longer true after action is performed an add list list of facts made true by executing the action ❖ each of these may contain variables ❖ technique that was developed in the STRIPS planner © Franz J. Kurfess 76 Stack Action ❖ occurs when the robot arm places the object x it is holding is placed on top of object y. Stack(x, y) pre del add Clear(y) ∧ Holding(x) Clear(y) ∧ Holding(x) ArmEmpty ∧ On(x, y) A B © Franz J. Kurfess 77 UnStack Action ❖ arm picks up an object x from on top of another object y UnStack(x, y) pre del add ❖ On(x, y) ∧ Clear(x) ∧ ArmEmpty On(x, y) ∧ ArmEmpty Holding(x) ∧ Clear(y) Stack and UnStack are inverses of one-another A B © Franz J. Kurfess 78 PickUp/PutDown Action ❖ arm picks up an object x from the table Pickup(x) pre del add ❖ Clear(x) ∧ OnTable(x) ∧ ArmEmpty OnTable(x) ∧ ArmEmpty Holding(x) arm places the object x onto the table Putdown(x) pre del add Holding(x) Holding(x) Clear(x) ∧ OnTable(x) ∧ ArmEmpty © Franz J. Kurfess A 79 Blocks World Plan a142 a1 I G a17 A sequence (list) of actions, with variables replaced by constants [Woolridge 2009] 80 Example of STRIPS Planning ❖ Charles F. Schmidt, Rutgers University Example plan adapted from: Richard E. Fikes, Peter E. Hart, and Nils J. Nilsson, Learning and Executing Generalized Robot Plans. Artificial Intelligence, 3 (1972) 251-288. http://www.rci.rutgers.edu/~cfs/472_html/Planning/STRIPS_plan_472.html © Franz J. Kurfess 81 Implementing Practical Reasoning Agents A first pass at an implementation of a practical reasoning agent: Agent Control Loop Version 1 1. while true 2. observe the world; 3. update internal world model; 4. deliberate about what intention to achieve next; 5. use means-ends reasoning to get a plan for the intention; 6. execute the plan 7. end while (emphasis on stages 4-6) [Woolridge 2009] 82 Implementing Practical Reasoning Agents Problem: deliberation and means-ends reasoning processes are not instantaneous. They have a time cost. Suppose the agent starts deliberating at t0, begins means-ends reasoning at t1, and begins executing the plan at time t2. Time to deliberate is tdeliberate = t1 – t0 and time for means-ends reasoning is tme = t2 – t1 [Woolridge 2009] 83 Implementing Practical Reasoning Agents Further suppose that deliberation is optimal in that if it selects some intention to achieve, then this is the best thing for the agent. (Maximizes expected utility.) So at time t1, the agent has selected an intention to achieve that would have been optimal if it had been achieved at t0. But unless tdeliberate is vanishingly small, then the agent runs the risk that the intention selected is no longer optimal by the time the agent has fixed upon it. This is calculative rationality. Deliberation is only half of the problem: the agent still has to determine how to achieve the intention. [Woolridge 2009] 84 Implementing Practical Reasoning Agents So, this agent will have overall optimal behavior in the following circumstances: 1. When deliberation and means-ends reasoning take a vanishingly small amount of time; or 2. When the world is guaranteed to remain static while the agent is deliberating and performing means-ends reasoning, so that the assumptions upon which the choice of intention to achieve and plan to achieve the intention remain valid until the agent has completed deliberation and means-ends reasoning; or 3. When an intention that is optimal when achieved at time t0 (the time at which the world is observed) is guaranteed to remain optimal until time t2 (the time at which the agent has found a course of action to achieve the intention). [Woolridge 2009] 85 Deliberation How does an agent deliberate? begin by trying to understand what the options available to you are choose between them, and commit to some Chosen options are then intentions [Woolridge 2009] 86 Deliberation The deliberate function can be decomposed into two distinct functional components: option generation in which the agent generates a set of possible alternatives; Represent option generation via a function, options, which takes the agent’s current beliefs and current intentions, and from them determines a set of options (= desires) filtering in which the agent chooses between competing alternatives, and commits to achieving them. In order to select between competing options, an agent uses a filter function. [Woolridge 2009] 87 Commitment Strategies An agent has commitment both to ends (i.e., the wishes to bring about), and means (i.e., the mechanism via which the agent wishes to achieve the state of affairs) Currently, our agent control loop is overcommitted, both to means and ends Modification: replan if ever a plan goes wrong [Woolridge 2009] 88 Commitment Strategies The following commitment strategies are commonly discussed in the literature of rational agents: Blind commitment A blindly committed agent will continue to maintain an intention until it believes the intention has actually been achieved. Blind commitment is also sometimes referred to as fanatical commitment. Single-minded commitment A single-minded agent will continue to maintain an intention until it believes that either the intention has been achieved, or else that it is no longer possible to achieve the intention. Open-minded commitment An open-minded agent will maintain an intention as long as it is still believed possible. [Woolridge 2009] 89 Practical Reasoning Agent Examples ❖ Intelligent Resource-bounded Machine Architecture (IRMA) ❖ Procedural Reasoning System (PRS) ❖ Homer ❖ simulated robot submarine SHRDLU early natural language understanding program © Franz J. Kurfess 90 Implemented BDI Agents: IRMA IRMA key symbolic data structures a plan library explicit representations of beliefs: information available to the agent desires: those things the agent would like to make true may be represented symbolically, but may be simple variables tasks that the agent has been allocated; in humans, not necessarily logically consistent, our agents will consistent intentions: desires that the agent has chosen and committed to [Woolridge 2009] 91 IRMA Components reasoner means-ends analyzer monitors the environment, generates new options as a result of changes filtering process determines which plans might be used to achieve intentions opportunity analyzer reasoning about the world (inference engine) determines options consistent with current intentions a deliberation process responsible for deciding upon the ‘best’ intentions to adopt [Woolridge 2009] 92 IRMA [Woolridge 2009] 93 Procedural Reasoning System (PRS) example of an Implemented Georgeff, Lansky explicit representations of beliefs desires intentions plan library represents that agent’s procedural knowledge BDI Agents knowledge about the mechanisms that can be used by the agent in order to realize its intentions options available to an agent directly determined by the plans an agent has an agent with no plans has no options [Woolridge 2009] 94 PRS [Woolridge 2009] 95 HOMER – An agent that plans Vere & Bickmore developed HOMER: a simulated robot submarine, in a two-dimensional ‘Seaworld’ HOMER takes instructions from a user in a subset of English with about an 800 word vocabulary HOMER can plan how to achieve its instructions, (which usually relate to collecting and moving items around the Seaworld), and can then execute its plans, modifying them as required during execution HOMER has a limited episodic memory, and using this, is able to answer questions about its past experiences [Woolridge 2009] 96 Homer [Woolridge 2009] 97 Dialogues with HOMER [Woolridge 2009] 98 Dialogues with Homer [Woolridge 2009] 99 SHRDLU ❖ early natural language understanding computer program ❖ developed by Terry Winograd at MIT from 1968-1970 ❖ often used in combination with the Blocks World domain © Franz J. Kurfess http://en.wikipedia.org/wiki/SHRDLU 100 Comparison with SHRDLU The dialog that was used as a SHRDLU demo: Person: PICK UP A BIG RED BLOCK. Computer: OK. (does it) Person: GRASP THE PYRAMID. Computer: I DON'T UNDERSTAND WHICH PYRAMID YOU MEAN. Person: FIND A BLOCK WHICH IS TALLER THAN THE ONE YOU ARE HOLDING AND PUT IT INTO THE BOX. Computer: BY "IT", I ASSUME YOU MEAN THE BLOCK WHICH IS TALLER THAN THE ONE I AM HOLDING. Computer: OK. (does it) Person: WHAT DOES THE BOX CONTAIN? Computer: THE BLUE PYRAMID AND THE BLUE BLOCK. Person: WHAT IS THE PYRAMID SUPPORTED BY? Computer: THE BOX. Person: HOW MANY BLOCKS ARE NOT IN THE BOX? Computer: FOUR OF THEM. Person: IS AT LEAST ONE OF THEM NARROWER THAN THE ONE WHICH I TOLD YOU TO PICK UP? Computer: YES, THE RED CUBE. Person: IS IT SUPPORTED? Computer: YES, BY THE TABLE. Person: CAN THE TABLE PICK UP BLOCKS? Computer: NO. Person: CAN A PYRAMID BE SUPPORTED BY A BLOCK? Computer: YES. Person: CAN A PYRAMID SUPPORT A PYRAMID? Computer: I DON'T KNOW. [Woolridge 2009] 101 SHRDLU Dialog Person: STACK UP TWO PYRAMIDS. Computer: I CAN'T. Person: WILL YOU PLEASE STACK UP BOTH OF THE RED BLOCKS AND EITHER A GREEN CUBE OR A PYRAMID? Computer: OK. (does it) Person: WHICH CUBE IS SITTING ON THE TABLE? Computer: THE LARGE GREEN ONE WHICH SUPPORTS THE RED PYRAMID. Person: IS THERE A LARGE BLOCK BEHIND A PYRAMID? Computer: YES, THREE OF THEM: A LARGE RED ONE, A LARGE GREEN CUBE, AND THE BLUE ONE. Person: PUT A SMALL ONE ONTO THE GREEN CUBE WHICH SUPPORTS A PYRAMID. Computer: OK. (does it) Person: PUT THE LITTLEST PYRAMID ON TOP OF IT. Computer: OK. (does it) Person: DOES THE SHORTEST THING THE TALLEST PYRAMID'S SUPPORT SUPPORTS SUPPORT ANYTHING GREEN? Computer: YES, THE GREEN PYRAMID. Person: WHAT COLOR IS IT? Computer: BY "IT", I ASSUME YOU MEAN THE SHORTEST THING THE TALLEST PYRAMID'S SUPPORT SUPPORTS. Computer: RED Person: HOW MANY THINGS ARE ON TOP OF GREEN CUBES? Computer: I'M NOT SURE WHAT YOU MEAN BY "ON TOP OF "IN THE PHRASE "ON TOP OF GREEN CUBES " . DO YOU MEAN: 1 - DIRECTLY ON THE SURFACE 2 - ANWHERE ON TOP OF ? Person: 2 Computer: THREE OF THEM. Person: HAD YOU TOUCHED ANY PYRAMID BEFORE YOU PUT THE GREEN ONE ON THE LITTLE CUBE? Computer: YES, THE GREEN ONE. [Woolridge 2009] 102 SHRDLU Dialog Person: WHEN DID YOU PICK IT UP? Computer: WHILE I WAS STACKING UP THE RED CUBE, A LARGE RED BLOCK AND A LARGE GREEN CUBE. Person: WHY? Computer: TO GET RID OF IT. Person: WHY DID YOU DO THAT? Computer: TO CLEAN OFF THE RED CUBE. Person: WHY DID YOU CLEAR OFF THAT CUBE? Computer: TO PUT IT ON A LARGE GREEN CUBE. Person: WHY DID YOU DO THAT? Computer: TO STACK UP THE RED CUBE , A LARGE RED BLOCK AND A LARGE GREEN CUBE. Person: WHY DID YOU DO THAT? Computer: BECAUSE YOU ASKED ME TO. Person: HOW DID YOU DO IT? Computer: BY PUTTING A LARGE RED BLOCK ON THE TABLE ; THEN LETTING GO OF IT ; THEN PUTTING A LARGE GREEN CUBE ON IT ; THEN LETTING GO OF THAT CUBE ; THEN PUTTING THE RED CUBE ON THAT CUBE; THEN LETTING GO OF THAT CUBE. Person: HOW MANY OBJECTS DID YOU TOUCH WHILE YOU WERE DOING IT? Computer: FOUR OF THEM. Person: WHAT DID THE RED CUBE SUPPORT BEFORE YOU STARTED TO CLEAN IT OFF? Computer: THE GREEN PYRAMID. Person: THERE WERE FIVE BLOCKS TO THE LEFT OF THE BOX THEN. Computer: NO, ONLY FOUR OF THEM: THE RED CUBE, TWO LARGE GREEN CUBES AND A LARGE RED BLOCK. Person: PUT THE BLUE PYRAMID ON THE BLOCK IN THE BOX. Computer: OK. (does it) Person: IS THERE ANYTHING WHICH IS BIGGER THAN EVERY PYRAMID BUT IS NOT AS WIDE AS THE THING THAT SUPPORTS IT? Computer: YES, THE BLUE BLOCK. Person: DOES A STEEPLE Computer interrupting: SORRY, I DON'T KNOW THE WORD "STEEPLE". [Woolridge 2009] 103 SHRDLU Dialog Person: A "STEEPLE" IS A STACK WHICH CONTAINS TWO GREEN CUBES AND A PYRAMID. Computer: I UNDERSTAND. Person: ARE THERE ANY STEEPLES NOW? Computer: NO. Person: BUILD ONE. Computer: OK. (does it) Person: CALL THE BIGGEST BLOCK "SUPERBLOCK". Computer: OK. Person: HAVE YOU PICKED SUPERBLOCK UP SINCE WE BEGAN? Computer: YES. Person: WHY DID YOU DROP IT? Computer: BY "IT", I ASSUME YOU MEAN THE SUPERBLOCK. I CAN'T EXPLAIN A NON-EXISTENT EVENT. Person: IS THERE ANYTHING TO THE RIGHT OF THE RED PYRAMID? Computer: YES, FOUR THINGS: THE BOX , THE RED CUBE, THE BLUE PYRAMID AND THE BLOCK NAMED SUPERBLOCK Person: THANK YOU. Computer: YOU'RE WELCOME! [Woolridge 2009] 104 Summary Reasoning Agents © Franz J. Kurfess 107 Important Concepts and Terms ❖ agent ❖ architecture ❖ belief ❖ blocks world ❖ deliberation ❖ desire ❖ environment ❖ hybrid architecture ❖ intention © Franz J. Kurfess 108