This article'suse ofexternal links may not follow Wikipedia's policies or guidelines. Pleaseimprove this article by removingexcessive orinappropriate external links, and converting useful links where appropriate intofootnote references.(May 2018) (Learn how and when to remove this message) |
GOAL is an agentprogramming language for programmingcognitive 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 itsdecision-making. The language provides an intuitive programming framework based oncommon sense orpractical reasoning.
The main features of GOAL include:
| An example blocks world problem | A GOAL Multi-Agent Elevator Controller[1] |
|---|
A GOAL agent program consists of six different sections, including theknowledge,beliefs,goals,action rules,action specifications, andpercept rules, respectively. The knowledge, beliefs and goals are represented in aknowledge representation language such asProlog,Answer set programming,SQL (orDatalog), or thePlanning 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 solveBlocks 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. Theknowledge section listed next contains additional conceptual ordomain 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 thebeliefs 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 thegoals 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).
In GOAL, different notions of goal are distinguished. Aprimitive goal is a statement that follows from the goal base in conjunction with the concepts defined in theknowledge base. For example,tower([a,e,b]) is a primitive goal and we writegoal(tower([a,e,b]) to denote this. Initially,tower([a,e,b]) is also anachievement goal since the agent does not believe that a is on top of e, e is on top of b, and b is on the table. Achievement goals are primitive goals that the agent does not believe to be the case and are denoted bya-goal(tower([a,e,b]). It is also useful to be able to express that agoal has been achieved.goal-a(tower([e,b]) is used to express, for example, that the tower[e,b] has been achieved with block e on top of block b. Both achievement goals as well as the notion of a goal achieved can be defined:
a-goal(formula) ::= goal(formula), not(bel(formula))goal-a(formula) ::= goal(formula), bel(formula)
There is a significant literature on defining the concept of an achievement goal in the agent literature (see the references).
GOAL is a rule-based programming language. Rules are structured into modules. Themain module of a GOAL agent specifies a strategy for selecting actions by means of action rules. The first rule below states that moving block X on top of block Y (or, possibly, the table) is an option if such a move is constructive, i.e. moves the block in position. The second rule states that moving a block X to the table is an option if block X is misplaced.
main module{ program{ if a-goal(tower([X,Y|T])), bel(tower([Y|T])) then move(X,Y). if a-goal(tower([X|T])) then move(X,table). }}Actions, such as the move action used above, are specified using aSTRIPS-style specification of preconditions and postconditions. Aprecondition specifies when the action can be performed (is enabled). Apostcondition specifies what the effects of performing the action are.
actionspec{ move(X,Y) { pre{ clear(X), clear(Y), on(X,Z), not(X=Y) } post{ not(on(X,Z)), on(X,Y) }}Finally, theevent module consists of rules for processing events such as percepts received from the environment. The rule below specifies that for all percepts received that indicate that block X is on block Y, and X is believed to be on top of Z unequal to Y, the new fact on(X,Y) is to be added to the belief base and the atom on(X,Z) is to be removed.
event module{ program{ forall bel( percept(on(X,Y)), on(X,Z), not(Y=Z) ) do insert(on(X,Y), not(on(X,Z))). }}The GOAL agent programming language is related to but different from other agent programming languages such asAGENT0,AgentSpeak,2APL,Golog,JACK Intelligent Agents,Jadex, and, for example,Jason. The distinguishing feature of GOAL is the concept of adeclarative goal. Goals of a GOAL agent describewhat an agent wants to achieve, not how to achieve it. Different from other languages, GOAL agents are committed to their goals and only remove a goal when it has beencompletely achieved. GOAL provides a programming framework with a strong focus ondeclarative programming and thereasoning capabilities required by cognitive agents.
Literature on the notion of a goal: