Belief
From Agent Factory
Contents |
Introduction
Beliefs are associated with mental state based agents, such as those that may be created via the AFAPL and AFAPL2 agent programming languages. Informally, a belief represents a fact about the state of the agents environment (this may include the agent itself). The term belief is used rather than fact because beliefs are seen as being subjective to the agent, and as a result may possibly be incorrect. Beliefs may be incorrect because agents are not omniprescient, and normally may only sense part of the environment (in Agent Factory, sensors are commonly implemented via Perceptor units). As a result, the agent may need to rely on old information, or other agents to gather all of the information it needs to make decisions about how to act.
For example, in a soccer agent system, an agent, A, may believe that another agent, B, has the ball. However, this may no longer be true because agent B has in fact passed the ball to another agent, C. Unfortunately, A did not see the pass, and was not told about the pass, so it is not aware that B no longer has the ball. The result is that A may incorrectly decide, for example, to make a run into the penalty area, anticipating a pass from B.
Generally speaking, beliefs are represented using well-formed formulae of first-order logic wrapped within a BELIEF operator. For example, the belief that another agent has the ball could take the form:
BELIEF(hasBall(midfielder1))
Alternatively, this could be represented by a more general belief, such as:
BELIEF(has(midfielder1, ball))
Either approach is acceptable, but the specific approach you adopt is dependent on how you model the environment. This is done via the creation of an appropriate Ontology.
A key feature of AFAPL2 that differentiates it from other AOP languages is the way in which it handles beliefs. AFAPL2 has been designed to support
the fabrication of agents that exist within highly dynamic environments. As such, agents may adopt beliefs that quickly become invalid. For example, consider a robot soccer agent that has a perceptor which generates a belief about whether the agent can see the ball or not. If the ball passes quickly in front of the agent, then it may see the ball only for one or two iterations of the interpreter cycle.
Rather than implement a complex belief revision algorithm that tries to understand when a belief has become invalid, the approach adopted in AFAPL2 is to assume that, by default, all beliefs become invalid at the end of a given iteration of the AFAPL2 interpreter cycle. In this way, perception becomes the process by which the agent generates a snapshot of the current state of the environment. This snapshot is then thrown away immediately before the next snapshot is generated.
While this approach helps to simplify the maintenance of an agents beliefs, it is not always appropriate (sometimes we need beliefs that persist for longer). To handle this requirement, AFAPL2 also provides a number of temporal operators that can be used to define beliefs that persist for more than one iteration.
Both AFAPL and AFAPL2 provide support for the manipulation and querying of beliefs via a Belief Management System.
Current Beliefs
The current beliefs of an agent are those beliefs that are considered valid for the current iteration of the agent interpreter. In some agent programming languages, beliefs are viewed as being relatively static, and as such persist until they are explicitly dropped by the agent. As was hinted at in the above example, this is not the view that has been adopted in AFAPL and AFAPL2.
Instead, we adopt a view of beliefs as being transient. That is, beliefs are only considered valid for a single iteration of the agent interpreter, namely, the iteration in which they are adopted. We have chosen this approach because we view an agents' environment as being fundamentally dynamic in nature. As a result, agents assume that information they perceive or are informed will not be valid beyond the iteration in which they perceive it.
So, in this model, the current beliefs of the agent are those beliefs that the agent has generated via [Perecptor|perception] and via communication with other agents. These beliefs persist only for the iteration of the agent interpreter in which they are adopted, and are thrown away at the start of the next iteration.
An example of a current belief is the one below, which represents the belief that it is currently 11:45 and 15 seconds.
BELIEF(time(11,45,15))
Temporal Beliefs
Naturally, some information is more static / persistent, and to overcome this, AFAPL and AFAPL2 introduce the notion of a temporal belief. A temporal belief is a belief that persists beyond the current iteration of the agent interpreter (possibly for the lifetime of the agent). They are specified by wrapping a current belief in a temporal operator, which currently is one of: NEXT, ALWAYS or UNTIL.
NEXT Beliefs
The NEXT temporal operator is used to specify temporal beliefs in which the agent will believe the content of the temporal belief in the subsequent iteration of the agent interpreter. For example, the belief:
NEXT(BELIEF(state(happy)))
represents the temporal belief that the agent will believe that it is in a happy state in the next iteration of the agent interpreter. When an agent has a NEXT belief, it does not believe the content of that belief until the start of the next iteration. For example:
Iteration 1: BELIEF(A) NEXT(BELIEF(B)) Iteration 2: BELIEF(B) Iteration 3:
As can be seen, in the first iteration, the agent believes A is true, and believes that B will be true in the next iteration (but not the current iteration). In the second iteration, A is no longer believed (remember beliefs do not persist), but the temporal belief from iteration 1 has now transformed into a current belief in iteration 2. Finally, the agent believes nothing in iteration 3.
ALWAYS Beliefs
The ALWAYS temporal belief operator is used to specify temporal beliefs that persist for every iteration until they are explicitly dropped (this is a lot like the more standard form of belief representation mentioned above). The content of an ALWAYS temporal belief is adopted as a belief in every iteration that the ALWAYS temporal belief is valid. For example:
Iteration 1: BELIEF(A) ALWAYS(BELIEF(B)) BELIEF(B) Iteration 2: ALWAYS(BELIEF(B)) BELIEF(B) Iteration 3: ALWAYS(BELIEF(B)) BELIEF(B)
As can be seen in the above example, in the first iteration the agent believes A and always believes B. As a result of this temporal belief, the agent also currently beliefs B. In the second iteration, the belief about A is no longer valid because it was a current belief. However, the agent maintains the temporal belief about B, and so the agent still always believes B, and as a result, currently believes B. In fact, this will continue to be the case until the temporal belief is explicitly retracted by the agent.
UNTIL Beliefs
The UNTIL temporal belief operator is used to specify temporal beliefs that persist for every iteration until some explicitly defined condition arises that causes the temporal belief to be dropped. The content of an UNTIL temporal belief is adopted as a belief in every iteration that it is valid. For example:
Iteration 1: BELIEF(A) UNTIL(BELIEF(B), BELIEF(C)) BELIEF(B) Iteration 2: UNTIL(BELIEF(B), BELIEF(C)) BELIEF(B) Iteration 3: BELIEF(C)
This example is similar to the example given in the [[Belief#ALWAYS_Beliefs|ALWAYS Belief] section, with the only difference being that, in iteration 3, the adoption of the belief about C causes the conditional part of the UNTIL temporal belief to be satisfied, resulting in that temporal belief being dropped (hence no UNTIL belief and no belief about B).
Belief Rules
Belief rules are Logical statements that encode implications that may be used to derive additional beliefs about the current state of the environment based on the Current Beliefs of the agent. They take the form of logical implications, where the beliefs that come on the right-hand side of the implication are considered valid if the supporting beliefs on the left_hand side are valid. Reasoning using belief rules is supported via a Prolog style reasoning engine that is based on Robinson's Resolution Algorithm.
An example of a belief rule is:
BELIEF(has(?x, ball)) & BELIEF(location(?x, right_wing)) => BELIEF(crossing(?x, ball))
This rule states that, if ?x has the ball, and ?x is on the right wing, then ?x is crossing the ball. For the belief that "Rem" is crossing the ball to be true, the agent must already have the following beliefs:
- BELIEF(has(Rem, ball))
- BELIEF(location(Rem, right_wing))
It is perfectly valid to have multiple rules that result in the same derived belief, for example, it is also possible that someone will cross the ball from the left wing:
BELIEF(has(?x, ball)) & BELIEF(location(?x, left_wing)) => BELIEF(crossing(?x, ball))
Naturally, it is possible to combine these two belief rules into a single belief rule of the form:
BELIEF(has(?x, ball)) & BELIEF(location(?x, ?y)) & BELIEF(crossingZone(?y)) => BELIEF(crossing(?x, ball))
Here, the belief about the crossingZone is used to identify areas that are good for making crosses. This information tends to be more static in nature, hence these beliefs would be most naturally modeled using Temporal Beliefs of the form:
ALWAYS(BELIEF(crossingZone(left_wing))) ALWAYS(BELIEF(crossingZone(right_wing)))
