<!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 />
    <article-meta>
      <title-group>
        <article-title>Two Remarks on Counting Propositional Logic⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Melissa Antonelli</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Bologna</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Counting propositional logic was recently introduced in relation to randomized computation and shown able to logically characterize the full counting hierarchy [1]. This paper aims to clarify the nature and expressive power of its univariate fragment. On the one hand, we make the connection of our logic with stochastic experiments explicit, proving that any (and only) event(s) associated with dyadic distribution can be simulated in this formalism. On the other, we provide an efective procedure to measure the probability of counting formulas.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Randomized Computation</kwd>
        <kwd>Probability Logic</kwd>
        <kwd>Dyadic Distributions</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Because many artificial intelligence applications require the ability to reason with uncertain
knowledge, it is important to seek appropriate generalizations of logic from this case. [2, p. 71]
For probabilistic algorithms behavioral properties, like termination or equivalence, have
quantitative nature, that is computation terminates with a certain probability, and programs simulate
the desired function up to some probability of error (for instance, when dealing with learning
algorithms). Then, how can such properties be studied within a logical system?</p>
      <p>
        In a series of recent works [
        <xref ref-type="bibr" rid="ref1 ref3 ref4">3, 1, 4</xref>
        ], we introduce logics with counting and measure quantifiers,
providing a new formal framework to study probability, and show them strongly related to
several aspects of randomized computation. In particular, our counting logics are shown able to
logically characterize probabilistic complexity classes, while counting-quantified formulas can
be seen as expressing that a program behaves in a certain way with a given probability. The main
goal of this paper is to clarify what the expressive power (and limit) of the simple, univariate
fragment of counting propositional logic [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] (CPL0, for short) is, so to better understand its
connection with both randomized computation and other probability systems.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. On Logic and Randomized Computation</title>
      <p>The development of counting logics is part of an overall study aiming to analyze interactions
between (quantitative) logic and probabilistic computation, in order to deepen our knowledge
of both.</p>
      <sec id="sec-2-1">
        <title>2.1. Overview</title>
        <p>Our project was motivated by two main considerations. On the one hand, since their appearance
in the 1970s, probabilistic computational models have become more and more pervasive in
several fast-growing areas of computer science and technology, from statistical learning to
approximate computing. On the other, the development of diferent computational models
has considerably benefitted from the mutual interchanges existing between logic and TCS.
Nevertheless, there is at least one crucial aspect of the theory of computation which was only
marginally touched by such fruitful interactions, namely randomized computation. The global
purpose of our study is to lay the foundation for a new approach to bridge this gap, and its key
ingredient consists in considering new inherently quantitative logics, the language of which
includes non-standard quantifiers able to “measure” the probability of their argument formulas.</p>
        <p>
          So far, we have mostly focussed on a few specific aspects of the interaction between
quantitative logics and randomized computation:
• Complexity theory: classical propositional logic (PL, for short) provides the first example
of an NP-complete problem [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], while its quantified version characterizes the full
polynomial hierarchy [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Instead, no analogous logical counterpart was known for probabilistic
and counting classes [
          <xref ref-type="bibr" rid="ref7 ref8 ref9">7, 8, 9</xref>
          ]. In [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], we introduce a counting propositional system, called
CPL, which ofers a logical characterization of Wagner’s counting hierarchy.
• Programming language theory: type systems for randomized  -calculi, also
guaranteeing various forms of termination properties, were introduced in the last decades, for
example in [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. Yet, these systems are not “logically oriented” and no Curry-Howard
correspondence [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] is known for them. In [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], we define an intuitionistic version of CPL,
called iCPL0, which is able to capture quantitative behavioral properties and provides
(the logical side of) a probabilistic correspondence in the style of Curry and Howard.
• Computation theory: arithmetics and the theory of deterministic computation are linked
by numerous, deep results from logic and recursion theory. In [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], we present a
quantitative extension of the language of Peano Arithmetic (PA, for short). This new language,
called MQPA, allows us to formalize basic results from probability theory, which are not
expressible in PA (for example, the so-called “infinite monkey theorem” or the “ random
walk theorem”), and to establish a probabilistic version of Gödel’s arithmetization [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. (Univariate) Counting Propositional Logic in a Nutshell</title>
        <p>
          In standard PL formulas are interpreted as single truth-values. The core idea of our counting
semantics consists in modifying this intuition in a quantitative sense, associating formulas
with measurable sets of (satisfying) valuations. Specifically, given a counting formula  , its
interpretation is taken to correspond to the set of all maps  ∈ 2N “making  true”. Any such
set belongs to the standard Borel algebra over 2N, B(2N), yielding a genuinely quantitative
semantics. In particular, atomic propositions correspond to cylinder sets [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] of the form
() = { ∈ 2N |  () = 1},
with  ∈ N, while molecular expressions are interpreted in the natural way as standard
operations of complementation, finite intersection and union. Clearly, such “interpretation sets” are
measurable and can be associated with the unique cylinder measure  C , where for any  ∈ N,
 C (()) = 12 [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
        </p>
        <p>
          We can then enrich our language with new formulas expressing the measure of such sets. By
adapting Wagner’s notion of counting operator [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], we introduce two non-standard quantifiers,
C and D, with  ∈ Q[
          <xref ref-type="bibr" rid="ref1">0,1</xref>
          ]. Basically, counting-quantified formulas C and D express that
 is satisfied in a certain portion of all its possible interpretations to be (resp.) greater or strictly
smaller than the given . For example, the formula C1/2 intuitively says that  is satisfied by
at least one half of its valuations. Semantically, this amounts at checking  C (J K) ≥ 21 .
Definition 1. Formulas of CPL0 are defined by the grammar below:
        </p>
        <p>
          := i | ¬ |  ∧  |  ∨  | C | D,
where  ∈ N and  ∈ Q[
          <xref ref-type="bibr" rid="ref1">0,1</xref>
          ]. Given the standard cylinder space P = (2N,  (C ),  C ), for each
formula of CPL0  , its interpretation is the measurable set J K ∈ B(2N) defined as follows:
i = ()
        </p>
        <p>J K</p>
        <p>J¬K = 2N − JK
J1 ∧ 2K = J1K ∩ J2K
J1 ∨ 2K = J1K ∪ J2K</p>
        <p>J
C =</p>
        <p>K
J
D =</p>
        <p>K</p>
        <p>∅
{︃2N if  C (JK) ≥</p>
        <p>otherwise
∅
{︃2N if  C (JK) &lt; 
otherwise.</p>
        <p>
          Notice that, in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], we even introduce a labelled calculus, which is proved sound and complete
for the semantics above.
        </p>
        <sec id="sec-2-2-1">
          <title>3. On the Expressive Power of CPL0</title>
          <p>Our counting logics are strongly related to probabilistic reasoning and, indeed, CPL0 ofers
a natural model to express the probability of events associated with Bernoulli distributions.
In fact, we show that counting formulas can simulate experiments associated to any dyadic
probability distribution.</p>
        </sec>
      </sec>
      <sec id="sec-2-3">
        <title>3.1. Expressing Exact Probability</title>
        <p>In CPL0, we can easily express that a formula is true with precisely a certain probability. For
clarity’s sake, we do so by means of auxiliary quantifiers, C and D, intuitively saying that
their argument formula is true with probability (resp.) strictly greater or smaller (or equal) than
the given index.</p>
        <p>Notation 1. So-called white counting quantifiers are interpreted as follows:
JC K :=</p>
        <p>∅
{︃2N if  C (J K) &gt; 
otherwise</p>
        <p>JD K :=</p>
        <p>∅
{︃2N if  C (J K) ≤ 
otherwise.</p>
        <p>Clearly, these quantifiers do not extend the expressive power of CPL0, as definable in terms of
primitive C and D,1 but due to them exact probability is expressed in a compact way.
Example 1. For example, we formalize that the formula  = 1 ∧ 2 is true with probability 14 as
 = C1/4(1 ∧ 2) ∧ D1/4(1 ∧ 2).</p>
      </sec>
      <sec id="sec-2-4">
        <title>3.2. Simulating Dyadic Distributions</title>
        <p>By their semantic definition, it is natural to interpret atomic formulas of CPL0 as infinite
sequences of independently and uniformly distributed random bits – that is, more concretely,
as infinite sequences of (independent) fair coin tosses – and, in general, counting formulas
as formally representing experiments associated with specific probability distributions. For
instance, the fact that, when tossing an unbiased coin twice, the probability that it returns
head both times is 14 can be expressed in CPL0 by the formula  above (which is also easily
proved valid in our semantics). Generally speaking, counting formulas can simulate events
associated with any dyadic probability distribution, but those related to non-dyadic ones only
approximately.</p>
        <p>In fact, we capture atomic sampling from a Bernoulli distribution of non-reducible parameter
 = 2 by molecular formulas of CPL0, while corersponding complex events are expressed
combining such formulas in the usual way. To make this intuition less vague, let us consider
the following simple example.</p>
        <p>Example 2. Let a biased coin return head only 25% of the time. In this case, it is clear that a
single toss cannot be formalized by an atomic formula of CPL0. Yet, it can be easily expressed
using a molecular formula, namely one in the form (i ∧ j) (with ,  ∈ N fresh). Consequently, also
properties concerning complex events can be captured in CPL0. For instance, that the probability
for at least one of two subsequent biased tosses to return head is greater than 13 is formalized by
the (valid) formula:</p>
        <p>= C1/3(︀ (1 ∧ 2) ∨ (3 ∧ 4))︀ .
1For further details, see Appendix B.1, and, in particular, Proposition 2.
In the same way, we can (quantitatively) simulate any discrete distribution with ♯ = 2.2
Something diferent happens when considering experiments related to non-dyadic distributions.
Indeed, by Lemma 1 below, formulas of CPL0 can simulate these events – such as tossing a
biased coin returning head with probability 31 – only in an approximate way.3
Lemma 1. For any formula of CPL0  , there exist ,  ∈ N, such that  C (J K) = 2 .</p>
        <sec id="sec-2-4-1">
          <title>4. Measuring Formulas of CPL0</title>
          <p>
            In [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ], the validity of counting formulas is decided accessing an oracle for ♯SAT, counting the
satisfying models of Boolean formulas.4 Here, we provide an efective procedure to measure
formulas of CPL0, without appealing for an external source, thus making the task done by the
oracle explicit. In our opinion, this could make the comparison with other probability logics, for
example [
            <xref ref-type="bibr" rid="ref14">14</xref>
            ], more clear and support a better understanding of the “nature” of our non-standard
quantifiers. We hope this is also the first step to shed new lights on the complexity of deciding
formulas of CPL0 (and of proofs in the corresponding calculus LKCPL0 [1, Sec. 2.2]).5
          </p>
          <p>The skeleton of our procedure is as follows. Given a formula of CPL0, we first consider its
(inner) not-quantified formulas. We do so by passing through a special form, the measure of
which can be computed in a straightforward way (Lemma 3). We prove that any formula of
CPL0 without quantifiers can be converted into such measurable form (Lemma 4). Notably,
the procedure we ofer is efective, but not necessarily “feasible” as requiring argument
formulas to be put in disjunctive normal form (DNF, for short). Finally, we can deal with nested
quantifications: by measuring argument formulas, one can substitute the corresponding inner
counting-quantified expression with either ⊤ or ⊥.</p>
        </sec>
      </sec>
      <sec id="sec-2-5">
        <title>4.1. Measurable Normal Form</title>
        <p>For simplicity, before defining so-called measurable normal forms, we introduce notational
conventions and the so-called auxiliary, polite forms.</p>
        <p>Notation 2. We use 1, 2... for literals, i.e. atomic formulas or their negations. Given  =
literal, we define  as follows:
 =
{︃j</p>
        <p>
          if  = ¬j
¬j if  = j,
with  ∈ N. We use ⊥ as a shorthand for  ∧  and ⊤ for  ∨  .
2Of course, any information concerning the nature of variables involved in the experiment is lost, but quantitative
aspects, that is events’ probability, are all preserved through the formalization. For further details, see Appendix B.2.
3Generalizations of CPL0 associated with a probability space (2N,  (C ),  ), where  is not necessarily the measure
of i.i.d. sequences of random bits, are cursorily presented in Appendix B.2. Observe that, diferently from standard
CPL0, the logics presented in the quoted Appendix can naturally formalize also events related to (any) non-dyadic
Bernoulli distributions.
45IInnd[e1e]d,a,oCnPeLc0a-nfoervmenuliantroidsuscaeidsytontbaectviacalildewxphreenssJionKs=of 2thNeafnodr minvmaeliads(wh)en=J, Kw=he∅re.  is a counting formula
without quantifiers and  ∈ Q[
          <xref ref-type="bibr" rid="ref1">0,1</xref>
          ], to be interpreted as predictable: Jmeas( ) = K is true when  C (J K) = JKQ.
Basing on them, LKCPL0 can be modified so to become purely syntactical (without loosing completeness).
Definition 2 (Polite Normal Forms). A formula of CPL0 in conjunctive normal form (CNF,
for short)  = ⋀︀∈{1,...,} , is said to be in conjunctive polite form (CPF, for short) if either
 ∈ {⊥, ⊤} or both  ̸= ′ and  ̸= ′ , for any  ̸= ′ ∈ {1, . . . , }. A formula of CPL0
in DNF  = ⋁︀∈{1,...,}  , is said to be in disjunctive polite form (DPF, for short) if either
 ∈ {⊥, ⊤} or for each  ∈ {1, . . . , },  is in CPF and  ̸∈ {⊥, ⊤}.
        </p>
        <p>Lemma 2. Given a formula of CPL0 in DNF , there is a * such that * is in DPF and  ≡ * .</p>
      </sec>
      <sec id="sec-2-6">
        <title>4.2. Conversion into MNF</title>
        <p>Now, as anticipated, we introduce a special form, such that expressions in this form can be
“measured” in a straightforward way. We start by defining contradictory pairs, that is formulas
(in CPF) the conjunction of which is invalid.</p>
        <p>Definition 3 (Contradictory Pair). Two formulas of CPL0 in CPF,  = ⋀︀∈{1,...,}  and
 = ⋀︀∈{1,...,} , are said to be mutually contradictory when there exist a  ∈ {1, ..., }
and a  ∈ {1, ..., } such that  =  (or  =  ).</p>
        <p>By Definition 1 plus basic measure theory, it is easy to see that the measure of the disjunction
of two contradictory formulas in CPF is the sum of the measure of each disjunct (which, being
themselves in CPF, are measurable as well). The generalization of this intuition leads to the
definition below.</p>
        <p>Definition 4 (Measurable Normal Form). A formula of CPL0  = ⋁︀∈{1,...,}  is in
measurable normal form (MNF, for short), if either  ∈ {⊥, ⊤} or  is in DPF and for each
,  ∈ {1, . . . , },  and  are mutually contradictory.</p>
        <p>Lemma 3. Given a formula of CPL0 in MNF, say  = ⋁︀∈{1,...,} : . if  = ⊤, then
 C (J K) = 1, . if  = ⊥, then  C (J K) = 0, . otherwise  C (J K) = ∑︀∈{1,...,}  C (JK).
Observe that, as said, each disjunct is in CPF, so, again by basic measure theory, its measure is
easily computable as well and any JK can efectively be measured. 6</p>
        <p>We conclude our proof showing that each formula in DPF can actually be “converted” into
MNF. To do so, we notice that two disjuncts can be mutually related in three ways only: (1) if
one is a sub-formula of the other, the former is simply removed;7 (2) if they are a contradictory
pair, the form is already as desired and the next pair is considered; (3) if one of the two disjuncts,
say , contains a literal , such that neither  or  occurs in the other disjunct, say  , we
substitute  with ′ =  ∧  and ′′ =  ∧  to be both taken into account again.
Lemma 4. For each CPL0-formula in DPF  , there is a formula in MNF  * such that  ≡  * .
We conclude by putting Lemmas 4 and 2 and Lemma 3 together, so to obtain the desired
procedure that, for any formula of CPL0, efectively computes the measure of its probability.
6For further details, see Corollary 1.
7A formula in CPF, say  = ⋀︀∈{1,...,} , is said to be a sub-formula of another formula in CPF, say  =
⋀︀′∈{1,...,} ′ , when (they are not a contradictory pairs or  ∈ {⊥, ⊤} or  ∈ {⊥, ⊤} and) for each
′ ∈ {1, . . . , }, there is a  ∈ {1, . . . , }, such that  = ′ . For example, a formula 1 ∧ 2 ∧ 3 is a sub-formula
of 1 ∧ 2.
1–13</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Appendix</title>
    </sec>
    <sec id="sec-4">
      <title>A. Section 2</title>
      <p>
        Preliminaries. In order to avoid clash in terminology, we briefly recap a few standard notions
from probability theory. An outcome or point is the result of a single execution of an experiment,
the sample space Ω is the set of all possible outcomes, and an event is a subset of Ω. Two events,
say 1 and 2, are disjoint or mutually exclusive, when they cannot happen at the same time,
that is 1 ∩ 2 = ∅. Two events are independent when the occurrence of one does not afect the
probability for the other to occur. A class of subsets of Ω is a ( -)field if containing Ω itself and
being closed under the formation of complements and (in)finite unions. A probability measure
Prob(· ) is a real-valued function defined on a field satisfying Kolmogorov’s axioms [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. So,
in particular, given two disjoint events, 1 and 2, Prob(1 ∪ 2) = Prob(1) + Prob(2),
while for two independent events, 1′ and 2′, Prob(1′ ∩ 2′) = Prob(1′) · Prob(2′).
      </p>
      <p>
        Following [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], infinite sequences of (random) tosses can be represented as  =
((1), (2), (3), . . . ), where for any  ∈ 2N and  ≥ 1, () ∈ 2, being 2 = {0, 1}. Then, 2
is the Cartesian product consisting of the -long sequences 1, . . . , , with  ∈ 2 for any
 ∈ {1, . . . , } and 2N is the set of all infinite sequences of elements in 2. A cylinder of rank k is
a set of the form C = { : ((1), . . . , ()) ∈ }, where  ⊂ 2. When  is a singleton,
C is a thin cylinder, corresponding to the fact that the first  repetitions of the experiment
have outcomes 1, . . . ,  in sequence. The class of cylinders of all ranks, denoted as C , is
a field and a standard probability measure can be defined over it. In particular, we assign a
probability measure  C to any cylinder of rank , such that for any  ∈ {1, . . . , },  ∈ 2, and
corresponding probability  of getting  ,
So, as a special case, when C is a thin cylinder,  C { : ((1), . . . , ()) = (1, . . . , )} =
1 · · ·  . Notice also that if the coin is fair, for each tossing 0 = 1 = 12 . In this case (since
for any  &gt; 0,  is finite) the Proposition 1 below follows.
      </p>
      <p>Proposition 1. If 0 = 1 = 12 , then for any cylinder of rank , call it C , there exist ,  ∈ N,
such that  C (C ) = 2 .</p>
      <p>Going back to  (C ), i.e. the smallest  -algebra including C and which is Borel, a well-defined
probability measure is assigned to it by generalizing in the natural way the measure defined
above for a cylinder of rank .</p>
    </sec>
    <sec id="sec-5">
      <title>B. Section 3</title>
      <p>B.1. Section 3.1
Proofs from Section 3.1.</p>
      <p>
        Lemma 5. For every formula of CPL0  , and  ∈ Q[
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ],
 C (J K) ◁
      </p>
      <p>⇔  C (J¬ K) ▷ 1 − ,
with (◁, ▷) ∈ {(≥ , ≤ ), (≤ , ≥ ), (&gt;, &lt;), (&lt;, &gt;)}.</p>
      <p>Proof. Let us consider the case ≤ , ≥ . By Definition 1  C (J¬ K) =  C (2N − J K) = 1 −
 C (J K). So, trivially,  C (J K) ≥  if 1 −  C (J K) ≤ 1 −  if  C (J¬ K) ≤ 1 − . All the
other cases are proved in a similar way.</p>
      <p>
        Proposition 2. For any formula of CPL0  , and  ∈ Q[
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ]:
      </p>
      <p>C¬ ≡ D1− 
C¬ ≡ ¬</p>
      <p>C1−</p>
      <p>D¬ ≡ C1− 
D¬ ≡ ¬</p>
      <p>D1− .
Proof. The proof relies on Definition 1 and Lemma 5:</p>
      <p>JC¬ K =</p>
      <p>∅
{︃2N if  C (J¬ K) ≥</p>
      <p>otherwise
=</p>
      <p>∅
= D1−</p>
      <p>J</p>
      <p>K
{︃2N if  C (J K) ≤ 1 −</p>
      <p>otherwise
JC¬ K = J¬D¬ K</p>
      <p>= J¬C1−  K
B.2. Section 3.2
JD¬ K =
=</p>
      <p>∅
= C1−</p>
      <p>J</p>
      <p>K
∅
{︃2N if  C (J¬ K) &lt;</p>
      <p>otherwise
{︃2N if  C (J K) &gt; 1 −</p>
      <p>otherwise
JD¬ K = J¬C¬ K
= J¬D1−  K.
Proof from Section 3.2. We prove that formulas of CPL0 are interpreted as events associated
with dyadic distributions relying on Proposition 1. To do so, we show that any counting formula
is interpreted as a cylinder of rank , for some  ∈ N.</p>
      <p>Lemma 6. For any formula of CPL0  , there is a cylinder of rank  C , such that J K = C .
Proof. The proof is by induction on the structure of  :
•  = i for some  ∈ N. Then JiK = (), which is a thin cylinder.
•  = ¬. By IH, there is a  and a cylinder of rank , C , such that JK = C . Let
′ = 2 − C (≡ 2N − C ). Then, J¬K = 2N − JK = 2N − C = C′ , which is
clearly a cylinder of rank  as well.
•  = 1 ∧ 2. By IH, there exist 1, 2 ∈ N and cylinders of rank 1, 2, C1 and C2 ,
such that (resp.) J1K = C1 and J2K = C2 . Then, if 1 = 2, J K = J1K ∩ J2K =
C1 ∩ C2 = C1∩2 , which is a cylinder of rank 1 as well. Otherwise, assume 1 &gt; 2
(the case 2 &gt; 1 is equivalent). Let 2′ consists of the sequences (1, . . . , 1 ) in
21 such that the truncated sequence (1, . . . , 2 ) is in 2. Then, C2 ≡ C′2 = { :
((1), . . . , (1)) ∈ 2′}. We conclude that J K = J1K∩J2K = C1 ∩C′2 = C1∩2′ ,
which is a cylinder of rank 1.
•  = 1 ∧ 2. Similar to the case above.
•  = C and  = D. Then, either J K = 2N or J K = ∅, which are both cylinders
of rank  (in particular, in the former case  = 0).</p>
      <p>Proof of Lemma 1. By putting Proposition 1 and Lemma 6 together.</p>
      <p>Notice also that a “syntactic” proof of Lemma 1 is obtained as a corollary of the results provided
in Section 4.
Non-Dyadic Bernoulli Distributions. As said, one can simulate events associated with
non-dyadic distributions in an approximate way only.</p>
      <p>Example 3. Let us consider a biased coin returning head only 13 of the time. We cannot simulate
this event in CPL0, but “approximate” it with  = 2 variables of CPL0 in the following sense. If
 = 2 we can down-approximate a single toss of the biased coin as:</p>
      <p>= (1 ∧ 2) ∨ (︀ (¬1 ∧ 2) ∧ (3 ∧ 4))︀ .</p>
      <p>Observe that disjuncts are mutually contradictory, so  C (JK) = 156 . If  = 3,
(down)approximation is obtained as,</p>
      <p>′ = (1 ∧ 2) ∨ (︀ (¬1 ∧ 2) ∧ (3 ∧ 4))︀ ∨ ︀( (¬1 ∧ 2) ∧ (¬3 ∧ 4) ∧ (5 ∧ 6))︀ .
Then,  C (J′K) = 2614 . In general, the more  is increased, the more precise is the approximation
of the desired event.</p>
      <p>
        Although events associated with non-dyadic distributions cannot be expressed in CPL0 in a
precise way, when switching to (CPL⋆0 or) the measure-quantified language MQPA [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] such
formalization becomes possible.
      </p>
      <p>
        Generalizing CPL0. As seen, the semantics for CPL0 is associated with a canonical
cylinder space (2N,  (C ),  C ), where  C is the standard measure  C (()) = 12 for any  ∈ N,
corresponding to tossing fair coins [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. It is possible to generalize this framework in a
straightforward way, so to allow the measure to be associated with distributions other than dyadic ones.
Indeed, we can define extended CPL⋆0 associated with a probability space P⋆ = (2N,  (C ),  ⋆),
where  ⋆ is any properly-defined probability measure over  (C ). Then, the grammar and
semantics for CPL⋆0 is as for CPL0 except for counting-quantified formulas.
      </p>
      <p>Definition 5. Extended formulas are defined by substituting standard counting quantifiers
with C ⋆ and D ⋆ , the interpretation of which is now based on P* :</p>
      <p>J  ⋆  K =
C</p>
      <p>∅
{︃2N if  ⋆(J K) ≥ 
otherwise</p>
      <p>J  ⋆  K =
D</p>
      <p>∅
{︃2N if  ⋆(J K) &lt; 
otherwise.</p>
      <p>Then, CPL0-formulas C and D become special cases of extended ones, namely C ⋆ 
and D ⋆  (resp.), where  ⋆ =  C . On the other hand, in CPL⋆0 we can simulate experiments
corresponding to tossing (arbitrarily) biased coins.</p>
      <p>Example 4. Let us consider a biased coin, which returns head only 13 of the time. Then, letting
 ⋆(()) = 13 (for any  ∈ N), we can express that the probability for subsequent tosses to be
successful is greater than 19 as</p>
      <p>= C1/⋆9(1 ∧ 2).</p>
      <p>Clearly, since  ⋆(︀ J1 ∧ 2K) = 31 · 31 , the formula is valid, i.e. JC1/*9(1 ∨ 2)K = 2N.</p>
    </sec>
    <sec id="sec-6">
      <title>C. Proofs from Section 4</title>
      <p>C.1. Section 4.1
Measurable Normal Form.
⊢ c ↣

⊢ b ↣
 ⋆(JcK) ≥ 
C ⋆ 
C↣⋆</p>
      <p>
        One can even define a calculus LKCPL0⋆ for this extended semantics, with no substantial
change with respect to the proof system LKCPL0 , introduced in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Indeed, only so-called
external hypotheses are related to probability measure and, consequently, no rule, except those
involving such measuring conditions, needs to be modified. Generalizations are obtained in the
following way:
Proof of Lemma 2. Let  = ⋁︀∈{1,...,}  be in DNF. For any  = ⋀︀∈{1,...,}  , with
 ∈ {1, . . . , }, we define * applying the transformations below:
* if  = ⊤, then * = ⊤.
* otherwise, consider each  ∈ {1, . . . , }, starting with  = 1:
. if  = ⊥, then * = ⊥.
. if  = ⊤, then  is removed and  + 1 is considered.
. if  ̸∈ {⊥, ⊤}, we consider each pedex  ̸=  ∈ {1, . . . , }, starting with the first:
. if  = , then  is removed and the subsequent pedex (diferent from  and
) is considered.
. if  = , then * = ⊥.8
. otherwise,  is left unchanged and  + 1 is considered.
      </p>
      <p>It is clear that  ≡ * . We now consider ′ = ⋁︀∈{1,...,′} * and define * applying the
following transformations:
* if * = ⊥ for any  ∈ {1, . . . , ′}, then * = ⊥.
* otherwise, we consider each  ∈ {1, . . . , ′} starting with  = 1:
. if  = ⊤, then * = ⊤.
. if  = ⊥, then  is removed and  + 1 is considered.
. if  ∈ {⊤, ⊥}, we consider each pedex starting with the first ′ ̸=  ∈ {1, . . . , ′}:
. if  and ′ contain exactly the same literals, then ′ is removed and the
subsequent pedex (diferent from both ′, ) is considered.
. otherwise,  is (at least temporarily) left unchanged and the subsequent pedex
(diferent from both ′, ) is considered.</p>
      <p>Again it is clear that  ≡ * .
8Actually, due to Notation 2, case . should already be considered as the first case * .
Observe that for any formula  in DPF, either  ∈ {⊥, ⊤} or no instance of ⊥, ⊤ occurs in it.
As anticipated in Section 4, it is easy to measure the probability of a formula in CPF.
21 .</p>
      <p>Proposition 3. Given a formula  in CPF: . if  = ⊤, then  C (JK) = 1, . if  = ⊥, then
 C (JK) = 0, . otherwise,  = ⋀︀∈{1,...,}  and  C (JK) = 21 .</p>
      <p>Proof. Case ., . are trivial consequences of Definition 1 and basic measure theory. Case .
relies on Definition 2. Since  does not contain ⊥, ⊤ (or contradictions) or repetitions, by
semantic definition, its literals have to be interpreted as independent events, the measure of which
is known. Thus, for basic measure theory,  C ︀( q ⋀︀∈{1,...,} y)︀ =  C (︀ ⋂︀∈{1,...,}JK︀) =
Proof of Lemma 3. As before, cases ., . hold by Definition 1 and basic measure theory. Case .
is proved relying on Definition 4: for any  ̸=  ∈ {1, . . . , }, ( , ) is a contradictory pair.
Then, by Definition 3, J K ∩ JK = ∅ for any , . So, we conclude  C ︀( q ⋁︀∈{1,...,} y)︀ =
 C (︀ ⋃︀∈{1,...,}JK︀) = ∑︀∈{1,...,}  C (JK).</p>
      <p>Corollary 1. Given a formula of CPL0 in MNF,  =
⋀︁
Proof. By Proposition 3 and Lemma 3.</p>
      <p>We show how to convert a CPL0-formula in DPF into an equivalent
Proof of Lemma 4. Given a formula of CPL0 in DPF  = ⋁︀∈{1,...,} , we define a formula
 * in MNF such that  ≡  * as follows:
* if  ∈ {⊥, ⊤}, then  * =  .
* otherwise, we consider each  ∈ {1, . . . , }, starting with  = 1:
. if there is a  ̸=  ∈ {1, . . . , } such that  is a sub-formula of  , then  is
removed and  + 1 is considered.
. otherwise, we consider each pedex  ̸=  ∈ {1, . . . , } starting from the first one:
. if  and  are mutually contradictory, then  + 1 is considered.
. otherwise, for  = ⋀︀∈{1,...,}  and  = ⋀︀′∈{1,...,′} ′ , we consider each
 ∈ {1, . . . , } starting with  = 1:
· if there is a ′ ∈ {1, . . . , ′} such that  = ′ , then  is left unchanged
and  + 1 is considered.
· if there is no ′ ∈ {1, . . . , ′} such that  = ′ , then  is replaced by
two formulas ′ =  ∧ ′ and ′′ =  ∧ ′ and .-. are applied again
to both.</p>
      <p>We consider each ′ ∈ {1, . . . , ′} starting with ′ = 1:
· if there is a  ∈ {1, . . . , } such that  = ′ , then ′ is left unchanged</p>
      <p>and ′ + 1 is considered.
· if there is no  ∈ {1, . . . , } such that  = ′ , then  is replaced by
′ =  ∧ ′ and ′′ =  ∧ ′ and .-. are applied again to both.</p>
      <p>Then, we consider  + 1.</p>
      <p>When  + 1 = ,  + 1 is considered (until also  + 1 = ).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Antonelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Dal Lago</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Pistone</surname>
          </string-name>
          ,
          <article-title>On Counting Propositional Logic and Wagner's Hierarchy</article-title>
          ,
          <source>in: Proc. ICTCS</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>107</fpage>
          -
          <lpage>121</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>N.</given-names>
            <surname>Nilsson</surname>
          </string-name>
          , Probabilistic Logic,
          <source>Artificial Intelligence</source>
          <volume>28</volume>
          (
          <year>1986</year>
          )
          <fpage>71</fpage>
          -
          <lpage>87</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Antonelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Dal Lago</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Pistone</surname>
          </string-name>
          ,
          <article-title>On Measure Quantifiers in First-Order Arithmetic</article-title>
          ,
          <source>in: Proc. CiE</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>12</fpage>
          -
          <lpage>24</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Antonelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Pistone</surname>
          </string-name>
          , U. Dal Lago,
          <article-title>Curry and Howard Meet Borel</article-title>
          ,
          <source>in: Proc. LICS</source>
          ,
          <year>2022</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>13</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Cook</surname>
          </string-name>
          ,
          <article-title>The Complexity of Theorem-Proving Procedures</article-title>
          ,
          <source>in: Proc. STOC</source>
          ,
          <year>1971</year>
          , pp.
          <fpage>151</fpage>
          -
          <lpage>158</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Meyer</surname>
          </string-name>
          , L. Stockmeyer,
          <article-title>The Equivalence Problem for Regular Expressions with Squaring Requires Exponential Space</article-title>
          ,
          <source>in: Proc. SWAT</source>
          ,
          <year>1972</year>
          , pp.
          <fpage>125</fpage>
          -
          <lpage>129</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J.</given-names>
            <surname>Gill</surname>
          </string-name>
          ,
          <article-title>Computational Complexity of Probabilistic Turing machines</article-title>
          ,
          <source>J. Comput. 6</source>
          (
          <year>1977</year>
          )
          <fpage>675</fpage>
          -
          <lpage>695</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>L.</given-names>
            <surname>Valiant</surname>
          </string-name>
          ,
          <source>The Complexity of Computing the Permanent, TCS</source>
          <volume>8</volume>
          (
          <year>1979</year>
          )
          <fpage>189</fpage>
          -
          <lpage>201</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>K.</given-names>
            <surname>Wagner</surname>
          </string-name>
          ,
          <article-title>The Complexity of Combinatorial Problems with Succinct Input Representation</article-title>
          ,
          <source>Acta Informatica</source>
          <volume>23</volume>
          (
          <year>1986</year>
          )
          <fpage>325</fpage>
          -
          <lpage>356</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>U.</given-names>
            <surname>Dal Lago</surname>
          </string-name>
          , G. Guerrieri, W. Heijltjes,
          <string-name>
            <surname>Decomposing Probabilistic</surname>
          </string-name>
          Lambda-Calculi,
          <source>in: Proc. FoSSaCS</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>136</fpage>
          -
          <lpage>156</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Sorensen</surname>
          </string-name>
          , P. Urzyczyn, Lectures on the
          <string-name>
            <surname>Curry-Howard</surname>
            <given-names>Isomorphism</given-names>
          </string-name>
          , Elsevier,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>K.</given-names>
            <surname>Gödel</surname>
          </string-name>
          ,
          <source>On Formally Undecidable Propositions of Principia Mathematica and Related Systems</source>
          , Dover Publications, Inc.,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>P.</given-names>
            <surname>Billingsley</surname>
          </string-name>
          , Probability and Measure, Wiley,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>R.</given-names>
            <surname>Fagin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Halpern</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Megiddo</surname>
          </string-name>
          ,
          <article-title>A Logic for Reasoning about Probabilities, Inf</article-title>
          . Comput.
          <volume>87</volume>
          (
          <year>1990</year>
          )
          <fpage>78</fpage>
          -
          <lpage>128</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>A.</given-names>
            <surname>Kolmogorov</surname>
          </string-name>
          , Grundbegrife der Wahrscheinllichkeitrechnung, in: Ergebnisse Der Mathematik,
          <year>1933</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>