• No results found

Golog. Golog stands for alGOL in lOGic. Levesque et al. (1997) proposed this robot or agent programming language. The idea of Golog is to combine agent programming with reasoning in an efficient way. Golog has its formal foundations in the situation calculus. It offers constructs known from imperative programming languages like conditionals, loops, or recursive procedures. The strength of Golog is, moreover, that it is capable to reason about action and change. The semantics of Golog is defined via a macroDo(σ, s, s′). The program σ is translated by macro expansion

into a situation calculus formula. Program synthesis is done by proving that the situation calculus basic action theory entails that the program reaches the specified goal situation. As a side-effect this constructive proof yields an executable program where nondeterministic choices for actions or arguments of actions are instantiated. It turned out that it can be applied successfully as a high- level language for encoding robot controllers, as we show below. Nevertheless, the original Golog lacks expressiveness for many problems arising in practice. During the last decade many useful extensions have been proposed, most of which we will discuss next.

ConGolog. De Giacomo et al. (2000) propose an alternative formal semantics for Golog, a transition semantics. They define a predicateT rans(σ, s, δ, s′) which transforms the ConColog

programσ in situation s to a successor configuration hδ, si, the remaining program after the

execution of the first action inσ with the resulting situation s′. A predicateF inal exists which

denotes if a program legally terminates. The transition semantics allows to define the concurrent execution of programs. De Giacomo et al. introduce so-called high-level interrupts. Triggered by a condition, the actual program execution is suspended and the program associated with the condition is executed until the condition becomes false again. Then the suspended program is continued. They further give a formal account of so-called exogenous actions, actions which are beyond the control of the agent. These actions or events are imposed by the environment, and the agent can properly react to these events. The transition semantics demands a reification of programs, i.e. programs have to be defined as functions in the logical language of the situation calculus.

2.2. THE ROBOT PROGRAMMING LANGUAGE GOLOG 21

sGolog. Lakemeyer (1999) proposes sGolog as an approach to deal with sensing results in the Golog framework. sGolog, like Golog and ConGolog, is off-line, i.e. program synthesis is not interleaved with program execution. Therefore, one needs a special treatment of possible results of sensing actions. Similar to the idea of a policy known from MDP theory, Lakemeyer provides a program branch for each possible sensing result, which reacts appropriately to the sensed value. He introduces a statementbranch on(ϕ) which allows the user to define so-called condition action trees (CAT) on the conditionϕ. CATs, formally defined in (Lakemeyer 1999), provide alternative programs w.r.t. the sensing result ofϕ. For his formalization he draws on (Scherl and Levesque 1993; Levesque 1996) and defines CATs andbranch on in terms of the fluent KWhether and a special functionSF (a, s) which represents the fluent value when the sensing action a is executed in situations. Note that sGolog is an off-line Golog dialect. It was the first approach to formally introduce sensing in Golog. Later approaches to sensing are based on on-line interpretation of Golog programs (Sardi ˜na 2001).

Concurrent Temporal Golog. Finzi and Pirri (2004) propose a concurrent temporal Golog di- alect suitable for constraint-based interval planning (see e.g. (Smith et al. 2000)). They integrate temporal aspects from the situation calculus and interleaved concurrency similar to ConGolog (but use an evaluation semantics). Several processes exist which need to be executed concurrently. Each process has an execution time with a start and an end time on a continuous time line. Con- straints are legal relations between processes, such asA before B, A after B, or A meets B (A ends in the moment whenB starts). Golog now fills in the missing details of a partially specified candidate plan, considering the process constraints. The motivation for constraint-based interval planning is that a robot has to perform multiple tasks, many actions like controlling the camera and actuating the motors have to be performed in parallel. Interval planning helps to order the different activities of the robot to achieve the goal.

IndiGolog. IndiGolog (De Giacomo and Levesque 1999) overcomes one of the central draw- backs of the original Golog approach w.r.t. the applicability for realistic scenarios. It makes use of the transition semantics introduced by (De Giacomo et al. 2000) in the ConGolog derivative. While ConGolog was still off-line, IndiGolog aims at on-line execution of robot programs. The interpreter directly commits to action choices made, by executing them. This is a fundamen- tal difference to Golog, where actions are executed only after the whole program/plan has been synthesized. The incremental execution enables the agent to gather new world information. In (De Giacomo et al. 2001) sensing histories are formally introduced, in (De Giacomo et al. 2002) De Giacomo et al. introduce epistemically accurate theories and epistemically feasible determinis- tic programs to theoretically underpin the incremental way of interpreting and executing programs. To still be able to perform projection tasks, they introduce a search operatorΣ. Σ carries out the projection while the execution of (exogenous) actions is suppressed.

ccGolog. Grosskreutz and Lakemeyer introduce continuous change into Golog (Grosskreutz and Lakemeyer 2000a; Grosskreutz and Lakemeyer 2003). Based on ideas of (Pinto 1998; Shana- han 1990) with a reified notion of time known from the temporal situation calculus (Pinto and Reiter 1995), fluents can be evaluated on a continuous time scale, similar to (Firby 1994). Each continuous fluent is associated with a function of time. Based on this function and a fluentstart

which denotes the starting time of an action, fluents can be projected onto an arbitrary point of time in the future. This notion also allows the introduction of a wait-for statement known from RPL (Beetz 2001) into ccGolog which is useful for condition-bounded execution of actions w.r.t. time. Grosskreutz and Lakemeyer (2001) treat the topic of on-line execution vs. off-line projec- tions with the new type of continuous fluents. They propose a system architecture which allows for passive sensing, i.e. sensing is done in the background without actively executing sensing actions. A thorough treatment of ccGolog and the reified time notion can be found in (Grosskreutz 2002; Grosskreutz and Lakemeyer 2003).

pGolog. Grosskreutz and Lakemeyer add the notion of probabilistic programs to Golog in their pGolog dialect (Grosskreutz 2000; Grosskreutz and Lakemeyer 2000b). Programs can be assigned a probability with a statementprob(p, σ1, σ2), where p is a probability and σ1, σ2are pGolog

programs. For calculating the probability of a future situation over a probabilistic program they introduce a weighted transition semantics. The semantics is similar to that in ConGolog, though the step semantics is defined as a function mapping pairs of configurations to probabilities (trans : program × situation × program × situation → [0, 1]). Based on the belief representation of Bacchus et al. (1999) they introduce probabilistic projections into the language. With this extension it is possible to reason if a goal holds in some future situation and with which probability. Further, several initial belief states can be handled with a probability distribution defined over them.

DTGolog. DTGolog (Boutilier et al. 2000) is an approach to integrate decision theory into the Golog framework. In addition to the basic action theory of Golog, an MDP optimization theory is needed. Given a Golog program, DTGolog computes an optimal policy which maximizes the agent’s cumulative reward. With the optimization theory DTGolog offers a version of nondeter- ministic choice of actions and their arguments in an optimized way. DTGolog selects the actions and arguments which lead to the maximal value. The Golog program is interpreted by a predicate BestDo (a version of Do which optimizes the program and calculates the policy). The algorithm used for calculating the policy is a forward search value iteration. Further, DTGolog offers the use of stochastic actions. Stochastic actions in the situation calculus are formalized in the fol- lowing way. A deterministic action exists which has a number of deterministic outcomes which are chosen by nature. To each outcome a probability is associated, which states the probability with which nature will choose the respective outcome. The resulting policy is a conditional Golog program which offers an optimal action for each of the possible outcomes. In the spirit of Golog, DTGolog also offers to guide the search for an optimal policy by restricting the search space at axiomatizer’s needs. Full MDP planning in a finite horizon MDP can be undertaken by using solely nondeterministic action choices. If knowledge about the world exists it can be encoded in the DTGolog program. DTGolog as such is off-line. Soutchanski (2001) proposes an on-line DTGolog interpreter which we discuss in greater detail in Chapter 4.2.1.

GTGolog. GTGolog (Finzi and Lukasiewicz 2004) is an generalization of DTGolog to multi- agent decision-theoretic planning. GT is an abbreviation for “game-theoretic”. Formally, multi- player Markov or stochastic games (cf. e.g (von Neumann and Morgenstern 1947; Littman 1994), are solved in their approach. Similar as in DTGolog a program is specified from which the optimal

2.2. THE ROBOT PROGRAMMING LANGUAGE GOLOG 23

policy is calculated. The optimization seeks at finding a Nash equilibrium for the program by optimizing away nondeterministic choices. Currently, the language is restricted to two-player zero sum Markov games. They give an example in a confined static soccer domain. Finzi and Lukasiewicz (2005) extend their approach to partially observable games. Recently, Farinelli et al. (2007) proposed a version of TeamGolog, a generalization of GTGolog. This dialect focuses on integrating multi-agent decision-theoretic planning and introduces explicit communication and synchronization states.

Applications of Golog

Jenkin et al. (1997) report on interfacing Golog with a Nomad200 and RWI B21 robot. The first realistic large-scale application of Golog was the tour-guide robot in the Deutsches Museum Bonn in the Rhino project (Burgard et al. 1998). Over several days a RWI B21 robot served as museum tour-guide and explained the exhibits. Golog was used here for high-level control. It was connected to the robot system with GOLEX (H¨ahnel et al. 1998) which interfaced Golog and the rest of the robot control software.

Funge (Funge 1998; Funge 2000) makes use of Golog for modeling animated creatures in a cognitive way. He argues that dealing with uncertainty is important for the animated creatures in order to make it look as realistic as possible, though he does not give a formal approach to it. He uses the possibility of nondeterminism in Golog for his creatures to fill in details in sketch plans based on their background domain knowledge. In an extended example he shows how a merman swims for cover to prevent a shark attack.

Levesque and Pagnucco (2000) report on Legolog, their implementation of Golog on a Lego Mindstorm robot. They connected an IndiGolog interpreter implemented in Prolog to the Lego Mindstorm Robotics Invention System (RIS). The Lego robot is equipped with a micro-controller whose firmware has a C-like API. Further there is a communication protocol with which Prolog and thus IndiGolog are able to communicate with the robot. Actions can be sent to the robot and sensor values can be read. With their implementation, low-cost experiments with cognitive robots can be conducted. This shows the importance of having an embodied physical robot in order to conduct realistic experiments and learn more about the interdependencies between high-level control and a robotic system which may not become apparent in simulations only.

McIlraith and Son (2002) aim at services for the semantic web. As a web agent has to perform complex actions and needs to gather new information, McIlraith and Son chose ConGolog as the specification language for their web agents. The services, encoded as Golog programs, are generic in the sense that different users are able to use them, customizable in the sense that user prefer- ences can be easily integrated, and usable in the sense that agents with different prior knowledge can use them. They extend ConGolog with user constraints by a predicateDesirable to encode user preferences and define self-sufficient programs (Davis 1994) in the situation calculus con- text. Preferences constrain the search for a solution and self-sufficiency by means of the fluent KWhether ensures that the agent is able to gather all information it needs to execute the program. While McIlraith and Son (2002) make use of ConGolog’s nondeterministic choice over actions to generate plans, Fritz and McIlraith (2005) compile qualitative preferences into DTGolog pro- grams. They formally introduce a basic desire language and extend the semantics of DTGolog to handle preference formulas. To ensure the forementioned knowledge gathering process of web agents and to be able to synchronize several web agents working in parallel, they provide a transi-

tion semantics for decision-theoretic Golog. In their paper they describe a successful application for booking a business trip considering over 30.000 combinations of flights and hotels, and nearly 1000 queries to the web to gather the needed information.

Pham (2006) describes an interface between DTGolog and the Sony Aibo ERS-7. The inter- face is based on the framework Tekkotsu (Tira-Thompson 2004). For example, an application that the Aibo is used for is to fulfill navigation tasks for which an optimal policy was calculated.

Soutchanski et al. (2006) discuss the application of DTGolog for the London Ambulance Service case study. The task in this domain is to dispatch an emergency call to an ambulance. An incoming emergency call is taken with all important details. Depending on the location of the request, the request is forwarded to one of three Resource Allocators (there are three as London is separated into three districts). Then, an ambulance is mobilized, either from its home base or on the road, and travels to the scene. At the location the ambulance crew notifies the control center and takes the patients to a nearby hospital if needed. The goal is to minimize the mobilization time to arrive at the scene. A time limit between the incoming request and the arrival at the location is about 14 minutes. The authors show how DTGolog can be applied to this task and show some results in a simulated environment. The results are notable because the state space for this domain is huge.