Well Formed Names

A well-formed name is used to specify goal/action names, characters, objects, properties, constants,

and relations. All information in the knowledge base is stored as well formed names. Its syntax is based on first order logic symbols, variables and predicates. The alphabet that makes up the symbol expressions of well-formed names consists of:

  • The set of letters, upper and lowercase.
  • The set of digits, 0,1,..,9
  • The symbols “_” and “-”


Symbol expressions begin with a letter and are followed by any sequence of these legal characters. Four types of symbols compose well-formed names:

  1. The Truth symbols True and False.
  2. Constant symbols, which are simple symbol expressions.
  3. Variables symbols, which are symbol expressions enclosed in square parentheses. Ex: [x] represents the variable x.
  4. The Self symbol [SELF], a reserved special variable that refers to the agent.


Constant symbols represent entities that we want to talk about such as actions, objects, properties and relations in the virtual world. They correspond to noun phrases in natural language. The use of variables allows us to express much more generic goals, actions and conditions. An unbound variable can be replaced for a constant or any unbound variable by a unifying algorithm. These variables are specified between brackets in order to be distinguished from an ordinary name. For instance, the composed name “Pick([object])” refers to the generic pick action which can be instantiated with any given object by replacing the variable [object] for a constant symbol representing a given object (ex: the substitution [object]/book applied to the above action will correspond to “Pick(book)”).


In order to specify conditions, actions and goal referring to the character itself without mentioning his name, the “[SELF]” unbound variable can be used anywhere in the character specification. When the character is loaded this unbound variable is replaced by the character name in every such symbol used in the character specification.


Finally, a well-formed name is specified as:

a)     All symbols are well-formed names.

b)    If S and s1,s2,…sn are symbols, then S(s1,s2,…,sn) is called a composed name which is also a well formed name.

c)     If C is a composed name, #C is also a well-formed name. Used only in some situations to specify that the name C should be evaluated as C instead of evaluating it by searching C’s value in the KnowledgeBase.


Composed names must follow some convention according to what the name is describing. The first symbol is called the major symbol and it is followed by a list of comma separated parameter symbols, which are enclosed in parenthesis. When writing an action, its major symbol must correspond to the action’s name, the first parameter symbol must correspond to the action’s target (if available) and the rest of the parameters correspond to any additional action’s parameters. Walk-to([object],[interactionspot]) is an example of a composed name that specifies the generic action of moving to an object’s interaction spot. If the action does not contain a target and parameters, such

as the cry action, it is represented with an empty list of parameter symbols: cry().


The major symbol on a property refers to the object/character that contains the property and the first parameter refers to the property name. For instance, the composed name [SELF](strength) refers to the character’s strength property. In order to specify a relation such as the interpersonal relation of Like its necessary to start with the relation’s name as the major symbol, and add all objects/character involved in the relation as additional parameters. The Like relation between John and Luke would then be modelled as Like(John,Luke). The order on which the parameters appear depends on the relation, for instance Like(John,Luke) is different from Like(Luke,John).