GOAL is an agent programming language for programming cognitive agents. GOAL agents derive their choice of action from their beliefs and goals. The language provides the basic building blocks to design and implement cognitive agents by programming constructs that allow and facilitate the manipulation of an agent's beliefs and goals and to structure its decision-making. The language provides an intuitive programming framework based on common sense or practical reasoning.
Overview
The main features of GOAL include: Declarative beliefs: Agents use a symbolic, logical language to represent the information they have, and their beliefs or knowledge about the environment they act upon in order to achieve their goals. This knowledge representation language is not fixed by GOAL but, in principle, may be varied according to the needs of the programmer. Declarative goals: Agents may have multiple goals that specify what the agent wants to achieve at some moment in the near or distant future. Declarative goals specify a state of the environment that the agent wants to establish, they do not specify actions or procedures how to achieve such states. Blind commitment strategy: Agents commit to their goals and drop goals only when they have been achieved. This commitment strategy, called a blind commitment strategy in the literature, is the default strategy used by GOAL agents. Cognitive agents are assumed to not have goals that they believe are already achieved, a constraint which has been built into GOAL agents by dropping a goal when it has been completely achieved. Rule-based action selection: Agents use so-called action rules to select actions, given their beliefs and goals. Such rules may underspecify the choice of action in the sense that multiple actions may be performed at any time given the action rules of the agent. In that case, a GOAL agent will select an arbitrary enabled action for execution. Policy-based intention modules: Agents may focus their attention and put all their efforts on achieving a subset of their goals, using a subset of their actions, using only knowledge relevant to achieving those goals. GOAL provides modules to structure action rules and knowledge dedicated to achieving specific goals. Informally, modules can be viewed as policy-based intentions in the sense of Michael Bratman. Communication at the knowledge level: Agents may communicate with each other to exchange information, and to coordinate their actions. GOAL agents communicate using the knowledge representation language that is also used to represent their beliefs and goals. Testing: You can also write tests for GOAL.
GOAL agent program
A GOAL agent program consists of six different sections, including the knowledge, beliefs, goals, action rules, action specifications, and percept rules, respectively. The knowledge, beliefs and goals are represented in a knowledge representation language such as Prolog, Answer set programming, SQL (or Datalog), or the Planning Domain Definition Language, for example. Below, we illustrate the components of a GOAL agent program using Prolog.
The overall structure of a GOAL agent program looks like: main: <agentname> { <sections> }
The GOAL agent code used to illustrate the structure of a GOAL agent is an agent that is able to solve Blocks world problems. The beliefs of the agent represent the current state of the Blocks world whereas the goals of the agent represent the goal state. The knowledge section listed next contains additional conceptual or domain knowledge related to the Blocks world domain.
knowledge{
block(a), block(b), block(c), block(d), block(e), block(f), block(g). clear(table). clear(X) :- block(X), not(on(Y,X)). tower([X]) :- on(X,table). tower([X,Y|T]) :- on(X,Y), tower([Y|T]). }
Note that all the blocks listed in the knowledge section reappear in the beliefs section again as the position of each block needs to be specified to characterize the complete configuration of blocks.
beliefs{
on(a,b), on(b,c), on(c,table), on(d,e), on(e,table), on(f,g), on(g,table). }
All known blocks also are present in the goals section which specifies a goal configuration which reuses all blocks. goals{ on(a,e), on(b,table), on(c,table), on(d,c), on(e,b), on(f,d), on(g,table). }
A GOAL agent may have multiple goals at the same time. These goals may even be conflicting as each of the goals may be realized at different times. For example, an agent might have a goal to watch a movie in the movie theater and to be at home (afterwards).