<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Hersonissos, Greece, May</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Fondazione Bruno Kessler</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Trento</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Italy</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2022</year>
      </pub-date>
      <volume>29</volume>
      <issue>2022</issue>
      <abstract>
        <p>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 multiple 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.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Multi context systems</title>
      <p>
        Ω +1 |= +1
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
Ω = {Ω }∈ where
where  is a sentential formula of  . A model for an MCS ⟨︀ {Φ }∈ , BR⟩︀ is a structure
1. Ω  is a set of interpretations of  such that for all  ∈ Ω ,  |= Φ  (written as Ω  |= Φ );
2. For every bridge rule of the form (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) in BR, if Ω  |=  for all  = 1, . . . , , then
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.
      </p>
      <p>
        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:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
 :  ⇒  :  → 
 :  ⇒  :  → 
 : ¬ ⇒  :  → ¬
 : ¬ ⇒  :  → ¬
The above bridge rules simulate all the query-answering interactions between Alice and Bob.
Notice 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
ifnal 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  .
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Multi context model counting</title>
      <p>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.</p>
      <p>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:
1When 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  :  ∈ ¯  =  ∖  .</p>
      <p>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  ⊆ :
where, for every set of labelled formulas ,  denotes the set { |  :  ∈ }.</p>
      <p>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  ∈ Ω .</p>
      <p>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</p>
      <p>
        0 = ∑︁(− 1)
=0
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
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:
 = ∑︁  (⊇  ) =
||=
      </p>
      <p>
        ⃒⃒ ⃒⃒
∑⊆ ︁¯  ⃒⃒⃒⃒ ⋂∈︁ ⃒⃒⃒⃒
||=
Notice that Ω ∈ ⋂︀∈  if and only if Ω |=  ∧ . This implies that ⃒⃒⃒ ⋂︀∈ ⃒⃒⃒ is the number
of subsets of the set of models that satisfiey  ∧ , i.e.,
 =
∑︁ 2(∧)
⊆ ¯ 
||=
0 =
∑︁ (− 1)||2(∪)
⊆ ¯ 
From which we conclude that the number of sets of models that satisfies  and do not satisfy
¯  is:
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
∑︀⊆ ¯  (− 1)||2(∪) of such sets of models, we can conclude that
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
□
(
        <xref ref-type="bibr" rid="ref7">7</xref>
        )
      </p>
      <p>∏︁ ∑︁ (− 1)||2(∪)
 ∈F(BR)  ⊆ ¯ 
Theorem 1.</p>
      <p>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) =</p>
      <p>mc( )
=</p>
      <p>∑︁
 ∈F(BR)</p>
      <p>∑︁
 ∈F(BR)  ⊆ ¯ 
∏︁ ∑︁ (− 1)||2(∪)
□</p>
      <p>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 .</p>
      <p>
        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
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ). The set  is equal to:
The set F of subsets  of  closed under the bridge rules (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) and (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ), are the following:
 = { : ,  : ¬,  :  → ,  :  → ¬}
0 = {}
1 = { :  → }
2 = { :  → ¬}
3 = { :  → ,  :  → ¬}
4 = { : ,  :  → }
5 = { :  → ,  :  → ¬}
6 = { : ¬,  :  → ¬}
7 = { : ¬,  :  → ,  :  → ¬}
8 = { : ,  : ¬,  :  → ,  :  → ¬}
Using formula (
        <xref ref-type="bibr" rid="ref5">5</xref>
        ) one can cmput mc() and then sum all the result, obtaining mc((
        <xref ref-type="bibr" rid="ref2">2</xref>
        )). Let us
for instance compute mc(3) and mc(4)
= 22 − 21 − 21 + 20) · 22
= (21 − 20) · (23 − 22)
mc(3) = (2(⊤) − 2() − 2(¬) + 2(∧¬)) · 2((→)∧(→¬))
mc(4) = (2() − 2(∧¬)) · (2(→) − 2(→∧→¬))
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion and future directions</title>
      <p>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.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>J. McCarthy</surname>
          </string-name>
          , Notes on formalizing context,
          <source>in: Proceedings of the 13th international joint conference on Artifical intelligence</source>
          ,
          <year>1993</year>
          , pp.
          <fpage>555</fpage>
          -
          <lpage>560</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>F.</given-names>
            <surname>Giunchiglia</surname>
          </string-name>
          , L. Serafini,
          <article-title>Multilanguage hierarchical logics, or: how we can do without modal logics</article-title>
          ,
          <source>Artificial intelligence 65</source>
          (
          <year>1994</year>
          )
          <fpage>29</fpage>
          -
          <lpage>70</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>C.</given-names>
            <surname>Ghidini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Giunchiglia</surname>
          </string-name>
          ,
          <article-title>Local models semantics, or contextual reasoning= locality+ compatibility</article-title>
          ,
          <source>Artificial intelligence 127</source>
          (
          <year>2001</year>
          )
          <fpage>221</fpage>
          -
          <lpage>259</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>G.</given-names>
            <surname>Brewka</surname>
          </string-name>
          , T. Eiter,
          <article-title>Equilibria in heterogeneous nonmonotonic multi-context systems</article-title>
          , in: AAAI, volume
          <volume>7</volume>
          ,
          <year>2007</year>
          , pp.
          <fpage>385</fpage>
          -
          <lpage>390</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>C.</given-names>
            <surname>Ghidini</surname>
          </string-name>
          , L. Serafini,
          <article-title>Distributed first order logic</article-title>
          ,
          <source>Artificial Intelligence</source>
          <volume>253</volume>
          (
          <year>2017</year>
          )
          <fpage>1</fpage>
          -
          <lpage>39</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Borgida</surname>
          </string-name>
          , L. Serafini,
          <article-title>Distributed description logics: Assimilating information from peer sources</article-title>
          ,
          <source>in: Journal on data semantics I</source>
          , Springer,
          <year>2003</year>
          , pp.
          <fpage>153</fpage>
          -
          <lpage>184</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Darwiche</surname>
          </string-name>
          ,
          <article-title>Three modern roles for logic in ai</article-title>
          ,
          <source>in: Proceedings of the 39th ACM SIGMODSIGACT-SIGAI Symposium on Principles of Database Systems</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>229</fpage>
          -
          <lpage>243</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>H. S.</given-names>
            <surname>Wilf</surname>
          </string-name>
          , Generatingfunctionology,
          <string-name>
            <given-names>A. K.</given-names>
            <surname>Peters</surname>
          </string-name>
          , Ltd., USA,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Chavira</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Darwiche</surname>
          </string-name>
          ,
          <article-title>On probabilistic inference by weighted model counting</article-title>
          ,
          <source>Artificial Intelligence</source>
          <volume>172</volume>
          (
          <year>2008</year>
          )
          <fpage>772</fpage>
          -
          <lpage>799</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>