Скачать презентацию GOLOG David Mui EEL 6938 Outline Introduction Скачать презентацию GOLOG David Mui EEL 6938 Outline Introduction

563993108cc545ed927bbef64044fdcf.ppt

  • Количество слайдов: 40

GOLOG David Mui EEL 6938 GOLOG David Mui EEL 6938

Outline Introduction Situational Calculus GOLOG Personal Banking Assistant Using GOLOG Con. GOLOG – GOLOG Outline Introduction Situational Calculus GOLOG Personal Banking Assistant Using GOLOG Con. GOLOG – GOLOG variant Conclusion

Introduction Computers System Embedded in complex environments Software for such systems does not maintain Introduction Computers System Embedded in complex environments Software for such systems does not maintain explicit model of the world Designers/Programmers Users and designers of the system have a general mental model of the environment Problematic because they need to reconstruct the model Difficult to extend because of high level abstraction Solution: GOLOG

GOLOG What is GOLOG? An Extension of situational calculus Logic Programming Language for Dynamic GOLOG What is GOLOG? An Extension of situational calculus Logic Programming Language for Dynamic Domains Maintains explicit model of environment domain Can be queried, reasoned at runtime Based on theory of actions and preconditions First, Second order logic Applications of GOLOG? Robotics Artificial Intelligence Mechanical Devices Modeling and Simulation

Situational Calculus Logic Formalism designed for representing dynamic domains First Order/Second Order logic formulae Situational Calculus Logic Formalism designed for representing dynamic domains First Order/Second Order logic formulae Actions performed in the world Fluent describe the world state Situations Can be thought of as properties of the world Finite sequence of actions Changes to the environment result in Actions can be parametrized Sequence of actions is described as a situation S 0 defined as initial situation constant (no action or situation)

Situational Calculus Cont. Binary function do: do(a, s), denotes successor situation based on “a” Situational Calculus Cont. Binary function do: do(a, s), denotes successor situation based on “a” (action) on “s” (situation), (i. e. the new situation) Example: pickup(A , S 0) do(putdown(A) , do(walk(L), do(pickup(A) , S 0)))

Situational Calculus Cont. Properties of the environment or world can be seen as fluents Situational Calculus Cont. Properties of the environment or world can be seen as fluents Relational Fluents Truth values that may change is_carrying(robot, item, s) Functional Fluents Functions that take the situation as their final argument Returns a situation dependent value loc(robot, s)

Creating Axioms from Actions and effects of the actions are axiomatized Actions have preconditions. Creating Axioms from Actions and effects of the actions are axiomatized Actions have preconditions. World Dynamics are specified by effect axioms

Frame Problem To define a dynamic world it requires more than just action preconditions Frame Problem To define a dynamic world it requires more than just action preconditions and effect axioms Frame Axioms Defines action invariants of the domain Could be a vast number of frame axiom in a domain Fluents unaffected by the action If robot picks up an object location does not change. Example:

Solution to the Frame Problem Generate Successor state Axiom Collect all effect axioms from Solution to the Frame Problem Generate Successor state Axiom Collect all effect axioms from fluent and make a completeness assumption Assume it specifies all possibilities the fluent may change Transform effect axioms to generate successor state axiom of given fluent

Situational Calculus, Cont. A domain is defined by the following theory: Axioms defining the Situational Calculus, Cont. A domain is defined by the following theory: Axioms defining the world in different situations Action preconditions Successor state axioms Foundational axioms

Complex Actions in GOLOG Situational Calculus methods described in previous slides can not handle Complex Actions in GOLOG Situational Calculus methods described in previous slides can not handle complex actions and reasoning Procedures Loops Nondeterministic actions Need to define complex actions with additional symbols

Complex Actions, cont. Define Complex Actions using extralogical symbols (e. g. , while, if, Complex Actions, cont. Define Complex Actions using extralogical symbols (e. g. , while, if, etc. ) Extralogical expressions are macros that expand into formulas Do(δ, s, s`) is the basic abbreviation in the GOLOG language, where δ is a complex action expression, for complex operations Do(δ, s, s`) means that executing δ (complex action) in situation “s” has s` as a terminating situation

Complex Actions, cont. 1. Primitive Actions 2. Test Actions 3. Sequence Complex Actions, cont. 1. Primitive Actions 2. Test Actions 3. Sequence

Complex Actions, cont. 4. Nondeterministic choice of two actions 5. Nondeterministic choice of two Complex Actions, cont. 4. Nondeterministic choice of two actions 5. Nondeterministic choice of two arguments 6. Nondeterministic Iterations

Complex Actions, cont. Conditional and loops definition in GOLOG Procedures difficult to define in Complex Actions, cont. Conditional and loops definition in GOLOG Procedures difficult to define in GOLOG No easy way of macro expansion on recursive procedure calls to itself

Complex Actions, cont. Create auxiliary macro definition: For any predicate symbol P of arity Complex Actions, cont. Create auxiliary macro definition: For any predicate symbol P of arity n+2 taking a pair of situation arguments Define a semantic for procedures utilizing recursive calls

GOLOG in a Nutshell GOLOG programs are executed uses a theorem prover User supplies, GOLOG in a Nutshell GOLOG programs are executed uses a theorem prover User supplies, axioms, successor state axioms, initial situation condition of domain, and GOLOG program describing agent behaviour Execution of program gives:

Example GOLOG Elevator Controller Example Primitive Actions Up(n): move the elevator to a floor Example GOLOG Elevator Controller Example Primitive Actions Up(n): move the elevator to a floor n Down(n): move the elevator down to a floor n Turnoff: turn off call button n Open: open elevator door Close: close the elevator door Current. Floor(s) = n, in situation s, the elevator is at floor n On(n, s), in situation s call button n is on Next. Floor(n, s) = in situation s the next floor (n) Fluents

Example, cont. Primitive Action Preconditions Successor State Axiom Example, cont. Primitive Action Preconditions Successor State Axiom

Example, cont. One of the possible fluents Elevator GOLOG Procedures Example, cont. One of the possible fluents Elevator GOLOG Procedures

Example, cont. Theorem proving task Successful Execution of GOLOG program Returns the following to Example, cont. Theorem proving task Successful Execution of GOLOG program Returns the following to elevator hardware control system

Personal Banking Assistant Using GOLOG Personal Banking Assistant (PBA) Assists users in personal banking Personal Banking Assistant Using GOLOG Personal Banking Assistant (PBA) Assists users in personal banking over computer networks Perform transactions based on certain actions, preconditions, and situations Collection of GOLOG agents that interact Over 2000 lines of GOLOG Code Currently implemented in simulated financial environment

System Components Personal Banking Assistant Agents User interface, performs actions directed by user, and System Components Personal Banking Assistant Agents User interface, performs actions directed by user, and monitors for certain situations Bank Agents Perform backend bank operations on accounts Conducts fund transfers between different bank institutions Transfer Facilitator Agents Router Agents Performs network operations/maintenance Provides ATM interface to bank agents Automated Teller Agents

System Diagram System Diagram

PBA Fluents used by the PBA to model the world: USERACCOUNT(type, bank, account, balance, PBA Fluents used by the PBA to model the world: USERACCOUNT(type, bank, account, balance, last. Update, rate. Of. Return, move. Funds, min. Balance, penalty, refresh. Rate, s) Monitor(type, bank, account, limit, lower. Or. Higher, priority, response, mon. ID, s) ALERT(alert. Message, max. Priority, mon. ID, s) ALERTACKNOLWEDGED(mon. ID, s) WAITINGUPDATE(bank, account, s)

PBA Primitive Actions SENDMESSAGE(method, recipient, message) STARTWAITINGUPDT(bank, account) STOPWAITINGUPDT(bank, account) CREATEALERT(message, max. Priority, mon. PBA Primitive Actions SENDMESSAGE(method, recipient, message) STARTWAITINGUPDT(bank, account) STOPWAITINGUPDT(bank, account) CREATEALERT(message, max. Priority, mon. ID) SENDALERT(priority, message, medium, mon. ID)

PBA, cont. Control. PBA Requests balance updates for accounts Process messages Send out alert PBA, cont. Control. PBA Requests balance updates for accounts Process messages Send out alert messages to users

PBA, cont. Refresh. Monitored. Accts Request balance updates for accounts Process new messages Send PBA, cont. Refresh. Monitored. Accts Request balance updates for accounts Process new messages Send out new messages to users

PBA, cont. Handle. Communications Procedure Main message handling loop Reads message from port and PBA, cont. Handle. Communications Procedure Main message handling loop Reads message from port and dispatches to appropriate action Generate. Alerts Procedure Directs agent to monitor triggers defined by user Alerts the user

PBA Results Pros: GOLOG capable of building useful applications Provides structure for the programmer PBA Results Pros: GOLOG capable of building useful applications Provides structure for the programmer Preconditions, successor state axioms Encourages a layered design Certain operations are tricky to accomplish Cons: Performing arithmetic Assigning a value to a variable Limited debugging tools Lack of standard libraries Lack of event driven reactive behaviors

Con. GOLOG Con. GOLOG

Con. GOLOG Extended version of GOLOG that incorporates concurrency Concurrent processes with different priorities Con. GOLOG Extended version of GOLOG that incorporates concurrency Concurrent processes with different priorities High level interrupts Arbitrary actions Con. Golog differs from other formal models of concurrency Allows incomplete information about the environment Allows primitive actions to affect the environment in a complex way and such changes to the environment can affect the execution of the remainder of the program

New Semantic for Concurrency Con. GOLOG adopts a transition semantic Trans Predicate Defines a New Semantic for Concurrency Con. GOLOG adopts a transition semantic Trans Predicate Defines a transition relation between two processes Final process Determines when process is completed Final Predicate

Trans Axioms 1. Empty Program 2. Primitive Action 3. Wait/Test Actions Trans Axioms 1. Empty Program 2. Primitive Action 3. Wait/Test Actions

New Concurrency Constructs to handle concurrent programming in Con. GOLOG New Concurrency Constructs to handle concurrent programming in Con. GOLOG

Other GOLOG Variants Cc. GOLOG GOLEX Incorporates continous change and event driven behavior Execution Other GOLOG Variants Cc. GOLOG GOLEX Incorporates continous change and event driven behavior Execution and monitoring system, distributed control software Autonomous mobile robots, sensing and interaction Indi. GOLOG Incremental Interpreter for high level programs involving nondeterminisim and sensing actions

Conclusion Logic programming for dynamic domains such as robotics, intelligent software agents, and modeling Conclusion Logic programming for dynamic domains such as robotics, intelligent software agents, and modeling and simulations GOLOG is based on situational calculus, utilizing first/second order logic and formal theory of actions Variants (cc. GOLOG, Con. GOLOG…etc. ) To solve weakness such as concurrency, event driven, sensing

References Hector J. Levesque, Raymond Reiter, Yves Lesperance, Fngzhen Lin, and Richard B. Scherl. References Hector J. Levesque, Raymond Reiter, Yves Lesperance, Fngzhen Lin, and Richard B. Scherl. GOLOG: A logic programming language for dynamic domains. To appear in the Journal of Logic Programming, special issue on Reasoning about Action and Change, 1996. Yves Lesperance, Hector J. Levesque, and Shane J. Ruman. An Experiment in Using GOLOG to Build a Personal Banking Assistant. To Appear in Intelligent Agent Systems: Theoretical and Practical Issues, 1997.

References, cont. Giuseppe De Giacomo, Yves Lespérance, and Hector Levesque. Con. Golog, a concurrent References, cont. Giuseppe De Giacomo, Yves Lespérance, and Hector Levesque. Con. Golog, a concurrent programming language based on the situation calculus. Artificial Intelligence, 121(1 -2): 109 -169, 2000. Yves Lespérance, Todd G. Kelly, John Mylopoulos, and Eric S. K. Yu. Modeling dynamic domains with Con. Golog. In Proceedings of CAi. SE -99, Heidelberg, Germany, June 1999.