formal representation of such settings by using the key concept of bridge rules .... other contexts as 'accessible' via the bridge rules. .... like t( GARDEN ,t37).
Multi-Context Systems with Activation Rules Stefan Mandl and Bernd Ludwig Dept. of Computer Science 8 (Artificial Intelligence), Friedrich-Alexander-Universit¨ at Erlangen-N¨ urnberg, Haberstraße 2, D-91058 Erlangen, Germany WWW home page: http://www8.informatik.uni-erlangen.de {Stefan.Mandl, Bernd.Ludwig}@cs.fau.de
Abstract. Multi-Context Systems provide a formal basis for the integration of knowledge from different knowledge sources. Yet, it is easy to conceive of applications where not all knowledge sources may be used together all the time. We present a natural extension of Multi-Context Systems by adding the notion of activation rules that allows modeling the applicability or relevance of contexts depending on beliefs in the various contexts and their mutual dependencies. We give a short account on possible consequence relations for Multi-Context System with Activation Rules and discuss a potential application in information retrieval.
1
Introduction
Figure 1 shows the by now almost classical motivating example for formal MultiContext Systems (MCS). Mr.1 and Mr.2 have different perspectives on the same real world object. There are queries that either Mr.1 or Mr.2 cannot answer by
Fig. 1. Magic box (taken from [5])
himself, depending on the configuration of the scenario. MCS provide a basis for formal representation of such settings by using the key concept of bridge rules that can be used to describe information flow between the involved parties. For instance, the bridge rule Mr.1:left ∨ Mr.1:right ← Mr.2:left. would transfer enough of Mr.2’s knowledge to Mr.1 to enable him to come up with the correct conclusion that from his point of view the ball must be hidden behind the left plate of the magic box.
Knowledge integration is not the only possible task imaginable. In [1] the aspect of integration belongs to the perspective dimension of context dependence. Further dimensions of context dependence like partiality and approximation are discussed there. In this paper we want to focus on dynamic scenarios like the one depicted in figure 2 where the perspective changes over time. There, the magic box is put on top of a pin and rotates with constant speed. For simplicity, we only consider the cases where a side of the box is fully exposed to the observer. Now imagine the task to implement behavior similar to that of Mr.1, but now in the dynamic scenario where Mr.1 would stand still while the box is rotating in front of him. When asked if and in which location he sees the ball, he would have to give different answers depending on the orientation of the box at the time he is asked. Contrary to the standard magic box scenario, now, only one of the contexts may be used at a time, all other contexts are not relevant or appropriate. Hence, Mr.1 has to decide which context to use and never may incorporate the knowledge contained in contexts currently rendered inappropriate due to the current orientation. We expect that realistic applications be typically not strictly
(a) Mr.1/Front
(b) Mr.1/Left
(c) Mr.1/Back
(d) Mr.1/Right
Fig. 2. The four different orientations of the spinning magic box
knowledge integration or knowledge separation scenarios. Instead, we think that for real world applications, which involve multiple knowledge bases from various knowledge sources probably using different knowledge representation formalisms, one has to deal with knowledge integration as well as knowledge separation tasks when modeling the systems knowledge. The goal of the paper is to develop a formalism that allows to model knowledge integration and knowledge separation in a uniform way providing a clean semantics of the resulting representations. The paper is structured as follows: Section 2 introduces Multi-Context Systems with Activation Rules (ARMCS) and gives consequence relations for MCS and ARMCS, effectively turning them into knowledge representation and reasoning formalisms. Section 3 shortly discusses the complexity of (AR)MCS reasoning and outlines a straightforward implementation.1 Section 4 gives a concise example. Section 5 shortly discusses some computational aspects of the computation of equilibrium states of ARMCS, concludes the paper, and outlines directions of future research. 1
We write (AR)MCS when we mean both MCS and ARMCS
2
MCS with Activation Rules
Brewka and Eiter (see [5]) introduced a theoretical framework for heterogeneous nonmonotonic MCS which—as the by now most refined model of MCS—forms the foundation for this paper. Due to space limitations, we only give a short review of the most crucial definitions from this paper (see below). The basic definitions of heterogeneous MCS from [5] Definition 1. A logic L = (KBL , BSL , ACCL ) is composed of the following components: 1. KBL is the set of well-formed knowledge bases of L. We assume each element of KBL is a set. 2. BSL is the set of possible belief sets, 3. ACCL : KBL 7→ 2BSL is a function describing the “semantics” of the logic by assigning to each element of KBL a set of acceptable sets of beliefs. Definition 2. Let L = {L1 , ..., Ln } be a set of logics. An Lk -bridge rule over L ,1 ≤ k ≤ n, is of the form s ← (r1 : p1 ), . . . , (rj : pj ), not(rj+1 : pj+1 ), . . . , not(rm : pm )
(1)
where 1 ≤ rk ≤ n, pk is an element of some belief set of Lrk ,and for each kb ∈ KBk : kb ∪ {s} ∈ KBk . Definition 3. A multi-context system M = (C1 , . . . , Cn ) consists of a collection of contexts Ci = (Li , kbi , bri ), where Li = (KBi , BSi , ACCi ) is a logic, kbi a knowledge base (an element of KBi ), and bri is a set of Li -bridge rules over {L1 , . . . , Ln }. Definition 4. Let M = (C1 , . . . , Cn ) be an MCS. A belief state is a sequence S = (S1 , . . . , Sn ) such that each Si is an element of BSi . We say a bridge rule r of form (1) is applicable in a belief state S = (S1 , . . . , Sn ) iff for 1 ≤ i ≤ j : pi ∈ Sri and for j + 1 ≤ k ≤ m : pk 6∈ Srk . Definition 5. A belief state S = (S1 , . . . , Sn ) of M is an equilibrium iff, for 1 ≤ i ≤ n, the following condition holds: Si ∈ ACCi (kbi ∪ {head(r)|r ∈ bri applicable in S}).
(2)
Please note that informally an equilibrium of a MCS is a belief state such that the belief set for each context is acceptable and respects the belief sets of the other contexts as ‘accessible’ via the bridge rules. Our goal is to introduce means to model knowledge separation, but also to retain the possibility of knowledge integration. To this end, we propose to extend MCS by activation rules. Informally, if an activation rule fires, its context is active and shall be taken into account when computing equilibria. If a context is not activated by any activation rule, it is not considered. The actual definition is more complicated as the applicability of activation rules can depend on the
beliefs in the contexts, influenced by bridge rules, and the outcome of other activation rules. Therefore, an activation rule may well be active in a certain equilibrium while it is not active in another equilibrium. Activation rules are similar to bridge rules (definition 2). They target contexts instead of belief set elements and can depend on the activation (or inactivity) of other contexts. Definition 6. Let C = {C1 , ..., Cn } be a set of contexts. A Cq -activation rule over C, 1 ≤ q ≤ n, is of the form Cq ← Cr1 , . . . , Crj , not Crj+1 , . . . , not Crk , rk+1 : pk+1 , . . . , rl : pl , not(rl+1 : pl+1 ), . . . , not(rm : pm )
(3)
where 1 ≤ ri ≤ n, pi is an element of some belief set of Lri , and Cri and Cq are contexts. ARMCS are standard MCS as of definition 3 with a distinct set of activation rules added to each context. Definition 7. A multi-context system with activation rules M = (C1 , . . . , Cn ) consists of a collection of contexts Ci = (Li , kbi , bri , ari ), where Li = (KBi , BSi , ACCi ) is a logic, kbi a knowledge base (an element of KBi ), bri is a set of Li -bridge rules over {L1 , . . . , Ln }, and ari is a set of Ci -activation rules over {C1 , . . . , Cn }. Belief states for ARMCS have to respect inactivity of contexts: Definition 8. Let M = (C1 , . . . , Cn ) be an ARMCS. A belief state is a sequence S = (S1 , . . . , Sn ) such that each Si is an element of BSi ∪ {∗i }, where ∗i denotes the fact that ith belief set is not available for inspection. We say an activation rule of form (3) is applicable in a belief state S = (S1 , . . . , Sn ) iff for 1 ≤ i ≤ j, Sri 6= ∗i and for j + 1 ≤ i ≤ k, Sri = ∗i and for k + 1 ≤ i ≤ l, pi ∈ Sri and for l + 1 ≤ i ≤ m, pi 6∈ Sri . Please note that ∗i 6= ∅. The definition for equilibria can easily be adapted to care about the active contexts only. Definition 9. A belief state S = (S1 , . . . , Sn ) of an ARMCS M is an equilibrium, iff for each available context Si in S, there is an activation rule in ari that is applicable and S 0 which is obtained from S by removing all unavailable contexts is an equilibrium as of definition 5 of the multi-context system M 0 that is obtained from M in the following way: – Delete all bridge rules that positively refer to unavailable contexts in S. – In the remaining bridge rules remove all negative references to unavailable contexts in S. – Consistently rename all context identifiers in the remaining bridge rules such that they respect the position changes that may have been caused by removing the unavailable contexts when creating S 0 from S. – Remove all unavailable contexts. – Remove all activation rules.
Example.
Let M = (C1 , C2 ) with KB = 2{p,q,r} BS = KB ACC(kb) = the set of stable models of kb ∈ KB L = (KB, BS, ACC) C1 = (L, ∅, {p ← 2 : q.}, {C1 ← not 2 : r.}) C2 = (L, ∅, {q ← 1 : p.
r ← not 1 : p.}, {C2 .})
Then (∗1 , {r}) and ({p}, {q}) are the two equilibria of M . (∗1 , {r}) is an equilibrium as C1 is not active and therefore the conditional part of the bridge rule r ← not 1 : p. is removed, hence r is simply asserted in C2 . ({p}, {q}) is an equilibrium as p in C1 is justified by the bridge rule p ← 2 : q. and q in C2 is justified by q ← 1 : p. and r ← not 1 : p. is not applicable. Please note that as of [5] these equilibria are both minimal. Furthermore they are also considered self justified as they are not grounded in facts in the knowledge bases, which in the example are both empty. In contrast, (∗1 , ∗2 ) is not an equilibrium as the activation rules of C2 , namely the single unconditional rule C2 ., require the presence of context 2 in every equilibrium. In order to use (AR)MCS for knowledge representation, we need to define a consequence relation that unifies the different perspectives that the contexts constitute. In order to do so, we need to make the assumption that symbolic names in different contexts are used in a consistent way, hence we assume that o1 ∈ bsi , o2 ∈ bsj : oI1 = oI2 ⇒ oi = oj for all interpretations I employed with a given (AR)MCS. The following consequence relation(s) are inspired by the consequence relations defined in the field of nonmonotonic reasoning (see for instance [4]). Definition 10. Assuming consistent names, a sentence φ is bravely (skeptically) entailed by an (AR)MCS M , (M φ) iff in at least one (every) equilibrium of M there is at least one belief set B such that φ ∈ B and no belief set such that ¬φ ∈ B. Hence, in the example above, {p, q, r} are bravely entailed and ∅ is skeptically entailed by M .
3
Computing Equilibria of ARMCS
In [7] it is shown that the problem of checking for existence of equilibria of MCS is in NP for local contexts with complexity P or NP and in PSPACE (resp. EXPTIME) for local contexts with complexity PSPACE (resp. EXPTIME). These results are obtained by considering a Turing machine which
guesses belief states and tests for equilibria. The introduction of activation rules does not change this picture in a qualitative way. We have realized a simple implementation of ARMCS with finite sets of bridge rules and activation rules, which follows a similar generate and test idea which is based on the observation that for any equilibrium of an (AR)MCS there is exactly one subset of bridge rules (and activation rules) that fire (see [2]). Hence, by considering all those subsets of the bridge rules (and activation rules), and for each subset generating a set of corresponding belief states, which are in turn tested for equilibria, one obtains a straightforward procedure to enumerate all equilibria of an (AR)MCS. While this procedure in general is intractable, many potential applications of (AR)MCS allow for substantial pruning of the involved search space: – if ACCi is functional, hence, if there is only one possible belief set in context Ci , the number of candidate belief states per subset of rules is reduced – if rules can be shown to interact, such that one rule can fire only if the other does not, no subsets of rules with both rules firing have to be considered at all The task of designing (AR)MCS can be greatly improved by allowing for variables to occur in bridge rules or activation rules. We suggest a simple preprocessing step of grounding an (AR)MCS like the one described in [9] for Answer Set Programs. The only additional step is to consider ground literals that are imported into contexts via bridge rules.
4
Example: ARMCS in Practice
In order to demonstrate the benefit of activation rules, we consider an information retrieval system like the one that was developed in the research project ROSE2 and tested at the science fair “Lange Nacht der Wissenschaften” which took place in the area of N¨ urnberg, F¨ urth, and Erlangen on a Saturday night in September 2009. Visitors could query a database of event descriptions in order to make a selection of events to visit before heading into the evening. As the available events came from different fields of science and domains of discourse and furthermore writers with different background phrased the corresponding descriptions, it is not surprising that the ambiguity of words in the queries lead to unexpected results. For instance, when searching for ‘Sprache’ (engl.: language), events of the Pattern Recognition Lab—matching the phrase ‘. . . gesprochene Sprache . . . ’ (engl.: ‘. . . spoken language . . . ’)—were returned along with events from the Chair for Data Management —matching the phrase ‘. . . in der Sprache SQL . . . ’ (engl.: ‘. . . in the language SQL . . . ’). Clearly, users would benefit if the system knew which respective meaning of the query terms is relevant to the user. Currently the ROSE system employs an abstraction step when processing queries. For each (normalized) query term, a set of relevant topics is selected. 2
ROSE is supported by a grant from the German Federal Ministry of Economics and Technology. A description of ROSE can be found at http://www.rose-mobil.de
Currently two kinds of topic spaces are used: The topic space defined by the Dornseiff lexicon ([6]), which contains 970 hand-moderated topics and an abstract topic space generated by using the LDA algorithm ([3]) on the available textual event descriptions which is based on the statistical properties of terms and documents. Term to topics abstractions can be straightforwardly represented as formal sentences (in this case as binary relations where the first element is the normalized term and the second element is an identifier for a specific topic, like t(0 GARDEN 0 , t37 ).) and trivially this relation can be thought of as a knowledge representation with an extremely simple consequence relation, namely set membership. Hence the use of knowledge representations in the term to topics abstraction, in future systems there is the opportunity to use ARMCS to enhance the systems performance. For instance, consider the following setup. kb1 could contain general-purpose topic abstractions that are useful in everyday language as defined by Dornseiff. kb2 could contain domain specific abstractions, for instance for the domain of natural languages. kb3 could contain domain specific abstractions for the field of computer science and programming languages. Now, for a given query, the system has to decide which knowledge base to use. The desired behavior is the following: The general-purpose mapping should be available as a fallback. If the system has reasons to believe that the user is interested in one of the specialized domains then the according knowledge base should be used. Those mappings are mutually exclusive. Terms not specified in the specialized domains should be ‘imported’ from the general purpose one. In order to decide on the user’s intentions, the history of queries in one interaction session is observed. We assume a classification context that is able to decide on the type of user interests. Such a context could be built by using classifiers like Hidden Markov Models for local reasoning and the history of query terms as knowledge base. The local consequence relation would contain the value of a class attribute, depending on the values in the query history, eventually triggering the context selection step suggested in [8]. For instance, a sequence of queries like (“Communication”, “Philosophy”, “Language”) is likely to be classified as in the natural language domain while a query sequence like (“Optimization”, “Compilers”, “Language”) is likely to be related to the computer science domain. Skipping the definitions of the involved logics Li , and assuming a set Q of possible query terms, the ARMCS M = (C1 , C2 , C3 , C4 ) with ACCi = the set of facts in kbi for i ∈ {1, 2, 3} KB4 = Q∗ ,
kb4 ∈ KB4 ,
ACC4 : KB4 7→ {{class(i)}|i ∈ {unknown, 2, 3}}
C1 = (L1 , kb1 , ∅, {C1 ← not C2 , not C3 }) C2 = (L2 , kb2 , {t(W, T ) ← 1 : t(W, T ), not 2 : t(W, ).}, {C2 ← c4 : class(2).}) C3 = (L3 , kb3 , {t(W, T ) ← 1 : t(W, T ), not 3 : t(W, ).}, {C3 ← c4 : class(3).}) C4 = (L4 , kb4 , ∅, {C4 .})
could be used to achieve the desired behavior under both brave and skeptical consequence as there is only one equilibrium.
5
Conclusion
We introduced activation rules for multi-context systems which allow to model the relevance of contexts given a state of beliefs. The complexity of reasoning with activation rules is in the same class as standard MCS reasoning. One open research questions about (AR)MCS and multi-context reasoning in general is the following: What intuition and pragmatics can guide the design of bridge rules from contexts with different semantics, e.g. bridge rules from contexts with Closed World Assumption to contexts using the Open World Assumption? Therefore our next steps is to build a stable implementation of (AR)MCS and to provide this implementation to the community, hopefully reaching practitioners in knowledge representation and reasoning whose experience will help us in answering this difficult question. Acknowedgements The authors would like to thank the anonymous reviewers for their valuable feedback which helped to improve this paper.
References 1. Benerecetti, M., Bouquet, P., Ghidini, C.: Contextual reasoning distilled. J. Exp. Theor. Artif. Intell. 12(3), 279–305 (2000) 2. Besold, T.R., Mandl, S.: Integrating Logical and Sub-Symbolic Contexts of Reasoning. In: Proceedings of ICAART 2010 - Second International Conference on Agents and Artificial Intelligence. INSTICC Press (2010) 3. Blei, D., Ng, A., Jordan, M.: Latent dirichlet allocation. The Journal of Machine Learning Research 3, 993–1022 (2003) 4. Brewka, G.: Nonmonotonic Reasoning: Logical Foundations of Commonsense. Cambridge University Press (1991) 5. Brewka, G., Eiter, T.: Equilibria in heterogeneous nonmonotonic multi-context systems. In: Proceedings of the National Conference on Artificial Intelligence. vol. 22, p. 385. Menlo Park, CA; Cambridge, MA; London; AAAI Press; MIT Press (2007) 6. Dornseiff, F., Quasthoff, U.: Der deutsche Wortschatz nach Sachgruppen. Walter de Gruyter (2004) 7. Eiter, T., Fink, M., Sch¨ uller, P., Weinzierl, A.: Finding explanations of inconsistency in multi-context systems. In: Knowledge Representation and Reasoning Conference (2010), http://aaai.org/ocs/index.php/KR/KR2010/paper/view/1265 8. Mandl, S., Ludwig, B.: Coping with unconsidered context of formalized knowledge. In: CONTEXT’07. pp. 342–355 (2007) 9. Syrj¨ anen, T.: Implementation of local grounding for logic programs with stable model semantics. Tech. Rep. B18, Digital Systems Laboratory, Helsinki University of Technology (October 1998)