Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 4 Multi-Agent Systems Lecture 4 Computer Science WPI Spring 2002 Adina Magda Florea

Similar presentations


Presentation on theme: "Lecture 4 Multi-Agent Systems Lecture 4 Computer Science WPI Spring 2002 Adina Magda Florea"— Presentation transcript:

1 Lecture 4 Multi-Agent Systems Lecture 4 Computer Science WPI Spring 2002 Adina Magda Florea adina@wpi.edu

2 Formal models for representing agents Lecture outline 1Knowledge representation for agents 2FOL 3Modal logic 4Logics of knowledge and belief 5Dynamic logic, temporal logic 6BDI logics 7Commitments as change 8 Practical BDI interpreters 8 Practical BDI interpreters - see Sect. 8.4 MA book

3 3 n Logic based representation –unique (almost) syntax  x  y loves(x,y) –formal (clear, well-defined) semantics Bel A loves(Bill, Mary)  shape(round)   color(green)  type(apple) n Rule based representation –situation-action or condition-conclusion rules + facts –subset of logic (Horn clauses) that emphasize implication if shape(round) and color(green) then type=apple n Frame-based representation –units, frames –subset of logic, represents relationship structured around objects in the universe apple01 shape: roundcolor: greentype: apple 1 Knowledge representation for agents Cognitive agents declarative representaton, AI What the agent knows/ believes

4 n Plan representation –represent actions –may be combined with any of the previous representations –partial representation of states stack(x,y) Precond: hold(x)  clear(y) Postcond:  clear(x)   hold(x)  on(x,y)  armempty n BDI representations –combines most (all) of the above n A big diversity of techniques and formalisms to represent interactions: –communication –cooperation –coordination n No symbolic representation 4 When and what to do What the agent believes and when and what to do How to cope with other agents in the environment Reactive agents

5 Logic based representations n 2 possible aims –to make MAS function according to the logic –to specify and validate the design n Conceptualization of the world / problem n Syntax - wffs n Semantics - significance, model n Model - the domain interpretation for which a formula is true n Model - linear or structured; index in a model n M |= S  - "  is true or satisfied in component S of the structure M" Model theory n Generate new wffs that are necessarily true, given that the old wffs are true - entailmentKB |=  Proof theory n Derive new wffs based on axioms and inference rules KB |- i  5

6 PrL, PL 6 Extend PrL, PL Tropistic agents (reactive) Sentential logic of beliefs Uses beliefs atoms B A (  ) Index PL with agents Modal logic Modal operators Logics of knowledge and belief Modal operators B and K Dynamic logic Modal operators for actions Temporal logic Modal operators for time Linear time Branching time CTL logic Branching time and action BDI logic Adds agents, B, D, I Linear model Structured models Situation calculus Adds states, actions Symbol level Knowledge level

7 2 First order logic L P - the language of Propositional logic n  - the set of atomic propositions Sin-1 )   implies that   L P Sin-2 ) p, q  L P implies that p  q  L P,  q  L P M 0 = is the formal model for L P n L   - interpretation Sem-1 ) M 0 |=  iff  L, where   Sem-2 ) M 0 |= p  q iff M 0 |= p and M 0 |= q Sem-3 ) M 0 |=  p iff M 0 |=/ p n p=A  BA - it rains n q=A  BB - take umbrella n r=A  A 7 A B A  B A  B A  A T T T T T T F F F T F T T F T F F T F T Knowledge represents: “atomic” propositions

8 Predicate logic n Knowledge represents: –Extensional knowledge existence of objects: ¬(  x)(¬P(x)) is true exactly when P is true for at least one object of D, (  x)(P(x)) facts about objects, not about properties of objects n p = (  x) young(x)  success(x) n q = (  x) young(x)  success(x) D = {Bill, Tom, Alice}MM |= p x young(x) success(x)M |=/ q Bill T T Tom F T Alice F F 8

9 9 Higher order logic

10 10 3 Modal logic L M - the language of Modal logic n 2 modal operators  p - p possible true p - p necessarily true Sin-3 ) the rules of L P are in L M Sin-4 ) p  L P implies that  p, p  L M n Possible worlds n The structure of the model is given by relating different worlds via a binary accessibility relation n M 1 = W - a set of worlds L:W  P (  ) - set of formula true in a world, R  W X W n  pp - it rains in NY n qq - the sun will rise tomorrow

11 Sem-4 ) M 1 |= W  iff  L(w), where   Sem-5 ) M 1 |= W p  q iff M 1 |= W p and M 1 |= W q Sem-6 ) M 1 |= W  p iff M 1 |=/ W p Sem-7 ) M 1 |= W  p iff (  w': R(w,w')  M 1 |= W' p) Sem-8 ) M 1 |= W p iff (  w': R(w,w')  M 1 |= W' p) in w 0 ? p, ? q, ?  r ?  p The accessibility relation - reflexive iff (  w: (w,w)  R) p  p - serial iff (  w: (  w': (w,w')  R)) p   p - transitive iff (  w 1,w 2,w 3 : (w 1,w 2 )  R  (w 2, w 3 )  R  (w 1,w 3 )  R) p  p - symmetric iff (  w 1,w 2 : (w 1,w 2 )  R  (w 2,w 1 )  R)p   p - euclidian iff (  w 1,w 2,w 3 : (w 1,w 2 )  R  (w 1, w 3 )  R  (w 2,w 3 )  R)  p   p 11 w 0 p, q,  r w 1 p, q,  r w 2 p,  q,  r w 3 p, q,  r

12 12 FOL augmented with two modal operators K(a,  ) - a knows  B(a,  ) - a believes  n Associate with each agent a set of possible worlds n M k = W - a set of worlds L:W  P (  ) - set of formula true in a world, R  A x W X W n An agent knows/believes a propositions in a given world if the proposition holds in all worlds accessible to the agent from the given world B(Bill, father-of(Zeus, Cronos)) ? B(Bill, father-of(Jupiter,Saturn)) referential opaque operators n The difference between B and K is given by their properties 4 Logics of knowledge and belief

13 Properties of knowledge (A1) Distribution axiom K(a,  )  K(a,    )  K(a,  ) (A2) Knowledge axiom K(a,  )   - satisfied if R is reflexive (A3) Positive introspection axiom K(a,  )  K(a, K(a,  )) - satisfied if R is transitive (A4) Negative introspection axiom  K(a,  )  K(a,  K(a,  )) - satisfied if R is euclidian 13 Properties of beliefs (A1) - OK, (A2) - no, (A3) - yes, (A4) - maybe but more problematic Inference rules (R1) Epistemic necessitation |-  infer K(a,  ) (R2) Logical omniscience    and K(a,  ) infer K(a,  ) problematic w 0 p, q,  r w 1 p, q,  r w 2 p,  q,  r w 3 p, q,  r in w 0 ?K(a,p), ?K(a,  r), ?K(a,q)

14 Two-wise men problem - Genesereth, Nilsson (1) A and B know that each can see the other's forehead. Thus, for example: (1a) If A does not have a white spot, B will know that A does not have a white spot (1b) A knows (1a) (2) A and B each know that at least one of them have a white spot, and they each know that the other knows that. In particular (2a) A knows that B knows that either A or B has a white spot (3) B says that he does not know whether he has a white spot, and A thereby knows that B does not know 14 1. K A (  White(A)  K B (  White(A)) (1b) 2. K A (K B (White(A)  White(B))) (2a) 3. K A (  K B (White(B))) (3) 4.  White(A)  K B (  White(A))1, A2 5. K B (  White(A)  White(B))2, A2 6. K B (  White(A))  K B (White(B))5, A1 7.  White(A)  K B (White(B))4, 6 8.  K B (White(B))  White(A)contrapositive of 7 9. K A (White(A))3, 8, R2 Proof

15 5 Dynamic logic, temporal logic Dynamic logic - the modal logic of action L D and L R Builds on L P, A - set of action symbols a;b - do a and b in sequence a+b - do either a or b - nondeterministic choice p? - an action based on the truth value of p a* - 0 or more (finitely many) iterations of a p - the execution of a will possibly make p true [a]p - the execution of a will necessarily make p true, [a]  L R, p  L D M 2 = W - a set of worlds L:W  P (  ) - set of formula true in a world, R  A X W X W R - accessibility relation based on L R - a world is accessible by executing an action a Sem-9 ) M 2 |= W p iff (  w': R a (w,w')  M 2 |= W' p) Sem-10 ) M 2 |= W [a] p iff (  w': R a (w,w')  M 2 |= W' p) 15

16 Temporal logic - the modal logic of time n Linear vs. branching; the branching can be in the past, in the future of both n Time is viewed as a set of moments with a strict partial order, <, which denotes temporal precedence. n Every moment is associated with a possible state of the world, identified by the propositions that hold at that moment n In a branching logic of time, a path at a given moment is any maximal set of moments containing the given moment and all the moments in the future along some particular branch of < Modal operators p U q - p is true until q becomes true - until Xp - p is true in the next moment - next Pp - p was true in a past moment - past Fp - p will eventually be true in the future - eventually Gp - p will always be true in the future – always F = ? U G = ? F 16 Fp  true U p Gp   F  p

17 Branching temporal and action logic - CTL n Temporal structure with a branching time future and a single past - time tree n Situation - a world w at a particular time point t, w t n State formulas - evaluated at a specific time point in a time tree n Path formulas - evaluated over a specific path in a time tree Modal operators over both state and path formulas Temporal logicFp - p will sometime be true in the future - eventually Gp - p will always be true in the future - always Xp - p is true in the next moment - next p U q - p is true until q becomes true - until Modal operators over path formulas - Branching temporal Ap - at a particular time moment, p is true in all paths emanating from that point - inevitable p Ep - at a particular time moment, p is true in some path emanating from that point - optional p Dynamic logic indexed over agentsx[a]px p Other modal operators Va:p - there is a under which p comes trueR - reality operator 17

18 n s is true in each time point (situation) and on all path n r is true in each time point on a single path n q will eventually be true on all path n q will eventually be true on a single path 18 rsrs s sqsq rsrs psqpsq rsqrsq s EFp EGr AFq AGs p -Alice visits Parisq - be spring time r - Alice lives in Italys – Paris is in France

19 n Each situation has associated a set of accessible words - the worlds the agent believes to be possible. Each such world is a time tree. n Within these worlds, the branching future represents the choices (options) available to the agent in selecting which action to perform n Similar to a decision tree in games of chance 19 Player 1 Player 2 Player 1 Dice Chance nodes Decision nodes Each arc emanating from a chance node corresponds to a possible world Each arc emanating from a decision node corresponds to choice available in a possible world 1/36 1/18 Dice 1/361/18

20 L B - set of moment formula L S - set of path-formula, B - set of agents, V - set of variables Syntax - see book Semantics M4 = - every t  T has associated a world w t  W Sem-14 ) M 4 |= t  iff t  |  |, where    is true in the set of moments for which  holds Sem-15 ) M 4 |= t p  q iff M 4 |= t p and M 4 |= t q Sem-16 ) M 4 |= t  p iff M 4 |=/ t p Sem-17 ) M 4 |= s,t pUq iff (  t': t  t' and M 4 |= s,t' q and (  t": t  t"  t'  M 4 |= s,t" p)) p holds on a path starting in the current moment until q comes true Sem-18 ) M 4 |= s,t X p iff M 4 |= s,t+1 p) Fp  true Up Gp   F  p 20

21 Sem-19 ) M 4 |= s,t x[a]p iff (  t'  s: [s;t,t']  |a| x  M 4 |= s,t' p) p is true on all the set of moments t' on a given path s starting at the current moment t while agent x executes action a Sem-20 ) M 4 |= s,t x p iff (  t'  s: [s;t,t']  |a| x  M 4 |= s,t' p) p is true at a moment t' on a given path s starting at the current moment t while agent x executes action a Sem-21 ) M 4 |= t A p iff (  s: s  S t  M 4 |= s,t p) s is a path, S t - all paths starting at the present moment E = ?A Sem-22 ) M 4 |= t (V a : p) iff (  b: b  B and M 4 |= t p| a b ) there is an action, be it b, under which p comes true, if executed at t Sem-23 ) M 4 |= t R p iff M 4 |= R(t),t p) R picks out at each moment the real path at that moment p holds in the real path at the present moment 21 Ep   A  p

22 6 BDI logic Modal operators Bel, Des, Int, (K h, K W ) L I based on L B and L S, set of agents A Sin18) if p  L S and x  A then xBelp, xIntp, xDesp, xK h p  L I xDes(A Fwin)  xInt(E Fbuy)   xBel(A Fwin) M 5 = B - belief accessible relation - belief accessible worlds; the worlds the agent believes possible  Require the desires to be consistent; therefore Desires  Goals D - desire (goal) accessible relation  Each situation has associated a set of goal-accessible worlds - realism  Strong realism = for each belief-accessible world w at a given time moment t, there must be a goal-accessible world that is a sub-world of w at time t I - intention accessible relation  Intentions - similarly represented by sets of intention-accessible worlds. These are the worlds the agent has committed to realize.  Corresponding to each goal-accessible world at some time t there must be an intention-accessible world that is a subworld of w at time t 22

23 rsrs s sqsq rsrs psqpsq rsqrsq s rsrs psqpsq s belief accessible world goal accessible world intention accessible world 23 p -Alice visits Parisq - be spring time r - Alice lives in Italys – Paris is in France rsrs rsqrsq

24 Sem-24 ) M 5 |= t xBelp iff (  t': (t,t')  B(x,t)  M 5 |= t' p) an agent x has a belief p in a given moment t if and only if p is true in all belief accessible worlds of the agent in that moment Sem-25 ) M 5 |= t xDesp iff (  t': (t,t')  D(x,t)  M 5 |= t' p) an agent x has a desire p in a given moment t if and only if p is true in all goal accessible worlds of the agent in that moment Sem-26 ) M 5 |= t xIntp iff (  s: s  I(x,t)  M 5 |= s,t Fp) at each moment t, I assigns a set of paths that the agent x has selected or preferred, i.e., if the agent has selected p as an intention, p will hold eventually in the future Properties of BDI and K W 24 (A2) Knowledge axiom aK w p  p (A3) Positive introspection axiom aBelp  aBel(aBelp)) - satisfied if B is transitive (A4) Negative introspection axiom  aBelp  aBel(  aBelp)) - satisfied if B is euclidian

25 Belief-goal compatibility If an agent adopts p as a goal, the agent believes p; the agent believes that there is a path on which p will be true as it is an adopted desire but it needs not believe that it will ever reach that point xDesp  xBelp Goal-intention compatibility If an agent adopts p as an intention, it should have adopted it as a goal to be achieved xIntp  xDesp Beliefs about intentions xIntp  xBel(xIntp)) No infinite deferral The agent should not procrastinate with respect to its intentions; if the agent forms an intention, then sometimes in the future it will give up this intention xIntp  A F(  xIntp)) 25

26 7 Commitments as change n Desires (goals) and intentions are quite similar in their semantic structure. The difference in these modalities arises in their relationships with the other modalities and in terms of how they may evolve over time. n An agent is treated as being committed to its intention but, cf. no infinite deferral, it will give up these intentions eventually - when? n Different types of agents will have different commitment strategies. Blindly committed agent o maintains its intentions until it believes it has achieved them xInt(A Fp)  A (xInt(A Fp)  xBelp) (exclusive  ) o an agent can be committed to means (p is an action) or to ends (p is a formula) o defined only for intentions toward actions or conditions that are true for all paths in the agent's intention accessible worlds. o nothing specified about the commitment of agents to optionally (E) achieve particular means or ends 26

27 Blindly committed agent Blindly committed agent (same as the prev slide) o maintains its intentions until it believes it has achieved them xInt(A Fp)  A (xInt(A Fp)  xBelp) Agent control loop B = B 0 ; I = I 0 ; D = D 0 ; while true do get next perceipt p; B = brf(B,p); I = options(D,I) ; /* D = options(B,I); */ I = filter(B, D, I);  = plan(B, I); execute(  ); end while 27

28 Single-minded committed agent o maintains its intentions as long as it belives they are still options xInt(A Fp)  A (xInt(A Fp)  (xBelp   xBel(E Fp))) Agent control loop B = B 0 ; I = I 0 ; D = D 0 while true do get next perceipt p ; B = brf(B,p) ; D = options(B,I); /* I = options(D,I) ; */ I = filter(B, D, I) ;  = plan(B, I) ; while not (empty(  ) or succeeded (I, B) or impossible(I, B)) do  = head(  ); execute(  );  = tail(  ) get next perceipt p ; B = brf(B,p) ; if not sound( , I, B) ; then  = plan(B, I) ; end while 28

29 Open-minded committed agent o maintains its intentions as long as these intentions are still its desires (goals) xInt(A Fp)  A (xInt(A Fp)  (xBelp   xDes(E Fp))) Agent control loop B = B 0 ; I = I 0 ; D = D 0 ; while true do get next perceipt p ; B = brf(B,p); D = options(B,I); I = filter(B, D, I) ;  = plan(B, I) ; while not (empty(  ) or succeeded (I, B) or impossible(I, B)) do  = head(  ); execute(  );  = tail(  ) ; get next perceipt p ; B = brf(B,p); D = options(B,I); I = filter(B, D, I) ; if not sound( , I, B) then  = plan(B, I) ; end while 29 if reconsider(I,B) thenendif

30 References o M. P. Singh, A.S. Rao. Formal methods in DAI: Logic-based representation and reasoning. In Multiagent Systems - A Modern Approach to Distributed Artficial Intelligence, G. Weiss (Ed.), The MIT Press, 2001, p.331-355. o M. Wooldrige. Reasoning about Rational Agents. The MIT Press, 2000, Chapter 2 o A.S. Rao, M.P. Georgeff. Modeling rational agents within a BDI- architecture. In Readings in Agents, M. Huhns & M. Singh (Eds.), Morgan Kaufmann, 1998, p.317-328. o M.R. Genesereth, N.J. Nilsson. Logical Foundations of Artificial Intelligence. Morgan Kaufmann, 1987, Chapter 9. o D. Kayser: La représentation des connaissances. Hermès, 1997. o J.Y. Halpern. Reasoning about knowledge: A survey. In Handbook of Logic in Artificial Intelligence and Logic Programming, Vol.4, D. Gabbay, C.A. Hoare, J.A. Robinson (Eds.), Oxford University Press, 1995, p.1-34.  A. Florea. Bazele logice ale inteligentei artificiale. UPB, 1995. 30


Download ppt "Lecture 4 Multi-Agent Systems Lecture 4 Computer Science WPI Spring 2002 Adina Magda Florea"

Similar presentations


Ads by Google