=Paper=
{{Paper
|id=Vol-3184/MK_short2
|storemode=property
|title=Multi Context Model Counting
|pdfUrl=https://ceur-ws.org/Vol-3184/MK_short2.pdf
|volume=Vol-3184
|authors=Luciano Serafini
|dblpUrl=https://dblp.org/rec/conf/esws/Serafini22
}}
==Multi Context Model Counting==
Multi Context Model Counting
Luciano Serafini
Fondazione Bruno Kessler, Trento, Italy
Abstract
Contextual reasoning is the result of the composition of local reasoning in each context via a set of
inference rules, called bridge rules. In the past it has been argued that organizing knowledge in multi-
ple related contexts (modules) provides many advantages. Logical inference and satisfiability in multi
context systems have been widely studied. However,there are other important inference tasks such as
model counting and weighted model counting that one want to perform on an MCS. In this note we
concentrate on Model Counting task that can provide a good base for probabilistic reasoning in Multi
Context Systems. The paper proposes a method that computes model counting for a multi context
system in terms of the combination of model counting in each context.
1. Introduction
Multi Context Systems (MCSs) [1, 2, 3, 4, 5, 6] are logical frameworks that allow modelling
knowledge distributed amongst a set theories called contexts. Each theory is specified in a
(possibly different) logical language, called local language. The fact that a formula π holds in
a context π is expressed by the labelled formula π : π. The connections between knowledge
of different contexts are modeled by the so called bridge rules, which are inference rules with
premises and conclusions in different contexts. An interpretation of an MCS maps every
context in a set of interpretations of the local language, called local interpretations. An MCS
interpretation is a model if local interpretations satisfy local theories and the combination of
local interpretations satisfy the bridge rules. Model counting for MCS is the task of determining
the cardinality of the set of models of an MCS.
Model counting for logical system is obtaining increasing attentions due to its important role
in the modern approaches of AI [7], where logical reasoning are blended with some form of
quantitative inference such as for instance probability. The aim of this paper is to investigate
about model counting method for MCS that exploit the intrinsic modular structure available
in an MCS. To the best of our knowledge this is the first attempt to solve the model counting
problem for MCSs. The paper provides theoretical result that proves how model counting in
MCS can be obtained by a suitable combination of algorithms for model counting in each single
context.
Modular Knowledge 2022 - 1st Workshop on Modular Knowledge ESWC 2022, Hersonissos, Greece, May 29, 2022
" serafini@fbk.eu (L. Serafini)
Β© 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
2. Multi context systems
Let πΆ be a set. Every element of πΆ is called context. A Multi Context System on a family of
logical languages πΏ = {πΏπ }πβπΆ , is a structure MC = {Ξ¦π }πβπΆ , BR where Ξ¦π is a set of
β¨οΈ β©οΈ
closed formulas of the language πΏπ and BR is a set of bridge rules, i.e., expressions of the form
π1 : π1 , . . . , ππ : ππ β ππ+1 : ππ+1 (1)
where ππ is a sentential formula of πΏππ . A model for an MCS {Ξ¦π }πβπΆ , BR is a structure
β¨οΈ β©οΈ
Ξ© = {β¦π }πβπΆ where
1. β¦π is a set of interpretations of πΏπ such that for all π β β¦π , π |= Ξ¦π (written as β¦π |= Ξ¦π );
2. For every bridge rule of the form (1) in BR, if β¦ππ |= ππ for all π = 1, . . . , π, then
β¦ππ+1 |= ππ+1
By considering each π β Ξ¦π as a rule with zero premises, an MCS can be seen as a set of bridge
rules BR. In the following we consider this simpler form of an MCS.
Example 1. Alice and Bob are two agents who have beliefs about two propositions π and π. Bob
can query Alice on her beliefs about π and π, Alice can have partial or contraddictory beliefs
about π and π, therefore, it is possible that Alice provides no answer or contraddictory answers
to Bobβs queries. Bob has the following beliefs about Alice. He believes that, if Alice is reliable
(π), then Aliceβs answers are correct, and therefore he will also believe in what Alice says. This
simple scenario can be formulated with an MCS π πΆππ with two contexts πΆ = {π, π}; where the
local languages πΏπ and πΏπ are s propositional languages on the propositions {π, π} and {π, π, π}
respectively, The two contexts are connected by the following bridge rules:
π:πβπ:πβπ π : Β¬π β π : π β Β¬π (2)
π:πβπ:πβπ π : Β¬π β π : π β Β¬π (3)
The above bridge rules simulate all the query-answering interactions between Alice and Bob. No-
tice that if Alice provides contraddictory answers, e.g., π : π and π : Β¬π then Bob will believe that
she is not reliable (π : Β¬π. A model for π πΆππ is a pair β¨β¦π , β¦π β©, where β¦π and β¦π represent the
final belief state of the two agents after Bob have done all the possible queries to Alice. We are
interested in counting the number of final states of such a simple system, i.e., the number of models
of π πΆππ .
3. Multi context model counting
Suppose that for every language context π, there is an oracle mc π that returns the number of
models mc π (Ξ¦)1 for every set of πΏπ -sentences Ξ¦. We are interested in finding a way to solve
the model counting problem for BR using such oracles.
Let π΅ be the set of labelled formulas π : π contained in in some bridge rule of BR. Let πΉ β π΅
be any subset of π΅ closed under BR. Let F be the set of all such πΉ βs. Letβs define mc(πΉ ) as the
number of Ξ© = {β¦π }πβπΆ , where β¦π is a set of models for πΏπ , such that:
1
When it is clear from the context we will omit the index to the context and use the simpler notation mc(π).
1. β¦π |= π for every π : π β πΉ and
2. β¦π ΜΈ|= π for every π : π β πΉ
Β― = π΅ β πΉ.
Notice that Ξ© satisfies conditions 1 and 2 if and only if Ξ© is a model of BR.
Proposition 1. Ξ© cannot satisfy conditions 1 and 2 for two distinct πΉ and πΉ β² .
Proof: If πΉ ΜΈ= πΉ β² there is a labelled formula π : π such that either π : π β πΉ β© πΉ Β― β² or
π:πβπΉ Β― β© πΉ β² . If Ξ© satisfies condition 1 and 2 for both πΉ and πΉ β² then β¦π |= π and β¦π ΜΈ|= π,
which is a contradiction. β‘
Lemma 1. For every πΉ β π΅:
βοΈ βοΈ
ππ(πΉ ) = (β1)|πΊ| 2ππ(πΉπ βͺπΊ)
Β―π
π πΊβπΉ
where, for every set of labelled formulas π, ππ denotes the set {π | π : π β π}.
Proof: For a given πΉ , an MC interpretation Ξ© = {β¦π }πβπΆ satisfies all the π : π in πΉ and does
not satisfy all the π : π β πΉ
Β― if and only if it satisfies the following two conditions for every
π β πΆ:
1. for all π β πΉπ , π |= π for all π β β¦π ;
2. for all π β πΉ
Β― π , π |= Β¬π for some π β β¦π .
Therefore we have to count how many such a β¦π exist for every π. For this purpose we use the
following result:
Corollary 1 ([8] section 4.2). Let π be a set of objects and let π΄ = {π1 , . . . , ππ } be a set of
subsets of π. For every π¬ β π΄, βlet π (β π¬) βbe the count of objects in π that belong to all the
β βοΈ βοΈ
subsets ππ β π¬, i.e., π (β π¬) = β{ ππ βπ ππ }β. For every 0 β€ π β€ π, let π π = |π¬|=π π (β π¬)
β
and let π0 be count of objects that do not belong to any of the ππ in π΄, then
π
βοΈ
π0 = (β1)π π π (4)
π=0
In our case, let π be the set of all the subsets of models of πΉπ . I.e. π = {β¦ β β¦(πΏπ ) | β¦ |= πΉπ },
where β¦(πΏπ ) is the set of all interpretations of πΏπ . Let π΄ = {ππ }πβπΉΒ― π , where ππ = {β¦ β π |
β¦ |= π}. With this definition we have that ππ is the number of subsets of π (models of πΉπ ) that
do not satisfy none of the formulas in πΉ Β― π . To apply Corollary 1 we need to calculate π π for every
0 β€ π β€ |πΉΒ― π |. By definition of π π we have:
β β
β β
βοΈ βοΈ β βοΈ β
π π = π (β π¬) = β
β ππ ββ
|π¬|=π πΊβπΉΒ― π πβπΊ
β β
|πΊ|=π
ββοΈ β
Notice that β¦ β πβπΊ ππ if and only if β¦ |= πΉπ β§ πΊ. This implies that β πβπΊ ππ β is the number
βοΈ β β
of subsets of the set of models that satisfiey πΉπ β§ πΊ, i.e.,
βοΈ
π π = 2ππ(πΉπ β§πΊ)
πΊβπΉΒ―π
|πΊ|=π
From which we conclude that the number of sets of models that satisfies πΉπ and do not satisfy
Β― π is:
πΉ
βοΈ
π0 = (β1)|πΊ| 2ππ(πΉπ βͺπΊ)
Β―π
πΊβπΉ
Notice that every model of πΉ that does not satisfy the formulas in πΉΒ― can be obtained by
selecting for every π a set of models that satisfy πΉπ and do not satisfy πΉ
Β― π . Since we have
|πΊ| ππ(πΉ βͺπΊ) of such sets of models, we can conclude that
βοΈ
Β― π (β1) 2
π
πΊβπΉ
βοΈ βοΈ
ππ(πΉ ) = (β1)|πΊ| 2ππ(πΉπ βͺπΊ) (5)
Β―π
π πΊβπΉ
(6)
β‘
Theorem 1.
βοΈ βοΈ βοΈ
mc(BR) = (β1)|πΊ| 2ππ(πΉπ βͺπΊ) (7)
Β―π
πΉ βF(BR) π πΊβπΉ
Proof: For every model Ξ© of BR there is an πΉ such that β¦ |= πΉ and for every π : π β πΉ Β―
β¦π ΜΈ|= π. Furthermore, Proposition 1 guarantees that Ξ© cannot be a model of two distinct πΉ βs.
This allows us to infer that
βοΈ
mc(BR) = mc(πΉ )
πΉ βF(BR)
βοΈ βοΈ βοΈ
= (β1)|πΊ| 2ππ(πΉπ βͺπΊ)
Β―π
πΉ βF(BR) π πΊβπΉ
β‘
Notice that the set F(BR) can be computed by starting from any subset of π΅ and by applying
bridge rules until a fixpoint is reached. This operation takes at most |BR| steps. In the worse
case at every step only one element of BR is fired. Furthermore one can compute and cash
ππ(ππ ) for all the subset ππ β π΅π . The complexity of this is fully determined by mc π and it is
not influenced by the complexity of the model counting in the other contexts. Therefore the
complexity of the entire process is just the sum of the complexity of computing model count in
π for all the subsets of π΅π .
Example 2 (continuation of Example 1). Let us apply Theorem ?? to a simplified version of
Example 1, where πΏπ contains the only proposition π and πΏπ π and π we consider only bridge rules
(2). The set π΅ is equal to:
π΅ = {π : π, π : Β¬π, π : π β π, π : π β Β¬π}
The set F of subsets πΉ of π΅ closed under the bridge rules (2) and (3), are the following:
πΉ0 = {}
πΉ1 = {π : π β π}
πΉ2 = {π : π β Β¬π}
πΉ3 = {π : π β π, π : π β Β¬π}
πΉ4 = {π : π, π : π β π}
πΉ5 = {π : π β π, π : π β Β¬π}
πΉ6 = {π : Β¬π, π : π β Β¬π}
πΉ7 = {π : Β¬π, π : π β π, π : π β Β¬π}
πΉ8 = {π : π, π : Β¬π, π : π β π, π : π β Β¬π}
Using formula (5) one can cmput mc(πΉπ ) and then sum all the result, obtaining mc((2)). Let us
for instance compute mc(πΉ3 ) and mc(πΉ4 )
mc(πΉ3 ) = (2πππ (β€) β 2πππ (π) β 2πππ (Β¬π) + 2πππ (πβ§Β¬π) ) Β· 2πππ ((πβπ)β§(πβΒ¬π))
= 22 β 21 β 21 + 20 ) Β· 22 =4
πππ (π) πππ (πβ§Β¬π) πππ (πβπ) πππ (πβπβ§πβΒ¬π)
mc(πΉ4 ) = (2 β2 ) Β· (2 β2 )
= (21 β 20 ) Β· (23 β 22 ) =4
4. Conclusion and future directions
In this short note, we proved a formula to compute model counting for MC systems that is based
on model counting for each single context. This initial idea can be generalised in a number
of directions. The first direction concerns the generalisation to MC weighted model counting.
Weighted model counting is tightly connected to probabilistic reasoning (see e.g., [9]), this will
open the opportunity of doing contextual probabilistic inference. A second research direction
can be obtained by exploiting the correspondence between modal logic and MC systems proved
in [2] and develop a context based approach to model counting and probabilistic inference for
modal logic. Finally one could extend the result of this note to distributed first order logic [5]
and distributed description logics [6]. Further generalisation involves more complex bridge
rules including for instance negated labelled formulas and disjunction of labelled formulas.
References
[1] J. McCarthy, Notes on formalizing context, in: Proceedings of the 13th international joint
conference on Artifical intelligence, 1993, pp. 555β560.
[2] F. Giunchiglia, L. Serafini, Multilanguage hierarchical logics, or: how we can do without
modal logics, Artificial intelligence 65 (1994) 29β70.
[3] C. Ghidini, F. Giunchiglia, Local models semantics, or contextual reasoning= locality+
compatibility, Artificial intelligence 127 (2001) 221β259.
[4] G. Brewka, T. Eiter, Equilibria in heterogeneous nonmonotonic multi-context systems, in:
AAAI, volume 7, 2007, pp. 385β390.
[5] C. Ghidini, L. Serafini, Distributed first order logic, Artificial Intelligence 253 (2017) 1β39.
[6] A. Borgida, L. Serafini, Distributed description logics: Assimilating information from peer
sources, in: Journal on data semantics I, Springer, 2003, pp. 153β184.
[7] A. Darwiche, Three modern roles for logic in ai, in: Proceedings of the 39th ACM SIGMOD-
SIGACT-SIGAI Symposium on Principles of Database Systems, 2020, pp. 229β243.
[8] H. S. Wilf, Generatingfunctionology, A. K. Peters, Ltd., USA, 2006.
[9] M. Chavira, A. Darwiche, On probabilistic inference by weighted model counting, Artificial
Intelligence 172 (2008) 772β799.