1.3 Unique operational semantics of a TeleoR procedure call

The two example TeleoR procedures of What is TeleoR? have the form:

p(X1,..Xm) {
    Guard1 ~> RAct1 ++ QAct1
    Guard2 ~> RAct2 ++ QAct2
    ....
    Guardn ~> RActn ++ QActn
    }

A robotic device control task T may be started with a call p(a1,..,am) to such a procedure. The given arguments a1,...,am, which must all be ground, replace the occurrences of the corresponding parameter variables X1,...,Xm throughout the rules of the TeleoR procedure p. The partially instantiated guards are then evaluated in order, starting with the guard of the first rule, against the current state BS of the agent’s Belief Store. The static relation and function rules are used as required. The first rule of the called procedure, say rule i, with a guard that has an inferable instantiation Guardi', determines the first action for task T. It is the fired rule of the task call p(a1,..,am) for Belief Store state BS. The action is the now fully instantitaed instantiated RActi' ++ QActi' of the i’th rule, corresponding to the inferred instantiation Guardi' of the rule’s guard. The action will always be fully instantiated and correctly typed. Compile time moded type checking of the procedure will ensure this.

If RActi' is a TeleoR procedure call, its rule guards are similarly evaluated against the same Belief Store state BS to determine the next rule firing. This continues until a rule is fired with a robotic action that is not a TeleoR procedure call. This robotic action is dispatched to an interface process for the external robotic devices. The QuLog actions of the fired rules of the nested sequence of TeleoR procedure calls are executed one by one, ending with the action for the last fired rule.

Often the determined robotic actions are durative actions such as move(r1,2.4), a forward move action for a mobile robot r1. This will continue until the agent task T that determined the action chooses another action for r1. It does this by re-evaluating the task’s initial TeleoR procedure call p(a1,..,am) after an update of the agent’s Belief Store, and not before. This re-evaluation could still determine the same action for r1, perhaps by firing exactly the same sequence of TeleoR rules. Or it could determine a tuple of actions (move(r1,2.0),turn(r1,left,1.0)), causing r1 to slow down its forward motion and to simultaneously start turning to the left. This will cause r1 to move in an arc. If the new determined action is the empty tuple (), this will will cause r1 to be sent a message to terminate its move(r1,2.4) action, in effect to stop.

This does not mean task T has terminated. On the next Belief Store update T’s initial TeleoR procedure call will be re-evaluated against the updated state and might result in a fresh robotic action such as move(r1,-1.2) being determined, perhaps to move r1 out of the path of an approaching robot or person. Each task’s TeleoR procedure call remains active, being re-evaluated each time the Belief Store is updated, until the task is explicitly killed by a separate task supervisor thread within the agent.

Typically, the call instantiated guard of the first rule of each TeleoR procedure is the goal to be achieved by that call, expressed as a declarative query to the agent’s Belief Store. It is the call’s goal - a state of the environment of the controlled robotic devices that can be detected by sensor readings mapped into percept facts. For procedures that are called to start tasks, this is also the logically expressed goal of the task. Call instantiated guards of lower rules are typically declaratively expressed sub-goals of the call goal, and often lie on a sub-goal tree routed at the call goal. The action of such a lower rule should make progress towards the call goal by changing the environment using robotic actions. Progress is made if eventually percept facts are received by the agent from which that the guard of a higher rule of the procedure can be inferred. TeleoR procedures are an extension of QuLog with an operation semantics well suited to programming reactive goal directed robotic control tasks.


On This Site