Goal Activation

In order to understand how a goal should be defined it’s extremely important to understand the goal activation process. The most relevant concept to acknowledge is that the goal activation tests a generic goal in order to create one or more concrete intentions. As example, the generic goal of bullying a weaker victim is instantiated to the intention of bullying John when Luke perceives John and realizes that he is weaker than him. This multiple intention generation is due to alternative substitutions to unbound variables used in the goal’s preconditions.


Formally, a goal can be considered as a tuple G(name,P,F,S), where name corresponds to the goal’s name, P is the set of the goal’s preconditions {P1,P2,…,Pn}, F is the set of the goal’s failure conditions {F1,F2,…,Fm}, and S defines the of the goal’s success conditions {S1,S2,…,Sk}. The sets P and S cannot be empty, i.e., you have to specify at least one precondition and one success condition, however the failure conditions set F can be empty. It’s not mandatory to define a goal’s failure conditions.


The goal activation depends on two important functions: FindSubst(c) receives a condition c and returns a set of substitution lists {θ1, θ2, …, θm} that make the condition c true. For instance, if the condition c is “Like([x],[y]) > 0” FindSubst returns the set of positive interpersonal relations 1={[x]/John,[y]/Rob}, θ2={[x]/Rob,[y]/John}, … , θm={[x]/Luke,[y]/Ollie}}. The second function, Subst(θ,c) corresponds to replacing all variables in c that are referenced in the substitution list θ by the appropriate value. As examples, applying the substitutions θ={[x]/John, [y]/Rob} in the condition “Like([x],[y])” results in the condition “Like(John,Rob)” and applying θ ={[x]/John, [y]/book} in the condition “[x](strength) > [z](strength)”  results in the condition “John(strength) > [z](strength)”.


Thus, given a goal G, in order to test its activation, the initial precondition P1 is selected as the root node in the activation tree. An activation tree consists on a tree where the nodes are tests to goal’s preconditions and the links between the nodes correspond to possible valid substitutions for a test. A node is tested by calling the function FindSubst(P1), which returns all possible substitution lists for that precondition. For each resulting valid substitution list θ a child node, which corresponds to the next precondition to be tested, is created in the activation tree. When a given node n is created, its value for Θ* is determined. The value of Θ*(n) for a given node n corresponds to the set of all substitutions in the path from the node n to the activation tree’s root. Formaly, Θ*(n) = Θ*(Parent(n)) U Θ(n), where Parent(n) is a function that returns n‘s parent node and Θ(n) is the substitution θ that originated the node n. By definition Θ*(root) = {}.


After the value of Θ*(n) is determined, the precondition to be tested in the node n is obtained from the next goal’s precondition Pi+1 by applying Subst(Θ*(n),Pi+1) where Pi corresponds to the precondition tested in n‘s parent node. Each level in the activation tree corresponds to a precondition being tested. The first level corresponds to the first precondition, the second level corresponds to a variation of the second precondition and so on. This process of testing a precondition and generating its children is then repeated for each child. If a tested precondition does not have valid substitutions it will generate no children and the activation in that path will stop. Bellow you can find a generic example of a goal’s activation tree.

Each path in the activation tree that successfully traverses all the goal’s preconditions, corresponds to a possible valid instantiation for the goal. Therefore, for each valid leaf node n and corresponding Θ*(n) – the set of substitutions for all preconditions -  an intention I to achieve the goal G is created by applying I = Subst(Θ*(n),G). Applying a substitution S to a goal corresponds to applying the substitution to the goal’s name, to all the goal’s preconditions, success and failure conditions, i.e, Subst(Θ*(n),G) = G(Subst(Θ*(n),name), Subst(Θ*(n),P), Subst(Θ*(n),F), Subst(Θ*(n),S)) according to a goal’s definition. If the created intention already exists in the deliberative layer, i.e., the agent is already trying to achieve the goal, the intention is not added again, but otherwise the intention is added to the intention structure and the planner will try to achieve the intention’s success condition: Subst(Θ*(n),S).


A goal’s name it’s important because it is used to detect if an intention is already being dealt with in the deliberative layer. Thus, the goal’s name should be able to distinguish between different intentions for the same goal, i.e., the goal’s name should include the most significant variables used in the goal’s preconditions. If so, when two different intentions (with different Θ*(n)) for the goal are made active, they will generate distinct names when Θ*(n) is applied to the goal’s name. For example, the bully goal is named “Bully([victim])” using the same variable [victim] that is used in the goal’s preconditions. If an intention is created to bully John, the intention’s name will be Bully(John) and a similar intention with another name (ex: Bully(Rob)) can be added. On the other hand, if after the activation process a created intention has unbound variables in its name, the intention will not be added for deliberation. So, if we use the name Bully([x]) and after applying Subst(Θ*(n),”Bully([x])”) it remains the same, the intention will be ignored.


Additionaly, success and failure conditions should only use variables that are used in the goal’s preconditions. Although is not mandatory (because there are situations were you do want to use them), variables specified in these conditions and not used in the goal’s preconditions will likely originate behaviour that the author was not intending. For instance, in the generic goal of bullying a weaker victim, the goal’s success conditions should be modelled so that they depend on the selected victim. If the selected victim is John (corresponding to the substitution “[victim]/John”) the success condition should be for instance “push([victim])” in order to be replaced by “push(John)”. If the success condition uses another variable, for example “push([x])”, the planner will try to achieve “push([x])” which can be achieved by pushing many things, of course including John, but also pushing other objects or even other characters such as the bully assistant, which clearly would not be what the author meant with the goal.