formal models for representing agents lecture outline

28
Multi-Agent Systems Lecture 4 Lecture 4 University “Politehnica” of Bucarest 2003 - 2004 Adina Magda Florea [email protected] http://turing.cs.pub.ro/blia_2004

Upload: ilori

Post on 12-Feb-2016

38 views

Category:

Documents


0 download

DESCRIPTION

Multi-Agent Systems Lecture 4 University “Politehnica” of Bucarest 2003 - 2004 Adina Magda Florea [email protected] http://turing.cs.pub.ro/blia_2004. Formal models for representing agents Lecture outline. 1Knowledge representation for agents 2FOL 3Modal logic - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Formal models for representing agents Lecture outline

Multi-Agent SystemsLecture 4Lecture 4

University “Politehnica” of Bucarest2003 - 2004

Adina Magda [email protected]

http://turing.cs.pub.ro/blia_2004

Page 2: Formal models for representing agents Lecture outline

Formal models for Formal models for representing agentsrepresenting agentsLecture outlineLecture outline11 Knowledge representation for agentsKnowledge representation for agents22 FOLFOL33 Modal logicModal logic44 Logics of knowledge and beliefLogics of knowledge and belief55 Dynamic logic, temporal logicDynamic logic, temporal logic66 BDI logicsBDI logics77 Commitments as changeCommitments as change

Page 3: Formal models for representing agents Lecture outline

3

Logic based representation– unique (almost) syntax xy loves(x,y)– formal (clear, well-defined) semantics BelAloves(Bill, Mary)

shape(round) color(green) type(apple) 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 Frame-based representation

– units, frames– subset of logic, represents relationship structured around objects in the

universeapple01shape: round color: green type: apple

1 Knowledge representation for 1 Knowledge representation for agentsagents Cognitive agents

declarative representaton, AI

Whatthe agentknows/believes

Page 4: Formal models for representing agents Lecture outline

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

BDI representations– combines most (all) of the above

A big diversity of techniques and formalisms to represent interactions:– communication– cooperation– coordination

No symbolic representation

4

When and whatto do

What the agent believes andwhen and what to do

How to cope with otheragents in the environment

Reactive agents

Page 5: Formal models for representing agents Lecture outline

Logic based representationsLogic based representations 2 possible aims

– to make MAS function according to the logic– to specify and validate the design

Conceptualization of the world / problem Syntax - wffs Semantics - significance, model Model - the domain interpretation for which a formula is true Model - linear or structured M |=S - " is true or satisfied in component S of the structure M"

Model theoryModel theory Generate new wffs that are necessarily true, given that the old wffs are

true - entailment KB |= Proof theoryProof theory Derive new wffs based on axioms and inference rules KB |-i

5

Page 6: Formal models for representing agents Lecture outline

PrL, PL

6

Extend PrL, PL

Tropistic agents(reactive)

Sentential logicof beliefsUses beliefs atoms BA()Index PL with agents

Modal logicModal operators

Logics of knowledgeand beliefModal operators B and K

Dynamic logicModal operatorsfor actions

Temporal logicModal operators for timeLinear timeBranching time

CTL logicBranching timeand action BDI logic

Adds agents, B, D, I

Linear model

Structured models

Situation calculusAdds states, actions

Symbol levelSymbol level

Knowledge levelKnowledge level

Page 7: Formal models for representing agents Lecture outline

2 First order logic2 First order logic LP - the language of Propositional logic - the set of atomic propositions

Sin-1) implies that LP

Sin-2) p, q LP implies that pq LP, q LP

M0 =<L> is the formal model for LP

L - interpretation

Sem-1) M0 |= iff L, where

Sem-2) M0 |= pq iff M0 |= p and M0 |= q

Sem-3) M0 |= p iff M0 |=/ p

p = A B A - it rains q = A B B - take umbrella r = A A

7

A B A B AB AAT T T T TT F F F TF T T F TF F T F T

Knowledge represents:“atomic” propositions

Page 8: Formal models for representing agents Lecture outline

Predicate logic 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

p = (x) young(x) success(x) q = (x) young(x) success(x)

D = {Bill, Tom, Alice} M M |= px young(x) success(x) M |=/ qBill T TTom F TAlice F F

8

Page 9: Formal models for representing agents Lecture outline

9

knowledge propositional first-order

Paul is a man a man(Paul)

Bill is a man b man(Bill)

men are mortal c (x) (man(x) mortal(x))

knowledge first-order second-order

smaller istransitive

( x) (( y) (( z)((<(x,y) <(y,z)

<(x,z)))))

transitive(<)

part-of istransitive

( x) (( y) (( z)((part-of(x,y) part-of(y,z) part-of(x,z)))))

transitive(part-of)

R is transitive iffwhenever R(x,y) andR(y,z) hold, R(x,z)

holds too

not expressible(see however pseudo-

second order)

( R) ((transitive(R) ( x) (( y) (( z)((R(x,y) R(y,z)

R(x,z)))))))

Higher order logic

Page 10: Formal models for representing agents Lecture outline

10

3 Modal logic3 Modal logic LM - the language of Modal logic 2 modal operators

p - p possible true p - p necessarily true

Sin-3) the rules of LP are in LM

Sin-4) p LP implies that p, p LM

Possible worlds The structure of the model is given by relating different worlds

via a binary accessibility relation M1 =<W, L, R> W - a set of worlds

L:W P() - set of formula true in a world, R W X W

p p - it rains in NY q q - the sun will rise tomorrow

Page 11: Formal models for representing agents Lecture outline

Sem-4) M1 |=W iff L(w), where

Sem-5) M1 |=W pq iff M1 |=W p and M1 |=W q

Sem-6) M1 |=W p iff M1 |=/W p

Sem-7) M1 |=W p iff (w': R(w,w') M1 |=W' p)

Sem-8) M1 |=W p iff (w': R(w,w') M1 |=W' p)

in w0 ? p, ? q, ? r

? qThe accessibility relation

- reflexive iff (w: (w,w)R) p p

- serial iff (w: (w': (w,w')R)) p p- transitive iff (w1,w2,w3: (w1,w2)R (w2, w3)R (w1,w3)R)

p p- symmetric iff (w1,w2: (w1,w2)R (w2,w1)R) p p

- euclidian iff (w1,w2,w3: (w1,w2)R (w1, w3)R (w2,w3)R) p p

11

w0

p, q, r

w1

p, q, r

w2

p, q, r

w3

p, q, r

Page 12: Formal models for representing agents Lecture outline

12

FOL augmented with two modal operatorsK(a,) - a knows B(a,) - a believes

Associate with each agent a set of possible worlds Mk =<W, L, R> W - a set of worlds

L:W P() - set of formula true in a world, R A x W X W

An agent knows/believes a propositions in a given world if the proposition holds in all worlds accessible to the agent from the given worldB(Bill, father-of(Zeus, Cronos))? B(Bill, father-of(Jupiter,Saturn))referential opaque operators

The difference between B and K is given by their properties

4 Logics of knowledge and 4 Logics of knowledge and beliefbelief

Page 13: Formal models for representing agents Lecture outline

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

w0

p, q, r

w1

p, q, r

w2

p, q, r

w3

p, q, r

in w0 ?K(a,p), ?K(a, r), ?K(a,q)

Page 14: Formal models for representing agents Lecture outline

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. KA(White(A) KB( White(A)) (1b)2. KA(KB(White(A) White(B))) (2a)3. KA(KB(White(B))) (3)4. White(A) KB(White(A)) 1, A2 A2: K(a, )

5. KB(White(A) White(B)) 2, A2

6. KB(White(A)) KB(White(B)) 5, A1 A1: K(a, ) K(a, ) K(a, )

7. White(A) KB(White(B)) 4, 6

8. KB(White(B)) White(A) contrapositive of 79. KA(White(A)) 3, 8, R2

Proof

Page 15: Formal models for representing agents Lecture outline

5 Dynamic logic, temporal logic5 Dynamic logic, temporal logicDynamic logic - the modal logic of actionLD and LR Builds on LP , A - set of action symbols

a;b - do a and b in sequencea+b - do either a or b - nondeterministic choicep? - an action based on the truth value of p - deterministic choicea* - 0 or more (finitely many) iterations of a

<a>p - the execution of a will possibly make p true[a]p - the execution of a will necessarily make p true

<a>, [a] LR , p LD

M2 = <W, L, R> 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 LR - a world is accessible by executing an action a

Sem-9) M2 |=W <a> p iff (w': Ra(w,w') M2 |=W' p)

Sem-10) M2 |=W [a] p iff (w': Ra(w,w') M2 |=W' p)15

Page 16: Formal models for representing agents Lecture outline

Temporal logic - the modal logic of time Linear vs. branching; the branching can be in the past, in the future of

both Time is viewed as a set of moments (T) with a partial order, <, which

denotes temporal precedence. Every moment is associated with a possible state of the world, identified

by the propositions that hold at that moment 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 of temporal logicp U q - p is true until q becomes true - untilXp - p is true in the next moment - nextPp - p was true in a past moment - past

Fp - p will sometime (eventually) be true in the future - eventuallyGp - p will always be true in the future – always

G = ? F

16

Gp F p

Page 17: Formal models for representing agents Lecture outline

Branching temporal and action logic - CTL Temporal structure with a branching time future and a single past - time tree Situation - a world w at a particular time point t, wt

State formulas - evaluated at a specific time point in a time tree Path formulas - evaluated over a specific path in a time tree

Modal operators over state formulas - Temporal logicFp - p will sometime be true in the future - eventuallyGp - p will always be true in the future - alwaysXp - p is true in the next moment - nextp U q - p is true until q becomes true - until

Modal operators over path formulas - Branching temporalAp - at a particular time moment, p is true in all paths emanating from that point - inevitable pEp - at a particular time moment, p is true in some path emanating from that point - optional p

Modal operators for actions - Dynamic logic indexed over agentsx[a]p x<a>pand Va:p - there is a under which p comes true

17

E = ?AEp A p

Page 18: Formal models for representing agents Lecture outline

s is true in each time point (situation) and on all path r is true in each time point on a single path p will eventually be true on a single path q will eventually be true on all path

18

rs

ssq

rs

psq

rsq

s

AGs

EGr

AFq

EFp

r - Alice is in Italy p -Alice visits Pariss – Paris is the capital of France q - it is spring time

F - eventuallyG - alwaysA - inevitableE - optional

Page 19: Formal models for representing agents Lecture outline

Each situation has associated a set of accessible words - the worlds the agent believes to be possible. Each such world is a time tree.

Within these worlds, the branching future represents the choices (options) available to the agent in selecting which action to perform

Similar to a decision tree in games of chance

19

Player 1

Player 2

Player 1

Dice

Chance nodes

Decision nodes

• Each arc emanating froma chance node correspondsto a possible world

• Each arc emanating froma decision node correspondsto a choice available in apossible world

1/36 1/18

Dice

1/36 1/18

Page 20: Formal models for representing agents Lecture outline

LF - set of moment formula

LS - set of path-formulaAg - set of agents, V - set of variablesT - set of time points, - partial order, | | - inverse of model

SemanticsM4 = <W, T, , | |, R> - every tT has associated a world wtW

Sem-14) M4 |=t iff t||, where is true in the set of moments for which holds

Sem-15) M4 |=t pq iff M4 |=t p and M4 |=t q

Sem-16) M4 |=t p iff M4 |=/t p

Sem-17) M4 |=s,t pUq iff (t': tt' and M4 |=s,t' q and

(t": t t" t' M4 |=s,t" p))p holds on a path starting in the current moment until q comes true

Sem-18) M4 |=s,t X p iff M4 |=s,t+1 p)

20

Page 21: Formal models for representing agents Lecture outline

Sem-19) M4 |=s,t x[a]p iff (t's: [s;t,t']|a|x M4 |=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) M4 |=s,t x<a>p iff (t's: [s;t,t']|a|x M4 |=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) M4 |=t A p iff (s: sSt M4 |=s,t p)s is a path, St - all paths starting at the present moment

Sem-22) M4 |=t (V a : p) iff (x: xAg and M4 |=t p|ax)there is an agent, be it x, capable of executing a under which p comes

true, if a is executed at t

21

Page 22: Formal models for representing agents Lecture outline

6 BDI logic6 BDI logicModal operators Bel, Des, Int, (Kh, KW)

L I based on LF and LS, set of agents AgSin18) if pLS and x Ag then xBelp, xIntp, xDesp, xKhpL I

xDes(A Fwin) xInt(E Fbuy) xBel(A Fwin)M5=<W, T, , | |, R, B, D, I>B - belief accessible relation - belief accessible worlds; the worlds the agent believes

possible

Require the desires to be consistent; therefore Desires GoalsD - 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

Page 23: Formal models for representing agents Lecture outline

rs

s sq

rs

psq

rsq

s

rs

psq

s

belief accessible world

goal accessible world

intention accessible world

23

rs

rsq

r - Alice is in Italy p -Alice visits Pariss – Paris is the capital of France q - it is spring time

Page 24: Formal models for representing agents Lecture outline

Sem-24) M5 |=t xBelp iff (t': (t,t')B(x,t) M5 |=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) M5 |=t xDesp iff (t': (t,t')D(x,t) M5 |=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) M5 |=t xIntp iff (s: sI(x,t) M5 |=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 KW

24

(A2) Knowledge axiom aKwp 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

F - eventuallyG - alwaysA - inevitableE - optional

Page 25: Formal models for representing agents Lecture outline

Belief-goal compatibilityIf an agent adopts p as a goal, 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 (xBel (E G p)

Goal-intention compatibilityIf an agent adopts p as an intention, it should have adopted it as a goal to be

achieved

xIntp xDesp

Beliefs about intentionsxIntp xBel(xIntp))

No infinite deferralThe 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

F - eventuallyG - alwaysA - inevitableE - optional

Page 26: Formal models for representing agents Lecture outline

7 Commitments as change7 Commitments as change 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.

An agent is treated as being committed to its intention but, cf. no infinite deferral, it will give up these intentions eventually - when?

Different types of agents will have different commitment strategies.

Blindly committed agentBlindly committed agent maintains its intentions until it believes it has achieved them

xInt(A Fp) A (xInt(A Fp) xBelp) (exclusive )

an agent can be committed to means (p is an action) or to ends (p is a formula)

defined only for intentions toward actions or conditions that are true for all paths in the agent's intention accessible worlds.

26

F - eventuallyG - alwaysA - inevitableE - optional

Page 27: Formal models for representing agents Lecture outline

Blindly committed agentBlindly committed agent (same as the prev slide)

maintains its intentions until it believes it has achieved them

xInt(A Fp) A (xInt(A Fp) xBelp)

Single-minded committed agentSingle-minded committed agent maintains its intentions as long as it belives they are still options

xInt(A Fp) A (xInt(A Fp) (xBelp xBel(E Fp)))

Open-minded committed agentOpen-minded committed agent maintains its intentions as long as these intentions are still its

desires (goals)

xInt(A Fp) A (xInt(A Fp) (xBelp xDes(E Fp)))

27

F - eventuallyG - alwaysA - inevitableE - optional

Page 28: Formal models for representing agents Lecture outline

ReferencesReferences 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.

M. Wooldrige. Reasoning about Rational Agents. The MIT Press, 2000, Chapter 2

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.

M.R. Genesereth, N.J. Nilsson. Logical Foundations of Artificial Intelligence. Morgan Kaufmann, 1987, Chapter 9.

D. Kayser: La représentation des connaissances. Hermès, 1997. 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.28