1 / 99

KGP A Computational Logic Based Model of Agency

KGP A Computational Logic Based Model of Agency. Fariba Sadri Imperial College London ICCL Summer School Dresden August 2008. Outline. KGP introduction KGP extension with normative concepts. KGP – Introduction The SOCS Project.

elinj
Download Presentation

KGP A Computational Logic Based Model of Agency

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. KGP A Computational Logic Based Model of Agency Fariba Sadri Imperial College London ICCL Summer School Dresden August 2008 Fariba Sadri ICCL 08 KGP

  2. Outline • KGP introduction • KGP extension with normative concepts Fariba Sadri ICCL 08 KGP

  3. KGP – IntroductionThe SOCS Project The KGP model was initially developed within the EU SOCS project, 2002-2006. SOCS: Societies of Computational Entities http://lia.deis.unibo.it/research/socs/ SOCS Partners: Imperial College, City, Cyprus, Pisa, Bologna, Ferrara Fariba Sadri ICCL 08 KGP

  4. KGP – Introduction KGP Knowledge Goals Plan Inspired by BDI! Fariba Sadri ICCL 08 KGP

  5. KGP – Introduction KGP integrates various aspects of agency • Autonomy • Reasoning (e.g. for Planning/Proactivity) • Reactivity • Situatedness – awareness of the environment/other agents • Interaction amongst agents • Goal introduction • Declarative control • (some) Belief revision Fariba Sadri ICCL 08 KGP

  6. KGP – Introduction • General purpose • Highly modular • Based on computational logic • Includes • an abstract model (declarative semantics) • a computational model (operational semantics) • a prototype implementation (PROSOCS) Fariba Sadri ICCL 08 KGP

  7. Modularity Fariba Sadri ICCL 08 KGP

  8. KGP – Introduction • Heterogeneity • Dynamic open environments • Adaptability to changes in the environment • Dynamic context-dependent control Fariba Sadri ICCL 08 KGP

  9. KGP – Introduction KGP agent: Decides its goals Write a paper Attend to the garden Book my travel Make dinner Repair the roof Fariba Sadri ICCL 08 KGP

  10. KGP – Introduction KGP agent: Observes its environment It is raining. Water is pouring in through the roof. Fariba Sadri ICCL 08 KGP

  11. KGP – Introduction KGP agent: adjusts its goals to the observations Write a paper Attend to the garden Book my travel Make dinner Repair the roof Fariba Sadri ICCL 08 KGP

  12. KGP – IntroductionKGP agent: Plans (partially) for its goals and executes actions Repair the roof Check bank balance at T1 Call roofer at T2, T2>T1 Make domestic arrangements at T4, T4>T2, T4>T3 Call decorator at T3, T3>T1 Fariba Sadri ICCL 08 KGP

  13. KGP – Introduction KGP agent: Adjusts its plans Bank balance very low Additional Goal: Find Money Fariba Sadri ICCL 08 KGP

  14. KGP – Introduction KGP agent: Reacts to information/interaction from the environment What should my answer be? Can you lend me money on the 10th? Policies for communication and negotiation Fariba Sadri ICCL 08 KGP

  15. KGP Architecture An agent is characterised by: • An internal mental state • A set of reasoning capabilities with associated knowledge bases • A set of physical and sensing capabilities • A set of formal state transition rules • A set of selection operators • A control(cycle) theory Fariba Sadri ICCL 08 KGP

  16. Control: Cycle Theories Choose next Transition to apply GI PI RE AE AOI POI SI SR State Environment Agent’s activities Other Conditions Selection Operators The Capabilities and Associated KBs Fariba Sadri ICCL 08 KGP

  17. Fariba Sadri ICCL 08 KGP

  18. KGP Architecture Agent Internal Mental State < KB0, F, C,  > • KB0 : a KB holding dynamic knowledge of the agent • F : a forest of trees representing the goal structure of the agent • C : the temporal constraint store •  : a set of equalities instantiating time variables Fariba Sadri ICCL 08 KGP

  19. KGP Architecture : KB0in state< KB0, F, C,  > • KB0 of agent x records: • actions executed by x (+ time of execution)executed(a, t) • properties (fluent literals) observed by x (+ time of observation)observed(fl, t) • actions x observes as being executed by other agents y (+ time of execution by y + time of observation by x) observed(y, a[t'], t) Fariba Sadri ICCL 08 KGP

  20. KGP Architecture : KB0 cntd. • KB0 isupdated as the agent: • Observes the world (via its sensing capability) • Executes actions (via its actuating capability) • KB0is contained within all the other KBs(and used by all the reasoning capabilities). Fariba Sadri ICCL 08 KGP

  21. KGP Architecture : Fin state < KB0, F, C,  > • F is a forest of trees • Each tree represents a goal hierarchy (goal/subgoal relationships) • Each node is a (timed) goal which is • Non-exectuable (subgoal) • Executable (action) • The root nodes represent a conjunction of literals and the leaf nodes together represent a (partial) plan for the goal at the root Fariba Sadri ICCL 08 KGP

  22. KGP Architecture : Fin state < KB0, F, C,  > G1 G2 ….. Gn G11 G12 G21 An1 Gn1 A11 A12 The top level goals, Gi, are conceptually conjoined. Fariba Sadri ICCL 08 KGP

  23. KGP Architecture : FInformal example of a Tree in F G: repair_roof(T), 5<T<20 G1: have_resource(r1,T1) 5<T1<18 A1: tell(a,b,request(assistance),T3) T3<20, T3>T1, T3>T2 G2: have_resource(r2,T) 5<T2<18 A2: tell(a,c,request(r1),T4) T4<T1 Fariba Sadri ICCL 08 KGP

  24. KGP Architecture : F cntd. • Goals can be: • Mental(under the control of the agent) e.g. repair_roof(T) • Sensing( not under the control of the agent and observable by sensing the external environment) e.g. weather_is_dry(T) Fariba Sadri ICCL 08 KGP

  25. KGP Architecture : F cntd. Actions can be: • Physical e.g. clear_table(T) book_ticket(london, tokyo, T) • Sensing (actively observe) e.g. sense(connection_on, T) • Communicative e.g. tell(x, y, request(r1), d, T) Fariba Sadri ICCL 08 KGP

  26. KGP Architecture :C - Temporal Constraint Store C is the temporal constraints store. In the previous example C will include: 5<T1<18, 5<T2<18 T3<20, T3>T1, T3>T2 T4<T1 Fariba Sadri ICCL 08 KGP

  27. KGP declarative model:Reasoning Capabilities • Planning: generates partial plans for given sets of goals in the State • Temporal reasoning: reasons about the evolving environment,andmakes predictions about properties holding in the environment • Reactivity: reacts to perceived changes in the environment by generating goals and actions to be added to the State Fariba Sadri ICCL 08 KGP

  28. Reasoning Capabilities cntd. • Identification of preconditions and effects of actions:to determine appropriate sensing actions, to check if an action can be executed and if recently executed actions have been successful. • Goal decision:torevise the top-most level goals of the agent, adapting to the perceived changes in the environment and the agent’s preferences. Fariba Sadri ICCL 08 KGP

  29. Reasoning Capabilities: General • Each reasoning capability: • uses a KB and • is defined formally by means of an “entailment” wrt the KB (and, where appropriate, a time point, now) • The knowledge bases are either abductive logic programs or logic programs with priorities. Fariba Sadri ICCL 08 KGP

  30. Reasoning Capabilities:Formal specifications Abductive logic programming for: • Planning • Temporal reasoning • Reactivity • Identification of preconditions and effects of actions Logic programming with priorities for: • Goal decision Fariba Sadri ICCL 08 KGP

  31. Reasoning Capabilities: Planning KBplan : Abductive Event Calculus for Planning KBplan = < Pplan, Aplan, Iplan > Logic program Abducible Integrity with predicates constraints constraints Fariba Sadri ICCL 08 KGP

  32. Reasoning Capabilities:Planning cntd. Formal specification of the Planning capability: The idea is: • Planning is specified via the semantics of abductive logic programs • To plan for a goal we take into account • all dynamic information received via observations and • all other partial plans already in the state. Fariba Sadri ICCL 08 KGP

  33. Reasoning Capabilities:Planning cntd. Formal specification of the Planning capability: Let KBnowplan be KBplan{time_now(now)} . Let S =<KB0, F, C,  > . Let G=g[T] be a mental goal in a leaf in F. Let 0 be the set of all abducibles already in F. Let C 0 = C  . Fariba Sadri ICCL 08 KGP

  34. Reasoning Capabilities:Planning cntd. Then S, G |=nowplan (, Tc) where such that( , Tc) is an abductive answer to the query holds_at(G, T) wrt (KBnowplan , 0 , C0). To allow partial planning: holds_at(F,T) ifassume_holds(F,T) Fariba Sadri ICCL 08 KGP

  35. Reasoning Capabilities: Underlying (C)LP-based semantics • The KGP model is parametric on: • ⊨ALP: some semantics for ALPs • ⊨pr: some semantics for logic programs with priorities (and negation) • ⊨:some semantics for constraint satisfaction • Operational model of the KGP assumes concrete instances of the above. Fariba Sadri ICCL 08 KGP

  36. Reasoning Capabilities: Reactivity In the KGP reactivity is used for : • To specify reactions to the environment, similar to condition-action rules • To specify interaction policies • To specify plan repair steps Fariba Sadri ICCL 08 KGP

  37. Reasoning Capabilities: Reactivity KBreact = KBplan + some additional integrity constraints we call Reactive Constraints Fariba Sadri ICCL 08 KGP

  38. Reasoning Capabilities: ReactivityFormal Specification Reactivity computes all the necessary reactions to the current state of the agent, including its current goals and its observations recorded in KB0. S|=nowreact (Gs, Tc) where Gs is a set of assume_happens atoms and assume_holds atoms in some  such that ( , Tc) is an abductive answer to the query true wrt (KBnowplan , 0 , C0). Fariba Sadri ICCL 08 KGP

  39. Reasoning Capabilities: Goal Decision KBgd is an abductive logic program with priorities. Example: Basic part: gd(garden): garden(T)  holds_at(finished_work,T) gd(repair): repair(T) holds_at(leaky_roof, T) Auxiliary part: Typeof(garden,optional) typeof(repair,required) more-urgent-wrt-type(required, optional) Behaviour part: gd_pref(X,Y):gd(Y)>gd(X)  typeof(X,TX), typeof(Y,TY), more-urgent-wrt-type(TY,TX) Fariba Sadri ICCL 08 KGP

  40. Reasoning Capabilities: Goal Decision cntd. Formal specification of GD: S|=nowgdGs iff Gs is a maximal set {G1, G2, …, Gn} of pairs Gi=<gi(Ti), TCi> such that KBnowgd |=pr <g1(T1), TC1> <g2 (T2), TC2> ….  <gn (Tn), TCn> Fariba Sadri ICCL 08 KGP

  41. Reasoning Capabilities:Summary • |=plan KBplan • |=tr KBtrAbductive logic • |=react KBreact prgogrammin • |=gd KBgd Logic programming with priorities • |=pre KBpre • |=eff KBefLogic programming Fariba Sadri ICCL 08 KGP

  42. Physical capabilities • Sensing capability: • Links the agent to its environment, including other agents • Allows agents to observe actions and fluents • sensing(L, t) = L’ • E.g. sensing((rain, door-open, window-open), 10) ={<rain, true>, <window-open, false>} • Actuating capability: • actuating(As, t) = As’ Fariba Sadri ICCL 08 KGP

  43. Transitions Transitions use the capabilities and change the state of the agent Transitions are of the form S=< KB0, F, C,  >, Input at timenow S’= < KB0’, F’, C’, ’ > Fariba Sadri ICCL 08 KGP

  44. Transitions – Brief Descriptions • Goal Introduction - GI: introduces new top level goals • Plan Introduction - PI: performs partial planning for the selected set of goals and updates the state accordingly • Reactivity - RE: extends the state with the generated reactions • Action Execution - AE: executes the selected set of actions Fariba Sadri ICCL 08 KGP

  45. Transitions –Brief Descriptions cntd. • Passive Observation Introduction - POI: senses the environment and records whatever is observed • Active Observation Introduction - AOI: senses the environment for a specific set of fluents and records the result • Sensing Introduction - SI: introduces new actions in the state for sensing the preconditions of some existing actions in Plan Fariba Sadri ICCL 08 KGP

  46. Transitions –Brief Descriptions cntd. • State Revision - SR: revises the state by removing timed out goals/actions and goals/actions that are no longer needed. Fariba Sadri ICCL 08 KGP

  47. Transitions: an exampleAction Execution (informally) AE :< KB0, F, C,  >, SAs now < KB0’, F, C, ’ > SAs will be a non-empty set ofsensingandnon-sensingactions. Then KB0 is updated by recording in it: • the non-sensing actions that were executed by the actuating capability, and • any information that the sensing actions bring in about the environment.  is updated by recording all the new time instantiations. Fariba Sadri ICCL 08 KGP

  48. Example 1 John is a businessman in Europe, and psa is his personal service agent. GI: psa has the goal : gain entry to museum PI: buy a ticket POI: psa “hears” that it is European Heritage day when all museums are free. SR: goal and plan are deleted as the goal is already achieved and the plan is no longer needed. Fariba Sadri ICCL 08 KGP

  49. Example 2 psa has the goal to have a plane ticket for a trip from London to Madrid. PI:Buy ticket online The action has pre-conditions -have internet connection sensing goals -destination available online SI: Introduce sensing actions for these preconditions AE: The sensing actions are executed first. Depending on their outcome: Either AE: To buy the ticket, Or SR and PI: To revise the state and re-plan. Fariba Sadri ICCL 08 KGP

  50. Cycle theories for declarative control • Cycle theory determines the sequences of transitionsdynamicallyand declaratively: Allowing Flexible control, e.g. tailored to agent profile/environment/application • Different cycle theories give rise to different profiles of agent behaviour • Control via cycle theories can in principle be adopted by any agent architecture Fariba Sadri ICCL 08 KGP

More Related