Declarative Programming for Agent Applications J.W. Lloyd · K.S. Ng

Received: date / Accepted: date

Abstract This paper introduces the execution model of a declarative programming language intended for agent applications. Features supported by the language include functional and logic programming idioms, higher-order functions, modal computation, probabilistic computation, and some theorem-proving capabilities. The need for these features is motivated and examples are given to illustrate the central ideas.

1 Introduction The agent paradigm is currently attracting considerable interest, largely because of its promise of providing appropriate technology for the increasingly sophisticated applications of computer systems. Consequently, for the last two decades, there has been considerable interest in designing programming languages that directly support agent concepts. In this paper, we contribute to this effort by introducing the execution model of a declarative agent programming language, called Bach, that amongst other things provides support for agent concepts, such as beliefs, and also the probabilistic handling of uncertainty. We now examine some design considerations for Bach. To motivate its execution model, consider an agent situated in some environment that can receive percepts from the environment and can apply actions to the environment. The primary task of the agent is to choose appropriate actions to achieve its goals (however these are defined). A major ingredient needed to make appropriate choices is the set of beliefs of the agent; for example, the agent may need to reason about its understanding of the beliefs of other agents, temporal considerations of when certain situations held, the goals of the agent itself, the possible effects of its actions, uncertainty in any of the preceding considerations, and so on. This situation suggests the choice of a highly expressive logic as the basis for the programming language. J.W. Lloyd College of Engineering and Computer Science, The Australian National University E-mail: [email protected] K.S. Ng College of Engineering and Computer Science, The Australian National University E-mail: [email protected]

2

What features should the logic have? The standard way of modelling mentalistic concepts such as beliefs, intentions, and so on, is with modal logic and since there are a number of such concepts and generally a number of agents in any application, we are led to the need for a multi-modal logic. While propositional modal logics are commonly used to analyse agents (see, for example, [1–3]), to adequately model beliefs, the logic must be much more expressive than propositional logic; we argue for the need for higher-order modal logic. Furthermore, in many applications, it is necessary for an agent to deal with uncertainty; thus some beliefs are likely to be probabilistic. This issue leads directly to the more general problem of integrating logic and probability, a topic in artificial intelligence that is currently attracting substantial interest (see, for example, [4–9], and the references therein). One of the advantages of working in a higher-order logic is that it is expressive enough to easily encompass uncertainty without any additional logical machinery. The key idea is to represent uncertainty by probability densities; these are non-negative functions whose integral is one. Densities can conveniently be represented and manipulated by higher-order functions. It is generally straightforward to represent directly in a theory the probability that a particular assumption holds and compute the probability that a theorem proved from such assumptions holds. In summary, knowledge representation requirements suggest the need for the underlying logic of Bach to be multi-modal, higher-order logic. As well as representing knowledge, it is necessary to reason about it. The reasoning system introduced in this paper combines a computation co