Indepth Contextual Description Integration Process
by
Adil KABBAJ
Contextual descriptions, like compound CGs, introduce an important element in knowledge representation: the use of contexts. A suitable formulation of complex structures, like causal structures and intentional structures requires the use of contexts. Consider for instance the following structure: it describes a state (Mary holds Ball1 at location locA), followed by an action (Mary throws Ball1) which is followed by a state (Mary doesn’t hold Ball1). The description of the two states and the action are expressed as contexts in the main structure S:
[Hold = [Hold]-
-pat->[Girl: Mary],
-obj->[Toy:ball1],
-loc->[Location:locA],
-State_Value->[State_Value:Yes_State_Value]
]-followedBy->
[Throw = [Throw]-
-agnt->[Girl: Mary],
-obj->[Toy:ball1]
]-followedBy->
[Hold = [Hold]-
-pat->[Girl: Mary],
-obj->[Toy:ball1],
-State_Value->[State_Value:No_State_Value]]
Of course, in more complex structures, contexts can be embedded in other contexts and so on.
The important point, concerning the indexation and integration of complex structures in an ontology/memory is that context constitutes a basic indexical element, beside concept type, and individuals. Indeed, while a simple description is indexed primarily under concept types and/or individuals (and later, due to the integration and generalization of several descriptions, it is indexed under other descriptions), a complex structure should be indexed primarily under concept types, individuals and also under the contexts that are contained in the structure. This involves a recursive integration of a contextual structure S: integrate first contexts contained in S and then integrates S. In this way, the content of a context is made visible; it is not hidden in the description of the contextual structure and so, it can be compared to other similar descriptions. For instance, states in the above example can be compared to other similar states and the same hold for actions (and for goals, plans, etc.).
A contextual description is viewed as a composition of several descriptions (with the embedded structure of the descriptions); the integration of the contextual description involves first the integration of the contexts that compose it and then the integration of the whole description.
Let us illustrate the dynamic integration of contextual structures with the following example (which is a reformulation of the example used by [Salveter] in his presentation of Moran: a program that learns the semantic of verbs). To run this example, use the ontology "Samples/Ontology/ManOntologyContext.xml". Situations used in this example are in the file dataForDynamicOntology/MoranThrowExple2.txt.
Assume that we want to integrate the above contextual structure S ([Hold = ...]-followedBy->[Throw = ...]-followedBy->[Hold = ...]), with pertinent types: Hold, Throw and State_Value (Figure 1 shows the frame dialog that asks the user the pertinent types for S). Note that specified pertinent types hold not only for the main description (context) but also for the embedded contexts.
Figure 1: Integration of a contextual structure: a frame to enter the new description and a frame to select pertinent types for the main context and the embedded contexts
The integration process produces the following update in the ontology (Figure 2 focuses only on the update around nodes State and Throw): first, each context in S is integrated in turn (with a recursive call to the integration process). Let us start with the first state (which is a context description):
[Hold = [Hold]-
-pat->[Girl: Mary],
-obj->[Toy:ball1],
-loc->[Location:locA],
-State_Value->[State_Value:Yes_State_Value] ]
The above context describes a situation for Hold type. Indeed, the description of a context is considered as a situation for the type of the context (type Hold in the above example). So the description is integrated and indexed (like any Situation) under Hold and Yes_State_Value (Figure 2.a). In this case, no other similar states exist and so no comparison is done with other descriptions. The above description is placed in a Context node (in order to know that it is a component of another description). The integration process continues with the integration of the description of the second context (with the same pertinent types):
[Hold = [Hold]-
-pat->[Girl: Mary],
-obj->[Toy:ball1],
-State_Value->[State_Value:No_State_Value]].
Note: The integration process assumes that the type of a Context (like Hold and Throw in our example) should be considered, by definition, as a pertinent type (so, even if context types are not specified in the pertinent types list, they will be added to it. For instance, types Hold and Throw will be considered as pertinent types any way.).
Figure 2: Integration of a contextual description (compound CGs)
Due to the integration of the above context description via the node Hold, it will be compared with the previous context description. The two descriptions have a common information:
[Hold #0] -
-pat->[Girl :Mary],
-State_Value->[State_Value],
-obj->[Toy :Ball1]
which is considered as a description of a generalized context and it is placed in a new Context node (Figure 2.a). The two integrated contexts are placed as specialization of the generalized context.
The third context ([Throw = ...]) is integrated in the same way. After the integration of the contexts that compose the main description S, S is integrated with pertinent types Hold and Throw. In this case, the integration is reduced to a simple addition and to the indexation of S under nodes Hold and Throw and also under the nodes that represent their contexts (Figure 2.b). As illustrated in Figure 2.b, descriptions of contexts in S are replaced by references to their corresponding nodes. Thus, a complex structure is represented in the ontology/memory by a complex pattern of nodes.
Figure 3 shows the result of the integration of a new contextual description (Figaro throws Ball1 to Ristin):
[Hold = [Hold]-
-pat->[Man:Figaro],
-obj->[Toy:ball1],
-loc->[Location:locA],
-State_Value->[State_Value:Yes_State_Value]
]-followedBy->
[Throw = [Throw]-
-agnt->[Man:Figaro],
-obj->[Toy:ball1],
-to->[Girl:Ristin]
]-followedBy->
[Hold = [Hold]-
-pat->[Girl: Ristin],
-obj->[Toy:ball1],
-loc->[Location:locB],
-State_Value->[State_Value:Yes_State_Value]]
Integration of this new description involves first integration of its contexts. Figure 3 shows the generalizations and update of the ontology/memory that result from these integrations. Then the main description is integrated (S5 in Figure 3). The process compares S5 with the previous description (S4) and discovers that they have common information which is stored in a new Situation node (S6) as specified in Figure 3. Here is the description of S6:
[Hold = [Hold]-
-pat->[Human],
-obj->[Toy:ball1],
-loc->[Location:locA],
-State_Value->[State_Value:Yes_State_Value]
]-followedBy->
[Throw = [Throw]-
-agnt->[Human],
-obj->[Toy:ball1]
]-followedBy->
[Hold = [Hold]-
-pat->[Human],
-obj->[Toy:ball1],
-State_Value->[State_Value]]
Figure 3: Integration of contextual structures
One important point to note here is the multi-layer organization of dynamic ontology (or agent memory): as description of objects, actions, states, goals, plans, explanations and other complex structures are integrated, dynamic integration process creates and updates generalization hierarchies of objects, actions, states, goals, plans, explanations and generalization hierarchy for each complex structure. Moreover, these hierarchies are not separate from each other; they are highly interconnected: description of objects (which form generalization hierarchies of objects) can be embedded/refered in action descriptions or in state descriptions, all the three kind of descriptions can be embedded/refered in goal descriptions, and all of them can be embedded/refered in plan descriptions, etc. Note also that this high interconnexion concerns not only the initial descriptions, but also descriptions that were created by generalization: for instance, in the previous example (Figure 3), situation S6, which is a generalization of the two situations S4 and S5, is composed of contexts H8, T0 and H5 that are generalization of other contexts.
More examples are provided in directory dataForDynamicOntology: Moran example, Occam example, Sowa Generalization example, Cyrus example, Sowa Cat/Mouse example, etc. Section More details and More Examples presents them in detail.
Integration of complex contextual descriptions (with embedded contexts)
This section illustrates the integration of complex contextual descriptions, i.e. integration of descriptions with embedded contexts. We use for this purpose an example that is a reformulation of situations treated by OCCAM; a program that performs multi-strategy learning [Pazzani]. To run the example, load first the ontology "samples/ontology/OccamSBLSample.xml". Situations used in this example are stored in the file dataForDynamicOntology/OccamSBLSamples.txt. Figure 4 presents the initial state of the ontology "OccamSBLSample".
Figure 4: Initial state of the ontology "OccamSBLSample"
The first situation to integrate concerns the following events: "Karen asks her father Mike for a slice of pizza and her father gives it to her". A more detailed paraphrase of this situation is: "Karen, a young woman with blond hair and blue eyes, has a goal to possess a (piece of) Pizza. The plan that she uses to satisfy her goal is to ask (a mental transfer action: MTrans) her father Mike, a grown up man with brown hair and green eyes, to give her the pizza (an abstract transfer action: ATrans). Mike gives the pizza to Karen.". A description of this intentional situation may be expressed in CG as follows: the whole description above is expressed as a Goal context (i.e. description of a specific goal). Note how contexts are embedded: the actor of the goal is an "entity" context (that describes Karen), the goal specification is a state context (description of a possession state) and the plan is a plan context (the plan is realized by an action context -MTrans- that contains other embedded contexts, etc.).
[Goal = [Goal]-
-actor->[Human
:Karen = [Human: Karen]-
-Age->[Age:Kid],
-Hair->[Hair]-Color->[Color:Blond],
-Eyes->[Eyes]-Color->[Color:Blue]
],
-goal->[Poss_By
= [Poss_By]-
-actor->[Human: Karen],
-object->[Pizza: pizza001],
-State_Value->[State_Value:Yes_State_Value]
],
-plan->[Plan
= [Plan]-RealizedBy->[MTrans = [MTrans]-
-actor->[Human: Karen],
-to->[Human : Mike = [Human:Mike]-
-Age->[Age: Grown_Up],
-Hair->[Hair]-Color->[Color:Brown],
-Eyes->[Eyes]-Color->[Color:Green]
]<-Father-[Human: Karen],
-object->[ATrans = [ATrans]-
-actor->[Human:Mike],
-object->[Pizza:Pizza001],
-to->[Human:Karen]
]
]
],
-outcome->[Success_Goal_Outcome]
]
Figure 5 shows the result of dynamic integration of this complex contextual description, with pertinent types: Pizza. Note that context types (in the above description): Human, Poss_By, Plan, MTrans and ATrans are considered automatically as pertinent types.
As specified in section Dynamic Integration Process II: For contextual description (compound CG), integration of a contextual description corresponds to a recursive integration: integrate first all contexts that compose the current description and then integrate the current description. The latter will be indexed (first and at least) under contexts that compose it. Of course, description of a context C can be composed itself of embedded contexts and so, integration of context C involves first the integration of all contexts that compose C and so on.
Figure 5: The Ontology after the integration of the first situation (SIT#0)
Note the impact of context imbrication on knowledge indexation: the (main) situation (SIT#0) is indexed under context Goal#0 that is indexed under context Plan#4 which is indexed under context MTrans#3, itself is indexed under context ATrans#2 which is indexed under Individual Pizza001. Of course, all this is only one path !
The second situation to integrate is: "Karen wants to go to the zoo. She asks Mike to take her to the zoo. Her goal succeeds." :
[Goal = [Goal]-
-actor->[Human
:Karen = [Human: Karen]-
-Age->[Age:Kid],
-Hair->[Hair]-Color->[Color:Blond],
-Eyes->[Eyes]-Color->[Color:Blue]
],
-goal->[Location = [Location]-
-actor->[Human: Karen],
-object->[Zoo :Zoo001],
-State_Value->[State_Value:Yes_State_Value]
],
-plan->[Plan
= [Plan]-RealizedBy->[MTrans = [MTrans]-
-actor->[Human: Karen],
-to->[Human : Mike = [Human:Mike]-
-Age->[Age: Grown_Up],
-Hair->[Hair]-Color->[Color:Brown],
-Eyes->[Eyes]-Color->[Color:Green]
]<-Father-[Human: Karen],
-object->[PTrans = [PTrans]-
-actor->[Human:Mike],
-object->[Human:Karen],
-to->[Zoo:Zoo001]
]
]
],
-outcome->[Success_Goal_Outcome]
]
Figure 6 shows the result of dynamic integration of this second situation, with (explicit) pertinent types: Zoo.
Figure 6: The Ontology after the integration of the second situation (SIT#1)
Figure 7 shows Goal#0 which results from the generalization of Goals Goal#1 and Goal#2. Similar generalization have been produced for the other contexts (for MTrans, for ATrans/PTrans, for Poss_By/Location, for Plans, etc.).
Figure 7: Goal#0 that results from the generalization of Goals Goal#1 and Goal#2
Figure 8 shows nodes that index Goal#0: Goal#0 is indexed: a) under context State#12 which is a generalization of Poss_By context and Location context, b) under context Karen#11 (that describes Karen), c) under context Plan#15 which is a generalization of Plan#10 and Plan#7, d) under types Goal and Plan, and e) under individual Karen. Figure 9 shows descriptions of these contexts.
Figure 8: Indexes of Goal#0
Figure 9: Contexts that index Goal#0
It is important to note that the description of Goal#0 does not contain descriptions of contexts contained in it, but only references to these contexts; it is the toLF() method, which produces the linear description of a CG, that replaces the reference by the description. Figure 10 illustrates this important point.
Figure 10: Correspondance between the effective representation and the linear notation of a compound CG
See the file dataForDynamicOntology/OccamSBLSamples.txt for the other situations to integrate.