Model Checking Quantitative Hyperproperties

Hyperproperties are properties of sets of computation traces. In this paper, we study quantitative hyperproperties, which we define as hyperproperties that express a bound on the number of traces that may appear in a certain relation. For example, quantitative non-interference limits the amount of information about certain secret inputs that is leaked through the observable outputs of a system. Quantitative non-interference thus bounds the number of traces that have the same observable input but different observable output. We study quantitative hyperproperties in the setting of HyperLTL, a temporal logic for hyperproperties. We show that, while quantitative hyperproperties can be expressed in HyperLTL, the running time of the HyperLTL model checking algorithm is, depending on the type of property, exponential or even doubly exponential in the quantitative bound. We improve this complexity with a new model checking algorithm based on model-counting. The new algorithm needs only logarithmic space in the bound and therefore improves, depending on the property, exponentially or even doubly exponentially over the model checking algorithm of HyperLTL. In the worst case, the new algorithm needs polynomial space in the size of the system. Our Max#Sat-based prototype implementation demonstrates, however, that the counting approach is viable on systems with nontrivial quantitative information flow requirements such as a passcode checker.


Introduction
Model checking algorithms [17] are the cornerstone of computer-aided verification. As their input consists of both the system under verification and a logical formula that describes the property to be verified, they uniformly solve a wide range of verification problems, such as all verification problems expressible in linear-time temporal logic (LTL), computation-tree logic (CTL), or the modal µ-calculus. Recently, there has been a lot of interest in extending model checking from standard trace and tree properties to information flow policies like observational determinism or quantitative information flow. Such policies are called hyperproperties [21] and can be expressed in HyperLTL [18], an extension of LTL with trace quantifiers and trace variables. For example, observational determinism [47], the requirement that any pair of traces that have the same observable input also have the same observable output, can be expressed as the following HyperLTL formula: ∀π.∀π . ( π = I π ) → ( π = O π ). For many information flow policies of interest, including observational determinism, there is no longer a need for property-specific algorithms: it has been shown that the standard HyperLTL model checking algorithm [26] performs just as well as a specialized algorithm for the respective property.
The class of hyperproperties studied in this paper is one where, by contrast, the standard model checking algorithm performes badly. We are interested in quantitative hyperproperties, i.e., hyperproperties that express a bound on the number of traces that may appear in a certain relation. A prominent example of this class of properties is quantitative non-interference [43,45], where we allow some flow of information but, at the same time, limit the amount of information that may be leaked. Such properties are used, for example, to describe the correct behavior of a password check, where some information flow is unavoidable ("the password was incorrect"), and perhaps some extra information flow is accceptable ("the password must contain a special character"), but the information should not suffice to guess the actual password. In HyperLTL, quantitative non-interference can be expressed [18] as the formula . The formula states that there do not exist 2 c + 1 traces (corresponding to more than c bits of information) with the same observable input but different observable output. The bad performance of the standard model checking algorithm is a consequence of the fact that the 2 c + 1 traces are tracked simultaneously. For this purpose, the model checking algorithm builds and analyzes a (2 c + 1)-fold self-composition of the system.
We present a new model checking algorithm for quantitative hyperproperties that avoids the construction of the huge self-composition. The key idea of our approach is to use counting rather than checking as the basic operation. Instead of building the self-composition and then checking the satisfaction of the formula, we add new atomic propositions and then count the number of sequences of evaluations of the new atomic propositions that satisfy the specification. Quantitative hyperproperties are expressions of the following form: where ∈ {≤, <, ≥, >, =}. The universal quantifiers introduce a set of reference traces against which other traces can be compared. The formulas ϕ and ψ are HyperLTL formulas. The counting quantifer #σ : X. ψ counts the number of paths σ with different valuations of the atomic propositions X that satisfy ψ. The requirement that no more than c bits of information are leaked is the following quantitative hyperproperty: As we show in the paper, such expressions do not change the expressiveness of the logic; however, they allow us to express quantitative hyperproperties in exponentially more concise form. The counting-based model checking algorithm then maintains this advantage with a logarithmic counter, resulting in exponentially better performance in both time and space.
The viability of our counting-based model checking algorithm is demonstrated on a Max#SAT-based prototype implementation. For quantitative hyperproperties of intrest, such as bounded leakage of a password checker, our algorithm shows promising results, as it significantly outperforms existing model checking approaches.

Related Work
Quantitative information-flow has been studied extensively in the literature. See, for example, the following selection of contributions on this topic: [43,34,19,14,1,32]. Multiple verification methods for quantitative information-flow were proposed for sequential systems. For example, with static analysis techniques [15], approximation methods [35], equivalence relations [22,3], and randomized methods [35]. Quantitative information-flow for multi-threaded programs was considered in [11].
The study of quantitative information-flow in a reactive setting gained a lot of attention recently after the introduction of hyperproperties [21] and the idea of verifying the self-composition of a reactive system [6] in order to relate traces to each other. There are several possibilities to measure the amount of leakage, such as Shannon entropy [24,15,37], guessing entropy [34,3], and minentropy [43]. A classification of quantitative information-flow policies as safety and liveness hyperproperties was given in [46]. While several verification techniques for hyperproperties exists [5,31,38,42], the literature was missing general approaches to quantitative information-flow control. SecLTL [25] was introduced as first general approach to model check (quantitative) hyperproperties, before HyperLTL [18], and its corresponding model checker [26], was introduced as a temporal logic for hyperproperties, which subsumes the previous approaches.
Using counting to compute the number of solutions of a given formula is studied in the literature as well and includes many probabilistic inference problems, such as Bayesian net reasoning [36], and planning problems, such as computing robustness of plans in incomplete domains [40]. State-of-the-art tools for propositional model counting are Relsat [33] and c2d [23]. Algorithms for counting models of temporal logics and automata over infinite words have been introduced in [27,28,44]. The counting of projected models, i.e., when some parts of the models are irrelevant, was studied in [2], for which tools such as #CLASP [2] and DSharp P [2,41] exist. Our SAT-based prototype implementation is based on a reduction to a Max#SAT [29] instance, for which a corresponding tool exists.
Among the already existing tools for computing the amount of information leakage, for example, QUAIL [8], which analyzes programs written in a specific while-language and LeakWatch [12], which estimates the amount of leakage in Java programs, Moped-QLeak [9] is closest to our approach. However, their approach of computing a symbolic summary as an Algebraic Decision Diagram is, in contrast to our approach, solely based on model counting, not maximum model counting.

HyperLTL
HyperLTL [18] extends linear-time temporal logic (LTL) with trace variables and trace quantifiers. Let AP be a set of atomic propositions. A trace t is an infinite sequence over subsets of the atomic propositions. We define the set of traces TR := (2 AP ) ω . A subset T ⊆ TR is called a trace property and a subset H ⊆ 2 TR is called a hyperproperty. We use the following notation to manipulate traces: let t ∈ TR be a trace and i ∈ N be a natural number. t[i] denotes the i-th element of t. Therefore, t[0] represents the starting element of the trace. Let denotes the infinite suffix of t starting at position i.
HyperLTL Syntax. Let V be an infinite supply of trace variables. The syntax of HyperLTL is given by the following grammar: where a ∈ AP is an atomic proposition and π ∈ V is a trace variable. Note that atomic propositions are indexed by trace variables. The quantification over traces makes it possible to express properties like "on all traces ψ must hold", which is expressed by ∀π. ψ. Dually, one can express that "there exists a trace such that ψ holds", which is denoted by ∃π. ψ. The derived operators , , and W are defined as for LTL. We abbreviate the formula x∈X (x π ↔ x π ), expressing that the traces π and π are equal with respect to a set X ⊆ AP of atomic propositions, by π = X π . Furthermore, we call a trace variable π free in a HyperLTL formula if there is no quantification over π and we call a HyperLTL formula ϕ closed if there exists no free trace variable in ϕ.
HyperLTL Semantics. A HyperLTL formula defines a hyperproperty, i.e., a set of sets of traces. A set T of traces satisfies the hyperproperty if it is an element of this set of sets. Formally, the semantics of HyperLTL formulas is given with respect to a trace assignment Π from V to TR, i.e., a partial function mapping trace variables to actual traces. Π[π → t] denotes that π is mapped to t, with everything else mapped according to Π. Π[i, ∞] denotes the trace assignment that is equal to Π(π)[i, ∞] for all π.
We say a set of traces T satisfies a HyperLTL formula ϕ if Π |= T ϕ, where Π is the empty trace assignment.

System model
A Kripke structure is a tuple K = (S, s 0 , δ, AP , L) consisting of a set of states S, an initial state s 0 ∈ S, a transition function δ : S → 2 S , a set of atomic propositions AP , and a labeling function L : S → 2 AP , which labels every state with a set of atomic propositions. We assume that each state has a successor, i.e., δ(s) = ∅. This ensures that every run on a Kripke structure can always be extended to an infinite run. We define a path of a Kripke structure as an infinite sequence of states s 0 s 1 · · · ∈ S ω such that s 0 is the initial state of K and s i+1 ∈ δ(s i ) for every i ∈ N. We denote the set of all paths of K that start in a state s with Paths(K, s). Furthermore, Paths * (K, s) denotes the set of all path prefixes and Paths ω (K, s) the set of all path suffixes. A trace of a Kripke structure is an infinite sequence of sets of atomic propositions L(s 0 ), L(s 1 ), · · · ∈ (2 AP ) ω , such that s 0 is the initial state of K and s i+1 ∈ δ(s i ) for every i ∈ N. We denote the set of all traces of K that start in a state s with TR(K, s). We say that a Kripke structure K satisfies a HyperLTL formula ϕ if its set of traces satisfies ϕ, i.e., if Π |= TR(K,s0) ϕ, where Π is the empty trace assignment.

Automata over infinite words
In our construction we use automata over infinite words. A Büchi automaton Furthermore, an alternating automaton, whose runs generalize from sequences to trees, is a tuple A = (Q, Q 0 , δ, Σ, F ). Q, Q 0 , Σ, and F are defined as above and δ : Q × Σ → B + Q being a transition function, which maps a state and a symbol into a Boolean combination of states. Thus, a run(-tree) of an alternating Büchi automaton A on an infinite word w is a Q-labeled tree. A word w is accepted by A and called a model if there exists a run-tree T such that all paths p trough T are accepting, i.e., Inf(p) ∩ F = ∅.
A strongly connected component (SCC) in A is a maximal strongly connected component of the graph induced by the automaton. An SCC is called accepting if one of its states is an accepting state in A.

Quantitative Hyperproperties
Quantitative Hyperproperties are properties of sets of computation traces that express a bound on the number of traces that may appear in a certain relation. In the following, we study quantitative hyperproperties that are specified in terms of HyperLTL formulas. We consider expressions of the following general form: Both the universally quantified variables π 1 , . . . , π k and the variable σ after the counting operator # are trace variables; ϕ is a HyperLTL formula over atomic propositions AP and free trace variables π 1 . . . π k ; A ⊆ AP is a set of atomic propositions; ψ is a HyperLTL formula over atomic propositions AP and free trace variables π 1 . . . π k and, additionally σ. The operator ∈ {<, ≤, =, >, ≥} is a comparison operator; and n ∈ N is a natural number.
For a given set of traces T and a valuation of the trace variables π 1 , . . . , π k , the term #σ : A. ψ computes the number of traces σ in T that differ in their valuation of the atomic propositions in A and satisfy ψ. The expression #σ : A. ψ n is true iff the resulting number satisfies the comparison with n. Finally, the complete expression ∀π 1 , . . . , π k . ϕ → (#σ : A. ψ n) is true iff for all combinations π 1 , . . . , π k of traces in T that satisfy ϕ, the comparison #σ : A. ψ n is satisfied.
Example 1 (Quantitative non-interference). Quantitative information-flow policies [30,13,34,20] allow the flow of a bounded amount of information. One way to measure leakage is with min-entropy [43], which quantifies the amount of information an attacker can gain given the answer to a single guess about the secret. The bounding problem [45] for min-entropy is to determine whether that amount is bounded from above by a constant 2 c , corresponding to c bits. We assume that the program whose leakage is being quantified is deterministic, and assume that the secret input to that program is uniformly distributed. The bounding problem then reduces to determining that there is no tuple of 2 c + 1 distinguishable traces [43,45]. Let O ⊆ AP be the set of observable outputs. A simple quantitative information flow policy is then the following quantitative hyperproperty, which bounds the number of distinguishable outputs to 2 c , corresponding to a bound of c bits of information: A slightly more complicated information flow policy is quantitative non-interference. In quantitative non-interference, the bound must be satisfied for every individual input. Let I ⊆ AP be the observable inputs to the system. Quantitative non-interference is the following quantitative hyperproperty 1 : For each trace π in the system, the property checks whether there are more than 2 c traces σ that have the same observable input as π but different observable output.
Example 2 (Deniability). A program satisfies deniability (see, for example, [7,10]) when there is no proof that a certain input occurred from simply observing the output, i.e., given an output of a program one cannot derive the input that lead to this output. A deterministic program satisfies deniability when each output can be mapped to at least two inputs. A quantitative variant of deniability is when we require that the number of corresponding inputs is larger than a given threshold. Quantitative deniability can be specified as the following quantitative Hyperproperty: ∀π. #σ : For all traces π of the system we count the number of sequences σ in the system with different input sequences and the same output sequence of π, i.e., for the fixed output sequence given by π we count the number of input sequences that lead to this output.

Model Checking Quantitative Hyperproperties
We present a model checking algorithm for quantitative hyperproperties based on model counting. The advantage of the algorithm is that its runtime complexity is independent of the bound n and thus avoids the n-fold self-composition necessary for any encoding of the quantitative hyperproperty in HyperLTL. Before introducing our novel counting-based algorithm, we start by a translation of quantitative hyperproperties into formulas in HyperLTL and establishing an exponential lower bound for its representation.

Standard model checking algorithm: encoding quantitative hyperproperties in HyperLTL
The idea of the reduction is to check a lower bound of n traces by existentially quantifying over n traces, and to check an upper bound of n traces by universally quantifying over n + 1 traces. The resulting HyperLTL formula can be verified using the standard model checking algorithm for HyperLTL [18].
Example 3 (Quantitative non-interference in HyperLTL). As discussed in Example 1, quantitative non-interference is the quantitative hyperproperty where we measure the amount of leakage with min-entropy [43]. The bounding problem for min-entropy asks whether the amount of information leaked by a system is bounded by a constant 2 c where c is the number of bits. This is encoded in HyperLTL as the requirement that there are no 2 c + 1 traces distinguishable in their output: This formula is equivalent to the formalization of quantitative non-interference given in [26].
Model checking quantitative hyperproperties via the reduction to HyperLTL is very expensive. In the best case, when ∈ {≤, <}, ψ ι does not contain existential quantifiers, and ψ does not contain universal quantifiers, we obtain an HyperLTL formula without quantifier alternations, where the number of quantifiers grows linearly with the bound n. For m quantifiers, the HyperLTL model checking algorithm [26] constructs and analyzes the m-fold self-composition of the Kripke structure. The running time of the model checking algorithm is thus exponential in the bound. If ∈ {≥, >, =}, the encoding additionally introduces a quantifier alternation. The model checking algorithm checks quantifier alternations via a complementation of Büchi automata, which adds another exponent, resulting in an overall doubly exponential running time.
The model checking algorithm we introduce in the next section avoids the n-fold self-composition needed in the model checking algorithm of HyperLTL and its complexity is independent of the bound n.

Counting-based model checking algorithm
A Kripke structure K = (S, s 0 , τ, AP, L) violates a quantitative hyperproperty ϕ = ∀π 1 , . . . , π k . ψ ι → (#σ : A.ψ n) if there is a k-tuple t = (π 1 , . . . , π k ) of traces π i ∈ TR(K) that satisfies the formula ∃π 1 , . . . , π k . ψ ι ∧ (#σ : A. ψ n) where is the negation of the comparison operator . The tuple t then satisfies the property ψ ι and the number of (k + 1)-tuples t = (π 1 , . . . , π k , σ) for σ ∈ TR(K) that satisfy ψ and differ pairwise in the A-projection of σ satisfies the comparison n (The A-projection of a sequence σ is defined as the sequence σ A ∈ (2 A ) ω , such that for every position i and every a ∈ A it holds that a ∈ σ A [i] if and only if a ∈ σ[i]). The tuples t can be captured by the automaton composed of the product of an automaton A ψι∧ψ that accepts all k +1 of traces that satisfy both ψ ι and ψ and a k + 1-self composition of K. Each accepting run of the product automaton presents k + 1 traces of K that satisfy ψ ι ∧ ψ. On top of the product automaton, we apply a special counting algorithm which we explain in detail in Section 4.4 and check if the result satisfies the comparison n. Algorithm 1 gives a general picture of our model checking algorithm. The algorithm has two parts. The first part applies if the relation is one of {≥, >}. In this case, the algorithm checks whether a sequence over AP ψ (propositions in ψ) corresponds to infinitely many sequences over A. This is done by checking whether the product automaton B has a so-called doubly pumped lasso(DPL), a subgraph with two connected lassos, with a unique sequence over AP ψ and different sequences over A. Such a doubly pumped lasso matches the same sequence over AP ψ with infinitely many sequences over A (more in section 4.4). If no doubly pumped lasso is found, a projected model counting algorithm is applied in the second part of the algorithm in order to compute either the maximum or the minimum value, corresponding to the comparison operator . In the next subsections, we explain the individual parts of the algorithm in detail.

Counting models of ω-Automata
Computing the number of words accepted by a Büchi automaton can be done by examining its accepting lassos. Consider, for example, the Büchi automata over the alphabet 2 {a} in Figure 1. the models of a Büchi automaton is insufficient for model checking quantitative hyperproperties as we are not interested in the total number of models. We rather maximize, respectively minimize, over sequences of subsets of atomic propositions the number of projected models of the Büchi automaton. For instance, consider the automaton given in Figure 2. The automaton has infinitely AP and a set A, such that A ⊆ AP , an A-projected model (or projected model over A) is defined as a sequence σ A ∈ (2 A ) ω that results in the A-projection of an accepting sequence σ ∈ (2 AP ) ω . In the following, we define the maximum model counting problem over automata and give an algorithm for solving the problem. We show how to use the algorithm for model checking quantitative hyperproperties.
Definition 1 (Maximum Model Counting over Automata (MMCA)). Given a Büchi automaton B over an alphabet 2 AP for some set of atomic propositions AP and sets X, Y, Z ⊆ AP the maximum model counting problem is to compute where σ ∪ σ is the point-wise union of σ and σ .
As a first step in our algorithm, we show how to check whether the maximum model count is equal to infinity. ). For a graph G, a doubly pumped lasso in G is a subgraph that entails a cycles C 1 and another different cycle C 2 that is reachable from C 1 . In general, we distinguish between two types of doubly pumped lassos as shown in Figure 3. We call the lassos with periods C 1 and C 2 the lassos of the doubly pumped lasso. A doubly pumped lasso of a Büchi automaton B is one in the graph structure of B. The doubly pumped lasso is called accepting when C 2 has an accepting state. A more generalized formalization of this idea is given in the following theorem.
To check whether there is a sequence σ ∈ (2 Y ) ω such that the number of X ∪ Yprojected models σ of B with σ = Y σ is infinite, we search for a doubly pumped lasso satisfying the constraints given in Theorem 2. This can be done by applying the following procedure: Given a Büchi automaton B = (Q, q 0 , 2 AP , δ, F ) and sets X, Y, Z ⊆ AP, we construct the following product automaton The automaton B has infinitely many models σ if there is an accepting lasso ρ = (q 0 , q 0 )(α 1 , α 1 ) . . . ((q j , q j )(α j+1 , α j+1 ) . . . (q k , q k )(α k+1 , α k+1 )) in B × such that: ∃h ≤ j. q h = q j , i.e., B has lassos ρ 1 and ρ 2 that share a state in the period of ρ 1 and ∃h > j. α h = X α h , i.e., the lassos differ in the evaluation of X in a position after the shared state and thus allows infinitely many different sequence over X for the a sequence over Y . The lasso ρ simulates a doubly pumped lasso in B satisfying the constraints of Theorem 2.
Theorem 3. Given an alternating Büchi automaton A = (Q, q 0 , δ, 2 AP , F ) for a set of atomic propositions AP = X ∪ Y ∪ Z, the problem of checking whether there is a sequence σ ∈ (2 Y ) ω such that A has infinitely many X ∪ Y -projected models σ with σ = Y σ is Pspace-complete.
The lower and upper bound for the problem can be given by a reduction from and to the satisfiability problem of LTL [4]. Due to the finite structure of Büchi automata, if the number of models of the automaton exceed the exponential bound 2 |Q| , where Q is the set of states, then the automaton has infinitely many models.
Lemma 1. For any Büchi automaton B, the number of models of B is less or equal to 2 |Q| otherwise it is ∞.
Proof. Assume the number of models is larger than 2 |Q| then there are more than 2 |Q| accepting lassos in B. By the pigeonhole principle, two of them share the same 2 |Q| -prefix. Thus, either they are equal or we found doubly pumped lasso in B.
Corollary 1. Let a Büchi automaton B over a set of atomic propositions AP and sets X, Y ⊆ AP. For each sequence σ Y ∈ (2 Y ) ω the number of X ∪ Yprojected models σ with σ = Y σ Y is less or equal than 2 |Q| otherwise it is ∞.
From Corollary 1, we know that if no sequence σ Y ∈ (2 Y ) ω matches to infinitely many X ∪ Y -projected models then the number of such models is bound by 2 |Q| . Each of these models has a run in B which ends in an accepting strongly connected component. Also from Corollary 1, we know that every model has a lasso run of length |Q|. For each finite sequence w Y of length |w Y | = |Q| that reaches an accepting strongly connected component, we count the number X ∪Yprojected words w of length |Q| with w = Y w Y and that end in an accepting strongly connected component. This number is equal to the maximum model counting number.
Algorithm 2 describes the procedure. An algorithm for the minimum model counting problem is defined in similar way. The algorithm works in a backwards for q ∈ W do 7: for (q , α, q) do 8: for σ ∈ Π(q) do 10: fashion starting with states of accepting strongly connected components. In each iteration i, the algorithm maps each state of the automaton with X ∪Y -projected words of length i that reach an accepting strongly connected component. After |Q| iterations, the algorithm determines from the mapping of initial state q 0 a Y -projected word of length |Q| with the maximum number of matching X ∪ Yprojected words. Proof. Let a Büchi automaton over an alphabet 2 AP for a set of atomic propositions AP and sets AP X , AP Y , AP Z ⊆ AP and a natural number n be given. We construct a nondeterministic Turing Machine M with access to a #P -oracle as follows: M guesses a sequence σ Y ∈ 2 APY . It then queries the oracle, to compute a number c, such that which is a #P problem [27]. It remains to check whether n > c. If so, M accepts.
The following theorem summarizes the main findings of this section, which establish, depending on the property, an exponentially or even doubly exponentially better algorithm (in the quantitative bound) over the existing model checking algorithm for HyperLTL.
Theorem 5. Given a Kripke structure K and a quantitative hyperproperty ϕ with bound n, the problem whether K |= ϕ can be decided in logarithmic space in the quantitative bound n and in polynomial space in the size of K.
The construction resembles the encoding of the bounded model checking approach for LTL [16]. Let ψ ι = ∃π 1 . . . π k . ψ ι and ψ = ∃π 1 . . . π k . ψ and let AP ψι and AP ψ be the sets of atomic propositions that appear in ψ ι and ψ respectively. The propositional formula φ is given as a conjunction of the following propositional formulas: µ is length of considered lassos and is equal to µ = 2 |ψ ι ∧ψ | * |S| k+k +k +1 +1, which is one plus the size of the product automaton constructed from the k + k + k + 1 self-composition and the automaton for ψ ι ∧ ψ. The "plus one" is to additionally to check whether the number of models is infinite. -K π k is the encoding of the transition relation of the copy of K where atomic propositions are indexed with π and up to an unrolling of length k. Each state of K can be encoded as an evaluation of a vector of log |S| unique propositional variables. The encoding 3 is given by the propositional ) which encodes all paths of K of length k. The formula I( #" v π 0 ) defines the assignment of the initial state. The formulas τ ( #" v π i , #" v π i+1 ) define valid transitions in K from the ith to the (i + 1)st state of a path.
ψ ι 0 k and ψ 0 k are constructed using the following rules 4 : 3 We refer the reader to [16] for more information on the encoding 4 We omitted the rules for boolean operators for the lack of space in case of an existential quantifier over a trace variable π, we add a copy of the encoding of K with new variables distinguished by π: We define sets X = {a i σ | a ∈ A, i ≤ k}, Y = {a i | a ∈ AP ψ \ A, i ≤ k} and Z = P \ X ∪ Y , where P is the set of all propositions in φ. The maximum model counting problem is then MMC(φ, X, Y, Z).

Experiments
We have implemented the Max#Sat-based model checking approach from the last section. We compare the Max#Sat-based approach to the expansion-based approach using HyperLTL [26]. Our implementation uses the MaxCount tool [29]. We use the option in MaxCount that enumerates, rather than approximates, the number of assignments for the counting variables. We furthermore instrumented the tool so that it terminates as soon as a sample is found that exceeds the given bound. If no sample is found after one hour, we report a timeout. Table 1 shows the results on a parameterized benchmark obtained from the implementation of an 8bit passcode checker. The parameter of the benchmark is the bound on the number of bits that is leaked to an adversary, who might, for example, enter passcodes in a brute-force manner. In all instances, a violation is found. The results show that the Max#Sat-based approach scales significantly better than the expansion-based approach.  Table 1. Comparison between the expansion-based approach (MCHyper) and the Max#Sat-based approach (MCQHyper). #max is the number of maximization variables (set Y ). #count is the number of the counting variables (set X). TO indicates a time-out after 1 hour.

Conclusion
We have studied quantitative hyperproperties of the form ∀π 1 , . . . , π k . ϕ → (#σ : A. ψ n), where ϕ and ψ are HyperLTL formulas, and #σ : A.ϕ n compares the number of traces that differ in the atomic propositions A and satisfy ψ to a threshold n. Many quantitative information flow policies of practical interest, such as quantitative non-interference and deniability, belong to this class of properties. Our new counting-based model checking algorithm for quantitative hyperproperties performs at least exponentially better in both time and space in the bound n than a reduction to standard HyperLTL model checking. The new counting operator makes the specifications exponentially more concise in the bound, and our model checking algorithm solves the concise specifications efficiently.
We also showed that the model checking problem for quantitative hyperproperties can be solved with a practical Max#SAT-based algorithm. The SAT-based approach outperforms the expansion-based approach significantly for this class of properties. An additional advantage of the new approach is that it can handle properties like deniability, which cannot be checked by MCHyper because of the quantifier alternation.