Teleo-Reactive programs are a set of reactive rules that continuously sense the environment and trigger actions whose continuous execution eventually leads the system to satisfy a goal. The main advantage of Teleo-Reactive program is their ability to react robustly to changes in their environment owing to the continuous computation of sensing values. Teleo-Reactive programs provide engineers with an intuitive approach within which to write goal-directed programs. A Teleo-Reactive program is defined as a set of prioritized condition/action rules. A Teleo-Reactive program interpreter should constantly re-evaluate the triggering condition set for each rule, and should execute the action corresponding to the highest-priority rule with a satisfied pre-condition.

A Teleo-Reactive program is usually denoted as:

K1 → a1
K2 → a2
Km → am

where the Ki are  conditions on perceptual inputs and on statements in a model of the world that keeps track of current perceptual data. The list of rules is evaluated from the top for the first rule whose condition is true, and its corresponding action is then executed. An action ai may consist of a single action, or may itself be a Teleo-Reactive program.

If a Teleo-Reactive program is complete (i.e., the condition K1 or K2 oror Km is a tautology) and respects the regression property (i.e., each condition Ki is a regression of some higher condition through an action ai) then the system implementing the Teleo-Reactive program will always achieve its goal. Teleo-Reactive programs differ substantively from conventional production systems because actions can be durative rather than discrete and endure only so long as its energizing conditions are the top satisfied conditions in the programs leading to those actions. A durative action is one that can continue indefinitely, and its execution will therefore continue as long as the conditions energizing it remain the top conditions (for example, move the robot forward is a durative action, as opposed to a discrete action like open gripper).

As an example of a Teleo-Reactive program, a robot that might be rotating until it detects the target (sensoring input) and starts to execute the (durative) action move_forward could be written as:

target_detected → move_forward
true  → rotate

The effects of an action on its environment occur as a consequence of the interaction of the system. They are not modelled in the Teleo-Reactive program but rather present in the changes detected in the sensor inputs.



As a case study we consider a TR program for a robot, taken from (Dongol et al., 2010)  to clear cans from the floor by moving them to a depot. The robot is able to rotate, to scan the environment for cans or the depot, to move forward, and to close or open its gripper. The robot includes sensors that evaluate whether or not the robot is holding, seeing, and touching a can. For example, if the robot sees a can, then it moves forward while it can see the can. Provided that the environment does not move the can, the robot will eventually touch it. Using its current location, the robot is able to see the depot and to know whether it is at the depot or not.

Extracted from (Dongol et al. 2010)

Extracted from (Dongol et al. 2010)

The TR program derived from the above specification is the following:

holding and at_depot → ungrasp
holding and see_depot → forward
holding → rotate
see_can and touching → grasp
see_can → forward
true → rotate

The conditions holding, see_can, at_depot, see_depot, and touching are Boolean variables whose values are equivalent to the values of the corresponding sensors. The primitive actions of the robot are ‘rotate’, ‘forward’, ‘grasp’, and ‘ungrasp’, and these control the robot’s basic movements.

Following is hierarchical version of the TR program for the robot:

   holding → Deliver
   true → Collect
   see_can → Fetch
   true → rotate
   touching → grasp
   true → forward
   at_depot → ungrasp
   true → Go_depot
   see_depot → forward
   True → rotate

We can see that the TR program includes one root goal (‘Robot’) and four subgoals. The fulfilment of each subgoal leaves the robotic system in a particular state. The actions (subgoals) Deliver and Collect cause the robot to respectively deliver and collect cans. Furthermore, Deliver is expanded into the primitive action ‘ungrasp’ and the subgoal Go_depot. Since the subgoal Fetch is the last action of the subgoal Collect, both subgoals are fulfilled at the same time, and the system will consequently hold the same state (holding). Here, completion of the first action Deliver represents the accomplishment of the goal, while completion of the second action Collect represents the achievement of the subgoals that cause the robot to make progress towards enabling the action Deliver. Completion of the ‘ungrasp’ activity represents completion of Deliver (because holding becomes false), while completion of Go_depot enables ‘ungrasp’.