ArticleslgStudy

science

GOAL agent programming language

GOAL agent programming language is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand GOAL agent programming language rather than just read about it. In short: GOAL is an agent programming language for programming cognitive agents. GOAL agents derive their choice of action from their beliefs and goals.

GOAL agent programming language — main illustration
GOAL agent programming language — illustration

Key takeaways

  • GOAL agent programming language belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect GOAL agent programming language to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of GOAL agent programming language from memory before moving on to harder problems.

Reference excerpt

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.

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). In GOAL, different notions of goal are distinguished. A primitive goal is a statement that follows from the goal base in conjunction with the concepts defined in the knowledge base. For example, tower([a,e,b]) is a primitive goal and we write goal(tower([a,e,b]) to denote this. Initially, tower([a,e,b]) is also an achievement 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 by a-goal(tower([a,e,b]). It is also useful to be able to express that a goal 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. The main 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 a STRIPS-style specification of preconditions and postconditions. A precondition specifies when the action can be performed (is enabled). A postcondition 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) } }

… excerpt ends here. Continue reading the full article.

Illustrations

GOAL agent programming language illustration

Worked examples

Example 1 — a first encounter with GOAL agent programming language

Start with the simplest possible case. Write down what GOAL agent programming language claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to GOAL agent programming language before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about GOAL agent programming language ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of GOAL agent programming language

In research
GOAL agent programming language appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses GOAL agent programming language in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
GOAL agent programming language is common in secondary-school and first-year university syllabi. It links to neighbouring topics Agent-based model, Agent-based programming languages, Declarative programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for GOAL agent programming language outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “GOAL agent programming language” →

How to study GOAL agent programming language in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what GOAL agent programming language means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain GOAL agent programming language out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is GOAL agent programming language in simple terms?

GOAL is an agent programming language for programming cognitive agents. GOAL agents derive their choice of action from their beliefs and goals.

Why does GOAL agent programming language matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study GOAL agent programming language?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on GOAL agent programming language.

Tags

  • Agent-based model
  • Agent-based programming languages
  • Declarative programming languages

Keep exploring